I’m adapting TX2 NX (Lanai) on a custom carrier-board with Jetpack version 32.5.1.
Problem: I cannot get the card mounted when booting with the card in place (=not hot-plugging it in when system is running)
When hot-plugging, it gets detected and mounted.
Question: where (which file and entry) should I add the reference for the mmc-card’s control gpio, in Lanai’s device-tree sources?
The carrier-board mmc-socket (sdhci@3440000) is verified to be working:
It fully works with minor device-tree modifications on Xavier NX
I can get the card detected and mounted when hot-plugging it also when using Lanai
I have added the corresponding cd-gpios entry to the device-tree and updated the pinmux with the correct pin functions.
I got it fully working with Xavier NX by adding gpio entry to regulator@106 block.
The similar modification (simply adding correct gpio entry to spmic_sd3) did not do the trick on Lanai.
The pins are:
CD: gpio 11 (configured as GPIO EE.02 in pinmux)
Control: gpio 7 (configured as GPIO U.00 in pinmux)
could you please compare the kernel logs between hot-plugging and mounted when booting.
you shall have the same kernel API being called for the fail use-case.
thanks
Ok, thanks for the patch will try it later today. Does this mean, the software does not power-cycle the device correctly normally or is this just a check to verify other configs? Shouldn’t the mmc voltage get controlled by gpio and that resetting the card?
Follow-up:
Can you provide an example, how to add control-gpio to sdhci@3440000? Currently the spmic_sd3 does not include gpios -endpoint, but I have added the corresponding gpio to gpio@c2f0000 and I am able to control the pin voltage by /sys/class/gpio interface. In Xavier NX’s default device tree, there is an obvious place to configure the pin, but such pre-made config does not exist for TX2 NX.
In other words,I mean, how to provide this info:
gpios = <TEGRA_AON_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
to vmmc-supply -entity of sdhci@3440000 (lanai/kernel-dts/common/tegra186-p3636-0001-common.dtsi):
vmmc-supply = <&spmic_sd3>;
so that the mmc-driver gets to control the pin.
I have tried this, in lanai/kernel-dts/common/tegra186-p3636-0001-a00-spmic.dtsi:
spmic_sd3: sd3 {
regulator-name = "vdd-3v3-sys";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on; //Have tried with tese off too
regulator-boot-on; //And this
//Here correct?
//gpios = <TEGRA_AON_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
maxim,active-fps-source = <MAX77620_FPS_SRC_DEF>;
};
may I know what’s your failure rate when booting with the card in place.
please do check the hardware signaling to confirm the waveform works.
since your card fails to be detected, it’s the attach workaround to power cycle the card again.
thanks
please check the mmc driver as below, it’s kernel API to get the regulators. $L4T_Sources/r32.5.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/drivers/mmc/core/core.c
you would like to have mmc driver to control GPIO pin, right?
please use the kernel API, of_get_named_gpio(). to get the GPIO handler.
you should also see below for the APIs to control the pin.
i.e. $L4T_Sources/r32.5.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/linux/gpio.h
thanks
Oh, I thought it already could control the gpio pin (or at least know what pin is wired).
For example for Xavier NX, in the file platform/t19x/jakku/kernel-dts/common/tegra194-fixed-regulator-p3668.dtsi
exists the following segment for mmc-card voltage regulator:
If on custom carrier board, the card is powered by some other pin than gpio G.2, this is obvious place to change to the correct pin. And the card works with that change on Xavier NX.
Could you explain, what is the purpose of gpio entry on certain regulators, if it is not for controlling the voltage on pin?
For example, the following entry on platform/t19x/jakku/kernel-dts/common/tegra194-fixed-regulator-p3668.dtsi:
Use case related to the latter question is using mmc-socket on P3509 carrier board and Xavier NX.
The code snippet above is from the Xavier NX device tree source code, released by Nvidia.
Kernel documentation for fixed-regulator says: Optional properties: - gpio: gpio to use for enable control
So, the gpio is used for controlling the regulator’s voltage, right?
BTW,
it’s Xavier NX to use t19x series.
you should check below sources if you’re referring to device tree for TX2 NX platforms.
i.e. $L4T_Sources/r32.5.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t18x/lanai/kernel-dts/common/tegra186-p3636-0001-a00-power-tree.dtsi
Yes I know what GPIO means and that the mentioned snippet is for t19x, which is different from t18x.
This does not answer the question:
The purpose of the mentioned gpio entry can be understood two ways: Does the pin control the regulator on/off, or does the regulator control the pin state?
This is the situation:
The custom carrier board, with Xavier NX module in place, and the gpio configured correctly(*
→ card works fine also when booting.
The custom carrier board, with Xavier NX module in place, and the gpio configured incorrectly
→ card does not detect on boot but works when hot-plugged.
The same custom carrier board, with Lanai module in place
→ card does not detect on boot but works when hot-plugged. (notice the similarity with the second scenario?)
(and yes, I also know the flashing commands and and device trees are different for Xavier and Lanai)
I’m trying to ask, do I need to provide a similar gpio entry to Lanai’s regulators. And if it’s not needed for Lanai, why it’s needed for Xavier NX then? (“They are different devices” is not answering the question)
*) by “gpio configured correctly”, I mean that the p3668_vdd_sdmmc1_sw has a gpio entry that points to the pin whose state enables/disables the voltage to external mmc-socket.