Skip to contentSkip to conversation

mtd/nand: modify NAND_CHIPOPTIONS_MSK

RFC In review Jan Weitzel 4 participants 12 messages Nov 28, 2011 – Dec 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mtd/nand: modify NAND_CHIPOPTIONS_MSK

Trying to set NAND_NO_SUBPAGE_WRITE from platform fail, because nand_flash_detect_onfi options from struct nand_flash_dev overwrite the flag.

Removing NAND_NO_SUBPAGE_WRITE from NAND_CHIPOPTIONS_MSK fix this, but setting it via struct nand_flash_dev table is not longer supported.

---
 include/linux/mtd/nand.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/mtd/nand.h +2 -1
index 904131b..babef5b 100644
@@ -216,7 +216,8 @@ typedef enum {
 					&& (chip->page_shift > 9))
 
 /* Mask to zero out the chip options, which come from the id table */
-#define NAND_CHIPOPTIONS_MSK	(0x0000ffff & ~NAND_NO_AUTOINCR)
+#define NAND_CHIPOPTIONS_MSK \
+	(0x0000ffff & ~NAND_NO_AUTOINCR & ~NAND_NO_SUBPAGE_WRITE)
 
 /* Non chip related options */
 /* This option skips the bbt scan during initialization. */
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 5 lines · Jan Weitzel

Trying to set NAND_NO_SUBPAGE_WRITE from platform fail, because nand_flash_detect_onfi options from struct nand_flash_dev overwrite the flag.

Removing NAND_NO_SUBPAGE_WRITE from NAND_CHIPOPTIONS_MSK fix this, but setting it via struct nand_flash_dev table is not longer supported.

Is it necessary to change the mask? I'm not real familiar with this particular option, but can't you set your flags after the initial identification stage? For instance, something like this:

nand_scan_ident(mtd, ...);
chip->options |= NAND_NO_SUBPAGE_WRITE;
nand_scan_tail(mtd);

Brian

#2 lore raw

PATCH 1/1 mdt nand: omap2+ use platform options

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

---
 drivers/mtd/nand/omap2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mtd/nand/omap2.c +2 -0
index f745f00..7de4c0e 100644
@@ -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) {
 
Signature · 6 lines
1.7.0.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#3 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Quoted 4 lines · Jan Weitzel

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

#4 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Am Mittwoch, den 30.11.2011, 12:31 -0800 schrieb Brian Norris:

Quoted 8 lines · Jan Weitzel
Quoted 4 lines

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

Quoted 5 lines

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

In reply to Jan Weitzel
Quoted 6 lines · Jan Weitzel

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

Pushed to l2-mtd-2.6.git, thank you!

#6 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel

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'

Signature · 5 lines
Gražvydas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Quoted 11 lines · Grazvydas Ignotas
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel

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.

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#8 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

In reply to Grazvydas Ignotas
Quoted 11 lines · Grazvydas Ignotas
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel

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

#9 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Quoted 9 lines · Brian Norris
Quoted 8 lines · Grazvydas Ignotas
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel

Pushed to l2-mtd-2.6.git, thank you!

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

Quoted 7 lines
Quoted 3 lines

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.

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#10 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

In reply to Grazvydas Ignotas

Am Freitag, den 02.12.2011, 12:20 +0200 schrieb Grazvydas Ignotas:

Quoted 7 lines · Artem Bityutskiy
Quoted 4 lines · Jan Weitzel
Quoted 1 line

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

Quoted 5 lines

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'

#11 lore raw

Re: [PATCH] mdt nand: omap2+ use platform options

Quoted 4 lines · Jan Weitzel

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.

Signature · 5 lines
Gražvydas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html