How to modify device tree for sd card vdd gpio in tx2 nx?

Thanks for this forums, I had already make sd card working properly on my custom carrier board with Nano.

But when come to the tx2 nx, I don’t know how to write a regualtor, assign it to the vmmc-supply to replace spmic_sd3. This is totally beyond my knowledge.

So could you teach me which files to be modified and how ? Thanks!

SDCARD_VDD_EN is from GPIO05, which is gpio L,0 if it is correct.

cd gpio and other settings are ok, because I short VDD_3V3_SYS to sd vdd and make vmmc-supply to spmic_sd3, sd card can work properly.

Below is what I tried but not working:
add vmmc-supply = <&p3509_sdmmc_vdd>; in sdmmc3: sdhci@3440000 section.
add below in tegra186-p3509-0000-a00-fixed-regulator.dtsi:

		p3509_sdmmc_vdd: regulator@114 {
			compatible = "regulator-fixed";
			reg = <114>;
			regulator-name = "sdmmc_vdd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(L, 0) 0>;
			enable-active-high;
		};

hello cfpl,

since it’s a custom carrier board,
please access Jetson TX2 NX Product Design Guide and check [Figure 9-1. SD Card Connection Example] for reference,
thanks

Hi Jerry, thanks for the DG reference. And my board is doing exactly as the reference suggests, using gpio to enable sd card power supply. I just don’t know how to do the software side, specificly how to modify device tree file to let gpio as a regulator to enable power supply to sd.

hello cfpl,

please check device tree sources for the regulators {...}, and fixed-regulators {...} property.

you should have regulator-name and its GPIO pin, gpio = <...> defined.
for example,
here’s definition to assign a GPIO pin as 2.8v regulator,

		en_vdd_cam_hv_2v8: regulator@11 {
			compatible = "regulator-fixed-sync";
			reg = <11>;
			regulator-name = "en-vdd-cam-hv-2v8";
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			gpio = <&gpio_i2c_0_74 13 1>;
			enable-active-high;
		};

and…
it’s being used by camera sensor drivers as vana-supply.

	i2c@3180000 {
		ov5693_c@36 {
                        ...
			vana-supply = <&en_vdd_cam_hv_2v8>;
1 Like

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