iriver_flash: correctly calculate when to stop erasing the bootloader
It was originally hard-coded at 0x200 which is 512 sectors. This only works for the H100 and H120. The larger ROM of the H300 is 1024 sectors in size. In either case the bootloader starts 16 sectors before the end of the ROM so rely on this fact to correctly calculate where to stop the bootloader erasure. Change-Id: Iec4112ebf24379f80a7bf1363035e005c434907e
This commit is contained in:
parent
c5d7cd5f9f
commit
dd3ea521ad
1 changed files with 1 additions and 1 deletions
|
@ -514,7 +514,7 @@ int flash_bootloader(const char *filename)
|
|||
cfi_program_word(FB + i, p16[i]);
|
||||
|
||||
/* Erase the bootloader flash section. */
|
||||
for (i = BOOTLOADER_ENTRYPOINT/SEC_SIZE; i < 0x200; i++)
|
||||
for (i = BOOTLOADER_ERASEGUARD; i < BOOTLOADER_ERASEGUARD+16; i++)
|
||||
/*rc =*/ cfi_erase_sector(FB + (SEC_SIZE/2) * i);
|
||||
|
||||
pos = BOOTLOADER_ENTRYPOINT/2;
|
||||
|
|
Loading…
Reference in a new issue