mtd/nand: modify NAND_CHIPOPTIONS_MSK
Subsystems (2)
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
@@ -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
Quoted 5 lines · Jan Weitzel
Trying to set
NAND_NO_SUBPAGE_WRITEfrom platform fail, becausenand_flash_detect_onfioptions from structnand_flash_devoverwrite the flag.Removing
NAND_NO_SUBPAGE_WRITEfromNAND_CHIPOPTIONS_MSKfix this, but setting it via structnand_flash_devtable 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
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
@@ -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/
Re: [PATCH] mdt nand: omap2+ use platform options
Quoted 4 lines · Jan Weitzel
Options from struct
omap_nand_platform_dataare not used. Apply options afternand_scan_identto avoid overwrite due toNAND_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
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_dataare not used. Apply options afternand_scan_identto avoid overwrite due toNAND_CHIPOPTIONS_MSK.
So you can pass options from platformcodeJust to clarify, were the
pdata->optionsever used before? And does structomap_nand_platform_dataeven 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
Artem Bityutskiy
AppliedRe: [PATCH] mdt nand: omap2+ use platform options
In reply to Jan WeitzelQuoted 6 lines · Jan Weitzel
Options from struct
omap_nand_platform_dataare not used. Apply options afternand_scan_identto avoid overwrite due toNAND_CHIPOPTIONS_MSK.
So you can pass options from platformcodeSigned-off-by Jan Weitzel <[email protected]>
Pushed to l2-mtd-2.6.git, thank you!
Re: [PATCH] mdt nand: omap2+ use platform options
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel
Signed-off-by Jan Weitzel <[email protected]>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
Re: [PATCH] mdt nand: omap2+ use platform options
Quoted 11 lines · Grazvydas Ignotas
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel
Signed-off-by Jan Weitzel <[email protected]>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: 'structomap_nand_platform_data' has no member named 'options'
OK, dropping it for now.
Signature · 2 lines
Best Regards, Artem Bityutskiy
Re: [PATCH] mdt nand: omap2+ use platform options
In reply to Grazvydas IgnotasQuoted 11 lines · Grazvydas Ignotas
Quoted 4 lines · Artem Bityutskiy
Quoted 1 line · Jan Weitzel
Signed-off-by Jan Weitzel <[email protected]>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: 'structomap_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
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
Signed-off-by Jan Weitzel <[email protected]>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: 'structomap_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
Re: [PATCH] mdt nand: omap2+ use platform options
In reply to Grazvydas IgnotasAm Freitag, den 02.12.2011, 12:20 +0200 schrieb Grazvydas Ignotas:
Quoted 7 lines · Artem Bityutskiy
Quoted 4 lines · Jan Weitzel
Quoted 1 line
Signed-off-by Jan Weitzel <[email protected]>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: 'structomap_nand_platform_data' has no member named 'options'
Re: [PATCH] mdt nand: omap2+ use platform options
Quoted 4 lines · Jan Weitzel
Sorry, I wasn't carefully enough. I missed
7a559c78where you removed options from structomap_nand_platform_data. Did you think getting we should reintroduce it? I am looking for a good way to getNAND_NO_SUBPAGE_WRITEfrom 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