imx8m mini custom board usdhc1 sd card detection issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx8m mini custom board usdhc1 sd card detection issue

跳至解决方案
4,023 次查看
Dhevan
Contributor IV

Hi,

         BSP Version - 5.4.24

         Our custom board design we have used usdhc1 for sd card storage purpose.

         NVCC_SD1 - Directly powered with 3.3v from supply.

         As mentioned NVCC_SD1 direct power supply that's we not used VSELECT pin.

         Our Custom design there is no RESET SUPPLY section that's why SD_RESET not used.

         We have used only

                       - CLK, CMD, DATA0, DATA1, DATA2, DATA3, CD (GPIO).

         We have removed usdhc2 and added usdhc1 in kernal device tree file.

         While inserting sd card to slot does not detecting and /dev also does not detecting.

         Please check attached usdhc1 device tree configuration any issue there means help us to solve this issue.

	reg_usdhc1_vmmc: regulator-usdhc1 {
		compatible = "regulator-fixed";
		regulator-name = "VSD_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

&usdhc1 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_usdhc1_gpio>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_usdhc1_gpio>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_usdhc1_gpio>;
	cd-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
	bus-width = <4>;
	vmmc-supply = <&reg_usdhc1_vmmc>;
	status = "okay";
};

	pinctrl_usdhc1_gpio: usdhc1grpgpio {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_DATA6_GPIO2_IO8	0x41
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK		0x190
			MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD		0x1d0
			MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0	0x1d0
			MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1	0x1d0
			MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2	0x1d0
			MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3	0x1d0
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK		0x194
			MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD		0x1d4
			MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0	0x1d4
			MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1	0x1d4
			MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2	0x1d4
			MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3	0x1d4
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK		0x196
			MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD		0x1d6
			MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0	0x1d6
			MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1	0x1d6
			MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2	0x1d6
			MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3	0x1d6
		>;
	};

 

     Advance Thank You.

 

Thanks & Regards,

      Vasu

 

 

标签 (1)
0 项奖励
回复
1 解答
3,973 次查看
Dhevan
Contributor IV

Hi @igorpadykov,

       Found the issue in device tree sd card card detection pin initialization was wrong.

       Thanks for your support.

 

在原帖中查看解决方案

0 项奖励
回复
5 回复数
4,013 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Vasu

 

one can check its functionality first in uboot and debug it :

https://source.codeaurora.org/external/imx/uboot-imx/tree/?h=imx_v2020.04_5.4.24_2.1.0

Use Porting Guide from L5.4.24 Documentation as additional help

 

Best regards
igor

0 项奖励
回复
4,003 次查看
Dhevan
Contributor IV

Hi @igorpadykov,

         I had debugged uboot code.

         I am getting error as a Card did not respond to voltage select!.

        

u-boot=> mmc dev 0
Card did not respond to voltage select!

 

       Why am getting this error ?

       How to solve this issue ?

Thanks & Regards,

        Vasu

0 项奖励
回复
3,998 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Vasu

 

one can look at

https://forum.fs-net.de/index.php?thread/4373-booting-from-sd-card-on-efusa7ul-v1-module/

So reason is that card does not respond at all, one can check its signals with oscilloscope.

 

Best regards
igor

0 项奖励
回复
3,974 次查看
Dhevan
Contributor IV

Hi @igorpadykov,

       Found the issue in device tree sd card card detection pin initialization was wrong.

       Thanks for your support.

 

0 项奖励
回复
3,984 次查看
Dhevan
Contributor IV

Hi @igorpadykov,

       Now we have used sd2 for sdcard.

       SD card detection pin does not working.

       SD card detection pin we have used GPIO pin.

       While inserting and removing kernel not able to detect the sdcard.

       If sd card inserted poweroff and poweron the board sd card detecting in /dev/mmc1pck1.

       If ad card removed also kernel showing /dev/mmc1pck1.

      

&usdhc2 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
	cd-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
	bus-width = <4>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	status = "okay";
};

	pinctrl_usdhc2_gpio: usdhc2grpgpio {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_DATA6_GPIO2_IO8	0x41
		>;
	};

 

      CD pin mentioned in device tree file even though sd card does not detecting.

      We have used gpio instant of sd2_cd pins.

      Please help us to solve the sd card detection issue.

Thanks & Regards,

        Vasu