mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* ECC nand 74 code error in barebox 2018.04.10
@ 2019-04-03 15:31 Mihaita Ivascu
  2019-04-04 19:51 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Mihaita Ivascu @ 2019-04-03 15:31 UTC (permalink / raw)
  To: barebox

[-- Attachment #1: Type: text/plain, Size: 1334 bytes --]

Hello,

   I have the following situation:

   I use imx6ul platforms.
   kernel 4.9.11 from NXP
   barebox 2018.04.10

   I create and update an FIT image(*.itb) using
ubiformat/ubiattach/ubimkvol/ubiupdatevol commands

   I also do this operation from Linux once the kernel was booted.
   Everything worked for a while but at some point the FITIMAGE size
increased over 50 MB and I adapted the nand table in device tree
sources.

  Now the image update from barebox is still working, I update, the
kernel loads and then at the next reboot the target boots correctly.
  But if do the the FIt image update from linux, the update is
finished without warnings but at the next reboot, the barebox will
complained as listed in the attachment and the target won't boot from
nand anymore. Then i have to do the update again but only from
barebox.

  nand partition table is the same in kernel and barebox dts.
  But for images larger than 50 MB somehow if I update from linux, the
barebox will complain about ECC code 74.
  I have enabled the other ECC options(software with/without BCH,
hardware) both in barebox and linux but no change.
  I don't know if/how should I play with the PEB settings.

 Does anybody know how could I get around this issue  or how to
continue with my investigation?

Thanks in advance,
          Mihaita Ivascu

[-- Attachment #2: NAND_ECC.txt --]
[-- Type: text/plain, Size: 2898 bytes --]

barebox 2018.04.0 #2 Wed Apr 3 07:55:40 PDT 2019


Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
detected i.MX6 UltraLite revision 1.2
mdio_bus: miibus0: probed
eth0: got preset MAC address: 50:2d:f4:14:96:09
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
nand_bbt: ECC error in BBT at 0x00001ffe0005
nand_bbt: ECC error in BBT at 0x00001ffc0005
Scanning device for bad blocks
Bad block table written to 0x00001ffe0000, version 0x01
Bad block table written to 0x00001ffc0000, version 0x01
imx-usb 2184200.usb: USB EHCI 1.00
imx-esdhc 2190000.usdhc: registered as 2190000.usdhc
netconsole: registered as netconsole-1
phySOM-i.MX6: Using environment in NAND flash
malloc space: 0x8fe7d300 -> 0x9fcfa5ff (size 254.5 MiB)
running /env/bin/init...

Hit m for menu or any other key to stop autoboot:    1
booting 'nand'
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 0:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 1:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 2:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 3:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 4:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 5:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 6:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 7:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 8:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 9:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 10:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 11:0


....................................................................................................


ubi0: scanning is finished
nand0.fit1: error -74 (ECC error) while reading 22528 bytes from PEB 273:4096
nand0.fit1: error -74 (ECC error) while reading 22528 bytes from PEB 274:4096
ubi0 error: vtbl_check: bad CRC at record 2: 0xf116c36b, not 0x000000
Volume table record 2 dump:
        reserved_pebs   0
        alignment       0
        data_pad        0
        vol_type        0
        upd_marker      0
        name_len        0
        name            NULL
ubi0 error: vtbl_check: bad CRC at record 2: 0xf116c36b, not 0x000000
Volume table record 2 dump:
        reserved_pebs   0
        alignment       0
        data_pad        0
        vol_type        0
        upd_marker      0
        name_len        0
        name            NULL
ubi0 error: process_lvol: both volume tables are corrupted
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd0, error -22

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: ECC nand 74 code error in barebox 2018.04.10
  2019-04-03 15:31 ECC nand 74 code error in barebox 2018.04.10 Mihaita Ivascu
@ 2019-04-04 19:51 ` Sascha Hauer
  2019-04-05 16:23   ` Mihaita Ivascu
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2019-04-04 19:51 UTC (permalink / raw)
  To: Mihaita Ivascu; +Cc: barebox

On Wed, Apr 03, 2019 at 05:31:09PM +0200, Mihaita Ivascu wrote:
> Hello,
> 
>    I have the following situation:
> 
>    I use imx6ul platforms.
>    kernel 4.9.11 from NXP
>    barebox 2018.04.10
> 
>    I create and update an FIT image(*.itb) using
> ubiformat/ubiattach/ubimkvol/ubiupdatevol commands
> 
>    I also do this operation from Linux once the kernel was booted.
>    Everything worked for a while but at some point the FITIMAGE size
> increased over 50 MB and I adapted the nand table in device tree
> sources.
> 
>   Now the image update from barebox is still working, I update, the
> kernel loads and then at the next reboot the target boots correctly.
>   But if do the the FIt image update from linux, the update is
> finished without warnings but at the next reboot, the barebox will
> complained as listed in the attachment and the target won't boot from
> nand anymore. Then i have to do the update again but only from
> barebox.
> 
>   nand partition table is the same in kernel and barebox dts.
>   But for images larger than 50 MB somehow if I update from linux, the
> barebox will complain about ECC code 74.
>   I have enabled the other ECC options(software with/without BCH,
> hardware) both in barebox and linux but no change.
>   I don't know if/how should I play with the PEB settings.
> 
>  Does anybody know how could I get around this issue  or how to
> continue with my investigation?
> 
> Thanks in advance,
>           Mihaita Ivascu

> barebox 2018.04.0 #2 Wed Apr 3 07:55:40 PDT 2019
> 
> 
> Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
> detected i.MX6 UltraLite revision 1.2
> mdio_bus: miibus0: probed
> eth0: got preset MAC address: 50:2d:f4:14:96:09
> nand: ONFI flash detected
> nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
> Bad block table found at page 262080, version 0x01
> Bad block table found at page 262016, version 0x01
> nand_bbt: ECC error in BBT at 0x00001ffe0005
> nand_bbt: ECC error in BBT at 0x00001ffc0005

Things go wrong here already. Could it be that you use a flash based bbt
in barebox but not in Linux?

Generally have you made sure that you can write a page in barebox and
read it in Linux, then afterwards the other way round?

I have no idea what the Freescale Kernel does. It might have some
options to use other ECC modes or something like that. Looking at the
device tree nodes might give a clue.

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] 5+ messages in thread

* Re: ECC nand 74 code error in barebox 2018.04.10
  2019-04-04 19:51 ` Sascha Hauer
@ 2019-04-05 16:23   ` Mihaita Ivascu
  2019-04-08  6:29     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Mihaita Ivascu @ 2019-04-05 16:23 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello,

    Yes both linux and barebox drivers use bbt. In fact the message
above related to ECC error in BBT I see them as well in dmesg when
loading kernel:

>nand_bbt: ECC error in BBT at 0x00001ffe0005
>nand_bbt: ECC error in BBT at 0x00001ffc0005


  I have disabled hardware ECC and enabled Software BCH ECC in barebox
menuconfig with the intention to have the same ECC as in kernel where
I have only software ECC option and now I have the following situation
in barebox:

Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
detected i.MX6 UltraLite revision 1.2
mdio_bus: miibus0: probed
eth0: got preset MAC address: 50:2d:f4:14:96:09
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron
MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
nand: Invalid NAND_ECC_MODE 2
BUG: failure at
~/Projects/barebox/2018.04.0-phy1-r7.0/git/drivers/mtd/nand/nand_base.c:3699/nand_scan_tail()!
BUG!
[<9fd71451>] (unwind_backtrace+0x1/0x58) from [<9fd00d9d>] (panic+0x1d/0x34)
[<9fd00d9d>] (panic+0x1d/0x34) from [<9fd1272d>] (nand_scan_tail+0x99/0x3dc)
[<9fd1272d>] (nand_scan_tail+0x99/0x3dc) from [<9fd15cf9>]
(mxs_nand_probe+0x40d/0x43c)
[<9fd15cf9>] (mxs_nand_probe+0x40d/0x43c) from [<9fd0c595>]
(device_probe+0x21/0x68)
[<9fd0c595>] (device_probe+0x21/0x68) from [<9fd0c601>] (match.part.0+0x25/0x2c)
[<9fd0c601>] (match.part.0+0x25/0x2c) from [<9fd0c7df>]
(register_driver+0x5b/0x78)
[<9fd0c7df>] (register_driver+0x5b/0x78) from [<9fd00acb>]
(start_barebox+0x1b/0x98)
[<9fd00acb>] (start_barebox+0x1b/0x98) from [<9fd6faa1>]
(barebox_non_pbl_start+0xd5/0xf8)
[<9fd6faa1>] (barebox_non_pbl_start+0xd5/0xf8) from [<9fd00005>]
(__bare_init_start+0x1/0xc)
### ERROR ### Please RESET the board ###

   I cannot recover it now.

Thanks,
      Mihaita


On Thu, Apr 4, 2019 at 9:51 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Wed, Apr 03, 2019 at 05:31:09PM +0200, Mihaita Ivascu wrote:
> > Hello,
> >
> >    I have the following situation:
> >
> >    I use imx6ul platforms.
> >    kernel 4.9.11 from NXP
> >    barebox 2018.04.10
> >
> >    I create and update an FIT image(*.itb) using
> > ubiformat/ubiattach/ubimkvol/ubiupdatevol commands
> >
> >    I also do this operation from Linux once the kernel was booted.
> >    Everything worked for a while but at some point the FITIMAGE size
> > increased over 50 MB and I adapted the nand table in device tree
> > sources.
> >
> >   Now the image update from barebox is still working, I update, the
> > kernel loads and then at the next reboot the target boots correctly.
> >   But if do the the FIt image update from linux, the update is
> > finished without warnings but at the next reboot, the barebox will
> > complained as listed in the attachment and the target won't boot from
> > nand anymore. Then i have to do the update again but only from
> > barebox.
> >
> >   nand partition table is the same in kernel and barebox dts.
> >   But for images larger than 50 MB somehow if I update from linux, the
> > barebox will complain about ECC code 74.
> >   I have enabled the other ECC options(software with/without BCH,
> > hardware) both in barebox and linux but no change.
> >   I don't know if/how should I play with the PEB settings.
> >
> >  Does anybody know how could I get around this issue  or how to
> > continue with my investigation?
> >
> > Thanks in advance,
> >           Mihaita Ivascu
>
> > barebox 2018.04.0 #2 Wed Apr 3 07:55:40 PDT 2019
> >
> >
> > Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
> > detected i.MX6 UltraLite revision 1.2
> > mdio_bus: miibus0: probed
> > eth0: got preset MAC address: 50:2d:f4:14:96:09
> > nand: ONFI flash detected
> > nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
> > Bad block table found at page 262080, version 0x01
> > Bad block table found at page 262016, version 0x01
> > nand_bbt: ECC error in BBT at 0x00001ffe0005
> > nand_bbt: ECC error in BBT at 0x00001ffc0005
>
> Things go wrong here already. Could it be that you use a flash based bbt
> in barebox but not in Linux?
>
> Generally have you made sure that you can write a page in barebox and
> read it in Linux, then afterwards the other way round?
>
> I have no idea what the Freescale Kernel does. It might have some
> options to use other ECC modes or something like that. Looking at the
> device tree nodes might give a clue.
>
> 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] 5+ messages in thread

* Re: ECC nand 74 code error in barebox 2018.04.10
  2019-04-05 16:23   ` Mihaita Ivascu
@ 2019-04-08  6:29     ` Sascha Hauer
  2019-04-08  6:51       ` Mihaita Ivascu
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2019-04-08  6:29 UTC (permalink / raw)
  To: Mihaita Ivascu; +Cc: barebox

On Fri, Apr 05, 2019 at 06:23:07PM +0200, Mihaita Ivascu wrote:
> Hello,
> 
>     Yes both linux and barebox drivers use bbt. In fact the message
> above related to ECC error in BBT I see them as well in dmesg when
> loading kernel:
> 
> >nand_bbt: ECC error in BBT at 0x00001ffe0005
> >nand_bbt: ECC error in BBT at 0x00001ffc0005
> 
> 
>   I have disabled hardware ECC and enabled Software BCH ECC in barebox
> menuconfig with the intention to have the same ECC as in kernel where
> I have only software ECC option and now I have the following situation
> in barebox:

You *always* want to use hardware ECC on i.MX. I don't know why you
think that you only have software ECC in the kernel, I am pretty sure
you can do hardware ECC in the FSL Kernel aswell.

> 
> Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
> detected i.MX6 UltraLite revision 1.2
> mdio_bus: miibus0: probed
> eth0: got preset MAC address: 50:2d:f4:14:96:09
> nand: ONFI flash detected
> nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron
> MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
> nand: Invalid NAND_ECC_MODE 2
> BUG: failure at
> ~/Projects/barebox/2018.04.0-phy1-r7.0/git/drivers/mtd/nand/nand_base.c:3699/nand_scan_tail()!
> BUG!
> [<9fd71451>] (unwind_backtrace+0x1/0x58) from [<9fd00d9d>] (panic+0x1d/0x34)
> [<9fd00d9d>] (panic+0x1d/0x34) from [<9fd1272d>] (nand_scan_tail+0x99/0x3dc)
> [<9fd1272d>] (nand_scan_tail+0x99/0x3dc) from [<9fd15cf9>]
> (mxs_nand_probe+0x40d/0x43c)
> [<9fd15cf9>] (mxs_nand_probe+0x40d/0x43c) from [<9fd0c595>]
> (device_probe+0x21/0x68)
> [<9fd0c595>] (device_probe+0x21/0x68) from [<9fd0c601>] (match.part.0+0x25/0x2c)
> [<9fd0c601>] (match.part.0+0x25/0x2c) from [<9fd0c7df>]
> (register_driver+0x5b/0x78)
> [<9fd0c7df>] (register_driver+0x5b/0x78) from [<9fd00acb>]
> (start_barebox+0x1b/0x98)
> [<9fd00acb>] (start_barebox+0x1b/0x98) from [<9fd6faa1>]
> (barebox_non_pbl_start+0xd5/0xf8)
> [<9fd6faa1>] (barebox_non_pbl_start+0xd5/0xf8) from [<9fd00005>]
> (__bare_init_start+0x1/0xc)
> ### ERROR ### Please RESET the board ###
> 
>    I cannot recover it now.

You mean you have flashed this version and can't update anymore because
you don't get to the prompt?

To make your life easier you always start a new barebox image from the
flashed one rather than flashing it directly.

You can refer to the PhyCORE documentation how to enable alternative
boot sources. Most convenient should be USB boot in which case you can
use the imx-usb-loader tool to upload a new barebox image.

Once you got that I suggest that you erase your whole NAND as the next
step.

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] 5+ messages in thread

* Re: ECC nand 74 code error in barebox 2018.04.10
  2019-04-08  6:29     ` Sascha Hauer
@ 2019-04-08  6:51       ` Mihaita Ivascu
  0 siblings, 0 replies; 5+ messages in thread
From: Mihaita Ivascu @ 2019-04-08  6:51 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Ok, thank you for the advice. I will try that.
I did more tests and I think that the ECC errors I was getting in the
first post I have them only if the FIT image is greater than 50 MB. It
does not matter the ECC/BBT options in bootloader/kernel or the kernel
version.
Do you know any limitation of the UBI FS in terms of image/partition size?

Thanks,
       Mihaita

On Mon, Apr 8, 2019 at 8:29 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Fri, Apr 05, 2019 at 06:23:07PM +0200, Mihaita Ivascu wrote:
> > Hello,
> >
> >     Yes both linux and barebox drivers use bbt. In fact the message
> > above related to ECC error in BBT I see them as well in dmesg when
> > loading kernel:
> >
> > >nand_bbt: ECC error in BBT at 0x00001ffe0005
> > >nand_bbt: ECC error in BBT at 0x00001ffc0005
> >
> >
> >   I have disabled hardware ECC and enabled Software BCH ECC in barebox
> > menuconfig with the intention to have the same ECC as in kernel where
> > I have only software ECC option and now I have the following situation
> > in barebox:
>
> You *always* want to use hardware ECC on i.MX. I don't know why you
> think that you only have software ECC in the kernel, I am pretty sure
> you can do hardware ECC in the FSL Kernel aswell.
>
> >
> > Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
> > detected i.MX6 UltraLite revision 1.2
> > mdio_bus: miibus0: probed
> > eth0: got preset MAC address: 50:2d:f4:14:96:09
> > nand: ONFI flash detected
> > nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron
> > MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
> > nand: Invalid NAND_ECC_MODE 2
> > BUG: failure at
> > ~/Projects/barebox/2018.04.0-phy1-r7.0/git/drivers/mtd/nand/nand_base.c:3699/nand_scan_tail()!
> > BUG!
> > [<9fd71451>] (unwind_backtrace+0x1/0x58) from [<9fd00d9d>] (panic+0x1d/0x34)
> > [<9fd00d9d>] (panic+0x1d/0x34) from [<9fd1272d>] (nand_scan_tail+0x99/0x3dc)
> > [<9fd1272d>] (nand_scan_tail+0x99/0x3dc) from [<9fd15cf9>]
> > (mxs_nand_probe+0x40d/0x43c)
> > [<9fd15cf9>] (mxs_nand_probe+0x40d/0x43c) from [<9fd0c595>]
> > (device_probe+0x21/0x68)
> > [<9fd0c595>] (device_probe+0x21/0x68) from [<9fd0c601>] (match.part.0+0x25/0x2c)
> > [<9fd0c601>] (match.part.0+0x25/0x2c) from [<9fd0c7df>]
> > (register_driver+0x5b/0x78)
> > [<9fd0c7df>] (register_driver+0x5b/0x78) from [<9fd00acb>]
> > (start_barebox+0x1b/0x98)
> > [<9fd00acb>] (start_barebox+0x1b/0x98) from [<9fd6faa1>]
> > (barebox_non_pbl_start+0xd5/0xf8)
> > [<9fd6faa1>] (barebox_non_pbl_start+0xd5/0xf8) from [<9fd00005>]
> > (__bare_init_start+0x1/0xc)
> > ### ERROR ### Please RESET the board ###
> >
> >    I cannot recover it now.
>
> You mean you have flashed this version and can't update anymore because
> you don't get to the prompt?
>
> To make your life easier you always start a new barebox image from the
> flashed one rather than flashing it directly.
>
> You can refer to the PhyCORE documentation how to enable alternative
> boot sources. Most convenient should be USB boot in which case you can
> use the imx-usb-loader tool to upload a new barebox image.
>
> Once you got that I suggest that you erase your whole NAND as the next
> step.
>
> 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] 5+ messages in thread

end of thread, other threads:[~2019-04-08  6:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 15:31 ECC nand 74 code error in barebox 2018.04.10 Mihaita Ivascu
2019-04-04 19:51 ` Sascha Hauer
2019-04-05 16:23   ` Mihaita Ivascu
2019-04-08  6:29     ` Sascha Hauer
2019-04-08  6:51       ` Mihaita Ivascu

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