diff options
author | grmoore@altera.com <grmoore@altera.com> | 2014-06-23 15:21:10 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-07-14 21:41:40 -0400 |
commit | d68a5c3d2db408a83e69f12b57b8e19c086d1aee (patch) | |
tree | 23dadc74088f47ecd16b911660cdc0af19fd6640 | |
parent | a152056c912db82860a8b4c23d0bd3a5aa89e363 (diff) |
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: Graham Moore <grmoore@altera.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/nand/denali.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 9f2012a3e764..0b071a3136a2 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) | |||
473 | static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) | 473 | static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) |
474 | { | 474 | { |
475 | uint16_t status = PASS; | 475 | uint16_t status = PASS; |
476 | uint32_t id_bytes[5], addr; | 476 | uint32_t id_bytes[8], addr; |
477 | uint8_t i, maf_id, device_id; | 477 | uint8_t i, maf_id, device_id; |
478 | 478 | ||
479 | dev_dbg(denali->dev, | 479 | dev_dbg(denali->dev, |
@@ -488,7 +488,7 @@ static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) | |||
488 | addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); | 488 | addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); |
489 | index_addr(denali, (uint32_t)addr | 0, 0x90); | 489 | index_addr(denali, (uint32_t)addr | 0, 0x90); |
490 | index_addr(denali, (uint32_t)addr | 1, 0); | 490 | index_addr(denali, (uint32_t)addr | 1, 0); |
491 | for (i = 0; i < 5; i++) | 491 | for (i = 0; i < 8; i++) |
492 | index_addr_read_data(denali, addr | 2, &id_bytes[i]); | 492 | index_addr_read_data(denali, addr | 2, &id_bytes[i]); |
493 | maf_id = id_bytes[0]; | 493 | maf_id = id_bytes[0]; |
494 | device_id = id_bytes[1]; | 494 | device_id = id_bytes[1]; |
@@ -1276,7 +1276,7 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col, | |||
1276 | addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); | 1276 | addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); |
1277 | index_addr(denali, (uint32_t)addr | 0, 0x90); | 1277 | index_addr(denali, (uint32_t)addr | 0, 0x90); |
1278 | index_addr(denali, (uint32_t)addr | 1, 0); | 1278 | index_addr(denali, (uint32_t)addr | 1, 0); |
1279 | for (i = 0; i < 5; i++) { | 1279 | for (i = 0; i < 8; i++) { |
1280 | index_addr_read_data(denali, | 1280 | index_addr_read_data(denali, |
1281 | (uint32_t)addr | 2, | 1281 | (uint32_t)addr | 2, |
1282 | &id); | 1282 | &id); |