* [PATCH] nand_base: fix to test for JCPV problem
@ 2013-05-08 16:20 Eric Bénard
2013-05-08 16:41 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 3+ messages in thread
From: Eric Bénard @ 2013-05-08 16:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
drivers/mtd/nand/nand_base.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index e8103cf..d04e24b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1167,10 +1167,9 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
- /* Read manufacturer and device IDs */
-
- id_data[0] = chip->read_byte(mtd);
- id_data[1] = chip->read_byte(mtd);
+ /* Read entire ID string */
+ for (i = 0; i < 8; i++)
+ id_data[i] = chip->read_byte(mtd);
if (id_data[0] != *maf_id || id_data[1] != dev_id) {
pr_err("%s: second ID read did not match "
@@ -1190,20 +1189,11 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
if (!type->name || !type->pagesize) {
/* Check is chip is ONFI compliant */
ret = nand_flash_detect_onfi(mtd, chip, &busw);
- if (ret)
goto ident_done;
- else {
- pr_err("NAND type unknown: %02x,%02x\n", *maf_id, dev_id);
- return ERR_PTR(-ENODEV);
- }
}
- chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
-
- /* Read entire ID string */
-
- for (i = 0; i < 8; i++)
- id_data[i] = chip->read_byte(mtd);
+ if (!type->name)
+ return ERR_PTR(-ENODEV);
if (!mtd->name)
mtd->name = type->name;
--
1.8.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nand_base: fix to test for JCPV problem
2013-05-08 16:20 [PATCH] nand_base: fix to test for JCPV problem Eric Bénard
@ 2013-05-08 16:41 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 17:05 ` Eric Bénard
0 siblings, 1 reply; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-08 16:41 UTC (permalink / raw)
To: Eric Bénard; +Cc: barebox
On 18:20 Wed 08 May , Eric Bénard wrote:
> Signed-off-by: Eric Bénard <eric@eukrea.com>
better but an other BUG
Board: Atmel at91sam9x5-ek
AT91: Detected soc type: at91sam9x5
AT91: Detected soc subtype: at91sam9x25
Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz
netconsole: registered as cs2
CM: SAM9X25-CM [B2] from RONETIX
EK: SAM9x5-EK [B0] from FLEX
DM: SAM9x5-DM [B0] from FLEX
sn: 0x4010465, rev: 0x10421
atmel_nand: Use On Flash BBT
nand: ONFI flash detected ... nand: no valid ONFI param page found
nand: Manufacturer ID: 0xad, Chip ID: 0xda (Hynix NAND 256MiB 3,3V 8-bit), page size: 0, OOB size: 0
atmel_nand atmel_nand0: Initialize PMECC params, cap: 2, sector: 512
nand: No oob scheme defined for oobsize 0
BUG: failure at /opt/work/barebox/drivers/mtd/nand/nand_base.c:1483/nand_scan_tail()!
BUG!
> ---
> drivers/mtd/nand/nand_base.c | 20 +++++---------------
> 1 file changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index e8103cf..d04e24b 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -1167,10 +1167,9 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
>
> chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
>
> - /* Read manufacturer and device IDs */
> -
> - id_data[0] = chip->read_byte(mtd);
> - id_data[1] = chip->read_byte(mtd);
> + /* Read entire ID string */
> + for (i = 0; i < 8; i++)
> + id_data[i] = chip->read_byte(mtd);
>
> if (id_data[0] != *maf_id || id_data[1] != dev_id) {
> pr_err("%s: second ID read did not match "
> @@ -1190,20 +1189,11 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
> if (!type->name || !type->pagesize) {
> /* Check is chip is ONFI compliant */
> ret = nand_flash_detect_onfi(mtd, chip, &busw);
> - if (ret)
> goto ident_done;
> - else {
> - pr_err("NAND type unknown: %02x,%02x\n", *maf_id, dev_id);
> - return ERR_PTR(-ENODEV);
> - }
> }
>
> - chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
> -
> - /* Read entire ID string */
> -
> - for (i = 0; i < 8; i++)
> - id_data[i] = chip->read_byte(mtd);
> + if (!type->name)
> + return ERR_PTR(-ENODEV);
>
> if (!mtd->name)
> mtd->name = type->name;
> --
> 1.8.1.4
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nand_base: fix to test for JCPV problem
2013-05-08 16:41 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-05-08 17:05 ` Eric Bénard
0 siblings, 0 replies; 3+ messages in thread
From: Eric Bénard @ 2013-05-08 17:05 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
Le Wed, 8 May 2013 18:41:58 +0200,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> a écrit :
> On 18:20 Wed 08 May , Eric Bénard wrote:
> > Signed-off-by: Eric Bénard <eric@eukrea.com>
>
> better but an other BUG
>
> Board: Atmel at91sam9x5-ek
> AT91: Detected soc type: at91sam9x5
> AT91: Detected soc subtype: at91sam9x25
> Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz
> netconsole: registered as cs2
> CM: SAM9X25-CM [B2] from RONETIX
> EK: SAM9x5-EK [B0] from FLEX
> DM: SAM9x5-DM [B0] from FLEX
> sn: 0x4010465, rev: 0x10421
> atmel_nand: Use On Flash BBT
> nand: ONFI flash detected ... nand: no valid ONFI param page found
Ok so your flash has the ONFI string but not the param page, some hynix
have that ... which is quite strange but already handled in the kernel.
> nand: Manufacturer ID: 0xad, Chip ID: 0xda (Hynix NAND 256MiB 3,3V 8-bit), page size: 0, OOB size: 0
> atmel_nand atmel_nand0: Initialize PMECC params, cap: 2, sector: 512
> nand: No oob scheme defined for oobsize 0
> BUG: failure at /opt/work/barebox/drivers/mtd/nand/nand_base.c:1483/nand_scan_tail()!
> BUG!
OK new version sent. Please send me the bootlog again.
thanks,
Eric
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-08 17:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-08 16:20 [PATCH] nand_base: fix to test for JCPV problem Eric Bénard
2013-05-08 16:41 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 17:05 ` Eric Bénard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox