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

2011-02-10 Thread Alexandre Gambier
Ok.

Thank you very much.

On 02/10/2011 10:48 AM, Wolfgang Denk wrote:
> Dear Alexandre Gambier,
>
> In message<4d539e01.6070...@ftemaximal.fr>  you wrote:
>>> waste of memory.  You can see that the following sectors are unused
>>> from the 'E' (= empty) flag.
>> Even if the first 4 sectors are empty they are protected (see below). So
>> the protected sectors are not selected depending on if U-Boot is burnt
>> in them, isn't it ?
> No, they are selected based on the real size of the (running) U-Boot
> image.
>
> Best regards,
>
> Wolfgang Denk
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2011-02-10 Thread Wolfgang Denk
Dear Alexandre Gambier,

In message <4d539e01.6070...@ftemaximal.fr> you wrote:
> 
> > waste of memory.  You can see that the following sectors are unused
> > from the 'E' (= empty) flag.
> Even if the first 4 sectors are empty they are protected (see below). So 
> the protected sectors are not selected depending on if U-Boot is burnt 
> in them, isn't it ?

No, they are selected based on the real size of the (running) U-Boot
image.

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: w...@denx.de
Of course there's no reason for it, it's just our policy.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2011-02-10 Thread Alexandre Gambier
Dear Wolfgang,

Thanks for your reply and your help.

On 02/09/2011 07:50 PM, Wolfgang Denk wrote:
>
>> 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.
Even if the first 4 sectors are empty they are protected (see below). So 
the protected sectors are not selected depending on if U-Boot is burnt 
in them, isn't it ?

  Sector Start Addresses:
   A000 E RO   A001 E RO   A002 E RO   A003 E RO   
A004 E
   A005 E  A006 E  A007 E  A008   RO   
A009 E RO
   A00A E  A00B E  A00C E  A00D E  
A00E E
   A00F E  A010 E  A011 E  A012 E  
A013 E
   A014 E  A015 E  A016 E  A017 E  
A018 E
   A019 E  A01A E  A01B E  A01C E  
A01D E
   A01E E  A01F E  A020 E  A021 E  
A022 E

I know my image fit in 256KiB, my image is 220KiB that I reserved more 
space just in case for the future releases.

> When they don't contain any code, there is also no need to pretect
> them, right?
It should be, but it's not completely true.

Best regards.
>
> Best regards,
>
> Wolfgang Denk
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2011-02-09 Thread Wolfgang Denk
Dear Alexandre Gambier,

In message <4d52ba80.4060...@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 :
> 
> 0xA000 -> 0xA008 -> 512k -> 8 sectors -> reserved for U-Boot.bin
> 0xA008 -> 0xA00A -> 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:
>A000   RO   A001   RO   A002   RO   A003   RO   A004 E
>A005 E  A006 E  A007 E  A008   RO   A009 E 
> RO
>A00A E  A00B E  A00C E  A00D E  A00E E
>A00F E  A010 E  A011 E  A012 E  A013 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: w...@denx.de
What about WRITING it first and rationalizing it afterwords?  :-)
   - Larry Wall in <8...@jpl-devvax.jpl.nasa.gov>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot