linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] In the Denali NAND controller driver, use 8 bytes for READID command.
@ 2014-06-23 19:21 Graham Moore
  2014-06-23 19:50 ` Dinh Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Graham Moore @ 2014-06-23 19:21 UTC (permalink / raw)
  To: ggrahammoore
  Cc: Graham Moore, linux-kernel, Yves Vandervennet, linux-mtd,
	Alan Tull, Brian Norris, David Woodhouse, Dinh Nguyen

The Denali NAND driver reads only 5 bytes of ID, but some Hynix and Samsung
have size parameters in the 6th byte.  As a result, the page and oob size
for a Hynix H27UAG8T2B were calculated incorrectly and the driver failed to
load.

The solution is to read 8 bytes of ID, as expected by the nand framework.

Signed-off-by: Graham Moore <grmoore@altera.com>
--
V2: Increase size of id_bytes array to 8.
---
 drivers/mtd/nand/denali.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 9f2012a..0b071a3 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -473,7 +473,7 @@ static void detect_partition_feature(struct denali_nand_info *denali)
 static uint16_t denali_nand_timing_set(struct denali_nand_info *denali)
 {
 	uint16_t status = PASS;
-	uint32_t id_bytes[5], addr;
+	uint32_t id_bytes[8], addr;
 	uint8_t i, maf_id, device_id;
 
 	dev_dbg(denali->dev,
@@ -488,7 +488,7 @@ static uint16_t denali_nand_timing_set(struct denali_nand_info *denali)
 	addr = (uint32_t)MODE_11 | BANK(denali->flash_bank);
 	index_addr(denali, (uint32_t)addr | 0, 0x90);
 	index_addr(denali, (uint32_t)addr | 1, 0);
-	for (i = 0; i < 5; i++)
+	for (i = 0; i < 8; i++)
 		index_addr_read_data(denali, addr | 2, &id_bytes[i]);
 	maf_id = id_bytes[0];
 	device_id = id_bytes[1];
@@ -1276,7 +1276,7 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
 		addr = (uint32_t)MODE_11 | BANK(denali->flash_bank);
 		index_addr(denali, (uint32_t)addr | 0, 0x90);
 		index_addr(denali, (uint32_t)addr | 1, 0);
-		for (i = 0; i < 5; i++) {
+		for (i = 0; i < 8; i++) {
 			index_addr_read_data(denali,
 						(uint32_t)addr | 2,
 						&id);
-- 
1.7.10.4

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

* Re: [PATCH V2] In the Denali NAND controller driver, use 8 bytes for READID command.
  2014-06-23 19:21 [PATCH V2] In the Denali NAND controller driver, use 8 bytes for READID command Graham Moore
@ 2014-06-23 19:50 ` Dinh Nguyen
  2014-07-15  1:46   ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Dinh Nguyen @ 2014-06-23 19:50 UTC (permalink / raw)
  To: Graham Moore
  Cc: ggrahammoore, linux-kernel, Yves Vandervennet, linux-mtd,
	Alan Tull, Brian Norris, David Woodhouse

Hi Graham,

On Mon, 2014-06-23 at 14:21 -0500, Graham Moore wrote:
> The Denali NAND driver reads only 5 bytes of ID, but some Hynix and Samsung
> have size parameters in the 6th byte.  As a result, the page and oob size
> for a Hynix H27UAG8T2B were calculated incorrectly and the driver failed to
> load.
> 
> The solution is to read 8 bytes of ID, as expected by the nand framework.
> 
> Signed-off-by: Graham Moore <grmoore@altera.com>
> --
> V2: Increase size of id_bytes array to 8.
> ---
>  drivers/mtd/nand/denali.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Your commit header should have "mtd: denali:"

i.e: "mtd: denali: use 8 bytes for READID command"

Dinh

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

* Re: [PATCH V2] In the Denali NAND controller driver, use 8 bytes for READID command.
  2014-06-23 19:50 ` Dinh Nguyen
@ 2014-07-15  1:46   ` Brian Norris
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-07-15  1:46 UTC (permalink / raw)
  To: Dinh Nguyen
  Cc: ggrahammoore, Graham Moore, linux-kernel, Yves Vandervennet,
	linux-mtd, Alan Tull, David Woodhouse

On Mon, Jun 23, 2014 at 02:50:15PM -0500, Dinh Nguyen wrote:
> On Mon, 2014-06-23 at 14:21 -0500, Graham Moore wrote:
> > The Denali NAND driver reads only 5 bytes of ID, but some Hynix and Samsung
> > have size parameters in the 6th byte.  As a result, the page and oob size
> > for a Hynix H27UAG8T2B were calculated incorrectly and the driver failed to
> > load.
> > 
> > The solution is to read 8 bytes of ID, as expected by the nand framework.
> > 
> > Signed-off-by: Graham Moore <grmoore@altera.com>
> > --
> > V2: Increase size of id_bytes array to 8.
> > ---
> >  drivers/mtd/nand/denali.c |    6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Your commit header should have "mtd: denali:"
> 
> i.e: "mtd: denali: use 8 bytes for READID command"

Modified the subject and pushed to l2-mtd.git. Thanks!

Brian

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

end of thread, other threads:[~2014-07-15  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 19:21 [PATCH V2] In the Denali NAND controller driver, use 8 bytes for READID command Graham Moore
2014-06-23 19:50 ` Dinh Nguyen
2014-07-15  1:46   ` Brian Norris

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