[U-Boot-Users] flash hardware protection with CFI driver does not autoprotect monitor completely

Matthias Fuchs matthias.fuchs at esd-electronics.com
Mon Nov 19 11:04:21 CET 2007


Hi,

On Monday 19 November 2007 07:14, Stefan Roese wrote:
> On Sunday 18 November 2007, Wolfgang Denk wrote:
> > > > I think as a short term fix we might define an additional  area  that
> > > > needs  to  be  protected  (the reset vector). Mid/long term we should
> > > > change the code so you  can  pass  a  list  of  areas  (start/end  or
> > > > start/length  pairs) that will be protected. This would, for example,
> > > > also allow to keep certain other  areas  (FDT,  kernel  image,  etc.)
> > > > auto-protected as well - configurable by the user ona per-board base.
> > >
> > > Sometinhg like this?
> > >
> > > Add this to board's config file:
> > > #define CONFIG_FLASH_AUTOPROTECT_LIST {{0xfffe0000, 0xffffffff},
> > > {0xfe000000, 0xfe0fffff}}
> >
> > Yes, that's what I meant, although I have to admit that my personal
> > preference would be to use { start, size }  instead.
> >
> > What do you (and others) think?
I am passionsless. So I vote with the majority.
> 
> Yes, I would prefer size too. This would lead to something like this on 4xx 
> boards:
> 
> #define CONFIG_FLASH_AUTOPROTECT_LIST { {CFG_MONITOR_BASE, CFG_MONITOR_LEN} }
This looks fine and I will start voting for this, too.

I am wondering if it is possible to get rid of the current autoprotection
code (3 x flash_protect for monitor, env and 2nd env) in drivers/cfi_flash.c 
and fully implement it through the AUTOPROTECT_LIST without modifyiny all 
board config files. Any nice idea?

Especially on 4xx when you like to have sometinhg like

#define CONFIG_FLASH_AUTOPROTECT_LIST { {CFG_MONITOR_BASE, CFG_MONITOR_LEN} }

in your config file you will flash_protect most of the bootloader flash space twice.

Matthias




More information about the U-Boot mailing list