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: PROCESSOR-SDK-AM437X: how to configure emmc driver in linux



Tool/software: Linux

Hi,

Presently i am using ti SDK, I want to  integrate SD in Am4379-MMC0 interface and emmc flash in  Am4379-MMC1, the emmc is SDIN8DE2-4G-XI of SANDISK, 

1. I know i need to configure emmc host controller driver in linux, the conifguration is for drivers/mmc/host/omap_hsmmc.c, so i follow this:

    

2. I don't know whether I need the emmc flash driver for  SDIN8DE2-4G-XI  chip;

3. The following is my linux starting log:

#######drivers/mmc/host/omap_hsmmc.c omap_hsmmc_probe ***begin*****
###### omap_hsmmc_probe ***res = 0x48060000*****
omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@48060000[0]' - status (0)
omap_hsmmc 48060000.mmc: Got CD GPIO
omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
omap_hsmmc 48060000.mmc: lookup for GPIO wp failed
#######drivers/mmc/host/omap_hsmmc.c omap_hsmmc_probe ***end*****
#######drivers/mmc/host/omap_hsmmc.c omap_hsmmc_probe ***begin*****
###### omap_hsmmc_probe ***res = 0x481d8000*****
omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
omap_hsmmc 481d8000.mmc: lookup for GPIO cd failed
omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
omap_hsmmc 481d8000.mmc: lookup for GPIO wp failed
#######drivers/mmc/host/omap_hsmmc.c omap_hsmmc_probe ***end*****

4. The address 48060000 is for sd, 481d8000 is emmc flash address, i find the driver run completely;

5. When I login the file system, i only find the device node for SD, they are  mmcblk0p1 and mmcblk0p2, but I can't find the device node for the emmac flash;

6. What's the problem, can you help me ? 

Thank you!

  • Hi Riguang,

    Could you try the steps described in the linked tutorial about partitioning eMMC from u-boot.
    You need to stop booting in u-boot prompt.
    processors.wiki.ti.com/.../Linux_Core_U-Boot_User's_Guide

    BR
    Tsvetolin Shulev
  • 1. The ti pin mux tool generate the deviceree about the emmc1 is:
    mymmc1_pins_default: mymmc1_pins_default {
    pinctrl-single,pins = <
    0x80 ( PIN_INPUT | MUX_MODE2 ) /* (B9) gpmc_csn1.mmc1_clk */
    0x84 ( PIN_OUTPUT | MUX_MODE2 ) /* (F10) gpmc_csn2.mmc1_cmd */
    0x0 ( PIN_INPUT | MUX_MODE1 ) /* (B5) gpmc_ad0.mmc1_dat0 */
    0x4 ( PIN_INPUT | MUX_MODE1 ) /* (A5) gpmc_ad1.mmc1_dat1 */
    0x8 ( PIN_INPUT | MUX_MODE1 ) /* (B6) gpmc_ad2.mmc1_dat2 */
    0xc ( PIN_INPUT | MUX_MODE1 ) /* (A6) gpmc_ad3.mmc1_dat3 */
    0x10 ( PIN_INPUT | MUX_MODE1 ) /* (B7) gpmc_ad4.mmc1_dat4 */
    0x14 ( PIN_INPUT | MUX_MODE1 ) /* (A7) gpmc_ad5.mmc1_dat5 */
    0x18 ( PIN_INPUT | MUX_MODE1 ) /* (C8) gpmc_ad6.mmc1_dat6 */
    0x1c ( PIN_INPUT | MUX_MODE1 ) /* (B8) gpmc_ad7.mmc1_dat7 */
    >;
    };

    2. so i modify the uboot/board/ti/am43xx/mux.c according to the devicetree as following:

    #define INPUT_EN (1 << 18)
    #define PULL_DISABLE (1 << 16)
    #define PIN_INPUT (INPUT_EN | PULL_DISABLE)
    #define PIN_OUTPUT (PULL_DISABLE)

    static struct module_pin_mux mmc1_pin_mux[] = {
    {OFFSET(gpmc_csn1), (MODE(2) | PIN_INPUT)},
    {OFFSET(gpmc_csn2), (MODE(2) | PIN_OUTPUT)},
    {OFFSET(gpmc_ad0), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT0 */
    {OFFSET(gpmc_ad1), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT1 */
    {OFFSET(gpmc_ad2), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT2 */
    {OFFSET(gpmc_ad3), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT3 */
    {OFFSET(gpmc_ad4), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT4 */
    {OFFSET(gpmc_ad5), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT5 */
    {OFFSET(gpmc_ad6), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT6 */
    {OFFSET(gpmc_ad7), (MODE(1) | PIN_INPUT)}, /* MMC1 DAT7 */
    {-1},
    };

    void enable_board_pin_mux(void)
    {
    ...
    configure_module_pin_mux(mmc1_pin_mux);
    ...
    }

    3. finally, in boot, i excute the commands:

    U-Boot# mmc list
    OMAP SD/MMC: 0
    OMAP SD/MMC: 1
    U-Boot# mmc dev 0
    mmc0 is current device
    U-Boot# mmcinfo
    Device: OMAP SD/MMC
    Manufacturer ID: 3
    OEM: 5344
    Name: SU04G
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 3.7 GiB
    Bus Width: 4-bit
    U-Boot# mmc dev 1
    mmc_read_data: timedout waiting for status!
    mmc_send_cmd: timedout waiting on cmd inhibit to clear
    mmc1 is current device
    U-Boot# mmcinfo
    mmc_read_data: timedout waiting for status!
    mmc_send_cmd: timedout waiting on cmd inhibit to clear
    Device: OMAP SD/MMC
    Manufacturer ID: 45
    OEM: 100
    Name: SEM04
    Tran Speed: 25000000
    Rd Block Len: 512
    MMC version 4.0
    High Capacity: Yes
    Capacity: 16 EiB
    Bus Width: 1-bit
    U-Boot#

    4. when i read the mmc1, the reslult is
    mmc_read_data: timedout waiting for status!
    mmc_send_cmd: timedout waiting on cmd inhibit to clear
  • the step one, i configure the linux kernel according to wiki: Linux Core MMC/SD User's Guide

    processors.wiki.ti.com/.../SD_User's_Guide
  • finally, i solved this problem by changing to this:  {OFFSET(gpmc_csn2), (MODE(2) | PIN_INPUT)},