SD-MMC (mmc1) on production module

Hello,
I’m trying to get the mmc1 device working on my custom carrier board.
I followed some advices found on the forum, trying to get things working correctly.
I double checked everything. The card-presence switch is working correctly, from what I’ve seen.
But I get errors on SD insertion (and mmc1 device is not showing):
[ 26.915470] mmc1: CMD CRC or end bit error, int mask 0xc0001
[ 26.921803] mmc1: CMD CRC or end bit error, int mask 0x40001
[ 26.928027] mmc1: CMD CRC or end bit error, int mask 0x40001
[ 26.935588] mmc1: CMD CRC or end bit error, int mask 0x40001
[ 26.943071] mmc1: CMD CRC or end bit error, int mask 0x40001
[ 26.949430] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 26.955712] mmc1: CMD CRC or end bit error, int mask 0xc0001
[ 26.962003] mmc1: CMD CRC or end bit error, int mask 0xc0001
[ 26.969180] mmc1: CMD CRC or end bit error, int mask 0xc0001
[ 26.976870] mmc1: CMD CRC or end bit error, int mask 0x40001
[ 28.088054] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 28.095017] mmc1: CMD CRC or end bit error, int mask 0x40000
[ 28.101920] mmc1: CMD CRC or end bit error, int mask 0x40000
[ 28.109502] mmc1: CMD CRC or end bit error, int mask 0x40000
[ 28.116552] mmc1: CMD CRC or end bit error, int mask 0x40000
[ 28.124103] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 28.131167] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 28.138149] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 28.145125] mmc1: CMD CRC or end bit error, int mask 0xc0000
[ 28.152178] mmc1: CMD CRC or end bit error, int mask 0x40000

I’m attaching the entire dmesg to the topic, along with the extracted dts…
extracted.dts (263.2 KB) dmesg.txt (50.0 KB)

What did I do wrong ? :/

Please refer to this post.

After applying the aforementioned patches… I end up with the following results:

  • Whether I boot with the SD card in, or I boot and then hotplug it, it does not create the mmcblk device…
  • The sdhci-tegra driver seems to have triggered some events though, so I’m really not sure what’s happening here

Also, the GPIO_CD is correct (according to the schematics), and the SDMMC_VDD_EN is also set to the correct GPIO.

Just to be thorough, I’ve attached to this message the two dmesg log (hotplug and boot-with-sd logs) as well as the complete extracted DTS…

I believe the DTS to be faulty, but how ?
already_in.log (46.4 KB)
extracted.dts (260.5 KB)
hotplug.log (46.5 KB)

What gpio is your sdmmc_vdd_en? I see the vmmc-supply is 0x47 and many peripherals are also using this power source.

Are you sure it is matching your board design?

SDMMC_VDD_EN is on GPIO09…
Therefore I modified the DTS accordingly:

	sdhci@700b0400 {
		status = "okay";
 		/delete-property/ keep-power-in-suspend;
 		/delete-property/ non-removable;
		// TO GPIO08 (phy pin 208)
		cd-gpios = <&gpio TEGRA_GPIO(Z, 2) 0>;
		nvidia,voltage-switch-gpio = <&gpio TEGRA_GPIO(BB, 0) 0>;
		mmc-ddr-1_8v;
		mmc-ocr-mask = <3>;
		uhs-mask = <0x0>;
		nvidia,vmmc-always-on;
		tap-delay = <3>;
	};

schem0

Yes, the problem is I am not sure why your write nvidia,voltage-switch-gpio. This is not what we are using.

You should write a regulator and assign your TEGRA_GPIO(BB, 0) to the regualtor. Then, assign this regulator to the vmmc-supply.

And since you are using gpio to control the power, you need to remove vmmc-always-on now since it is not always-on.

You should write a regulator and assign your TEGRA_GPIO(BB, 0) to the regualtor. Then, assign this regulator to the vmmc-supply.

I’m not sure about how to do this, actually…
Should I modify this ? :

		p3448_vdd_3v3_sd: regulator@3 {
			compatible = "regulator-fixed-sync";
			reg = <3>;
			regulator-name = "vdd-3v3-sd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			gpio = <&gpio TEGRA_GPIO(Z, 3) 0>;
			enable-active-high;
			regulator-boot-on;
			vin-supply = <&p3448_vdd_3v3_sys>;
		};

It’s from ./porg-platforms/tegra210-porg-fixed-p3448-0000-a00.dtsi

Yes, write similar thing like this and feed it to your vmmc-supply. The document of how to write regulator could be found in

kernel/kernel-4.9/Documentation/devicetree/bindings/regulator/regulator.txt

Hum… Okay. I made the changes. One question though, should I change the vqmmc-supply also ? As I understand, it should be using 1.8v for high-speed operation.

Anyway, still no concrete results. The measured voltage on VCC pin is 3.3 regardless of the SD-card presence, so I also suspect that the detection process is faulty. It doesn’t matter really, as the SD-card is not meant to be removed for my application.

Not sure where to go from here… I’m attaching logs and subsequent DTS to this post.
already_in2.log (48.8 KB)
extracted2.dts (260.8 KB)
hotplug2.log (48.2 KB)

Could you also share the schematic of sd part?

So the SDMMC_VDD_EN here is to TEGRA_GPIO(BB, 0)?

Yes, indeed.

It looks like the pinmux setting for TEGRA_GPIO(BB, 0) by default is input. Should set it to output.

hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0002-b00.dtsi

	gpio_default: default {
		gpio-input = <
			TEGRA_GPIO(BB, 0)
			TEGRA_GPIO(B, 4)
			TEGRA_GPIO(B, 5)

Okay… Same result.
I don’t get it, really.
already_in3.log (48.2 KB)
extracted3.dts (260.8 KB)
hotplug3.log (47.8 KB)

Hi,

For the “hotplug3” case, could you check the polarity of cd-gpios?

There is totally no hint of sd detection in hotplug case.

Also, I am not sure why your dts is a little out-of order and many of properties are gone.

For example, below properties are all needed. And they should be inside the default device tree.

 sd-uhs-sdr104;
 sd-uhs-sdr50;
 sd-uhs-sdr25;
 sd-uhs-sdr12;
 mmc-ddr-1_8v;
 mmc-hs200-1_8v;
 no-sdio;
 no-mmc;

I am more curious about how do you compile your device tree and cause so many properties are gone?

Okay,
After soldering a wire to the CD (PT28 on the schematics)… Before SD-card insertion, level is 1.8v.
On insertion, it goes down to 0v

Indeed. Those properties were meant to be added through an overlay somewhere else in the dts. I didn’t notice they were ignored. I’m making sure they’re correctly added to the sdhci2, recompile and give you the result !
Nicely spotted ! Thank you…

Just to inform that there is just another thread using jetson nano and extra sdcard slot. This was resolved just 20 mins ago.

Looks like you can even assign always on regulator to vmmc-supply with gpio control on it. It worth trying.