I have modified uboot to boot from sd0 rather than sd1 on imx6ulevk board. then uboot passed, but kernel stuck at "Waiting for root device /dev/mmcblk0p2..." could anyone give me a hint?
Thanks & Best Regards
-Shawn
Below comparison used same sd card, which had uboot modified but evk kernel unmodified
Imx6ul EVK log
=> printenv baudrate=115200 board_name=EVK board_rev=14X14 boot_fdt=try bootcmd=run findfdt;mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; bootdelay=3 bootscript=echo Running bootscript from mmc ...; source console=ttymxc0 ethact=FEC1 ethaddr=00:04:9f:04:b4:c1 ethprime=FEC fdt_addr=0x83000000 fdt_file=undefined fdt_high=0xffffffff findfdt=if test $fdt_file = undefined; then if test $board_name = EVK && test $board_rev = 9X9; then setenv fdt_file imx6ul-9x9-evk.dtb; fi; if test $board_name = EVK && test $board_rev = 14X14; then setenv fdt_file imx6ul-14x14-evk.dtb; fi; if test $fdt_file = undefined; then echo WARNING: Could not determine dtb to use; fi; fi; image=zImage initrd_addr=0x83800000 initrd_high=0xffffffff ip_dyn=yes loadaddr=0x80800000 loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script}; loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file} loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} mmcautodetect=yes mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi; mmcdev=1 mmcpart=1 mmcroot=/dev/mmcblk1p2 rootwait rw netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi; panel=TFT43AB script=boot.scr
Environment size: 2457/8188 bytes => mmc list FSL_SDHC: 0 FSL_SDHC: 1 (SD) => mmc part Partition Map for MMC device 1 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type 1 8192 16384 0aad0b47-01 0c 2 24576 1949696 0aad0b47-02 83 => mmc dev switch to partitions #0, OK mmc1 is current device =>boot … usbcore: registered new interface driver ath3k sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman sdhci-pltfm: SDHCI platform and OF driver helper /soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA /soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified sdhci-esdhc-imx 2194000.usdhc: could not get ultra high speed state, work on normal mode sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA caam 2140000.caam: Entropy delay = 3200 caam 2140000.caam: Instantiated RNG4 SH0 mmc1: host does not support reading read-only switch, assuming write-enable caam 2140000.caam: Instantiated RNG4 SH1 caam 2140000.caam: device ID = 0x0a16030000000000 (Era -524) caam 2140000.caam: job rings = 3, qi = 0 mmc1: new high speed SDHC card at address aaaa #string from drivers/mmc/core/bus.c mmcblk1: mmc1:aaaa SL32G 29.7 GiB mmcblk1: p1 p2
caam algorithms registered in /proc/crypto caam_jr 2141000.jr0: registering rng-caam … can-3v3: disabling ALSA device list: #0: wm8960-audio EXT3-fs (mmcblk1p2): error: couldn't mount because of unsupported optional features (240) EXT2-fs (mmcblk1p2): error: couldn't mount because of unsupported optional features (240) EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null) VFS: Mounted root (ext4 filesystem) on device 179:2. devtmpfs: mounted Freeing unused kernel memory: 444K (80b29000 - 80b98000) INIT: version 2.88 booting Starting udev udevd[175]: starting version 3.1.5 random: udevd urandom read with 14 bits of entropy available EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) bootlogd: cannot allocate pseudo tty: No such file or directory
| Imx costom board uboot environment
=> printenv baudrate=115200 board_name=EVK board_rev=14X14 boot_fdt=try bootcmd=run findfdt;mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; bootdelay=3 bootscript=echo Running bootscript from mmc ...; source console=ttymxc0 ethprime=FEC
fdt_addr=0x83000000 fdt_file=undefined fdt_high=0xffffffff findfdt=if test $fdt_file = undefined; then if test $board_name = EVK && test $board_rev = 9X9; then setenv fdt_file imx6ul-9x9-evk.dtb; fi; if test $board_name = EVK && test $board_rev = 14X14; then setenv fdt_file imx6ul-14x14-evk.dtb; fi; if test $fdt_file = undefined; then echo WARNING: Could not determine dtb to use; fi; fi; image=zImage initrd_addr=0x83800000 initrd_high=0xffffffff ip_dyn=yes loadaddr=0x80800000 loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script}; loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file} loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} mmcautodetect=yes mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi; mmcdev=0 mmcpart=1 mmcroot=/dev/mmcblk0p2 rootwait rw netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi; panel=TFT43AB script=boot.scr
Environment size: 2415/8188 bytes => mmc list FSL_SDHC: 0 (SD) FSL_SDHC: 1 => mmc part Partition Map for MMC device 0 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type 1 8192 16384 0aad0b47-01 0c 2 24576 1949696 0aad0b47-02 83 => mmc dev switch to partitions #0, OK mmc0 is current device =>boot … usbcore: registered new interface driver ath3k sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman sdhci-pltfm: SDHCI platform and OF driver helper /soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA /soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified sdhci-esdhc-imx 2194000.usdhc: could not get ultra high speed state, work on normal mode sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA caam 2140000.caam: Entropy delay = 3200 caam 2140000.caam: Instantiated RNG4 SH0 mmc1: MAN_BKOPS_EN bit is not set caam 2140000.caam: Instantiated RNG4 SH1 caam 2140000.caam: device ID = 0x0a16030000000000 (Era -524) caam 2140000.caam: job rings = 3, qi = 0 mmc1: new DDR MMC card at address 0001 mmcblk1: mmc1:0001 P1XXXX 7.20 GiB mmcblk1boot0: mmc1:0001 P1XXXX partition 1 16.0 MiB mmcblk1boot1: mmc1:0001 P1XXXX partition 2 16.0 MiB mmcblk1rpmb: mmc1:0001 P1XXXX partition 3 128 KiB caam algorithms registered in /proc/crypto caam_jr 2141000.jr0: registering rng-caam … can-3v3: disabling ALSA device list: No soundcards found. Waiting for root device /dev/mmcblk0p2... #then it is stuck
|
P.S.below is what I modified for uboot. or else imx-uboot can't find card to load zimage.
Uboot Change 1: /home/dev/IMX/fsl-release-bsp/build_imx6ulevk/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2016.03-r0/git/board/freescale/mx6ul_14x14_evk/ mx6ul_14x14_evk.c | |
//EVK original code: int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; int ret = 0;
switch (cfg->esdhc_base) { case USDHC1_BASE_ADDR: ret = !gpio_get_value(USDHC1_CD_GPIO); break; case USDHC2_BASE_ADDR: #if defined(CONFIG_MX6UL_EVK_EMMC_REWORK) ret = 1; #else imx_iomux_v3_setup_multiple_pads(usdhc2_cd_pads, ARRAY_SIZE(usdhc2_cd_pads)); gpio_direction_input(USDHC2_CD_GPIO);
/* * Since it is the DAT3 pin, this pin is pulled to * low voltage if no card */ ret = gpio_get_value(USDHC2_CD_GPIO);
imx_iomux_v3_setup_multiple_pads(usdhc2_dat3_pads, ARRAY_SIZE(usdhc2_dat3_pads)); #endif break; }
return ret; } | //modified code int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; int ret = 0;
switch (cfg->esdhc_base) { case USDHC1_BASE_ADDR: ret = 1; //manually ensure that card is in slot break; case USDHC2_BASE_ADDR: #if defined(CONFIG_MX6UL_EVK_EMMC_REWORK) ret = 1; #else imx_iomux_v3_setup_multiple_pads(usdhc2_cd_pads, ARRAY_SIZE(usdhc2_cd_pads)); gpio_direction_input(USDHC2_CD_GPIO);
/* * Since it is the DAT3 pin, this pin is pulled to * low voltage if no card */ ret = gpio_get_value(USDHC2_CD_GPIO);
imx_iomux_v3_setup_multiple_pads(usdhc2_dat3_pads, ARRAY_SIZE(usdhc2_dat3_pads)); #endif break; }
return ret; } |
Uboot Change 2: diff include/configs/mx6ul_14x14_evk.h.old include/configs/mx6ul_14x14_evk.h 67c67 < #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR --- > #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR |
解決済! 解決策の投稿を見る。
problem solved. extra change on device tree is needed, working one as shown below:
emacs /home/dev/IMX/fsl-release-bsp/build_imx6ulevk/tmp/work/imx6ulevk-poky-linux-gnueabi/linux-imx/4.1.15-r0/git/arch/arm/boot/dts/imx6ul-14x14-evk.dts
/*
&usdhc1 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
keep-power-in-suspend;
enable-sdio-wakeup;
vmmc-supply = <®_sd1_vmmc>;
status = "okay";
};
*/
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
non-removable;
status = "okay";
};
&usdhc2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2>;
/* non-removable; */
status = "okay";
};
Did you also update /etc/fstab?
I didn't change /etc/fstab
Hi Li,
I am trying to boot EVK custom board of DRAM 512 MB. I compiled the source with some changes but the board was hanging as shown below:
U-Boot 2014.04-08637-gaffa03210f-dirty (Aug 11 2017 - 15:40:06)
CPU: Freescale i.MX6SL rev1.2 at 792 MHz
CPU: Temperature 39 C, calibration data: 0x59a51269
Reset cause: POR
Board: MX6SLEVK
I2C: ready
DRAM:
I am using Android 4.4.3 source and flashing images into eMMC. I tried with your changes also as mentioned in the above post but was helpless.Can you suggest me anything to overcome this one.
Regards,
srikanth.
looks like problem happened while detection DRAM. as UART is ok already, here is a slow but feasible method: you can add some debug in uboot source code to see what's going on.
Hello,
On the EVK (with demo image) it is enough to change U-boot environment :
mmcdev=0
mmcroot=/dev/mmcblk0p2 rootwait rw
and system boots from SD port 0.
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Yuri,
thanks for your reply. But that setting doesn't work:
-------------------------
=> echo $mmcdev
0
=> echo $mmcroot
/dev/mmcblk0p2 rootwait rw
=> boot
MMC: no card present
MMC: no card present
MMC: no card present
Booting from net ...
*** ERROR: `ethaddr' not set
*** ERROR: `ethaddr' not set
Bad Linux ARM zImage magic!
=>
---------------------------
this is why I changed uboot.
Thanks & Best Regards
-Shawn
Hello,
Have You tried NXP demo image ?
i.MX 6 / i.MX 7 Series Software and Development Tool|NXP
Regards,
Yuri.
Hi Yuri,
below is the uboot output of the demo image from your first link.
----------------
U-Boot 2016.03-imx_v2016.03_4.1.15_2.0.0_ga+g0ec2a01 (Nov 11 2016 - 03:51:17 -0600)
CPU: Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 30C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
force_idle_bus: failed to clear bus, sda=0 scl=1
MMC: FSL_SDHC: 0, FSL_SDHC: 1
MMC: no card present
*** Warning - MMC init failed, using default environment
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
MMC: no card present
Net: Board Net Initialization Failed
No ethernet found.
Normal Boot
Hit any key to stop autoboot: 0
MMC: no card present
MMC: no card present
MMC: no card present
Booting from net ...
No ethernet found.
No ethernet found.
Bad Linux ARM zImage magic!
=> mmc list
FSL_SDHC: 0
FSL_SDHC: 1
=> mmc part
MMC: no card present
=>
=> setenv mmcroot /dev/mmcblk0p2 rootwait rw
=> setenv mmcdev 0
=> boot
MMC: no card present
MMC: no card present
MMC: no card present
Booting from net ...
No ethernet found.
No ethernet found.
Bad Linux ARM zImage magic!
=>
---------------
My analysis and what has been done:
with dip switch config, my board is booted from FSL_SDHC_0, then uboot loaded. this means hardware should be alright. I searched the string "MMC: no card present" in uboot source code, then found the reason it gets there is because uboot was trying card detection but failed. so I 'muted' the card detection logic in uboot and always return true over there, as shown in my first post of this thread. Now uboot can load zimage successfully and enter kernel boot.
However, there is another problem followed in kernel boot -- system locked at "Waiting for root device /dev/mmcblk0p2..." this is where I am stucking at.
Thanks & Regards
-Shawn
problem solved. extra change on device tree is needed, working one as shown below:
emacs /home/dev/IMX/fsl-release-bsp/build_imx6ulevk/tmp/work/imx6ulevk-poky-linux-gnueabi/linux-imx/4.1.15-r0/git/arch/arm/boot/dts/imx6ul-14x14-evk.dts
/*
&usdhc1 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
keep-power-in-suspend;
enable-sdio-wakeup;
vmmc-supply = <®_sd1_vmmc>;
status = "okay";
};
*/
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
non-removable;
status = "okay";
};
&usdhc2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2>;
/* non-removable; */
status = "okay";
};
I tried L4.1.15_2.0.0-ga_images_MX6UL7D.tar.gz, but as the link you mentioned is updated version, let me have a try again.
Thanks & Regards
-Shawn