Message ID | 20090918211004.GA12907@mag.az.mvista.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
> > From: Mark A. Greer <mgreer@mvista.com> > > The existing NAND infrastructure allows the default main and > mirror bad block tables to be overridden in nand_default_bbt(). > However, the davinci_nand driver does not support this. So, > add fields to the davinci driver's platform data so platform > code can pass in their own bbt's and make the driver honor > those overrides. > > Signed-off-by: Mark A. Greer <mgreer@mvista.com> > --- > This is required by the da830 evm (see following patch) which requires > different 'offs' and 'veroffs' values than the default. This seemed > like the solution that fit best with the existing infratructure. If > anyone has a better solution, please speak up. > Mark, IIRC this feature was originally added by Andy Lowe in LSP 1.2 The same was then used in LSP 2.xx. In the initial set of patches we were using this again but in the final iterations of the DaVinci NAND driver patch review, we have decided to go with the default patterns from the MTD NAND driver. If you look at the Dm355/Dm365 patches for board specific NAND support we do not add this anymore. Since the EMIF on DA830 is similar to DM3xx, in my opinion we should align with DM355 and DM365. Thanks, Sandeep
On Fri, Sep 18, 2009 at 04:21:19PM -0500, Paulraj, Sandeep wrote: > > > > > From: Mark A. Greer <mgreer@mvista.com> > > > > The existing NAND infrastructure allows the default main and > > mirror bad block tables to be overridden in nand_default_bbt(). > > However, the davinci_nand driver does not support this. So, > > add fields to the davinci driver's platform data so platform > > code can pass in their own bbt's and make the driver honor > > those overrides. > > > > Signed-off-by: Mark A. Greer <mgreer@mvista.com> > > --- > > This is required by the da830 evm (see following patch) which requires > > different 'offs' and 'veroffs' values than the default. This seemed > > like the solution that fit best with the existing infratructure. If > > anyone has a better solution, please speak up. > > > Mark, IIRC this feature was originally added by Andy Lowe in LSP 1.2 > The same was then used in LSP 2.xx. > > In the initial set of patches we were using this again but in the final iterations of the DaVinci NAND driver patch review, we have decided to go with the default patterns from the MTD NAND driver. > > If you look at the Dm355/Dm365 patches for board specific NAND support we do not add this anymore. Since the EMIF on DA830 is similar to DM3xx, in my opinion we should align with DM355 and DM365. Hi Sandeep. The issue is that the values for the 'offs' and 'veroffs' are wrong in the defaults used by nand_base.c:nand_default_bbt(). The da830 evem won't work with the default values. So, some way to override the default needs to be provided. This patch seemed like the most reasonable way to override the default since it merely implements driver functionality that the infrastructure already allows (if not expects). Its not optimal for the case of the da830 evm because we have to duplicate a bunch of the data in the platform code--it would be nice to just override those two values. However, it still seems like the proper solution overall. Or...did I miss your point? Mark --
On Friday 18 September 2009, Mark A. Greer wrote: > The issue is that the values for the 'offs' and 'veroffs' are wrong in > the defaults used by nand_base.c:nand_default_bbt(). In what way "wrong"?
On Fri, Sep 18, 2009 at 11:21:17PM -0700, David Brownell wrote: > On Friday 18 September 2009, Mark A. Greer wrote: > > The issue is that the values for the 'offs' and 'veroffs' are wrong in > > the defaults used by nand_base.c:nand_default_bbt(). > > In what way "wrong"? The default: .offs = 8, .veroffs = 12, The da830 evm values: .offs = 2, .veroffs = 16, With the default values, every block is flagged as bad. This is using a small page nand flash chip. Mark --
On Sat, Sep 19, 2009 at 02:40:04, Mark A. Greer wrote: > From: Mark A. Greer <mgreer@mvista.com> > > The existing NAND infrastructure allows the default main and > mirror bad block tables to be overridden in nand_default_bbt(). > However, the davinci_nand driver does not support this. So, > add fields to the davinci driver's platform data so platform > code can pass in their own bbt's and make the driver honor > those overrides. > > Signed-off-by: Mark A. Greer <mgreer@mvista.com> > --- > This is required by the da830 evm (see following patch) which requires > different 'offs' and 'veroffs' values than the default. This seemed > like the solution that fit best with the existing infratructure. If > anyone has a better solution, please speak up. > Mark, Are you trying to align with the OOB layout being followed in U-Boot? U-Boot for da830/omap-l137 is not in mainline yet. I am planning to start working on that shortly. We can re-visit this when da830/omap-l137 support is present in u-boot. Regards, Sudhakar
different 'offs' and 'veroffs' values than the default. This seemed like the solution that fit best with the existing infratructure. If anyone has a better solution, please speak up. arch/arm/mach-davinci/include/mach/nand.h | 4 ++++ drivers/mtd/nand/davinci_nand.c | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h index b520c4b..b2ad809 100644 --- a/arch/arm/mach-davinci/include/mach/nand.h +++ b/arch/arm/mach-davinci/include/mach/nand.h @@ -79,6 +79,10 @@ struct davinci_nand_pdata { /* platform_data */ /* e.g. NAND_BUSWIDTH_16 or NAND_USE_FLASH_BBT */ unsigned options; + + /* Main and mirror bbt descriptor overrides */ + struct nand_bbt_descr *bbt_td; + struct nand_bbt_descr *bbt_md; }; #endif /* __ARCH_ARM_DAVINCI_NAND_H */ diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 0bcfd49..31461d7 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -591,6 +591,8 @@ static int __init nand_davinci_probe(struct platform_device *pdev) /* options such as NAND_USE_FLASH_BBT or 16-bit widths */ info->chip.options = pdata->options; + info->chip.bbt_td = pdata->bbt_td; + info->chip.bbt_md = pdata->bbt_md; info->ioaddr = (uint32_t __force) vaddr;