mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* problem booting with Micron MT29F8G08ABABAWP ...
@ 2014-03-13 19:32 raespi
  2014-03-13 20:28 ` Eric Bénard
  0 siblings, 1 reply; 6+ messages in thread
From: raespi @ 2014-03-13 19:32 UTC (permalink / raw)
  To: barebox

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 available
DIVN_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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem booting with Micron MT29F8G08ABABAWP ...
  2014-03-13 19:32 problem booting with Micron MT29F8G08ABABAWP raespi
@ 2014-03-13 20:28 ` Eric Bénard
  2014-03-14 18:45   ` raespi
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2014-03-13 20:28 UTC (permalink / raw)
  To: raespi; +Cc: barebox

Hi,

Le Thu, 13 Mar 2014 15:32:23 -0400,
raespi <raespi@icid.cu> a écrit :
> 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 available
> DIVN_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 ??
> 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem booting with Micron MT29F8G08ABABAWP ...
  2014-03-13 20:28 ` Eric Bénard
@ 2014-03-14 18:45   ` raespi
  2014-03-14 20:18     ` Eric Bénard
  2014-03-17  6:39     ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: raespi @ 2014-03-14 18:45 UTC (permalink / raw)
  To: Eric Bénard; +Cc: 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 ...

On 03/13/2014 04:28 PM, Eric Bénard wrote:
> Hi,
>
> Le Thu, 13 Mar 2014 15:32:23 -0400,
> raespi <raespi@icid.cu> a écrit :
>> 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 available
>> DIVN_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 ??
>>
> 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem booting with Micron MT29F8G08ABABAWP ...
  2014-03-14 18:45   ` raespi
@ 2014-03-14 20:18     ` Eric Bénard
  2014-03-14 20:30       ` raespi
  2014-03-17  6:39     ` Sascha Hauer
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2014-03-14 20:18 UTC (permalink / raw)
  To: raespi; +Cc: barebox

Hello,

Le Fri, 14 Mar 2014 14:45:05 -0400,
raespi <raespi@icid.cu> a écrit :

> 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;
> 
then you tell your flash has an OOB of 128 when it has more ...

> 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem booting with Micron MT29F8G08ABABAWP ...
  2014-03-14 20:18     ` Eric Bénard
@ 2014-03-14 20:30       ` raespi
  0 siblings, 0 replies; 6+ messages in thread
From: raespi @ 2014-03-14 20:30 UTC (permalink / raw)
  To: Eric Bénard; +Cc: 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.

On 03/14/2014 04:18 PM, Eric Bénard wrote:
> Hello,
>
> Le Fri, 14 Mar 2014 14:45:05 -0400,
> raespi <raespi@icid.cu> a écrit :
>
>> 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;
>>
> then you tell your flash has an OOB of 128 when it has more ...
>
>> 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: problem booting with Micron MT29F8G08ABABAWP ...
  2014-03-14 18:45   ` raespi
  2014-03-14 20:18     ` Eric Bénard
@ 2014-03-17  6:39     ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2014-03-17  6:39 UTC (permalink / raw)
  To: raespi; +Cc: barebox

On Fri, Mar 14, 2014 at 02:45:05PM -0400, raespi wrote:
> 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.

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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-17  6:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-13 19:32 problem booting with Micron MT29F8G08ABABAWP raespi
2014-03-13 20:28 ` Eric Bénard
2014-03-14 18:45   ` raespi
2014-03-14 20:18     ` Eric Bénard
2014-03-14 20:30       ` raespi
2014-03-17  6:39     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox