On 16:29 Fri 18 Apr , Matthias Fuchs wrote: > This patch adds a configurable flash auto protection list that can be used > to make U-Boot protect flash regions in flash_init(). > > The idea has been discussed on the u-boot mailing list starting > on Nov 18th, 2007. > > Even this patch brings a new feature it is used as a bugfix for 4xx > platforms where flash_init() does not completely protect the > monitor's flash range in all situations. > > U-Boot protects the flash range from CFG_MONITOR_BASE to > (CFG_MONITOR_BASE + monitor_flash_len - 1) by default. This does not > include the reset vector at 0xfffffffc. > > Example: > #define CFG_FLASH_AUTOPROTECT_LIST {{0xfff80000, 0x80000}} > > This config option will auto protect the last 512k of flash that > contains the bootloader on board like APC405 and PMC405. > > Signed-off-by: Matthias Fuchs <[EMAIL PROTECTED]> > --- > drivers/mtd/cfi_flash.c | 17 +++++++++++++++++ > 1 files changed, 17 insertions(+), 0 deletions(-) > > diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c > index e3cfb8a..68ab55f 100644 > --- a/drivers/mtd/cfi_flash.c > +++ b/drivers/mtd/cfi_flash.c > @@ -1873,6 +1873,12 @@ unsigned long flash_init (void) > { > unsigned long size = 0; > int i; > +#if defined(CFG_FLASH_AUTOPROTECT_LIST) > + struct apl_s { > + ulong start; > + ulong size; > + } apl[] = CFG_FLASH_AUTOPROTECT_LIST; > +#endif I think it will be better to create a weak structure.
Best Regards, J. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users