Verdin am62-booting from MMC2 using SD card

Hi,

we are trying to boot from SD card using the MMC2 port.we have done the changes in the device tree as below,

/* On-module Wi-Fi on WB SKUs, module-specific SDIO otherwise /
pinctrl_sdhci2: main-mmc2-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x120, PIN_INPUT, 0) /
(C24) MMC2_CMD / / WiFi_SDIO_CMD /
AM62X_IOPAD(0x118, PIN_INPUT, 0) /
(D25) MMC2_CLK / / WiFi_SDIO_CLK /
AM62X_IOPAD(0x114, PIN_INPUT, 0) /
(B24) MMC2_DAT0 / / WiFi_SDIO_DATA0 /
AM62X_IOPAD(0x110, PIN_INPUT, 0) /
(C25) MMC2_DAT1 / / WiFi_SDIO_DATA1 /
AM62X_IOPAD(0x10c, PIN_INPUT, 0) /
(E23) MMC2_DAT2 / / WiFi_SDIO_DATA2 /
AM62X_IOPAD(0x108, PIN_INPUT, 0) /
(D24) MMC2_DAT3 / / WiFi_SDIO_DATA3 /
AM62X_IOPAD(0x11c, PIN_INPUT, 0) /
(#N/A) MMC2_CLKB */
>;
};

    /* Verdin SD_2_CD# as GPIO */
pinctrl_sd2_cd_gpio: main-gpio0-71-pins-default {
    pinctrl-single,pins = <
        AM62X_IOPAD(0x0124, PIN_INPUT_PULLUP, 7) /* (A23) MMC2_SDCD.GPIO0_71 */ /* SODIMM 157 */
    >;
};

&sdhci2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sdhci2>, <&pinctrl_sd2_cd_gpio>;
cd-gpios = <&main_gpio1 71 GPIO_ACTIVE_LOW>;
disable-wp;
ti,fails-without-test-cd;
ti,driver-strength-ohm = <33>;
status = "okay";

};

we create a .wic image and write it into external Sd card using Sudo DD commad.

the issue is that when i try to boot from Sd card using mmc2.

in u-boot when i use the commad mmc dev 2, it returns an error stating No MMC 2 device found.

is there anything wrong in the above config or suggest me a way to boot from MMC2!

Thanks in advance

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the provided context, it seems like you have made the necessary device tree changes to enable MMC2 for booting from an SD card on the Verdin AM62. However, you are encountering an issue where U-Boot does not recognize the MMC2 device.

Here are a few suggestions to troubleshoot and resolve the issue:

  1. Verify Hardware Connections:
    Ensure that the SD card is properly inserted into the MMC2 slot and that there are no hardware issues with the slot or the SD card itself.

  2. Check Device Tree Configuration:
    Double-check the device tree configuration to ensure that all pin mappings and settings are correct. Specifically, verify that the pinctrl settings and GPIO configurations are accurate.

  3. U-Boot Configuration:
    Ensure that U-Boot is configured to support MMC2. You may need to enable MMC2 support in the U-Boot configuration. This typically involves setting the appropriate configuration options in the U-Boot source code and rebuilding U-Boot.

    For example, you might need to enable the following in your U-Boot configuration:

    CONFIG_MMC=y
    CONFIG_GENERIC_MMC=y
    CONFIG_MMC_SDHCI=y
    CONFIG_MMC_SDHCI_AM62X=y
    
  4. U-Boot Environment Variables:
    Ensure that the U-Boot environment variables are correctly set to use MMC2 for booting. You can set the environment variables in the U-Boot console:

    setenv mmcdev 2
    setenv bootcmd 'mmc dev 2; ext4load mmc 2:1 ${loadaddr} /boot/uImage; bootm ${loadaddr}'
    saveenv
    
  5. Debugging in U-Boot:
    Use U-Boot commands to debug the MMC2 device. For example, you can use the following commands to list available MMC devices and probe MMC2:

    mmc list
    mmc dev 2
    
  6. Kernel Configuration:
    Ensure that the Linux kernel is configured to support MMC2. This typically involves enabling the appropriate kernel configuration options for MMC and SDHCI.

If you have verified all the above steps and the issue persists, it might be helpful to check the U-Boot and kernel logs for any error messages or clues that could indicate what is going wrong.

If you still face issues, please provide more details about the U-Boot version you are using and any relevant logs or error messages. This will help in providing more specific guidance.

Please, also check if these links can help you solve your problem:

AM62 Wifi Device Not Appearing.

Hi @naveenkumar.muthusam ,
I hope you have already gone through this article.
Let us know if you are still facing the issue

Hi @sahil.tx ,

we are currently not using it for booting , but trying to connect Sd card and try to read some file from the SD card.

we are using the same configuration, but still SD card is not detected in the board. 3v3 for the SD card is enabled at the board power up itself and we are not controlling it. anything else we need to do in device tree to make it work?

Hi @sahil.tx ,

it seems that booting from the SD card is not supported in MMC2 as per Ti