SD card CD pin issue on imx7d

Hi,

I am using imx7d emmc (V1.1A) with my own carrier board with bsp Linux colibri-imx7-emmc 4.1.44-00001-gdd5a082f1307-dirty.

I have some issues with the SD card.
I have kept same pinmux as in colibri evaluation board, but i have changed the CD pin from SODIMM43 to SODIMM69.

I have changed the imx7-colibri.dtsi

From

pinctrl_cd_usdhc1: usdhc1-cd-grp {
			fsl,pins = <
				MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0 0x59 /* CD */
			>;
		};

To

pinctrl_cd_usdhc1: usdhc1-cd-grp {
			fsl,pins = <
				MX7D_PAD_SD1_CD_B__GPIO5_IO0  0x59 /* CD */
			>;
		};

When i use SODIMM43 it works fine.

Hi

Did you also make sure that:

  • The pin is not muxed and/or used by another driver?
  • The usdhc driver knows that it needs to use another gpio?

Max

Hi,
The pin is not muxed with other driver.
I have added this line.
But its not working.

#endif
	cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
	disable-wp;
	enable-sdio-wakeup;
	keep-power-in-suspend;
	status = "okay";
	vmmc-supply = <&reg_3v3>;

And

root@colibri-imx7-emmc:~# dmesg | grep usdhc
[    1.507971] sdhci-esdhc-imx: probe of 30b40000.usdhc failed with error -22
[    1.519825] /soc/aips-bus@30800000/usdhc@30b60000: voltage-ranges unspecified
[    1.531643] sdhci-esdhc-imx 30b60000.usdhc: Looking up vmmc-supply from device tree
[    1.531666] sdhci-esdhc-imx 30b60000.usdhc: Looking up vmmc-supply property in node /soc/aips-bus@30800000/usdhc@30bd
[    1.531692] sdhci-esdhc-imx 30b60000.usdhc: Looking up vqmmc-supply from device tree
[    1.531705] sdhci-esdhc-imx 30b60000.usdhc: Looking up vqmmc-supply property in node /soc/aips-bus@30800000/usdhc@30d
[    1.531718] sdhci-esdhc-imx 30b60000.usdhc: No vmmc regulator found
[    1.542044] sdhci-esdhc-imx 30b60000.usdhc: No vqmmc regulator found
[    1.590519] mmc0: SDHCI controller on 30b60000.usdhc [30b60000.usdhc] using ADMA

Can you attach the full output of dmesg?

dmesg

Hi

Search for iomuxc in the dmesg log.

I assume the errors releated to iomuxc originate from now using a pin controlled by the ‘normal’ iomuxc and not the iomuxc-lpsr.

You will have to move the usdhc1-cd-grp node from the iomuxc_lpsr node to the iomuxc node.

Max

Hi @max.tx

It solved the problem.
iomuxc_lpsr and iomux have different registers for mux and pad control.

Thanks for your support. :slight_smile:

Perfect that it works. Thanks for the feedback.