We are trying to boot IMX6UL custom board using NAND. Flashed images using MFG tool and booted the board.
While booting the baord getting below error for mounting the filesystem.
----------------------------------------------------------------------------------------------------------------------------------------------------------
snvs-secvio 20cc000.caam-snvs: can't get snvs clock
snvs-secvio 20cc000.caam-snvs: violation handlers armed - non-secure state
hidraw: raw HID events driver (C) Jiri Kosina
hid-generic 0003:05AC:12A8.0001: hiddev0,hidraw0: USB HID v1.11 Device [Apple Inc. iPhone] on usb-ci_hdrc.0-1/input2
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 26
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
cpu cpu0: Registered imx6q-cpufreq
imx_thermal 2000000.aips-bus:tempmon: Commercial CPU temperature grade - max:95C critical:90C passive:85C
UBI error: cannot open mtd 4, error -19snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)
can-3v3: disabling
VSD_3V3: disabling
gpio_dvfs: disabling
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
Please append a correct "root=" boot option; here are the available partitions:
0100 65536 ram0 (driver?)
0101 65536 ram1 (driver?)
0102 65536 ram2 (driver?)
0103 65536 ram3 (driver?)
0104 65536 ram4 (driver?)
0105 65536 ram5 (driver?)
0106 65536 ram6 (driver?)
0107 65536 ram7 (driver?)
0108 65536 ram8 (driver?)
0109 65536 ram9 (driver?)
010a 65536 ram10 (driver?)
010b 65536 ram11 (driver?)
010c 65536 ram12 (driver?)
010d 65536 ram13 (driver?)
010e 65536 ram14 (driver?)
010f 65536 ram15 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
----------------------------------------------------------------------------------------------------------------------------------------------------------
I have following queries, can you help to understand. I am using U-boot : 2017 and Kernel : 4.9.11.
1. MFG tool will create Partitions automatically, because I haven't created any partitions manually .
2. When Kernel panic occurs it is not printing MTD partitions, instead it is printing ram partitions.
The MFG tool vb script file is attached. Can you guide in fixing the NAND issue.
解決済! 解決策の投稿を見る。
Either U-Boot or devicetree pass the partition info to your kernel so you shoud check them first.
And can you make sure the kernel detects the NAND chip? Are the related drivers enabled in your kernel config? I assume you are using parallel NAND so you should be seeing kernel messages regarding NAND chip being detected like the following:
nand: device found, Manufacturer ID: 0xXX, Chip ID: 0xXX
nand: Manufacturer Flash ID
nand: X MiB, SLC, page size: X, OOB size: X
After that kernel creates partitions on detected NAND chips according to command line parameter "mtdparts":
Creating 4 MTD partitions on "gpmi-nand":
0x000000000000-0x000000100000 : "boot"
0x000000100000-0x000000120000 : "dtb"
0x000000120000-0x000000200000 : "kernel
0x000000200000-0x000001000000 : "rootfs"
After that mounting rootfs should be successful.
Can you post your kernel command line parameters?
Following are the Kernel command line parameters.
Kernel command line: console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),-(rootfs)
It seems the sizes are decided by MFG tool scripts. My doubt here is why the U-boot size is set as 64MB, the size of U-boot is less than 1MB.
Any suggestions why the U-boot size is set to high value?
Either U-Boot or devicetree pass the partition info to your kernel so you shoud check them first.
And can you make sure the kernel detects the NAND chip? Are the related drivers enabled in your kernel config? I assume you are using parallel NAND so you should be seeing kernel messages regarding NAND chip being detected like the following:
nand: device found, Manufacturer ID: 0xXX, Chip ID: 0xXX
nand: Manufacturer Flash ID
nand: X MiB, SLC, page size: X, OOB size: X
After that kernel creates partitions on detected NAND chips according to command line parameter "mtdparts":
Creating 4 MTD partitions on "gpmi-nand":
0x000000000000-0x000000100000 : "boot"
0x000000100000-0x000000120000 : "dtb"
0x000000120000-0x000000200000 : "kernel
0x000000200000-0x000001000000 : "rootfs"
After that mounting rootfs should be successful.
For Kernel either U-boot or devicetree will pass the partition info.
I have a doubht, For U-boot who will pass the partition info ? Because without partition info U-boot can't load the devicetree and Kernel. Can you help on this.
It is usually defined in U-Boot environment as a variable named "mtdparts". The same variable is then passed to kernel in "bootargs". I think recent versions support devicetree as well. For environment based parsing you should have
CONFIG_CMD_MTDPARTS
CONFIG_MTD_DEVICE
CONFIG_MTD_PARTITIONS
enabled, and
MTDIDS_DEFAULT
MTDPARTS_DEFAULT
set to appropriate values. (Note that the configuration might change depending on the U-Boot version). Then you can run mtdparts in U-Boot console and see your partitions properly being detected. You may find example configurations for various boards under include/configs of U-Boot source. See also doc/README.ubi and cmd/mtdparts.c.
The issue is with the DeviceTree pinmux entry for NAND due to which NAND driver binding is failing. Now it is fixed and could see the NAND info and partitin creation in Kernel messages. Thanks for the info.
The U-boot is passing the partition info to Kernel and it is in sync with the MFG tool partition info.
Hi Ravi
one can try to follow sect.4.7.2 Running the image from NAND
attached Linux Guide. Also may be useful to check
How-To use NAND boot on i.MX6UL EVK board
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------