All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] Two bug fixes of Denali NAND controller driver
@ 2014-10-03 11:03 Masahiro Yamada
  2014-10-03 11:03 ` [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command Masahiro Yamada
  2014-10-03 11:03 ` [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command Masahiro Yamada
  0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2014-10-03 11:03 UTC (permalink / raw)
  To: u-boot




Masahiro Yamada (2):
  mtd: denali: fix NAND_CMD_PARAM command
  mtd: denali: support NAND_CMD_RNDOUT command

 drivers/mtd/nand/denali.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

-- 
1.9.1

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

* [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command
  2014-10-03 11:03 [U-Boot] [PATCH 0/2] Two bug fixes of Denali NAND controller driver Masahiro Yamada
@ 2014-10-03 11:03 ` Masahiro Yamada
  2014-10-08  8:12   ` Chin Liang See
  2014-10-03 11:03 ` [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command Masahiro Yamada
  1 sibling, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2014-10-03 11:03 UTC (permalink / raw)
  To: u-boot

NAND_CMD_PARAM (0xEC) command is not working on the Denali
NAND controller driver.

Unlike NAND_CMD_READID (0x90), when the NAND_CMD_PARAM command
is followed by an address cycle, the target device goes busy.
(R/B# is deasserted)
Wait until the parameter data are ready.

In addition, unnecessary clear_interrupts() should be removed.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 drivers/mtd/nand/denali.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index ba3de1a..d9abc7e 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1059,9 +1059,8 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
 		addr = MODE_11 | BANK(denali->flash_bank);
 		index_addr(denali, addr | 0, cmd);
 		break;
-	case NAND_CMD_PARAM:
-		clear_interrupts(denali);
 	case NAND_CMD_READID:
+	case NAND_CMD_PARAM:
 		reset_buf(denali);
 		/* sometimes ManufactureId read from register is not right
 		 * e.g. some of Micron MT29F32G08QAA MLC NAND chips
@@ -1070,6 +1069,8 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
 		addr = MODE_11 | BANK(denali->flash_bank);
 		index_addr(denali, addr | 0, cmd);
 		index_addr(denali, addr | 1, col & 0xFF);
+		if (cmd == NAND_CMD_PARAM)
+			udelay(50);
 		break;
 	case NAND_CMD_READ0:
 	case NAND_CMD_SEQIN:
-- 
1.9.1

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

* [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command
  2014-10-03 11:03 [U-Boot] [PATCH 0/2] Two bug fixes of Denali NAND controller driver Masahiro Yamada
  2014-10-03 11:03 ` [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command Masahiro Yamada
@ 2014-10-03 11:03 ` Masahiro Yamada
  2014-10-08  8:13   ` Chin Liang See
  2014-10-09 22:31   ` Scott Wood
  1 sibling, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2014-10-03 11:03 UTC (permalink / raw)
  To: u-boot

The function nand_flash_detect_ext_param_page() requires
NAND_CMD_RNDOUT command supported.  It is necessary to detect some
types of ONFi-compliant devices.  Without it, the error message
"unsupported command received 0x5" is shown.

Let's support this command on the Denali NAND controller driver.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 drivers/mtd/nand/denali.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index d9abc7e..308b784 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1072,6 +1072,13 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
 		if (cmd == NAND_CMD_PARAM)
 			udelay(50);
 		break;
+	case NAND_CMD_RNDOUT:
+		addr = MODE_11 | BANK(denali->flash_bank);
+		index_addr(denali, addr | 0, cmd);
+		index_addr(denali, addr | 1, col & 0xFF);
+		index_addr(denali, addr | 1, col >> 8);
+		index_addr(denali, addr | 0, NAND_CMD_RNDOUTSTART);
+		break;
 	case NAND_CMD_READ0:
 	case NAND_CMD_SEQIN:
 		denali->page = page;
-- 
1.9.1

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

* [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command
  2014-10-03 11:03 ` [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command Masahiro Yamada
@ 2014-10-08  8:12   ` Chin Liang See
  0 siblings, 0 replies; 6+ messages in thread
From: Chin Liang See @ 2014-10-08  8:12 UTC (permalink / raw)
  To: u-boot

On Fri, 2014-10-03 at 20:03 +0900, Masahiro Yamada wrote:
> NAND_CMD_PARAM (0xEC) command is not working on the Denali
> NAND controller driver.
> 
> Unlike NAND_CMD_READID (0x90), when the NAND_CMD_PARAM command
> is followed by an address cycle, the target device goes busy.
> (R/B# is deasserted)
> Wait until the parameter data are ready.
> 
> In addition, unnecessary clear_interrupts() should be removed.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
> 
>  drivers/mtd/nand/denali.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index ba3de1a..d9abc7e 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -1059,9 +1059,8 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
>  		addr = MODE_11 | BANK(denali->flash_bank);
>  		index_addr(denali, addr | 0, cmd);
>  		break;
> -	case NAND_CMD_PARAM:
> -		clear_interrupts(denali);
>  	case NAND_CMD_READID:
> +	case NAND_CMD_PARAM:
>  		reset_buf(denali);
>  		/* sometimes ManufactureId read from register is not right
>  		 * e.g. some of Micron MT29F32G08QAA MLC NAND chips
> @@ -1070,6 +1069,8 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
>  		addr = MODE_11 | BANK(denali->flash_bank);
>  		index_addr(denali, addr | 0, cmd);
>  		index_addr(denali, addr | 1, col & 0xFF);
> +		if (cmd == NAND_CMD_PARAM)
> +			udelay(50);
>  		break;
>  	case NAND_CMD_READ0:
>  	case NAND_CMD_SEQIN:

Acked-by: Chin Liang See <clsee@altera.com>

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

* [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command
  2014-10-03 11:03 ` [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command Masahiro Yamada
@ 2014-10-08  8:13   ` Chin Liang See
  2014-10-09 22:31   ` Scott Wood
  1 sibling, 0 replies; 6+ messages in thread
From: Chin Liang See @ 2014-10-08  8:13 UTC (permalink / raw)
  To: u-boot

On Fri, 2014-10-03 at 20:03 +0900, Masahiro Yamada wrote:
> The function nand_flash_detect_ext_param_page() requires
> NAND_CMD_RNDOUT command supported.  It is necessary to detect some
> types of ONFi-compliant devices.  Without it, the error message
> "unsupported command received 0x5" is shown.
> 
> Let's support this command on the Denali NAND controller driver.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
> 
>  drivers/mtd/nand/denali.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index d9abc7e..308b784 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -1072,6 +1072,13 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
>  		if (cmd == NAND_CMD_PARAM)
>  			udelay(50);
>  		break;
> +	case NAND_CMD_RNDOUT:
> +		addr = MODE_11 | BANK(denali->flash_bank);
> +		index_addr(denali, addr | 0, cmd);
> +		index_addr(denali, addr | 1, col & 0xFF);
> +		index_addr(denali, addr | 1, col >> 8);
> +		index_addr(denali, addr | 0, NAND_CMD_RNDOUTSTART);
> +		break;
>  	case NAND_CMD_READ0:
>  	case NAND_CMD_SEQIN:
>  		denali->page = page;

Acked-by: Chin Liang See <clsee@altera.com>

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

* [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command
  2014-10-03 11:03 ` [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command Masahiro Yamada
  2014-10-08  8:13   ` Chin Liang See
@ 2014-10-09 22:31   ` Scott Wood
  1 sibling, 0 replies; 6+ messages in thread
From: Scott Wood @ 2014-10-09 22:31 UTC (permalink / raw)
  To: u-boot

On Fri, 2014-10-03 at 20:03 +0900, Masahiro Yamada wrote:
> The function nand_flash_detect_ext_param_page() requires
> NAND_CMD_RNDOUT command supported.  It is necessary to detect some
> types of ONFi-compliant devices.  Without it, the error message
> "unsupported command received 0x5" is shown.
> 
> Let's support this command on the Denali NAND controller driver.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
> 
>  drivers/mtd/nand/denali.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index d9abc7e..308b784 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -1072,6 +1072,13 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
>  		if (cmd == NAND_CMD_PARAM)
>  			udelay(50);
>  		break;
> +	case NAND_CMD_RNDOUT:
> +		addr = MODE_11 | BANK(denali->flash_bank);
> +		index_addr(denali, addr | 0, cmd);
> +		index_addr(denali, addr | 1, col & 0xFF);
> +		index_addr(denali, addr | 1, col >> 8);
> +		index_addr(denali, addr | 0, NAND_CMD_RNDOUTSTART);
> +		break;

This usage of RNDOUT is a regression for other drivers as well, such as
fsl_ifc_nand... I really wish emulating a simple controller weren't the
API used to talk to higher level drivers. :-(

-Scott

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

end of thread, other threads:[~2014-10-09 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 11:03 [U-Boot] [PATCH 0/2] Two bug fixes of Denali NAND controller driver Masahiro Yamada
2014-10-03 11:03 ` [U-Boot] [PATCH 1/2] mtd: denali: fix NAND_CMD_PARAM command Masahiro Yamada
2014-10-08  8:12   ` Chin Liang See
2014-10-03 11:03 ` [U-Boot] [PATCH 2/2] mtd: denali: support NAND_CMD_RNDOUT command Masahiro Yamada
2014-10-08  8:13   ` Chin Liang See
2014-10-09 22:31   ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.