Hi team,
I'm working with i.MX91 custom board, the major difference in SD Card interface is EVK is using dedicated GPIO for card detection, but we are using DATA3. I changed Kernel dts file as (Mentioned in RM DATA3 should be pull-down)
HI @Robbi!
Thank you for contacting NXP Support!
The configuration that I recommend is the next:
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
pinctrl-0 = <&pinctrl_usdhc2>;
pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
pinctrl-3 = <&pinctrl_usdhc2_sleep>;
fsl,cd-gpio-wakeup-disable;
fsl,cd-controller;
bus-width = <4>;
status = "okay";
no-sdio;
};
The pinctrl looks good.
Do you want to boot from SD card using usdhc2?
This device tree is the u-boot device tree or Linux-device tree?
What BSP version are you using?
Best Regards!
Chavira
Hi @Chavira ,
Please suggest me what changes need to be done, to boot from sd card.
Thanks @Chavira ,
For the response, this kernel dts, initially I left u-boot dts same as imx91 EVK but later I tried and changed. still same error MMC1 not detecting.
Thanks.
Robbi
HI @Robbi!
Yes the changes should be done in U-boot device tree too.
Can you share the schematic of the SD connections?
Best Regards!
Chavira
Please find the attached image.
And the interface of pins with IMX91, where SD2_CD_B is not used.
[AA19] SD2_CLK | SD2_CLK |
[Y19] SD2_CMD | SD2_CMD |
[Y18] SD2_DATA0 | SD2_DATA0 |
[AA18] SD2_DATA1 | SD2_DATA1 |
[Y20] SD2_DATA2 | SD2_DATA2 |
[AA20] SD2_DATA3 | SD2_DATA3 |
[AA17] SD2_RESET_B | SD2_nRST |
Thanks
Robbi
And while booting from emmc try to detect using lsblk command, but unable to find, displays error above message
Hi @Robbi!
I can boot u-boot without the error message.
The u-boot device tree should be the next:
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc2>;
pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
vmmc-supply = <®_usdhc2_vmmc>;
bus-width = <4>;
non-removable;
status = "okay";
no-sdio;
no-mmc;
};
pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX93_PAD_SD2_CLK__USDHC2_CLK 0x1582
MX93_PAD_SD2_CMD__USDHC2_CMD 0x40001382
MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x40001382
MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x40001382
MX93_PAD_SD2_DATA2__USDHC2_DATA2 0x40001382
MX93_PAD_SD2_DATA3__USDHC2_DATA3 0x40001382
MX93_PAD_SD2_VSELECT__USDHC2_VSELECT 0x51e
>;
};
Result:
U-boot booting without error from SD card
If you want to boot from SD card there is not needed the cd function since the SD should not be disconnected from the board.
Your custom board only has SD boot?
I made the next changes in Linux Kernel device tree and the card detection is working good without CD gpio configured:
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
pinctrl-0 = <&pinctrl_usdhc2>;
pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
pinctrl-3 = <&pinctrl_usdhc2_sleep>;
broken-cd;
fsl,cd-gpio-wakeup-disable;
vmmc-supply = <®_usdhc2_vmmc>;
bus-width = <4>;
status = "okay";
no-sdio;
no-mmc;
};
pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX91_PAD_SD2_CLK__USDHC2_CLK 0x1582
MX91_PAD_SD2_CMD__USDHC2_CMD 0x1382
MX91_PAD_SD2_DATA0__USDHC2_DATA0 0x1382
MX91_PAD_SD2_DATA1__USDHC2_DATA1 0x1382
MX91_PAD_SD2_DATA2__USDHC2_DATA2 0x1382
MX91_PAD_SD2_DATA3__USDHC2_DATA3 0x1382
MX91_PAD_SD2_VSELECT__USDHC2_VSELECT 0x51e
>;
};
pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
fsl,pins = <
MX91_PAD_SD2_CLK__USDHC2_CLK 0x158e
MX91_PAD_SD2_CMD__USDHC2_CMD 0x138e
MX91_PAD_SD2_DATA0__USDHC2_DATA0 0x138e
MX91_PAD_SD2_DATA1__USDHC2_DATA1 0x138e
MX91_PAD_SD2_DATA2__USDHC2_DATA2 0x138e
MX91_PAD_SD2_DATA3__USDHC2_DATA3 0x138e
MX91_PAD_SD2_VSELECT__USDHC2_VSELECT 0x51e
>;
};
pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
fsl,pins = <
MX91_PAD_SD2_CLK__USDHC2_CLK 0x15fe
MX91_PAD_SD2_CMD__USDHC2_CMD 0x13fe
MX91_PAD_SD2_DATA0__USDHC2_DATA0 0x13fe
MX91_PAD_SD2_DATA1__USDHC2_DATA1 0x13fe
MX91_PAD_SD2_DATA2__USDHC2_DATA2 0x13fe
MX91_PAD_SD2_DATA3__USDHC2_DATA3 0x13fe
MX91_PAD_SD2_VSELECT__USDHC2_VSELECT 0x51e
>;
};
pinctrl_usdhc2_sleep: usdhc2grpsleep {
fsl,pins = <
MX91_PAD_SD2_CLK__GPIO3_IO1 0x51e
MX91_PAD_SD2_CMD__GPIO3_IO2 0x51e
MX91_PAD_SD2_DATA0__GPIO3_IO3 0x51e
MX91_PAD_SD2_DATA1__GPIO3_IO4 0x51e
MX91_PAD_SD2_DATA2__GPIO3_IO5 0x51e
MX91_PAD_SD2_DATA3__GPIO3_IO6 0x51e
MX91_PAD_SD2_VSELECT__GPIO3_IO19 0x51e
>;
};
Result:
Booting from MMC the SD cards are detected and mounted in the system without errors
Best Regards!
Chavira