[U-Boot-Users] [patch] additional check against flash size (oneliner)
Paweł Hikiert
p.hikiert at wb.com.pl
Sun Jul 1 12:45:28 CEST 2007
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
--
Paweł Hikiert <p.hikiert at wb.com.pl>
WB Electronics
More information about the U-Boot
mailing list