Re: [PATCH] Missing implementation of omap3evm_flash_init()

Tony Lindgren
2009-06-24T13:36:51Z

* Premi, Sanjeev <premi@ti.com> [090624 14:45]:
> > -----Original Message-----
> > From: Tony Lindgren [mailto:tony@atomide.com]
> > Sent: Monday, June 22, 2009 7:04 PM
> > To: Premi, Sanjeev
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] Missing implementation of omap3evm_flash_init()
> >
> > * Premi, Sanjeev <premi@ti.com> [090622 16:16]:
> > > > -----Original Message-----
> > > > From: Tony Lindgren [mailto:tony@atomide.com]
> > > > Sent: Monday, June 22, 2009 2:37 PM
> > > > To: Premi, Sanjeev
> > > > Cc: linux-omap@vger.kernel.org
> > > > Subject: Re: [PATCH] Missing implementation of
> > omap3evm_flash_init()
> > > >
>
> <snip>--<snip>
>
> Tony,
>
> I had a few follow-up queries below:
>
> > > >
> > > > We already have code that initializes the GPMC for
> > onenand in kernel.
> > > > And I posted a patch to enable onenand for the SDP boards
> > > > last week [1].
> > >
> > > Did not see it; before creating the patch; lookig at this now...
> >
> > OK, thanks.
> >
> > > > And this is yet another copy of the same code that was
> > duplicated for
> > > > multiple boards. So how about making the following changes:
> > > >
> > > > - Pass the onenand chip select for GPMC in platform data. I
> > > > doubt that the
> > > > chip select is changing?
> > > >
> > > > - If you still need to probe for onenand, please create a
> > > > generic function
> > > > in gpmc-onenand.c to probe for onenand
>
> I always see "onenand_base" being passed as argument. Where is it
> initialized?

That is allocated with gpmc_cs_request() based on the cs in the
struct omap_onenand_platform_data.

> I did implement this function to probe for nand/onenand - based on
> the code that existed in board-omap3evm-flash.c; but ran into
> some problems with the setting base address.

I guess the probe is only looking at the GPMC configuration registers
though?

> Looking at the gpmc-onenand.c do you believe we would need a
> gpmc-nand.c on same lines? Or an implementation within the
> board-omap3evm.c is okay for now?

Well if you can figure out how to do a common gpmc-nand.c, I'm sure
it would make things easier to bring up new boards (and omaps).

Regards,

Tony

>
> Best regards,
> Sanjeev
>
> > > >
> > >
> > > Some EVMs have OneNAND and others have NAND. How/ Where do
> > you suggest
> > > this check sould go?
> >
> > If it's based on just checking the GPMC registers, you could
> > put it into
> > gpmc.c.
> >
> > Regards,
> >
> > Tony
> >
> >
> >
>
>
> <snip>--<snip>--<snip till end>
>