1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Frank Gevaerts 2008-11-01 16:14:28 +00:00
parent 646cac0bde
commit 2f8a0081c6
64 changed files with 541 additions and 554 deletions

View file

@ -29,7 +29,7 @@
#include "kernel.h"
#include "lcd.h"
#include "font.h"
#include "ata.h"
#include "storage.h"
#include "button.h"
#include "disk.h"
#include "crc32-mi4.h"
@ -185,14 +185,14 @@ void* main(void)
printf("");
i=ata_init();
i=storage_init();
disk_init(IF_MV(0));
memset(zero,0,16*1024);
printf("Zeroing flash");
for(i=0;i<250816;i++)
{
ata_write_sectors(IF_MV2(0,) i*32,32,zero);
storage_write_sectors(IF_MV2(0,) i*32,32,zero);
if(i%64 == 0)
{
printf("%d kB left",(250816-i)/2);
@ -200,13 +200,13 @@ void* main(void)
}
printf("Writing MBR");
ata_write_sectors(IF_MV2(0,) 0,1,mbr);
storage_write_sectors(IF_MV2(0,) 0,1,mbr);
printf("Writing FAT bootsector");
ata_write_sectors(IF_MV2(0,) 1023,1,fat);
storage_write_sectors(IF_MV2(0,) 1023,1,fat);
printf("Writing more FAT");
ata_write_sectors(IF_MV2(0,) 1024,1,backupfat);
storage_write_sectors(IF_MV2(0,) 1024,1,backupfat);
printf("Writing more FAT");
ata_write_sectors(IF_MV2(0,) 1264,1,backupfat);
storage_write_sectors(IF_MV2(0,) 1264,1,backupfat);
if (button_hold())
printf("Release Hold and");