linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mtd/nand: modify NAND_CHIPOPTIONS_MSK
@ 2011-11-28 14:20 Jan Weitzel
  2011-11-28 18:34 ` Brian Norris
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Weitzel @ 2011-11-28 14:20 UTC (permalink / raw)
  To: linux-mtd; +Cc: dedekind, Jan Weitzel, tglx

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.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 include/linux/mtd/nand.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 904131b..babef5b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -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. */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [RFC] mtd/nand: modify NAND_CHIPOPTIONS_MSK
  2011-11-28 14:20 [RFC] mtd/nand: modify NAND_CHIPOPTIONS_MSK Jan Weitzel
@ 2011-11-28 18:34 ` Brian Norris
  2011-11-29  9:00   ` [PATCH] mdt nand: omap2+ use platform options Jan Weitzel
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Norris @ 2011-11-28 18:34 UTC (permalink / raw)
  To: Jan Weitzel; +Cc: dedekind, tglx, linux-mtd

On Mon, Nov 28, 2011 at 6:20 AM, Jan Weitzel <j.weitzel@phytec.de> wrote:
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] mdt nand: omap2+ use platform options
  2011-11-28 18:34 ` Brian Norris
@ 2011-11-29  9:00   ` Jan Weitzel
  2011-11-30 20:31     ` Brian Norris
  2011-12-01  8:42     ` Artem Bityutskiy
  0 siblings, 2 replies; 12+ messages in thread
From: Jan Weitzel @ 2011-11-29  9:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: dedekind, Jan Weitzel, tglx, computersforpeace, linux-omap

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(-)

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) {
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-11-29  9:00   ` [PATCH] mdt nand: omap2+ use platform options Jan Weitzel
@ 2011-11-30 20:31     ` Brian Norris
  2011-12-01  8:21       ` Jan Weitzel
  2011-12-01  8:42     ` Artem Bityutskiy
  1 sibling, 1 reply; 12+ messages in thread
From: Brian Norris @ 2011-11-30 20:31 UTC (permalink / raw)
  To: Jan Weitzel; +Cc: dedekind, tglx, linux-omap, linux-mtd

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-11-30 20:31     ` Brian Norris
@ 2011-12-01  8:21       ` Jan Weitzel
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Weitzel @ 2011-12-01  8:21 UTC (permalink / raw)
  To: Brian Norris; +Cc: dedekind, tglx, linux-omap, linux-mtd

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-11-29  9:00   ` [PATCH] mdt nand: omap2+ use platform options Jan Weitzel
  2011-11-30 20:31     ` Brian Norris
@ 2011-12-01  8:42     ` Artem Bityutskiy
  2011-12-02 10:20       ` Grazvydas Ignotas
  1 sibling, 1 reply; 12+ messages in thread
From: Artem Bityutskiy @ 2011-12-01  8:42 UTC (permalink / raw)
  To: Jan Weitzel; +Cc: dedekind, tglx, computersforpeace, linux-mtd, linux-omap

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!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-01  8:42     ` Artem Bityutskiy
@ 2011-12-02 10:20       ` Grazvydas Ignotas
  2011-12-02 11:10         ` Artem Bityutskiy
                           ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Grazvydas Ignotas @ 2011-12-02 10:20 UTC (permalink / raw)
  To: dedekind1
  Cc: linux-omap, dedekind, Jan Weitzel, linux-mtd, tglx, computersforpeace

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'


-- 
Gražvydas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-02 10:20       ` Grazvydas Ignotas
@ 2011-12-02 11:10         ` Artem Bityutskiy
  2011-12-02 17:28         ` Brian Norris
  2011-12-05  8:11         ` Jan Weitzel
  2 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2011-12-02 11:10 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Jan Weitzel, tglx, computersforpeace, linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

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.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-02 10:20       ` Grazvydas Ignotas
  2011-12-02 11:10         ` Artem Bityutskiy
@ 2011-12-02 17:28         ` Brian Norris
  2011-12-04 14:29           ` Artem Bityutskiy
  2011-12-05  8:11         ` Jan Weitzel
  2 siblings, 1 reply; 12+ messages in thread
From: Brian Norris @ 2011-12-02 17:28 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: dedekind1, dedekind, Jan Weitzel, linux-mtd, tglx, linux-omap

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-02 17:28         ` Brian Norris
@ 2011-12-04 14:29           ` Artem Bityutskiy
  0 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2011-12-04 14:29 UTC (permalink / raw)
  To: Brian Norris; +Cc: Jan Weitzel, tglx, linux-omap, linux-mtd, Grazvydas Ignotas

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

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.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-02 10:20       ` Grazvydas Ignotas
  2011-12-02 11:10         ` Artem Bityutskiy
  2011-12-02 17:28         ` Brian Norris
@ 2011-12-05  8:11         ` Jan Weitzel
  2011-12-05 10:32           ` Grazvydas Ignotas
  2 siblings, 1 reply; 12+ messages in thread
From: Jan Weitzel @ 2011-12-05  8:11 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: linux-omap, dedekind1, dedekind, linux-mtd, tglx, computersforpeace

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'
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mdt nand: omap2+ use platform options
  2011-12-05  8:11         ` Jan Weitzel
@ 2011-12-05 10:32           ` Grazvydas Ignotas
  0 siblings, 0 replies; 12+ messages in thread
From: Grazvydas Ignotas @ 2011-12-05 10:32 UTC (permalink / raw)
  To: J.Weitzel
  Cc: linux-omap, dedekind1, dedekind, linux-mtd, tglx, computersforpeace

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.


-- 
Gražvydas

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-12-05 10:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 14:20 [RFC] mtd/nand: modify NAND_CHIPOPTIONS_MSK Jan Weitzel
2011-11-28 18:34 ` Brian Norris
2011-11-29  9:00   ` [PATCH] mdt nand: omap2+ use platform options Jan Weitzel
2011-11-30 20:31     ` Brian Norris
2011-12-01  8:21       ` Jan Weitzel
2011-12-01  8:42     ` Artem Bityutskiy
2011-12-02 10:20       ` Grazvydas Ignotas
2011-12-02 11:10         ` Artem Bityutskiy
2011-12-02 17:28         ` Brian Norris
2011-12-04 14:29           ` Artem Bityutskiy
2011-12-05  8:11         ` Jan Weitzel
2011-12-05 10:32           ` Grazvydas Ignotas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).