additional check against flash size (oneliner)
PATCH 1/1 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.cu-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
Signature · 2 lines
Pawe? Hikiert <[email protected]> WB Electronics
PATCH 1/1 additional check against flash size (oneliner)
Quoted 5 lines · Pawe? Hikiert
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 becomes0xffffffff. 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.
Quoted 31 lines
diff -Bubrp
../src/u-boot-1.2.0/common/flash.cu-boot-1.2.0/common/flash.c
---../src/u-boot-1.2.0/common/flash.c2007-01-07 00:13:11.000000000 +0100
+++u-boot-1.2.0/common/flash.c2007-06-28 19:31:44.000000000 +0200(quoted diff) +1
-0@@ -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, sincegreetings
--
Pawe? Hikiert <[email protected]>
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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Signature · 4 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. grant.likely at secretlab.ca (403) 399-0195