Micro-SD card on custom jetson nano

The number after “@” is just the register address in the jetson nano and it is following the order of your hardware pin.

For example,
SDMMC3 is mapping to sdhci@700b0400
SDMMC4 Is mapping to sdhci@700b0600.

These two are not affecting each other. SDMMC4 has other device (emmc) running on it. Thus, do not change anything on it unless you want the board fails to boot.

For your current case, I guess it is a hardware problem rather than a software one…

The regulator goes into disabled state because no driver needs to use that, so it goes power saving…
Which means your sdmmc3 pin may be not powered on at all…

Ok, thanks for the explanation. We will check the hardware.

Hi,

There is one thing that seems no change. Your “SD_VDD_EN” is connected to GPIO9.

But the GPIO in vdd-3v3-sd is GPIO Z,4 by default. If you don’t change it, then it is also wrong. Thus, please change it to gpio9 (pin BB0).

Hi,

I added the gpio in vdd-3v3-sd, in /hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-fixed-p3448-0000-a00.dtsi

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>;
			gpio = <&gpio TEGRA_GPIO(BB, 0) 0>;
			enable-active-high;
			regulator-boot-on;
			vin-supply = <&p3448_vdd_3v3_sys>;
		};

And still not working.

dmesg.txt (79.7 KB)

tegra210-p.dts (327.1 KB)

Did you remember to configure the pinmux of your gpio? Especially the cd-gpio and the gpio9 for your power control.

How do I configure the pinmux? Is it in /hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0002-b00.dtsi?

If there, gpio9 and power control are set in gpio_default: default { gpio-input = <

Yes, set it in device tree but it should be output.

Both in gpio-output-high? There is also gpio-output-low.

Actually, I am only talking about the TEGRA_GPIO(BB, 0) here. The cd-gpio is fine if it has level changed when you insert the sdcard.
There is no need to set high or low. Just let the driver to handle it. What we should prevent is that gpio in “input” state.

Looks like it was a hardware issue after all. I am going to collect all the changes I’ve made to mark it as the solution.

Thank you for all the help.

Is your issue resolved?

Yes.

Ok, please share what you have changed in both software and hardware.

Set status as “okay” in /hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi

sdhci@700b0400 {
		mmc-ocr-mask = <0>;
		default-drv-type = <1>;
		uhs-mask = <0x1c>;
		power-off-rail;
		nvidia,update-pinctrl-settings;
		status = "okay";
	};

Set status as “okay”, add " nvidia,vmmc-always-on;", the correct cd-gpio and others properties in both files (I made the changes in both files but I think it’s enough changing just the dts):

hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0002-p3449-0000-b00.dts

sdhci@700b0400 {
		status = "okay";
		cd-gpios = <&gpio TEGRA_GPIO(V, 0) 0>;
		nvidia,vmmc-always-on;
		vmmc-supply = <&p3448_vdd_3v3_sd>;
		/delete-property/ keep-power-in-suspend;
		/delete-property/ non-removable;
		mmc-ocr-mask = <3>;
		uhs-mask = <0x0>;
		tap-delay = <3>;
		sd-uhs-sdr104;
		sd-uhs-sdr50;
		sd-uhs-sdr25;
		sd-uhs-sdr12;
		mmc-ddr-1_8v;
		mmc-hs200-1_8v;
		no-sdio;
		no-mmc;
	};

/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi

override@1 {
 				target = <&sdhci2>;
 				_overlay_ {
-					vmmc-supply = <&max77620_ldo6>;
+					status = "okay";
+					vqmmc-supply = <&max77620_ldo6>;
 					no-sdio;
 					no-mmc;
 					sd-uhs-sdr104;

I changed the gpio in vdd-3v3-sd, in /hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-fixed-p3448-0000-a00.dtsi

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>;
			gpio = <&gpio TEGRA_GPIO(BB, 0) 0>;
			enable-active-high;
			regulator-boot-on;
			vin-supply = <&p3448_vdd_3v3_sys>;
		};

And the hardware problem was that a resistor was missing.

1 Like

Hi @mjnm

I think you can just paste your last dtb. There is no need to share separate files.

Ok, the last dtb:

sdhci@700b0400 {
		compatible = "nvidia,tegra210-sdhci";
		reg = <0x0 0x700b0400 0x0 0x200>;
		interrupts = <0x0 0x13 0x4>;
		aux-device-name = "sdhci-tegra.2";
		iommus = <0x30 0x1b>;
		nvidia,runtime-pm-type = <0x0>;
		clocks = <0x26 0x45 0x26 0xf3 0x26 0x136 0x26 0xc1>;
		clock-names = "sdmmc", "pll_p", "pll_c4_out2", "sdmmc_legacy_tm";
		resets = <0x26 0x45>;
		reset-names = "sdhci";
		status = "okay";
		tap-delay = <0x3>;
		trim-delay = <0x3>;
		mmc-ocr-mask = <0x3>;
		max-clk-limit = <0xc28cb00>;
		ddr-clk-limit = <0x2dc6c00>;
		bus-width = <0x4>;
		calib-3v3-offsets = <0x7d>;
		calib-1v8-offsets = <0x7b7b>;
		compad-vref-3v3 = <0x7>;
		compad-vref-1v8 = <0x7>;
		pll_source = "pll_p", "pll_c4_out2";
		ignore-pm-notify;
		cap-mmc-highspeed;
		cap-sd-highspeed;
		nvidia,en-io-trim-volt;
		nvidia,en-periodic-calib;
		cd-inverted;
		wp-inverted;
		pwrdet-support;
		nvidia,min-tap-delay = <0x6a>;
		nvidia,max-tap-delay = <0xb9>;
		pinctrl-names = "sdmmc_schmitt_enable", "sdmmc_schmitt_disable", "sdmmc_clk_schmitt_enable", "sdmmc_clk_schmitt_disable", "sdmmc_drv_code", "sdmmc_default_drv_code", "sdmmc_e_33v_enable", "sdmmc_e_33v_disable";
		pinctrl-0 = <0x8d>;
		pinctrl-1 = <0x8e>;
		pinctrl-2 = <0x8f>;
		pinctrl-3 = <0x90>;
		pinctrl-4 = <0x91>;
		pinctrl-5 = <0x92>;
		pinctrl-6 = <0x93>;
		pinctrl-7 = <0x94>;
		vqmmc-supply = <0x3b>;
		vmmc-supply = <0x95>;
		cd-gpios = <0x5b 0xa8 0x0>;
		nvidia,vmmc-always-on;
		uhs-mask = <0x0>;
		sd-uhs-sdr104;
		sd-uhs-sdr50;
		sd-uhs-sdr25;
		sd-uhs-sdr12;
		mmc-ddr-1_8v;
		mmc-hs200-1_8v;
		no-sdio;
		no-mmc;
		linux,phandle = <0xbd>;
		phandle = <0xbd>;

		prod-settings {
			#prod-cells = <0x3>;

			prod_c_ds {
				prod = <0x100 0xff0000 0x10000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x3000007d>;
			};

			prod_c_hs {
				prod = <0x100 0xff0000 0x10000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x3000007d>;
			};

			prod_c_sdr12 {
				prod = <0x100 0xff0000 0x10000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x30007b7b>;
			};

			prod_c_sdr25 {
				prod = <0x100 0xff0000 0x10000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x30007b7b>;
			};

			prod_c_sdr50 {
				prod = <0x100 0xff0000 0x10000 0x1c0 0xe000 0x8000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x30007b7b>;
			};

			prod_c_sdr104 {
				prod = <0x100 0xff0000 0x10000 0x1c0 0xe000 0x4000 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x30007b7b>;
			};

			prod_c_ddr52 {
				prod = <0x100 0x1fff0000 0x0 0x1e0 0xf 0x7 0x1e4 0x30077f7f 0x30007b7b>;
			};

			prod {
				prod = <0x100 0x1fff000e 0x3090028 0x1c0 0x8001fc0 0x8000040 0x1c4 0x77 0x0 0x120 0x20001 0x1 0x128 0x43000000 0x0 0x1f0 0x80000 0x80000>;
			};
		};
	};

tegra210-p.dts (327.1 KB)

2 Likes

Hello,

I am using the jetson production module. I know that a00 is a keyword related to devkit, but if I edit the contents of this file, does it apply to the production module?

Thank you.

You can try it and check your dts…

1 Like

Hello,

If you modify all dtsi files in this article equally and build dtb and make dts, the status of the sdhci@700b0400 item remains disabled.

Thank you.