Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

MMC1 interface not detected by LINUX kernel

On a custom board I use MMC0 and MMC1.

The bootloader (MLO file), U-Boot and the LINUX kernel are stored on an SD card that connects to MMC1. Everything runs fine (including loading the LINUX kernel from MMC1) but only MMC0 interface is detected by the LINUX kernel. Somehow the MMC1 interface is not detected by the LINUX kernel.

I have made a few changes to the file 'board-arm335xevm.c'. For now my 'am335x_evm_setup' function executes the following code:

mmc1_init(0, 0);
mmc0_init(0, 0);
am33xx_sr_init();
return;

where the two MMC initialization functions do the following:

static void mmc0_init(int evm_id, int profile)
{
    setup_pin_mux(mmc0_common_pin_mux);

    am335x_mmc[0].gpio_cd = -EINVAL;
    am335x_mmc[0].gpio_wp = -EINVAL;

    omap2_hsmmc_init(am335x_mmc);
    return;
}

and

static void mmc1_init(int evm_id, int profile)
{
    setup_pin_mux(mmc1_common_pin_mux);

    am335x_mmc[1].mmc = 2;
    am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;
    am335x_mmc[1].gpio_cd = -EINVAL;
    am335x_mmc[1].gpio_wp = -EINVAL;
    am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; // 3V3

    // mmc will be initialized when mmc0_init is called
    return;
}

As I am booting and loading the kernel from MMC1 I know the hardware is fine. As already stated MMC0 is detected by the kernel but MMC1 is not. Is there something more I have to do here or is something (power management?) disabling something (clock?) here?

many thanks and kind regards, Felix

  • Some more information after setting 'MMC_DEBUG' to true in the kernel configuration. Here is the kernel log:

    [    0.982727] The board is PDU-001 or EVB-003
    [    0.987121]    calling 'mmc1_init(0, 0)
    [    0.991302]    calling 'mmc0_init(0, 0)
    [    0.995483]  omap_hsmmc.0: alias fck already exists
    [    1.001098]  omap_hsmmc.1: alias fck already exists
    [    1.006835] registered am33xx_sr device
    [    1.013092] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.020294] omap2-nand driver initializing
    [    1.024841] OneNAND driver initializing
    [    1.030426] CAN device driver interface
    [    1.034454] CAN bus driver for Bosch D_CAN controller 1.0
    [    1.041137] usbcore: registered new interface driver zd1201
    [    1.047363] usbcore: registered new interface driver cdc_ether
    [    1.053710] usbcore: registered new interface driver cdc_eem
    [    1.059814] usbcore: registered new interface driver dm9601
    [    1.065704] cdc_ncm: 04-Aug-2011
    [    1.069274] usbcore: registered new interface driver cdc_ncm
    [    1.075225] Initializing USB Mass Storage driver...
    [    1.080566] usbcore: registered new interface driver usb-storage
    [    1.086883] USB Mass Storage support registered.
    [    1.092285] mousedev: PS/2 mouse device common for all mice
    [    1.099212] i2c /dev entries driver
    [    1.105682] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    1.116973] cpuidle: using governor ladder
    [    1.121887] cpuidle: using governor menu
    [    1.128204] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
    [    1.137054] omap4_aes_mod_init: loading AM33X AES driver
    [    1.142822] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
    [    1.149444] omap4_aes_probe: probe() done
    [    1.154205] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
    [    1.160400] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
    [    1.176452] omap4_sham_probe: probe() done
    [    1.184967] usbcore: registered new interface driver usbhid
    [    1.190856] usbhid: USB HID core driver
    [    1.196350] oprofile: hardware counters not available
    [    1.201690] oprofile: using timer interrupt.
    [    1.206237] nf_conntrack version 0.5.0 (3966 buckets, 15864 max)
    [    1.213134] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    1.218841] TCP cubic registered
    [    1.222290] NET: Registered protocol family 17
    [    1.226959] can: controller area network core (rev 20090105 abi 8)
    [    1.233581] NET: Registered protocol family 29
    [    1.238250] can: raw protocol (rev 20090105)
    [    1.242767] can: broadcast manager protocol (rev 20090105 t)
    [    1.248779] Registering the dns_resolver key type
    [    1.253814] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    1.261932] ThumbEE CPU extension supported.
    [    1.266479] mux: Failed to setup hwmod io irq -22
    [    1.272216] Power Management for AM33XX family
    [    1.277130] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [    1.283874] Copied the M3 firmware to UMEM
    [    1.288269] Cortex M3 Firmware Version = 0x18
    [    1.292968] Compensating OPP0 for 0mV Orig nvalue:0x9a8efd New nvalue:0x9a8efd
    [    1.300659] Compensating OPP1 for 0mV Orig nvalue:0x9a8efd New nvalue:0x9a8efd
    [    1.311645] Compensating OPP0 for 0mV Orig nvalue:0x999d8f New nvalue:0x999d8f
    [    1.319366] Compensating OPP1 for 0mV Orig nvalue:0x999282 New nvalue:0x999282
    [    1.327056] Compensating OPP2 for 0mV Orig nvalue:0x9a81e3 New nvalue:0x9a81e3
    [    1.334777] Compensating OPP3 for 0mV Orig nvalue:0xaadfc5 New nvalue:0xaadfc5
    [    1.342529] create_regulator: VDD1: Failed to create debugfs directory
    [    1.351013] smartreflex smartreflex: am33xx_sr_probe: Driver initialized
    [    1.365051] clock: disabling unused clocks to save power
    [    1.374938] mmc0: new high speed MMC card at address 0001
    [    1.381774] mmcblk0: mmc0:0001 002G49 1.82 GiB
    [    1.386932] mmcblk0boot0: mmc0:0001 002G49 partition 1 1.00 MiB
    [    1.393432] mmcblk0boot1: mmc0:0001 002G49 partition 2 1.00 MiB
    [    1.401550]  mmcblk0: p1
    [    1.408111]  mmcblk0boot1: unknown partition table
    [    1.416595]  mmcblk0boot0: unknown partition table
    [    1.422332] mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
    [    1.438171] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    [    1.445404] Root-NFS: no NFS server address
    [    1.449798] VFS: Unable to mount root fs via NFS, trying floppy.
    [    1.456878] VFS: Cannot open root device "mmcblk1p2" or unknown-block(2,0)
    [    1.464141] Please append a correct "root=" boot option; here are the available partitions:
    [    1.472991] b300         1916928 mmcblk0  driver: mmcblk
    [    1.478607]   b301         1916896 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
    [    1.487030] b310            1024 mmcblk0boot1  (driver?)
    [    1.492645] b308            1024 mmcblk0boot0  (driver?)
    [    1.498229] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

    Looking at the timestamps of the messages 'mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz' and 'mmc0: new high speed MMC card at address 0001' one can see that they differ by about 250ms. Is this the time for 'mmc0' to be detected?

    The time from the message ' mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz' until the kernel panic message however is only 75ms. Could this be the problem, i.e. "the kernel giving up too soon" looking for the root file system?

    regards Felix

  • Finally I found the solution to this problem. As stated in the previous post it is the kernel not taking enough time to load the driver for the MMC1 interface.

    I already had the 'rootwait' kernel parameter activated but this did not help. LINUX seemed to figure out that loading the driver for MMC0 is enough to decide whether a valid root filesystem is available or not. This assumption is wrong as the root filesystem is on an SD card mounted to MMC1.

    SOLUTION: I added the kernel parameter 'rootdelay=2' and there you go! From the log blow you can see that the MMC1 driver gets loaded just about 80ms 'too late'.

    [    1.474395] Waiting 2sec before mounting root device...
    [    1.534271] mmc1: host does not support reading read-only switch. assuming write-enable.
    [    1.545104] mmc1: new high speed SDHC card at address 0007
    [    1.551574] mmcblk1: mmc1:0007 SD8GB 7.21 GiB
    [    1.558410]  mmcblk1: p1 p2 p3

    It took me about 40'000'000ms to figure out this 80ms problem, hence this final post. Maybe it helps somebody else to save some hours.

    regards Felix

  • Hi Felix,

    I am ending up in same issue. I need mmc1 driver need to be configured for my external sd card. I use 3.8 kernel. Could you please let me know where is initialize the mmc1 driver?

    thanks,

    siva.

  • Hello Siva,


    Please read my posts above, they include the solution I found for my problem. If this solution does not work for you, you probably have some other kind of problem. In this case you should start a new thread. In any case you should provide much more information.


    regards, Felix

  • Hi Felix,

    I got it working now. It seems eMMC driver got initialized for mmc card. Once I fix that, I am able to get mmc detected. Thanks for your response.