Re: [EXT] Re: [PATCH 3/4] mtd: spinand: Enabled support to detect parameter page

From: Miquel Raynal
Date: Thu May 02 2019 - 08:00:11 EST


Hi Shiva,

"Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@xxxxxxxxxx> wrote on
Thu, 2 May 2019 11:37:10 +0000:

> Hi Miquel,
>
> >
> > Hi Shivamurthy,
> >
> > "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@xxxxxxxxxx> wrote
> > on
> > Tue, 26 Mar 2019 10:52:00 +0000:
> >
> > > Some of the SPI NAND devices has parameter page which is similar to ONFI
> > > table.
> > >
> > > But, it may not be self sufficient to propagate all the required
> > > parameters. Fixup function has been added in struct manufacturer to
> > > accommodate this.
> > >
> > > Signed-off-by: Shivamurthy Shastri <sshivamurthy@xxxxxxxxxx>
> > > ---
> > > drivers/mtd/nand/spi/core.c | 113
> > +++++++++++++++++++++++++++++++++++-
> > > include/linux/mtd/spinand.h | 5 ++
> > > 2 files changed, 117 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> > > index 985ad52cdaa7..40882a1d2bc1 100644
> > > --- a/drivers/mtd/nand/spi/core.c
> > > +++ b/drivers/mtd/nand/spi/core.c
> > > @@ -574,6 +574,108 @@ static int spinand_lock_block(struct
> > spinand_device *spinand, u8 lock)
> > > return spinand_write_reg_op(spinand, REG_BLOCK_LOCK, lock);
> > > }
> > >
> > > +/**
> > > + * spinand_read_param_page_op - Read parameter page operation
> > > + * @spinand: the spinand device
> > > + * @page: page number where parameter page tables can be found
> > > + * @parameters: buffer used to store the parameter page
> >
> > Does not match the prototype
>
> I will fix this in next version.
>
> >
> > > + * @len: length of the buffer
> > > + *
> > > + * Read parameter page
> > > + *
> > > + * Returns 0 on success, a negative error code otherwise.
> > > + */
> > > +static int spinand_parameter_page_read(struct nand_device *base,
> >
> > Please use a spinand structure as parameter, you don't need a
> > nand_device here (same for other spinand functions).
>
> This function is helper function for generic ONFI layer.
> From generic ONFI layer, I can get only nand_device.

How do you handle if the SPI NAND core is not compiled-in?


Thanks,
MiquÃl