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

Grant Likely grant.likely at secretlab.ca
Sun Jul 1 14:50:36 CEST 2007


On 7/1/07, Paweł Hikiert <p.hikiert at 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 at 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195


More information about the U-Boot mailing list