Skip to contentSkip to conversation

This patch fix the usage of the "CE don't care"-type NAND chips

PATCH Superseded Michael Trimarchi 4 participants 5 messages Feb 23, 2011

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 This patch fix the usage of the "CE don't care"-type NAND chips

Change since V1:

- add a better description

---
 drivers/mtd/nand/atmel_nand.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/mtd/nand/atmel_nand.c +10 -0
index ab8bbb3..c167f77 100644
@@ -249,8 +249,18 @@ static void at91_nand_hwcontrol(struct mtd_info *mtd,
 		if (ctrl & NAND_ALE)
 			IO_ADDR_W |= CONFIG_SYS_NAND_MASK_ALE;
 
+		/*
+		 * atmel_nand: don't require CONFIG_SYS_NAND_ENABLE_PIN
+		 * If NCE is hooked up to NCS3, we don't need to (and can't)
+		 * explicitly set the state of the NCE pin. Instead, the
+		 * controller asserts it automatically as part of a
+		 * command/data access. Only "CE don't care"-type NAND chips
+		 * can be used in this manner.
+		 */
+#ifdef CONFIG_SYS_NAND_ENABLE_PIN
 		at91_set_gpio_value(CONFIG_SYS_NAND_ENABLE_PIN,
 				    !(ctrl & NAND_NCE));
+#endif
 		this->IO_ADDR_W = (void *) IO_ADDR_W;
 	}
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 This patch fix the usage of the "CE don't care"-type NAND chips

Hi Michael,

Le 23/02/2011 12:28, Michael Trimarchi a ?crit :

Quoted 3 lines

Change since V1:

- add a better description

History should not be put above the '---' cut line; it should be below.

Quoted 6 lines
---
  drivers/mtd/nand/atmel_nand.c |   10 ++++++++++
  1 files changed, 10 insertions(+), 0 deletions(-)

[...]

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH v2 1/1 This patch fix the usage of the "CE don't care"-type NAND chips

Hi,

Quoted 16 lines · Albert ARIBAUD

Hi Michael,

Le 23/02/2011 12:28, Michael Trimarchi a ?crit :

Quoted 3 lines

Change since V1:

- add a better description

History should not be put above the '---' cut line; it should be below.

Quoted 6 lines
---
  drivers/mtd/nand/atmel_nand.c |   10 ++++++++++
  1 files changed, 10 insertions(+), 0 deletions(-)

[...]

I will edit the text and resend with mutt. do I need to change again revision?

Michael Trimarchi

Quoted 1 line

Amicalement,

#3 lore raw

PATCH v2 1/1 This patch fix the usage of the "CE don't care"-type NAND chips

Dear Michael Trimarchi,

Quoted 2 lines · In message <[email protected]> you wrote:

I will edit the text and resend with mutt. do I need to change again revision?

Yes, please, as it's a new commit (commit message has changed).

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Houston, Tranquillity Base here.  The Eagle has landed.
                                                    -- Neil Armstrong
#4 lore raw

PATCH v2 1/1 This patch fix the usage of the "CE don't care"-type NAND chips

In reply to Michael Trimarchi
Quoted 3 lines · On Wed, 23 Feb 2011 12:28:34 +0100 Michael Trimarchi…

Change since V1:

- add a better description

This part does not go in the changelog -- it should be below the --- line.

Quoted 12 lines
---
 drivers/mtd/nand/atmel_nand.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/mtd/nand/atmel_nand.c +0 -0
index ab8bbb3..c167f77 100644
@@ -249,8 +249,18 @@ static void at91_nand_hwcontrol(struct mtd_info *mtd,
 		if (ctrl & NAND_ALE)

drivers/mtd/nand/atmel_nand.c static void at91_nand_hwcontrol(struct mtd_info *mtd, · line 259

Quoted 10 lines
drivers/mtd/nand/atmel_nand.c +8 -0
 			IO_ADDR_W |= CONFIG_SYS_NAND_MASK_ALE;
 
+		/*
+		 * atmel_nand: don't require CONFIG_SYS_NAND_ENABLE_PIN
+		 * If NCE is hooked up to NCS3, we don't need to (and can't)
+		 * explicitly set the state of the NCE pin. Instead, the
+		 * controller asserts it automatically as part of a
+		 * command/data access. Only "CE don't care"-type NAND chips
+		 * can be used in this manner.
+		 */

This was meant for the changelog, not the code. For the code, it seems reasonably self-explanatory that if you don't have CONFIG_SYS_NAND_ENABLE_PIN, you don't use it.

If you want to put a short comment in the code about this situation, fine (though it really belongs in a README that documents CONFIG_SYS_NAND_ENABLE_PIN instead), but the text above should go in the git changelog.

-Scott