problem booting with Micron MT29F8G08ABABAWP ...
Hi ... I'm using barebox 2014.02.0 to boot with a clone of the mini2440 board using the MT29F8G08ABABAWP NAND.
I'm getting the following error:
barebox 2014.02.0 #1 Thu Mar 13 15:28:57 CDT 2014
Board: <NULL>
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0x38 (Micron MT29F8G08ABABAWP), 1024
nand: No oob scheme defined for oobsize 224
BUG: failure at drivers/mtd/nand/nand_base.c:3357/nand_scan_tail()!
BUG!
no stack data availableDIVN_UPLL0
MPLLVal [M:61h,P:1h,S:2h]
CLKDIVN:7h
After this poing the board gets resetted back to the original point. I can never get to the barebox prompt.
Any ideas on how to fix this ??
Thanks in advance ...
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi,
Quoted 20 lines · raespi
Hi ... I'm using barebox 2014.02.0 to boot with a clone of the mini2440 board using the MT29F8G08ABABAWP NAND.
I'm getting the following error:
barebox 2014.02.0 #1 Thu Mar 13 15:28:57 CDT 2014
Board: <NULL>
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID:0x2c, Chip ID:0x38(Micron MT29F8G08ABABAWP), 1024
nand: No oob scheme defined for oobsize 224BUG: failure at drivers/mtd/nand/nand_base.c:3357/nand_scan_tail()!BUG!
no stack data availableDIVN_UPLL0
MPLLVal [M:61h,P:1h,S:2h]
CLKDIVN:7h
Quoted 5 lines
After this poing the board gets resetted back to the original point. I can never get to the barebox prompt.
Any ideas on how to fix this ??
you may need to add support for 4k+224 page size to your nand controller.
For example this was done for i.MX in comit 632c45795065e6a7471ab82be38e808eb6204341
Eric
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hello again ... diving through the drivers/mtd/nand/nand_base.c code I managed to boot with this little modification in the nand_flash_detect_onfi() function just before exiting from it:
if ( mtd->oobsize > 128 )
mtd->oobsize = 128;Apparently the only allowed oobsizes are 8, 16, 64 and 128 according to the nand_scan_ident() function. I followed Eric's advice in seeing how the i.Mx manages it and it's something like this:
NFC_V3_CONFIG2_SPAS(((mtd->oobsize > 218) ?
218 : mtd->oobsize) >> 1)
Basically setting it to a value of 218. I first tried a value of 218 and it didn't work, with a value of 128 I arrive at the prompt but not very cleanly I presume:
nand: ONFI param page 0 valid
OOBSIZE4: 128
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0x38 (Micron MT29F8G08ABABAWP), 1028 Bad block table found at page 262016, version 0x01
Bad block table found at page 261888, version 0x01
I'm currently having trouble booting the kernel from the /dev/nand0.kernel partition, it boots fine from an SD partition meaning the boot mechanism in barebox is fine. Still moving forward ...
Quoted 27 lines · Eric Bénard
Hi,
Quoted 23 lines · raespi
Hi ... I'm using barebox 2014.02.0 to boot with a clone of the mini2440 board using the MT29F8G08ABABAWP NAND.
I'm getting the following error:
barebox 2014.02.0 #1 Thu Mar 13 15:28:57 CDT 2014
Board: <NULL>
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID:0x2c, Chip ID:0x38(Micron MT29F8G08ABABAWP), 1024
nand: No oob scheme defined for oobsize 224BUG: failure at drivers/mtd/nand/nand_base.c:3357/nand_scan_tail()!BUG!
no stack data availableDIVN_UPLL0
MPLLVal [M:61h,P:1h,S:2h]
CLKDIVN:7hAfter this poing the board gets resetted back to the original point. I can never get to the barebox prompt.
Quoted 10 lines
Quoted 2 lines
Any ideas on how to fix this ??
you may need to add support for 4k+224 page size to your nand controller.
For example this was done for i.MX in comit632c45795065e6a7471ab82be38e808eb6204341Eric
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hello,
Quoted 7 lines · raespi
Hello again ... diving through the
drivers/mtd/nand/nand_base.ccode I managed to boot with this little modification in thenand_flash_detect_onfi()function just before exiting from it:if ( mtd->oobsize > 128 ) mtd->oobsize = 128;
then you tell your flash has an OOB of 128 when it has more ...
Quoted 7 lines
Apparently the only allowed oobsizes are 8, 16, 64 and 128 according to the
nand_scan_ident()function. I followed Eric's advice in seeing how the i.Mx manages it and it's something like this:NFC_V3_CONFIG2_SPAS(((mtd->oobsize > 218) ?
218 : mtd->oobsize) >> 1)
that's specific to the i.MX NAND controller : you need to adapt the code of _your_ CPU's NAND controller to get it to properly support 4k page flashes.
Eric
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
So what I'm understanding here is that it isn't enough to fix an oobsize also the 4k support is needed. I'm guessing it's not something so trivial then, I'll have to delve in deeper. Any tips on how to code it as simple as possible?? I'm a programmer but I'm not familiarized with the inner workings of a NAND flash or how to initialize it from the bootloader.
Quoted 18 lines · Eric Bénard
Hello,
Quoted 7 lines · raespi
Hello again ... diving through the
drivers/mtd/nand/nand_base.ccode I managed to boot with this little modification in thenand_flash_detect_onfi()function just before exiting from it:if ( mtd->oobsize > 128 ) mtd->oobsize = 128;then you tell your flash has an OOB of 128 when it has more ...
Quoted 4 lines
Apparently the only allowed oobsizes are 8, 16, 64 and 128 according to the
nand_scan_ident()function. I followed Eric's advice in seeing how the i.Mx manages it and it's something like this:
Quoted 10 lines
Quoted 3 lines
NFC_V3_CONFIG2_SPAS(((mtd->oobsize > 218) ?
218 : mtd->oobsize) >> 1)that's specific to the i.MX NAND controller : you need to adapt the code of _your_ CPU's NAND controller to get it to properly support 4k page flashes.
Eric
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 9 lines · raespi
Hello again ... diving through the
drivers/mtd/nand/nand_base.ccode I managed to boot with this little modification in thenand_flash_detect_onfi()function just before exiting from it:if ( mtd->oobsize > 128 ) mtd->oobsize = 128;Apparently the only allowed oobsizes are 8, 16, 64 and 128 according to the
nand_scan_ident()function.
You're probably referring to this code:
/*
* If no default placement scheme is given, select an
* appropriate one.
*/
if (!chip->ecc.layout && (chip->ecc.mode != NAND_ECC_SOFT_BCH)) {
switch (mtd->oobsize) {
case 8:
chip->ecc.layout = &nand_oob_8;
break;
case 16:
chip->ecc.layout = &nand_oob_16;
break;
case 64:
chip->ecc.layout = &nand_oob_64;
break;
case 128:
chip->ecc.layout = &nand_oob_128;
break;
default:
pr_warn("No oob scheme defined for oobsize %d\n",
mtd->oobsize);
BUG();
}
}This check is only executed when you haven't specified an ecc layout in your chip driver. You probably have to set chip->ecc.layout in your driver.
For problems like this it often helps to compare it to the kernel code (provided it works there). The code is quite similar.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox