AnsweredAssumed Answered

customer board kernel boot stuck at "Waiting for root device /dev/mmcblk0p2

Question asked by Shawn Li on Aug 10, 2017
Latest reply on Aug 11, 2017 by Gregory Dyess

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

 

Outcomes