[OpenWrt-Devel] [PATCH 4/9] mtd: rawnand: bcm47xx: Demistify a few more things

Boris Brezillon boris.brezillon at collabora.com
Mon Apr 27 14:31:54 EDT 2020


On Mon, 27 Apr 2020 19:07:01 +0200
Miquel Raynal <miquel.raynal at bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon at collabora.com> wrote on Sun, 19 Apr
> 2020 14:51:35 +0200:
> 
> > There were a few places were raw hex values were used instead of the  
> 
>                           where
> 
> > macro def.  
> 
>         def? :)

Will fix the commit message :-).

> 
> > 
> > We also add macros to help forming the conf value (note that we still
> > have one magic bit whose meaning I couldn't extract from the code), and
> > add an extra macro to specify the number of DATA cycles to issue when
> > the READ or WRITE flag is set.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> > ---
> >  .../mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c  | 34 +++++++++++++++----
> >  1 file changed, 27 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c
> > index 591775173034..fbb7acebc8f7 100644
> > --- a/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c
> > +++ b/drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c
> > @@ -25,12 +25,29 @@
> >  #define NCTL_CMD1W			0x00080000
> >  #define NCTL_READ			0x00100000
> >  #define NCTL_WRITE			0x00200000
> > +/* When the SPECADDR is set CMD1 is interpreted as a single ADDR cycle */
> >  #define NCTL_SPECADDR			0x01000000
> >  #define NCTL_READY			0x04000000
> >  #define NCTL_ERR			0x08000000
> > +/*
> > + * Number of DATA cycles to issue when NCTL_{READ,WRITE} is set. The minimum
> > + * value is 1 and the maximum value is 4. Those bytes are then stored in the
> > + * BCMA_CC_NFLASH_DATA register.
> > + */
> > +#define NCTL_DATA_CYCLES(x)		((((x) - 1) & 0x3) << 28)
> > +/*
> > + * The CS pin seems to be asserted even if NCTL_CSA is not set. All this bit
> > + * seems to encode is whether the CS line should stay asserted after the
> > + * operation has been executed. In other words, you should only set it if if  
> 
> s/it if if/it if/
> 

And drop this duplicate.

> > + * you intend to do more operations on the NAND bus.
> > + */
> >  #define NCTL_CSA			0x40000000
> >  #define NCTL_START			0x80000000
> >  
> > +#define CONF_MAGIC_BIT			0x00000002
> > +#define CONF_COL_BYTES(x)		(((x) - 1) << 4)
> > +#define CONF_ROW_BYTES(x)		(((x) - 1) << 6)
> > +  
> 
> 
> With the above corrected,
> 
> Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
> 
> 
> 
> Thanks,
> Miquèl


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list