[U-Boot] [PATCHv2 CFI flash]: Workaround for Numonyx Axcell P33/P30 256-Mbit 65nm bug

Philippe De Muyter phdm at macqel.be
Mon Aug 9 17:46:03 CEST 2010


Hi Stefan,

On Mon, Aug 09, 2010 at 03:52:03PM +0200, Stefan Roese wrote:
> Hi Philippe,
> 
> first sorry for the late review (thanks Wolfgang for reminding).
> 
> On Saturday 07 August 2010 01:11:02 Wolfgang Denk wrote:
> > Dear Stefan,
> > 
> > In message <20100623131040.GA23209 at frolo.macqel> Philippe De Muyter wrote:
> > > Hello Wolfgang & list,
> > > 
> > > This is a revised patch, with comments and indentation fixed, I hope.
> > > 
> 
> Minor note: Such commentary lines should be moved below the "---" line
> below. They shouldn't appear in the git history.
> 
> <snip>
> 
> > diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> > index 3267c5d..4bf0807 100644
> > --- a/drivers/mtd/cfi_flash.c
> > +++ b/drivers/mtd/cfi_flash.c
> > @@ -1347,17 +1347,34 @@ int flash_real_protect (flash_info_t * info, long
> > sector, int prot)
> > 
> >         switch (info->vendor) {
> >         
> >                 case CFI_CMDSET_INTEL_PROG_REGIONS:
> > 
> >                 case CFI_CMDSET_INTEL_STANDARD:
> > -               case CFI_CMDSET_INTEL_EXTENDED:
> > -                       flash_write_cmd (info, sector, 0,
> > -                                        FLASH_CMD_CLEAR_STATUS);
> > -                       flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT);
> > +               case CFI_CMDSET_INTEL_EXTENDED: {
> > +                       unsigned short cmd;
> > +
> > 
> >                         if (prot)
> > 
> > -                               flash_write_cmd (info, sector, 0,
> > -                                       FLASH_CMD_PROTECT_SET);
> > +                               cmd = FLASH_CMD_PROTECT_SET;
> > 
> >                         else
> > 
> > +                               cmd = FLASH_CMD_PROTECT_CLEAR;
> 
> Please move this variable declaration of "cmd" and assignment further down
> (see below). You can remove the "{" "}" of this block then.
> 

Here is the excerpt from the errata :

Workaround:  If the interval between 60h and its subsequent command
	     can be guaranteed within 20μs, Option I is recommended,
	     otherwise Option II (involves hardware) should be selected.
Option I: The table below lists the detail command sequences:
Command
	      Data bus           Address bus       Remarks
Sequence
  1              90h            Block Address
						   Read Lock Status
  2             Read         Block Address + 02h
 (2)(3)                                      (1)
3                60h           Block Address
 (2)(3)                                      (1)   Lock/Unlock/RCR Configuration
4           D0h/01h/03h        Block Address
Notes:
(1) Block Address refers to RCR configuration data only when the 60h
    command sequence is used to set RCR register combined with 03h
    subsequent command.
(2) For the third and fourth command sequences, the Block Address must
    be the same.
(3) The interval between 60h command and its subsequent D0h/01h/2Fh/03h
    commands should be less than 20μs.

Because of requirement (3), I choosed to minimize the number of instructions
between the `read lock status' and the `unlock' commands, hence the
initialisation of `cmd' moved before the `read lock status' (hidden
in `flash_isequal').  

> > +                       /*
> > +                        * see errata called
> > +                        * "Numonyx Axcell P33/P30 Specification Update" :)
> > +                        */
> > +                       flash_write_cmd (info, sector, 0, FLASH_CMD_READ_ID);
> > +                       if (!flash_isequal (info, sector, FLASH_OFFSET_PROTECT,
> > +                                           prot)) {
> > +                               int flag = disable_interrupts ();
> 
> Declare and assign "cmd" here please.
> 
> Please change and resubmit. Thanks.

If you still prefer it changed, speak :)

Best regards

Philippe


More information about the U-Boot mailing list