This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3354: Bad device mmc 0

Part Number: AM3354


Tool/software: Linux

Dear All,

I have a custom AM3354 board, mostly based on SK.

I am using ti-processor-sdk-linux-am335x-evm-05.01.00.11.

Using uart boot mode, I get ' Bad device mmc 0' error.

U-Boot SPL 2018.01-00445-gc852b6f-dirty (Jan 10 2019 - 11:29:53)
Trying to boot from UART                                                             
CCCzModem - CRC mode, 4333(SOH)/0(STX)/0(CAN) packets, 9 retries
Loaded 553868 bytes


U-Boot 2018.01-00445-gc852b6f-dirty (Jan 10 2019 - 11:29:53 +0300)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x LOCUS
DRAM:  256 MiB
MMC:   OMAP SD/MMC: 0
** Bad device mmc 0 **
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0                                                     
MMC Device 1 not found                                                               
no mmc device at slot 1                                                              
MMC Device 1 not found                                                               
no mmc device at slot 1                                                              
## Error: "bootcmd_nand0" not defined                                                
starting USB...                                                                      
USB0:   MUSB host is not registered                                                  
Port not available.                                                                  
No ethernet found.                                                                   
missing environment variable: pxeuuid                                                
Retrieving file: pxelinux.cfg/00000000                                               
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/0000000                                                
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/000000                                                 
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/00000                                                  
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/0000                                                   
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/000                                                    
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/00                                                     
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/0                                                      
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/default-arm-am33xx                                     
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/default-arm                                            
No ethernet found.                                                                   
Retrieving file: pxelinux.cfg/default                                                
No ethernet found.                                                                   
Config file not found                                                                
starting USB...                                                                      
USB0:   MUSB host is not registered                                                  
Port not available.                                                                  
No ethernet found.                                                                   
No ethernet found.                         

Below is my configuration for eMMC.

Could you tell me what am I missing or doing wrong?

&mmc1 {
    status="disabled";
};

&mmc2 {
    vmmc-supply = <&vmmc_reg>;
    pinctrl-names = "default";
    pinctrl-0 = <&emmc_pins_default>;
    bus-width = <8>;
    status = "okay";
};

&mmc3 {

    status="disabled";
};

emmc_pins_default: emmc_pins_default {
        pinctrl-single,pins = <
            0x80 ( PIN_INPUT | MUX_MODE2 ) /* (U9) gpmc_csn1.mmc1_clk */
            0x84 ( PIN_INPUT | MUX_MODE2 ) /* (V9) gpmc_csn2.mmc1_cmd */
            0x0 ( PIN_INPUT | MUX_MODE1 ) /* (U7) gpmc_ad0.mmc1_dat0 */
            0x4 ( PIN_INPUT | MUX_MODE1 ) /* (V7) gpmc_ad1.mmc1_dat1 */
            0x8 ( PIN_INPUT | MUX_MODE1 ) /* (R8) gpmc_ad2.mmc1_dat2 */
            0xc ( PIN_INPUT | MUX_MODE1 ) /* (T8) gpmc_ad3.mmc1_dat3 */
            0x10 ( PIN_INPUT | MUX_MODE1 ) /* (U8) gpmc_ad4.mmc1_dat4 */
            0x14 ( PIN_INPUT | MUX_MODE1 ) /* (V8) gpmc_ad5.mmc1_dat5 */
            0x18 ( PIN_INPUT | MUX_MODE1 ) /* (R9) gpmc_ad6.mmc1_dat6 */
            0x1c ( PIN_INPUT | MUX_MODE1 ) /* (T9) gpmc_ad7.mmc1_dat7 */
        >;
    };

  • Hello Mehmet,

    Can you also revise the pinmux settings in <Processor SDK>/board-support/u-boot-<version>/board/ti/am335x/mux.c file and attach the output of these commands?

    => env default -a -f
    => saveenv
    => mmc list
    => mmc dev 0
    => mmc info
    => mmc dev 1
    => mmc info

    Best regards,
    Kemal

  • Hello Kemal,

    It looks like it was related with mux.c as you mentioned. I modified mux.c as follows;

    static struct module_pin_mux mmc1_pin_mux[] = {
    
    {OFFSET(gpmc_ad7), (MODE(1) | RXACTIVE )}, /* MMC1_DAT7 */
    
    {OFFSET(gpmc_ad6), (MODE(1) | RXACTIVE )}, /* MMC1_DAT6 */
    
    {OFFSET(gpmc_ad5), (MODE(1) | RXACTIVE )}, /* MMC1_DAT5 */
    
    {OFFSET(gpmc_ad4), (MODE(1) | RXACTIVE )}, /* MMC1_DAT4 */
    
    {OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE )}, /* MMC1_DAT3 */
    
    {OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE )}, /* MMC1_DAT2 */
    
    {OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE )}, /* MMC1_DAT1 */
    
    {OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE )}, /* MMC1_DAT0 */
    
    {OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN )}, /* MMC1_CLK */
    
    {OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE )}, /* MMC1_CMD */
    
    {-1},
    
    };

    ..

    ...

    ..

    else if (board_is_evm_sk()) {
    
    		/* Starter Kit EVM */
    		configure_module_pin_mux(i2c0_pin_mux);
    		configure_module_pin_mux(gpio0_7_pin_mux);
    		configure_module_pin_mux(rmii1_pin_mux);
    		configure_module_pin_mux(mmc1_pin_mux);
    		
    		// configure_module_pin_mux(mmc0_pin_mux_sk_evm);
    	}

    Now I can see eMMC is detected, however when I try to partition the eMMC with below commands I get below error;

    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    ** Unrecognized filesystem type **
    SD/MMC found on device 0
    ** Bad device mmc 0 **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    ## Error: "bootcmd_nand0" not defined
    cpsw Waiting for PHY auto negotiation to complete.......user interrupt!
    missing environment variable: pxeuuid
    Retrieving file: pxelinux.cfg/01-0c-1c-57-69-cb-eb
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/00000000
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/0000000
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/000000
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/00000
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/0000
    cpsw Waiting for PHY auto negotiation to completeuser interrupt!
    Retrieving file: pxelinux.cfg/000
    cpsw Waiting for PHY auto negotiation to completeuser interrupt!
    Retrieving file: pxelinux.cfg/00
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/0
    cpsw Waiting for PHY auto negotiation to completeuser interrupt!
    Retrieving file: pxelinux.cfg/default-arm-am33xx
    cpsw Waiting for PHY auto negotiation to completeuser interrupt!
    Retrieving file: pxelinux.cfg/default-arm
    cpsw Waiting for PHY auto negotiation to complete.user interrupt!
    Retrieving file: pxelinux.cfg/default
    cpsw Waiting for PHY auto negotiation to completeuser interrupt!
    Config file not found
    => <INTERRUPT>
    => mmc list
    OMAP SD/MMC: 0
    OMAP SD/MMC: 1 (eMMC)
    => mmc dev 0
    => mmc rescan
    => mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    => setenv uuid_gpt_disk 3a757a80-cedb-4e7d-9537-07de10fda65d
    => setenv uuid_gpt_rootfs bf2599f4-de0f-4e00-ae58-f0eb2b3d3c45
    => gpt write mmc 1 ${partitions}
    Writing GPT: omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
    ** Can't write to device 1 **
    ** Can't write to device 1 **
    error!
    => mmc list
    OMAP SD/MMC: 0
    OMAP SD/MMC: 1 (eMMC)
    =>

    Do you have any idea about the cause?

    Best Regards

    Mehmet

  • You can refer to this thread. They had the same "omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear" error and it was caused by wrong Pinmux settings.

  • Hi Kemal,

    Changing pinmux settings like below has resolved the issue;

    static struct module_pin_mux mmc1_pin_mux[] = {
    {OFFSET(gpmc_ad7), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT7 */
    {OFFSET(gpmc_ad6), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT6 */
    {OFFSET(gpmc_ad5), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT5 */
    {OFFSET(gpmc_ad4), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT4 */
    {OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT3 */
    {OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT2 */
    {OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT1 */
    {OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT0 */
    {OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN )}, /* MMC1_CLK */
    {OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE | PULLUP_EN)}, /* MMC1_CMD */
    {-1},
    };

    Thanks
  • I am glad to hear that the issue is resolved.