diff --git a/bootloader/main-c240wipe.c b/bootloader/main-c240wipe.c index 8c213a94c2..556907b34a 100644 --- a/bootloader/main-c240wipe.c +++ b/bootloader/main-c240wipe.c @@ -192,7 +192,7 @@ void* main(void) printf("Zeroing flash"); for(i=0;i<250816;i++) { - storage_write_sectors(0,i*32,32,zero); + storage_write_sectors(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"); - storage_write_sectors(0,0,1,mbr); + storage_write_sectors(0,1,mbr); printf("Writing FAT bootsector"); - storage_write_sectors(0,1023,1,fat); + storage_write_sectors(1023,1,fat); printf("Writing more FAT"); - storage_write_sectors(0,1024,1,backupfat); + storage_write_sectors(1024,1,backupfat); printf("Writing more FAT"); - storage_write_sectors(0,1264,1,backupfat); + storage_write_sectors(1264,1,backupfat); if (button_hold()) printf("Release Hold and"); diff --git a/bootloader/main-c250wipe.c b/bootloader/main-c250wipe.c index cecc0aac5a..c64bbee92e 100644 --- a/bootloader/main-c250wipe.c +++ b/bootloader/main-c250wipe.c @@ -257,7 +257,7 @@ void* main(void) printf("Zeroing flash"); for(i=0;i<250816;i++) { - storage_write_sectors(0,i*32,32,zero); + storage_write_sectors(i*32,32,zero); if(i%64 == 0) { printf("%d kB left",(250816-i)/2); @@ -265,15 +265,15 @@ void* main(void) } printf("Writing MBR"); - storage_write_sectors(0,0,1,mbr); + storage_write_sectors(0,1,mbr); printf("Writing FAT bootsector"); - storage_write_sectors(0,1017,2,bootsector); + storage_write_sectors(1017,2,bootsector); printf("Writing more FAT"); - storage_write_sectors(0,1023,1,fat); + storage_write_sectors(1023,1,fat); printf("Writing more FAT"); - storage_write_sectors(0,1049,1,backupfat); + storage_write_sectors(1049,1,backupfat); printf("Writing more FAT"); - storage_write_sectors(0,4920,1,backupfat); + storage_write_sectors(4920,1,backupfat); if (button_hold()) printf("Release Hold and"); diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c index a24892458d..0a7b56b1b6 100644 --- a/bootloader/main-e200r-installer.c +++ b/bootloader/main-e200r-installer.c @@ -139,8 +139,7 @@ void* main(void) printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512); #endif - storage_read_sectors(0, - pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, + storage_read_sectors(pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 1 , sector); crc32 = chksum_crc32 (sector, 512); @@ -161,7 +160,7 @@ void* main(void) /* E200R bootloader detected - patch it */ memcpy(§or[HACK_OFFSET], changedBytes, sizeof(changedBytes)/sizeof(*changedBytes)); - storage_write_sectors(0, + storage_write_sectors( pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 1 , sector); printf("Firmware unlocked"); diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index a2562f8a9d..4f1fe2a4e1 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c @@ -391,8 +391,8 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, unsigned long sum; /* Read header to find out how long the mi4 file is. */ - storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET, - PPMI_SECTORS, &ppmi_header); + storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET, + PPMI_SECTORS, &ppmi_header); /* The first four characters at 0x80000 (sector 1024) should be PPMI*/ if( memcmp(ppmi_header.magic, "PPMI", 4) ) @@ -401,7 +401,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 */ - storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header); /* We don't support encrypted mi4 files yet */ @@ -424,7 +424,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, printf("Binary type: %.4s", mi4header.type); /* Load firmware */ - storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS + (ppmi_header.length/512) + MI4_HEADER_SECTORS, (mi4header.mi4size-MI4_HEADER_SIZE)/512, buf); @@ -443,9 +443,9 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, printf("Disabling database rebuild"); - storage_read_sectors(0, pinfo->start + 0x3c08, 1, block); + storage_read_sectors(pinfo->start + 0x3c08, 1, block); block[0xe1] = 0; - storage_write_sectors(0, pinfo->start + 0x3c08, 1, block); + storage_write_sectors(pinfo->start + 0x3c08, 1, block); } #else (void) disable_rebuild;