diff mbox

[U-Boot,1/2] mtd: denali: fix NAND_CMD_PARAM command

Message ID 1412334184-6497-2-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Scott Wood
Headers show

Commit Message

Masahiro Yamada Oct. 3, 2014, 11:03 a.m. UTC
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(-)

Comments

Chin Liang See Oct. 8, 2014, 8:12 a.m. UTC | #1
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>
diff mbox

Patch

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: