AM5718: How to configure the mmc3 interface connection memory function in am5718

Part Number: AM5718
Other Parts Discussed in Thread: SYSCONFIG, PMP

Tool/software:

Hello experts:

       I use TI's am5718 as the processor, SDK version: ti-processor-sdk-linux-am57xx-evm-04.03.00.05.

      Because it uses various peripherals such as on-chip DDR/MAC_SDIO/MMC1/GPMC/QSPI/PRUST1_MII/UART, and requires separate GPMC data lines and address lines. This resulted in MMC3 being changed to MMC2 to mount memory FEMDMW016G due to pin conflicts.
       I analyzed the device tree configuration of the original EMMC2, which involves clock configuration, power configuration, pin and delay configuration, and many parameters do not know how to configure them.
       Could you please provide expert guidance on where to find corresponding materials and examples?

       And can you tell me how to configure them?
       Thank you very much!

  • Hello Jiabin,

     As you know, this is a very old kernel with little to no support from our side. You will have to try to replicate the usage of mmc3 to mmc2 based on the original DTS

    and the open source documentation:

    Bindings and explanation:

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/Documentation/mmc?h=ti-linux-4.9.y

    DTS example:

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm/boot/dts/dra7.dtsi?h=ti-linux-4.9.y

    pin and delay configuration can be done via :

    https://www.ti.com/tool/SYSCONFIG

    See also the following thread https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1253387/am5728-how-import-sysconfig-device-tree-into-linux-device-tree

    -Josue

  • hello, Josue:

           Thank you for your reply. Thank you for your reply. I will do it following your help.

  • hello, Josue:

           I replaced the MMC2 related properties in the device tree files am571x-idk.dts, dra72x-mmc-iodelay.dtsi, am57xx-idk-common.dtsi in the Linux directory, and the file mux_data. h in the uboot directory with MMC3 properties. After the Linux system started, it could recognize the MMC3 device, and I replicated the complete file system on this MMC device.

           However, during the startup phase, after uboot is completed, the MMC device cannot be found.                                                                                             
           I have already found the relevant contents of the am571x-idk.dts and am57xx-idk-common.dtsi files in the uboot directory/home/sys/ti processor sdk-linux-am57xx-evm-04.03.00.05/board-support/u-bot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/arch/arm/dts, but the system still cannot find the MMC device during startup.


           Is there still a peripheral pin configuration similar to the configuration in mux_data. h and a configuration related to starting from mmc3? Where are these configurations? Can you give me some guidance?

  • Jiabin,

    Did you use the Sysconfig utility? I am assuming so.

    Are you able to share all the changes you made in file format?

    Also,

    Please see the following thread:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/772339/am5748-am5748-emmc-issue

    -Josue

  • Josue,

           Thank you very much,your help is so helpful!

  • Jiabin,

    I am out of office until December 4th.

    Please expect delays.

    -Josue

  • Josue,

           Thank you very much.

            I have already found the relevant contents of the am571x-idk.dts and am57xx-idk-common.dtsi files in the uboot directory/home/sys/ti processor sdk-linux-am57xx-evm-04.03.00.05/board-support/u-bot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/arch/arm/dts.

           In  am57xx-idk-common.dtsi,I add:

    // add mmc3 2024-11-20
    &mmc3 {
    status = "okay";
    vmmc-supply = <&v3_3d>;
    bus-width = <8>;
    ti,non-removable;
    max-frequency = <32000000>;
    // no-1-8-v;
    };
    //end add

    In am571x-dik.dts ,I add in &dra7_pmx_core :

    //add 2024-11-21
    mmc3_pins_ds: pinmux_mmc3_pins_ds {
    pinctrl-single,pins = <
    DRA7XX_CORE_IOPAD(0x377c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_clk.mmc3_clk */
    DRA7XX_CORE_IOPAD(0x3780, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_cmd.mmc3_cmd */
    DRA7XX_CORE_IOPAD(0x3784, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat0.mmc3_dat0 */
    DRA7XX_CORE_IOPAD(0x3788, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat1.mmc3_dat1 */
    DRA7XX_CORE_IOPAD(0x378c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat2.mmc3_dat2 */
    DRA7XX_CORE_IOPAD(0x3790, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat3.mmc3_dat3 */
    DRA7XX_CORE_IOPAD(0x3794, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat4.mmc3_dat4 */
    DRA7XX_CORE_IOPAD(0x3798, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat5.mmc3_dat5 */
    DRA7XX_CORE_IOPAD(0x379c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat6.mmc3_dat6 */
    DRA7XX_CORE_IOPAD(0x37a0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat7.mmc3_dat7 */
    >;
    };
    mmc3_pins_sdr12: pinmux_mmc3_pins_sdr12 {
    pinctrl-single,pins = <
    DRA7XX_CORE_IOPAD(0x377c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_clk.mmc3_clk */
    DRA7XX_CORE_IOPAD(0x3780, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_cmd.mmc3_cmd */
    DRA7XX_CORE_IOPAD(0x3784, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat0.mmc3_dat0 */
    DRA7XX_CORE_IOPAD(0x3788, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat1.mmc3_dat1 */
    DRA7XX_CORE_IOPAD(0x378c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat2.mmc3_dat2 */
    DRA7XX_CORE_IOPAD(0x3790, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat3.mmc3_dat3 */
    DRA7XX_CORE_IOPAD(0x3794, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat4.mmc3_dat4 */
    DRA7XX_CORE_IOPAD(0x3798, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat5.mmc3_dat5 */
    DRA7XX_CORE_IOPAD(0x379c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat6.mmc3_dat6 */
    DRA7XX_CORE_IOPAD(0x37a0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat7.mmc3_dat7 */
    >;
    };

    mmc3_pins_hs: pinmux_mmc3_pins_hs {
    pinctrl-single,pins = <
    DRA7XX_CORE_IOPAD(0x377c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_clk.mmc3_clk */
    DRA7XX_CORE_IOPAD(0x3780, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_cmd.mmc3_cmd */
    DRA7XX_CORE_IOPAD(0x3784, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat0.mmc3_dat0 */
    DRA7XX_CORE_IOPAD(0x3788, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat1.mmc3_dat1 */
    DRA7XX_CORE_IOPAD(0x378c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat2.mmc3_dat2 */
    DRA7XX_CORE_IOPAD(0x3790, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat3.mmc3_dat3 */
    DRA7XX_CORE_IOPAD(0x3794, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat4.mmc3_dat4 */
    DRA7XX_CORE_IOPAD(0x3798, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat5.mmc3_dat5 */
    DRA7XX_CORE_IOPAD(0x379c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat6.mmc3_dat6 */
    DRA7XX_CORE_IOPAD(0x37a0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat7.mmc3_dat7 */
    >;
    };

    mmc3_pins_sdr25: pinmux_mmc3_pins_sdr25 {
    pinctrl-single,pins = <
    DRA7XX_CORE_IOPAD(0x377c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_clk.mmc3_clk */
    DRA7XX_CORE_IOPAD(0x3780, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_cmd.mmc3_cmd */
    DRA7XX_CORE_IOPAD(0x3784, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat0.mmc3_dat0 */
    DRA7XX_CORE_IOPAD(0x3788, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat1.mmc3_dat1 */
    DRA7XX_CORE_IOPAD(0x378c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat2.mmc3_dat2 */
    DRA7XX_CORE_IOPAD(0x3790, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat3.mmc3_dat3 */
    DRA7XX_CORE_IOPAD(0x3794, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat4.mmc3_dat4 */
    DRA7XX_CORE_IOPAD(0x3798, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat5.mmc3_dat5 */
    DRA7XX_CORE_IOPAD(0x379c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat6.mmc3_dat6 */
    DRA7XX_CORE_IOPAD(0x37a0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc3_dat7.mmc3_dat7 */
    >;
    };

    mmc3_pins_sdr50: pinmux_mmc3_pins_sdr50 {
    pinctrl-single,pins = <
    DRA7XX_CORE_IOPAD(0x377c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_clk.mmc3_clk */
    DRA7XX_CORE_IOPAD(0x3780, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_cmd.mmc3_cmd */
    DRA7XX_CORE_IOPAD(0x3784, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat0.mmc3_dat0 */
    DRA7XX_CORE_IOPAD(0x3788, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat1.mmc3_dat1 */
    DRA7XX_CORE_IOPAD(0x378c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat2.mmc3_dat2 */
    DRA7XX_CORE_IOPAD(0x3790, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat3.mmc3_dat3 */
    DRA7XX_CORE_IOPAD(0x3794, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat4.mmc3_dat4 */
    DRA7XX_CORE_IOPAD(0x3798, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat5.mmc3_dat5 */
    DRA7XX_CORE_IOPAD(0x379c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat6.mmc3_dat6 */
    DRA7XX_CORE_IOPAD(0x37a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc3_dat7.mmc3_dat7 */
    >;
    };
    //end add

    and add in &dra7_iodelay_core:

    //add 2024-11-21
    mmc3_iodelay_sdr50_rev20_conf: mmc3_iodelay_sdr50_rev20_conf {
    pinctrl-single,pins = <
    0x678 (A_DELAY_PS(1085) | G_DELAY_PS(21)) /* CFG_MMC3_CLK_IN */
    0x680 (A_DELAY_PS(1269) | G_DELAY_PS(0)) /* CFG_MMC3_CLK_OUT */
    0x684 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_CMD_IN */
    0x688 (A_DELAY_PS(128) | G_DELAY_PS(0)) /* CFG_MMC3_CMD_OEN */
    0x68C (A_DELAY_PS(98) | G_DELAY_PS(0)) /* CFG_MMC3_CMD_OUT */
    0x690 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT0_IN */
    0x694 (A_DELAY_PS(362) | G_DELAY_PS(0)) /* CFG_MMC3_DAT0_OEN */
    0x698 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT0_OUT */
    0x69C (A_DELAY_PS(7) | G_DELAY_PS(0)) /* CFG_MMC3_DAT1_IN */
    0x6A0 (A_DELAY_PS(333) | G_DELAY_PS(0)) /* CFG_MMC3_DAT1_OEN */
    0x6A4 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT1_OUT */
    0x6A8 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT2_IN */
    0x6AC (A_DELAY_PS(402) | G_DELAY_PS(0)) /* CFG_MMC3_DAT2_OEN */
    0x6B0 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT2_OUT */
    0x6B4 (A_DELAY_PS(203) | G_DELAY_PS(0)) /* CFG_MMC3_DAT3_IN */
    0x6B8 (A_DELAY_PS(549) | G_DELAY_PS(0)) /* CFG_MMC3_DAT3_OEN */
    0x6BC (A_DELAY_PS(1) | G_DELAY_PS(0)) /* CFG_MMC3_DAT3_OUT */
    0x6C0 (A_DELAY_PS(121) | G_DELAY_PS(0)) /* CFG_MMC3_DAT4_IN */
    0x6C4 (A_DELAY_PS(440) | G_DELAY_PS(0)) /* CFG_MMC3_DAT4_OEN */
    0x6C8 (A_DELAY_PS(206) | G_DELAY_PS(0)) /* CFG_MMC3_DAT4_OUT */
    0x6CC (A_DELAY_PS(336) | G_DELAY_PS(0)) /* CFG_MMC3_DAT5_IN */
    0x6D0 (A_DELAY_PS(283) | G_DELAY_PS(0)) /* CFG_MMC3_DAT5_OEN */
    0x6D4 (A_DELAY_PS(174) | G_DELAY_PS(0)) /* CFG_MMC3_DAT5_OUT */
    0x6D8 (A_DELAY_PS(320) | G_DELAY_PS(0)) /* CFG_MMC3_DAT6_IN */
    0x6DC (A_DELAY_PS(443) | G_DELAY_PS(0)) /* CFG_MMC3_DAT6_OEN */
    0x6E0 (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT6_OUT */
    0x6E4 (A_DELAY_PS(2) | G_DELAY_PS(0)) /* CFG_MMC3_DAT7_IN */
    0x6E8 (A_DELAY_PS(344) | G_DELAY_PS(0)) /* CFG_MMC3_DAT7_OEN */
    0x6EC (A_DELAY_PS(0) | G_DELAY_PS(0)) /* CFG_MMC3_DAT7_OUT */
    >;
    };
    and I add:

    &mmc3 {
    pinctrl-names = "default", "hs", "ddr_1_8v";
    pinctrl-0 = <&mmc3_pins_ds>;
    pinctrl-1 = <&mmc3_pins_hs>;
    pinctrl-2 = <&mmc3_pins_sdr50 &mmc3_iodelay_sdr50_rev20_conf>;
    };

    in the file  board.c  in//home/cys/ti-processor-sdk-linux-am57xx-evm-04.03.00.05/board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/board/ti/am57xx/

    I add:

    omap_mmc_init(2, 0, 0, -1, -1);//add in 2024-11-30

    in the function int board_mmc_init(bd_t *bis);

    I have already configured mux_data.h using pinmux . After configuring the device tree of the Linux kernel, mmc3 can be recognized and used, but this storage cannot be recognized during the uboot phase.

    Startup phase log:

    U-Boot SPL 2017.01-00458-g32d3fcd-dirty (Nov 30 2024 - 14:52:32)
    DRA722-GP ES2.0
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment

    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img


    U-Boot 2017.01-00458-g32d3fcd-dirty (Nov 30 2024 - 14:52:32 +0800)

    CPU : DRA722-GP ES2.0
    Model: TI AM5718 IDK
    Board: AM571x IDK, For JRU REV
    DRAM: 1 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    SF: Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiB, mapped at 5c000000
    *** Warning - bad CRC, using default environment

    Warning: fastboot.board_rev: unknown board revision
    omap_hsmmc_init_setup: timedout waiting for cc2!
    ERROR: invalid mmc device

    at ../arch/arm/mach-omap2/utils.c:95/omap_mmc_get_part_size()
    SCSI: SATA link 0 timeout.
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
    scanning bus for devices...
    Found 0 device(s).
    Net: Could not get PHY for ethernet@48484000: addr 0

    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    =>
    =>
    =>
    =>
    => mmc list
    OMAP SD/MMC: 0
    OMAP SD/MMC: 1
    =>

    I used the mmc list command and found that the system did not recognize the mmc3 device.

    I hope you can help me after your vacation ends.

  • I appreciate you patience!

  • :

             I holp you would help me.

  • Jiabin,

    I am low in bandwidth at the moment. will probably not get a chance until next week.

    One comment though is that Pinmux changes are generally not done on the DTS

    In am571x-dik.dts ,I add in &dra7_pmx_core :

    , but on the 

    mux_data. h

    file only.

    -Josue

  • Josue,

            Sorry, I haven't had the chance to try during my business trip these days. I'll give it a try。

  • Josue,

           Thanks for your help!