[U-Boot] NOR sectors are not all protected as they should be.

Wolfgang Denk wd at denx.de
Wed Feb 9 19:50:05 CET 2011


Dear Alexandre Gambier,

In message <4D52BA80.4060405 at ftemaximal.fr> you wrote:
> Hello,
> 
> I'm using U-Boot with a NOR and a NAND Flash.
> 
> U-Boot is stored into the NOR flash.
> The NOR flash is setup as :
> 
> 0xA0000000 -> 0xA0080000 -> 512k -> 8 sectors -> reserved for U-Boot.bin
> 0xA0080000 -> 0xA00A0000 -> 128k -> 2 sectors -> reserved for U-Boot 
> environment
> 
> If I use the command `flinfo` to see which sectors are protected I see 
> this...
> 
> Sector Start Addresses:
>    A0000000   RO   A0010000   RO   A0020000   RO   A0030000   RO   A0040000 E
>    A0050000 E      A0060000 E      A0070000 E      A0080000   RO   A0090000 E RO
>    A00A0000 E      A00B0000 E      A00C0000 E      A00D0000 E      A00E0000 E
>    A00F0000 E      A0100000 E      A0110000 E      A0120000 E      A0130000 E
...
> 
> The first sectors #0,1,2,3 are protected and sectors #8,9 (U-Boot 
> environment) are protected.
> It should be sectors #0,1,2,3,4,5,6,7 and sectors #8,9.

No, it should not.  Only the sectors that actually contain the U-Boot
code and environment are protected.  Obviously your image is small
enough to fit in the first 4 sectors (= 256 KiB).  Actually this is a
perfectly normal size, and your reservation of 512 KiB was just a
waste of memory.  You can see that the following sectors are unused
from the 'E' (= empty) flag.

When they don't contain any code, there is also no need to pretect
them, right?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What about WRITING it first and rationalizing it afterwords?  :-)
                       - Larry Wall in <8162 at jpl-devvax.JPL.NASA.GOV>


More information about the U-Boot mailing list