Hi all,
I have designed a custom carrier board for Jetson Xavier NX (production version) with external SD card supported.
I modify dtbs file to enable smmc3:
sdmmc3: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
// cd-inverted; // our cd-pin not inverted
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) 1>;
nvidia,cd-wakeup-capable;
nvidia,vmmc-always-on;
mmc-ocr-mask = <0>;
// cd-inverted;
vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
status = “okay”;
};
When i insert the SD card, my Jetson freeze and reboot after servaral seconds. After, the Jetson can not boot successful until i reject the SD card.
Please help me to check dmes file and give me some advise.
dmes.txt (14.8 KB)
Please dump the log from uart.
karoot
May 17, 2021, 10:26am
3
Hi Wayne,
dmes.txt (14.8 KB)
this file was output from console port when i insert the SD card.
How can i dump the log file as you expect?
Hi,
Sorry, my fault. Your log is already from the uart. Could you also dump the full dmesg?
The problem is generally we don’t see cpu error when sdcard is inserted. No other users who enable sdmmc3 sdcard slot have this problem.
I think it is either due to the vmmc-supply or the cd-gpios. Are you using TEGRA194_MAIN_GPIO(G, 2) on your board for vmmc-supply?
Hi Wayne,
Pls check the log file.
dmes.txt (278.8 KB)
Here is my dtsi for sdmmc3:
/** adding external SD card **/
sdmmc3: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
// cd-inverted;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) 1>;
nvidia,cd-wakeup-capable;
nvidia,vmmc-always-on;
mmc-ocr-mask = <0>;
// cd-inverted;
vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
status = “okay”;
};
I don’t use TEGRA194_MAIN_GPIO(G, 2) for vmmc-supply, i use directly 3.3V and my cd-gpio is not inverted, so i comment cd-inverted.
Then please set your vmmc-supply to battery_reg. p3668_vdd_sdmmc1_sw is using GPIO(G,2). And does not match your board design.
Hi Wayne,
I changed vmmc-supply tp battery_reg.
sdmmc3: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
// cd-inverted;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) 1>;
nvidia,cd-wakeup-capable;
nvidia,vmmc-always-on;
mmc-ocr-mask = <0>;
// cd-inverted;
// vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
vmmc-supply = <&battery_reg>;
status = "okay";
};
But my Jetson still freeze and reboot after that. It can not complete boot until i reject the SD card.
Here is log
dmes.txt (64.5 KB)
My cd-gpio is active-high design, so i use tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1)
But the “1” in your second field of cd-gpios means active low.
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) 1 >;
This is the definition from kerenl.
define GPIO_ACTIVE_HIGH 0
define GPIO_ACTIVE_LOW 1
karoot
May 18, 2021, 4:23am
12
Hi Wayne,
I changed
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) GPIO_ACTIVE_HIGH>;
When i insert SD card, my Jetson looks like not detect SD card and no reboot anymore.
In dmesg, i see an error sdhci-tegra 3440000.sdhci: could not set regulator OCR (-22)
dmesg.txt (68.8 KB)
My hardware design for you ref
Could you concert your dtb back to dts and share it here? What you’ve shared is not the full dts.
karoot
May 18, 2021, 5:07am
14
Hi Wayne,
dtc -I dtb -O dts -o extracted.dts /boot/tegra194-p3668-all-p3509-0000.dtb
extracted.dts (238.0 KB)
Hi,
Sorry, my fault again. For the OCR issue, it is because we feed a regulator that is 5V. Though battery_reg is a dummy regulator, it is still labeled as 5V.
Thus, please pick up one dummy regulator that has 3v3.
For example, hdr40_vdd_3v3: p3509_vdd_3v3_cvb.
karoot
May 18, 2021, 8:35am
16
Hi Wayne,
I changed vmmc-supply to hdr40_vdd_3v3
sdmmc3: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
// cd-inverted;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) GPIO_ACTIVE_HIGH>;
nvidia,cd-wakeup-capable;
nvidia,vmmc-always-on;
mmc-ocr-mask = <0>;
// cd-inverted;
// vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
vmmc-supply = <&hdr401_vdd_3v3>;
status = “okay”;
};
Now my Jetson looks like not detect SD card plugin
dmesg.txt (64.1 KB)
I have probed the cd-gpio by VOM, when no SD card, it is 0V and when SD card pluged, it is 3.3V, but no output from debug port.
One more thing here. Your dts still has one cd-inverted under sdhci@3440000.
clock-names = "sdmmc", "pll_p", "sdmmc_legacy_tm";
iommus = <0x11 0x18>;
nvidia,en-periodic-calib;
mmc-ocr-mask = <0x3>;
nvidia,vmmc-always-on;
cd-inverted;
cd-gpios = <0x16 0x9c 0x0>;
status = "okay";
vqmmc-supply = <0x17>;
vmmc-supply = <0x13>;
linux,phandle = <0xc1>;
phandle = <0xc1>;
karoot
May 18, 2021, 8:58am
18
Hi Wayne,
I can not find cd-inverted; in my dts.
Pls check my dts here
extracted.dts (238.0 KB)
Oh, ok. Sorry that I have 20 files all named extracted.dts in my directory.
Are you sure your board design is really a active-high one? I guess if you change it back to active-low and insert the card, you will see the tuning start.
karoot
May 19, 2021, 2:30am
20
Hi Wayne
I try to change cd-gpio to another pin but nothing change.
sdmmc3: sdhci@3440000 {
mmc-ocr-mask = <0x0>;
cd-inverted;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) GPIO_ACTIVE_HIGH>;
// cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
nvidia,cd-wakeup-capable;
nvidia,vmmc-always-on;
mmc-ocr-mask = <0>;
cd-inverted;
// vmmc-supply = <&p3668_vdd_sdmmc1_sw>;
vmmc-supply = <&p3509_vdd_3v3_cvb>;
status = “okay”;
};
My cd-gpio pin logic signal:
sd card insterted: 3.3V
no sd card: 0V
When i set “wrong cd-gpio”, my Jetson can not detect SD card and boot normally
But when i correct the cd-gpio pin setup, the SD card was detected and my Jetson can not boot.
So i think the problem come from my dts setup or anything else.
Pls see the dmesg and dts below
duong_extracted.dts (238.0 KB)
duong_dmesg_no_sdcard.txt (64.1 KB)
duong_dmesg_boot_with_sdcard.txt (63.6 KB)