Commit d68a5c3d authored by grmoore@altera.com's avatar grmoore@altera.com Committed by Brian Norris

mtd: denali: use 8 bytes for READID command

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: default avatarGraham Moore <grmoore@altera.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent a152056c
...@@ -473,7 +473,7 @@ static void detect_partition_feature(struct denali_nand_info *denali) ...@@ -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) static uint16_t denali_nand_timing_set(struct denali_nand_info *denali)
{ {
uint16_t status = PASS; uint16_t status = PASS;
uint32_t id_bytes[5], addr; uint32_t id_bytes[8], addr;
uint8_t i, maf_id, device_id; uint8_t i, maf_id, device_id;
dev_dbg(denali->dev, dev_dbg(denali->dev,
...@@ -488,7 +488,7 @@ static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) ...@@ -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); addr = (uint32_t)MODE_11 | BANK(denali->flash_bank);
index_addr(denali, (uint32_t)addr | 0, 0x90); index_addr(denali, (uint32_t)addr | 0, 0x90);
index_addr(denali, (uint32_t)addr | 1, 0); 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]); index_addr_read_data(denali, addr | 2, &id_bytes[i]);
maf_id = id_bytes[0]; maf_id = id_bytes[0];
device_id = id_bytes[1]; device_id = id_bytes[1];
...@@ -1276,7 +1276,7 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col, ...@@ -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); addr = (uint32_t)MODE_11 | BANK(denali->flash_bank);
index_addr(denali, (uint32_t)addr | 0, 0x90); index_addr(denali, (uint32_t)addr | 0, 0x90);
index_addr(denali, (uint32_t)addr | 1, 0); 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, index_addr_read_data(denali,
(uint32_t)addr | 2, (uint32_t)addr | 2,
&id); &id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment