Error initializing sd card on TX2 NX custom carrier (mmc1: error -22)

“non-removable” will make the driver ignore the cd-gpios, so hotplug will have no effect.

Hi @WayneWWW

We ended up with this dts:
tegra186-p3636-0001-p3509-0000-a01.dts (233.5 KB)

Something different is happening now though. SD Card is not recognized at all when we boot with it inserted. When we remove nothing happens but when we insert the sd card again, dmesg shows mmc1: Disabling vmmc regulator (so every instance of this line in the following dmesg.txt, happened only when we inserted the card).

dmesg(1).txt (61.8 KB)

I am not quite sure what you are doing.

If I didn’t ask you to remove something, then why do you want to remove it?

For example, I didn’t ask you to remove vmmc always on , why did you remove that? Your hardware tells it is a always-on vmmc supply. Then you need to add it.

And it is “cd-inverted”. Not “cd-invert”…

Hi,

You are right, sorry. My colleague was doing some hardware fixes yesterday and then we were trying some things out and ended up taking some things out and didn’t set it was it was before.

We won’t touch it anymore without you saying.

Here’s the dts with the nvidia,vmmc-always-on; and cd-inverted properly spelled.
tegra186-p3636-0001-p3509-0000-a01.dts (233.6 KB)

dmesg:
dmesg.txt (64.5 KB)

We can’t see the SD card at akk with this current setup.

Thank you for your patience with us.

If the mmc is totally gone then probably

  1. Your power supply is gone.

  2. The cd gpio is not correctly confiugre at all.

I think you can just compare the dts file you shared yesterday with current one. If sdhci@3440000 are same, then then the issue is something else.

I compared it with the previous one that I had and found out that by adding the /delete-property/ non-removable;, which you had suggested here:

I can’t see the sdcard anymore.

So, when it is like this:

	sdhci@3440000 {
        status = "okay";
        cd-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(X, 4) GPIO_ACTIVE_HIGH>;
        nvidia,sd-device;
		nvidia,vmmc-always-on;
		nvidia,vqmmc-always-on;
        vmmc-supply = <&spmic_sd3>;
        mmc-ocr-mask = <3>;
        sd-uhs-sdr104;
        sd-uhs-sdr50;
        sd-uhs-sdr25;
        sd-uhs-sdr12;
        cd-inverted;

		mmc-ddr-1_8v;
		mmc-hs200-1_8v;

        /delete-property/ non-removable;
    };

I can’t see the sd card.
It’s only when I comment out the /delete-property/ non-removable; that I’m able to see it again.

Are you sure GPIO X,4 is the one that you are using for hotplug?

Hi @WayneWWW, I want to add some more information here.

When we remove the nvidia,vmmc-always-on; line, we can get a dmesg message saying that the vmmc regulator has been disabled when we plug in the SD Card.

Looking at /sys/kernel/debug/gpio, we can also see the cd line configured in gpio-478 (which corresponds to GPIO 08, the line we are using for the cd connection). Looking at the status of this like, it is HIGH when the card is inserted and LOW when the card is not inserted. To me this would seem like an active high signal, however, the SD Card is clearly working the other way around, as we can see from the regulator getting disabled when we insert the card. With the nvidia,vmmc-always-on; property, we don’t see the dmesg line about the regulator getting disabled, but the SD Card hot plug doesn’t work either.

To try to solve for this, both me and my colleague have tried using GPIO_ACTIVE_LOW, cd-inverted;and both simultaneously, with no effect.

Hi

Have you tried to use “either” GPIO_ACTIVE_LOW or “cd-inverted” case? or you only try the simultaneous case?

Hi @WayneWWW.

We hadn’t tried either of them exclusively, only both simultaneously.
Turns out the following configuration works and allows to hotplug the sdcard.

	sdhci@3440000 {
        status = "okay";
        cd-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(X, 4) GPIO_ACTIVE_LOW>;
        nvidia,sd-device;
		nvidia,vmmc-always-on;
		nvidia,vqmmc-always-on;
        vmmc-supply = <&spmic_sd3>;
        mmc-ocr-mask = <3>;
        sd-uhs-sdr104;
        sd-uhs-sdr50;
        sd-uhs-sdr25;
        sd-uhs-sdr12;

		mmc-ddr-1_8v;
		mmc-hs200-1_8v;

        /delete-property/ non-removable;
    };

Thank you very much for your help and patience.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.