IMX6 : ubi0 attaching fail - Kernel 4.19.35 uboot-2014-07

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 : ubi0 attaching fail - Kernel 4.19.35 uboot-2014-07

3,398 Views
wzairi
Contributor I

Hello,

I am trying to boot 4.19.35 linux-imx kernel but it fails when attahing mtd partition  and so no rootfs mounted .

The kernel detects Ecc errors while uboot is able to attach the partition .

Any suggestion please ?


U-Boot 2014.07 (Jul 23 2015 - 12:37:28)
arm-bistro-linux-gnueabi-gcc (GCC) 4.8.2
GNU ld (GNU Binutils) 2.24
U-Boot> ubi part system1
UBI: mtd1 is detached from ubi0
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=0"
UBI: MTD device size:            128 MiB
UBI: number of good PEBs:        1021
UBI: number of bad PEBs:         3
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     4
UBI: available PEBs:             27
UBI: total number of reserved PEBs: 994
UBI: number of PEBs reserved for bad PEB handling: 10
UBI: max/mean erase counter: 9/5
U-Boot>

Here resulting errors:

ubi0: attaching mtd0
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.35-imx-4.19.35-1.0.0 #1


Here some enabled kernel configs :
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20

Here gpmi dts options :

&gpmi {
----
    nand-on-flash-bbt;    
    fsl,use-minimum-ecc;
partition@0 {
        label = "system1";
        reg = <0x00000000  0x08000000 >;
    };
    partition@1 {
        label = "system2";
        reg = <0x08000000  0x08000000 >;
    };
};

Here nand chip well detected :

nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xda
nand: Macronix MX30LF2G18AC
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
gpmi-nand 112000.gpmi-nand: driver registered.

Here uboot boot cmd :

setenv bootargs rw rootfstype=ubifs ubi.mtd=0 ubi.mtd=1 root=ubi0:rootfs ; sf probe; sf read 0x18000000 0x100000 0x20000; sf read 0x12000000 0x120000 0x500000; bootm 0x12000000 - 0x18000000"

Here kernel boot logs :


Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.19.35-imx-4.19.35-1.0.0 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 PREEMPT Fri Jun 12 10:07:10 UTC 2020
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Pamela i.MX6 Solo Board
Memory policy: Data cache writeback
Reserved memory: created CMA memory pool at 0x1a000000, size 320 MiB
OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
CPU: All CPU(s) started in SVC mode.
random: get_random_bytes called from start_kernel+0xa0/0x3fc with crng_init=0
Built 1 zonelists, mobility grouping on.  Total pages: 130048
Kernel command line: rw rootfstype=ubifs ubi.mtd=0 ubi.mtd=1 root=ubi0:rootfs wire.timeout=1 console=ttymxc2,115200 panic=1 systemd.show_status=false
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 181440K/524288K available (6144K kernel code, 218K rwdata, 1364K rodata, 1024K init, 362K bss, 15168K reserved, 327680K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xa0800000 - 0xff800000   (1520 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (7136 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 218 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 363 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
L2C: DT/platform modifies aux control register: 0x32050000 -> 0x32450000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 16 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 16 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76450001
Switching to timer-based delay loop, resolution 333ns
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
Setting up static identity map for 0x10100000 - 0x10100060
rcu: Hierarchical SRCU implementation.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
CPU identified as i.MX6DL, silicon rev 1.2
vdd1p1: supplied by regulator-dummy
vdd3p0: supplied by regulator-dummy
vdd2p5: supplied by regulator-dummy
vddarm: supplied by regulator-dummy
vddpu: supplied by regulator-dummy
vddsoc: supplied by regulator-dummy
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
imx6dl-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource mxc_timer1
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
Bus freq driver module loaded
workingset: timestamp_bits=30 max_order=17 bucket_order=0
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.27)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
imx-sdma 20ec000.sdma: no iram assigned, using external mem
imx-sdma 20ec000.sdma: Falling back to syfs fallback for: imx/sdma/sdma-imx6q.bin
mxs-dma 110000.dma-apbh: initialized
imx-pgc-pd imx-pgc-power-domain.0: DMA mask not set
imx-pgc-pd imx-pgc-power-domain.0: Linked as a consumer to 20dc000.gpc
imx-pgc-pd imx-pgc-power-domain.1: DMA mask not set
imx-pgc-pd imx-pgc-power-domain.1: Linked as a consumer to regulator.5
imx-pgc-pd imx-pgc-power-domain.1: Linked as a consumer to 20dc000.gpc
2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 27, base_baud = 5000000) is a IMX
21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 64, base_baud = 5000000) is a IMX
21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 65, base_baud = 5000000) is a IMX
console [ttymxc2] enabled
21f4000.serial: ttymxc4 at MMIO 0x21f4000 (irq = 66, base_baud = 5000000) is a IMX
brd: module loaded
loop: module loaded
random: fast init done
nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xda
nand: Macronix MX30LF2G18AC
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Scanning device for bad blocks
Bad eraseblock 272 at 0x000002200000nand:
Bad eraseblock 585 at 0x000004920000
Bad eraseblock 587 at 0x000004960000
Bad eraseblock 1773 at 0x00000dda0000
Bad eraseblock 1947 at 0x00000f360000
2 fixed-partitions partitions found on MTD device gpmi-nand
Creating 2 MTD partitions on "gpmi-nand":
0x000000000000-0x000008000000 : "system1"
0x000008000000-0x000010000000 : "system2"
gpmi-nand 112000.gpmi-nand: driver registered.
spi_imx 2010000.ecspi: probed
libphy: Fixed MDIO Bus: probed
fec 2188000.ethernet: 2188000.ethernet supply phy not found, using dummy regulator
fec 2188000.ethernet: Linked as a consumer to regulator.0
pps pps0: new PPS source ptp0
fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 76:cd:a0:e0:50:51
libphy: fec_enet_mii_bus: probed
fec 2188000.ethernet eth0: registered PHC device 0
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-rtc-lp as rtc0
mxc_vpu 2040000.vpu_fsl: VPU initialized
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 26
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
cpu cpu0: Failed to get clk 'pll1_bypass': -2
imx6q-cpufreq: probe of imx6q-cpufreq failed with error -2
ubi0: attaching mtd0
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.35-imx-4.19.35-1.0.0 #1
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<8010de94>] (unwind_backtrace) from [<8010b448>] (show_stack+0x10/0x14)
[<8010b448>] (show_stack) from [<804d5910>] (ubi_io_read+0x1b0/0x334)
[<804d5910>] (ubi_io_read) from [<804d5ca0>] (ubi_io_read_ec_hdr+0x44/0x1f4)
[<804d5ca0>] (ubi_io_read_ec_hdr) from [<804daff0>] (ubi_attach+0x1b4/0x1420)
[<804daff0>] (ubi_attach) from [<804cfb14>] (ubi_attach_mtd_dev+0x4c8/0xbd8)
[<804cfb14>] (ubi_attach_mtd_dev) from [<8091fd0c>] (ubi_init+0x1ac/0x234)
[<8091fd0c>] (ubi_init) from [<801025d0>] (do_one_initcall+0x7c/0x1a8)
[<801025d0>] (do_one_initcall) from [<80900dfc>] (kernel_init_freeable+0x12c/0x1c0)
[<80900dfc>] (kernel_init_freeable) from [<806d7238>] (kernel_init+0x8/0x110)
[<806d7238>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0x8804bfb0 to 0x8804bff8)
bfa0:                                     00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000

Labels (5)
Tags (3)
0 Kudos
Reply
3 Replies

3,250 Views
wzairi
Contributor I

Thank you igorpadykov for your reply !

Yes, already planned , but in some cases we want to mount rootfs from mtd partiton already formated and volume updated by a kernel 3.10.17 .


I notes that kernel 4.19.35 cannot attach mtd partition formated by kernel 3.10 but able when fromat/update mtd by itself (using mtd-utils) and inversely

I'm able to have system booting after partitionning and updating rootfs from a an initramfs image based on same k4.19.35 .

After this workaround , the uboot 2014.07 and kernel-3.10.17 cann't both attach the mtd partition and result the same error :
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 199:0, read 64 bytes
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 200:0, read 64 bytes
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 201:0, read 64 bytes
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 202:0, read 64 bytes

It looks like mtd/ubi drivers are not compatible between tow kernels version .

Have you a suggestion ? Do i miss a kernel config or something else that can help ?

Kind regards !

0 Kudos
Reply

3,250 Views
wzairi
Contributor I

Hi, 

Problem fixed by adding below dts options to the gpmi nand controller  to align ECC scheme between two kernel versions and the ubi attach is now possible.  

nand-on-flash-bbt;
fsl,legacy-bch-geometry;

Regards,

Wajdi

0 Kudos
Reply

3,250 Views
igorpadykov
NXP Employee
NXP Employee

Hi Wajdi

for 4.19.35 linux-imx kernel recommended to use imx_v2019.04 version uboot

from nxp source.codeaurora.org/external/imx/  repository

uboot-imx - i.MX U-Boot 

and program image using uuu tool

GitHub - NXPmicro/mfgtools: Freescale/NXP I.MX Chip image deploy tools. 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply