[U-Boot-Users] [patch] additional check against flash size (oneliner)

hello i run modified version of at91rm9200dk, without on-board 2mb flash. u-boot code 'detects' it as as 0-bytes flash chip at address 0 (so it seems find). but since addr2info function checks against address+size-1 it becomes 0xffffffff. i think this patch won't hurt ;)
diff -Bubrp ../src/u-boot-1.2.0/common/flash.c u-boot-1.2.0/common/flash.c --- ../src/u-boot-1.2.0/common/flash.c 2007-01-07 00:13:11.000000000 +0100 +++ u-boot-1.2.0/common/flash.c 2007-06-28 19:31:44.000000000 +0200 @@ -106,6 +106,7 @@ addr2info (ulong addr)
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) { if (info->flash_id != FLASH_UNKNOWN && + info->size > 0 && addr >= info->start[0] && /* WARNING - The '- 1' is needed if the flash * is at the end of the address space, since
greetings

On 7/1/07, Paweł Hikiert p.hikiert@wb.com.pl wrote:
hello i run modified version of at91rm9200dk, without on-board 2mb flash. u-boot code 'detects' it as as 0-bytes flash chip at address 0 (so it seems find). but since addr2info function checks against address+size-1 it becomes 0xffffffff. i think this patch won't hurt ;)
This patch might be a good idea, but I think you're just fixing a symptom here. A 0 length region shouldn't be registered in flash_info in the first place. You should look for the root cause.
Cheers, g.
diff -Bubrp ../src/u-boot-1.2.0/common/flash.c u-boot-1.2.0/common/flash.c --- ../src/u-boot-1.2.0/common/flash.c 2007-01-07 00:13:11.000000000 +0100 +++ u-boot-1.2.0/common/flash.c 2007-06-28 19:31:44.000000000 +0200 @@ -106,6 +106,7 @@ addr2info (ulong addr)
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) { if (info->flash_id != FLASH_UNKNOWN &&
info->size > 0 && addr >= info->start[0] && /* WARNING - The '- 1' is needed if the flash * is at the end of the address space, since
greetings
Paweł Hikiert p.hikiert@wb.com.pl WB Electronics
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
participants (2)
-
Grant Likely
-
Paweł Hikiert