diff options
| author | Frank Gevaerts <frank@gevaerts.be> | 2008-11-01 16:14:28 +0000 |
|---|---|---|
| committer | Frank Gevaerts <frank@gevaerts.be> | 2008-11-01 16:14:28 +0000 |
| commit | 2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 (patch) | |
| tree | 84dbdbd5326cb48f43d2ebd5a4c86e992c1d5288 /bootloader/main-pp.c | |
| parent | 646cac0bde7b11fa7bcb670d1d76eec78e360485 (diff) | |
| download | rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.zip rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.gz rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.bz2 rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.xz | |
Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/main-pp.c')
| -rw-r--r-- | bootloader/main-pp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index c1aad5c..09e1c23 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c @@ -30,7 +30,7 @@ #include "kernel.h" #include "lcd.h" #include "font.h" -#include "ata.h" +#include "storage.h" #include "adc.h" #include "button.h" #include "disk.h" @@ -371,7 +371,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, unsigned long sum; /* Read header to find out how long the mi4 file is. */ - ata_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET, + storage_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET, PPMI_SECTORS, &ppmi_header); /* The first four characters at 0x80000 (sector 1024) should be PPMI*/ @@ -381,7 +381,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, printf("BL mi4 size: %x", ppmi_header.length); /* Read mi4 header of the OF */ - ata_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + storage_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header); /* We don't support encrypted mi4 files yet */ @@ -404,7 +404,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, printf("Binary type: %.4s", mi4header.type); /* Load firmware */ - ata_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + storage_read_sectors(IF_MV2(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + (ppmi_header.length/512) + MI4_HEADER_SECTORS, (mi4header.mi4size-MI4_HEADER_SIZE)/512, buf); @@ -423,9 +423,9 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, printf("Disabling database rebuild"); - ata_read_sectors(IF_MV2(0,) pinfo->start + 0x3c08, 1, block); + storage_read_sectors(IF_MV2(0,) pinfo->start + 0x3c08, 1, block); block[0xe1] = 0; - ata_write_sectors(IF_MV2(0,) pinfo->start + 0x3c08, 1, block); + storage_write_sectors(IF_MV2(0,) pinfo->start + 0x3c08, 1, block); } #else (void) disable_rebuild; @@ -505,7 +505,7 @@ void* main(void) printf("Version: %s", version); printf(MODEL_NAME); - i=ata_init(); + i=storage_init(); #if !(CONFIG_STORAGE & STORAGE_SD) if (i==0) { identify_info=ata_get_identify(); @@ -601,7 +601,7 @@ void* main(void) { printf("dumping sector %d", i); } - ata_read_sectors(IF_MV2(0,) pinfo->start + i, 1, sector); + storage_read_sectors(IF_MV2(0,) pinfo->start + i, 1, sector); write(fd,sector,512); } close(fd); |