Patchwork mdt nand: omap2+ use platform options

login
register
mail settings
Submitter Jan Weitzel
Date Nov. 29, 2011, 9 a.m.
Message ID <1322557213-23565-1-git-send-email-j.weitzel@phytec.de>
Download mbox | patch
Permalink /patch/128240/
State New
Headers show

Comments

Jan Weitzel - Nov. 29, 2011, 9 a.m.
Options from struct omap_nand_platform_data are not used.
Apply options after nand_scan_ident to avoid overwrite due to
NAND_CHIPOPTIONS_MSK.
So you can pass options from platformcode

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 drivers/mtd/nand/omap2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Brian Norris - Nov. 30, 2011, 8:31 p.m.
On Tue, Nov 29, 2011 at 1:00 AM, Jan Weitzel <j.weitzel@phytec.de> wrote:
> Options from struct omap_nand_platform_data are not used.
> Apply options after nand_scan_ident to avoid overwrite due to
> NAND_CHIPOPTIONS_MSK.
> So you can pass options from platformcode

Just to clarify, were the pdata->options ever used before? And does
struct omap_nand_platform_data even have such a field?

Brian
Jan Weitzel - Dec. 1, 2011, 8:21 a.m.
Am Mittwoch, den 30.11.2011, 12:31 -0800 schrieb Brian Norris:
> On Tue, Nov 29, 2011 at 1:00 AM, Jan Weitzel <j.weitzel@phytec.de> wrote:
> > Options from struct omap_nand_platform_data are not used.
> > Apply options after nand_scan_ident to avoid overwrite due to
> > NAND_CHIPOPTIONS_MSK.
> > So you can pass options from platformcode
> 
> Just to clarify, were the pdata->options ever used before? And does
> struct omap_nand_platform_data even have such a field?

No not used, but field exists. There is also a devsize field which is
used to provide NAND_BUSWIDTH_16 to info->nand.options
(drivers/mtd/nand/omap2.c)
Jan

> Brian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Artem Bityutskiy - Dec. 1, 2011, 8:42 a.m.
On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
> Options from struct omap_nand_platform_data are not used.
> Apply options after nand_scan_ident to avoid overwrite due to
> NAND_CHIPOPTIONS_MSK.
> So you can pass options from platformcode
> 
> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>

Pushed to l2-mtd-2.6.git, thank you!
Grazvydas Ignotas - Dec. 2, 2011, 10:20 a.m.
On Thu, Dec 1, 2011 at 10:42 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
>> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
>
> Pushed to l2-mtd-2.6.git, thank you!

This breaks build here, did you really test it, Jan?

drivers/mtd/nand/omap2.c: In function 'omap_nand_probe':
drivers/mtd/nand/omap2.c:1078: error: 'struct omap_nand_platform_data'
has no member named 'options'
Artem Bityutskiy - Dec. 2, 2011, 11:10 a.m.
On Fri, 2011-12-02 at 12:20 +0200, Grazvydas Ignotas wrote:
> On Thu, Dec 1, 2011 at 10:42 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
> >> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> >
> > Pushed to l2-mtd-2.6.git, thank you!
> 
> This breaks build here, did you really test it, Jan?
> 
> drivers/mtd/nand/omap2.c: In function 'omap_nand_probe':
> drivers/mtd/nand/omap2.c:1078: error: 'struct omap_nand_platform_data'
> has no member named 'options'

OK, dropping it for now.
Brian Norris - Dec. 2, 2011, 5:28 p.m.
On Fri, Dec 2, 2011 at 2:20 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> On Thu, Dec 1, 2011 at 10:42 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>> On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
>>> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
>>
>> Pushed to l2-mtd-2.6.git, thank you!
>
> This breaks build here, did you really test it, Jan?
>
> drivers/mtd/nand/omap2.c: In function 'omap_nand_probe':
> drivers/mtd/nand/omap2.c:1078: error: 'struct omap_nand_platform_data'
> has no member named 'options'

This is exactly what I was asking already. I don't see 'options' in
'struct omap_nand_platform_data' in
'arch/arm/plat-omap/include/plat/nand.h', even in linux-next.

Brian
Artem Bityutskiy - Dec. 4, 2011, 2:29 p.m.
On Fri, 2011-12-02 at 09:28 -0800, Brian Norris wrote:
> On Fri, Dec 2, 2011 at 2:20 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> > On Thu, Dec 1, 2011 at 10:42 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> >> On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
> >>> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> >>
> >> Pushed to l2-mtd-2.6.git, thank you!
> >
> > This breaks build here, did you really test it, Jan?
> >
> > drivers/mtd/nand/omap2.c: In function 'omap_nand_probe':
> > drivers/mtd/nand/omap2.c:1078: error: 'struct omap_nand_platform_data'
> > has no member named 'options'
> 
> This is exactly what I was asking already. I don't see 'options' in
> 'struct omap_nand_platform_data' in
> 'arch/arm/plat-omap/include/plat/nand.h', even in linux-next.

Yes, sorry, I've payed not enough attention to the patch.
Jan Weitzel - Dec. 5, 2011, 8:11 a.m.
Am Freitag, den 02.12.2011, 12:20 +0200 schrieb Grazvydas Ignotas:
> On Thu, Dec 1, 2011 at 10:42 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Tue, 2011-11-29 at 10:00 +0100, Jan Weitzel wrote:
> >> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> >
> > Pushed to l2-mtd-2.6.git, thank you!
> 
> This breaks build here, did you really test it, Jan?
Sorry, I wasn't carefully enough. I missed 7a559c78 where you removed
options from struct omap_nand_platform_data. Did you think getting we
should reintroduce it? I am looking for a good way to get
NAND_NO_SUBPAGE_WRITE from boardfile to driver.
Jan
> drivers/mtd/nand/omap2.c: In function 'omap_nand_probe':
> drivers/mtd/nand/omap2.c:1078: error: 'struct omap_nand_platform_data'
> has no member named 'options'
> 
>
Grazvydas Ignotas - Dec. 5, 2011, 10:32 a.m.
On Mon, Dec 5, 2011 at 10:11 AM, Jan Weitzel <J.Weitzel@phytec.de> wrote:
> Sorry, I wasn't carefully enough. I missed 7a559c78 where you removed
> options from struct omap_nand_platform_data. Did you think getting we
> should reintroduce it? I am looking for a good way to get
> NAND_NO_SUBPAGE_WRITE from boardfile to driver.

You could just rename .devsize to .options and use that I guess.

Patch

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index f745f00..7de4c0e 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1075,6 +1075,8 @@  static int __devinit omap_nand_probe(struct platform_device *pdev)
 		}
 	}
 
+	info->nand.options |= pdata->options;
+
 	/* rom code layout */
 	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {