SD card issue in Jetson TX2 NX


I am trying to make an external sd card working on Jetson TX2 NX with custom carrier board.On hot plugging, it is throwing below error

mmc1: Disabling vmmc regulator

GPIO05 is used as sd card enable pin and GPIO08 is used as sd card detect pin .Following are the changes made in the lanai/kernel-dts/common/tegra186-p3636-0001-common.dtsi

sdhci@3440000 {
status = “okay”;
cd-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(X, 4) GPIO_ACTIVE_LOW>;
/delete-property/ non-removable;
/delete-property/ force-non-removable-rescan;
vmmc-supply = <&spmic_sd3>;
mmc-ocr-mask = <3>;

GPIO05 is enabled and GPIO08 is set as GPIO pin using pinmux table.

What would be the reason for the above error?
Please help me in resolving this issue

Thanks in advance.

That is not an error. That log appears when the system notices that driver is not powering up.

You need to clarify your design first so that we can help you.

For example, what are these two gpios doing here? One for card detection and another one for the VDD?

If so, did you write a regulator that has this gpio to control the power and assign it to vmmc-supply?

spmic_sd3 is a default regulator in the default device tree. It does not know that you have a gpio there to control the VDD. is for card detection and another one is for the VDD.SD card is getting power.That part is checked.but on hot plug still showing mmc1: Disabling vmmc regulator.Anything needs to be done?

This property is for the sdcard power.

vmmc-supply = <&spmic_sd3>;

And I don’t think the default “spmic_sd3” would know your hardware design… That is what you need to modify.

Okay.If that is the case could you please tell me what should I add in device tree file.GPIO05 is the enable pin.

You can google search what is regulator framework in linux kernel and how to configure it.

After you write a regualtor, assign it to the vmmc-supply to replace spmic_sd3.

Okay .Let me check