SD card on sdmmc3 is not working

Hi team,

We are using sdmmc3 on the carrier board, but we cannot see this device,
Some similar problems were found from forums, but none of them can solve the problem of not being able to catch SDCard.
How can we use the SDcard on sdmmc3?

Here are the dmesg logs:

anycon@tegra-ubuntu:~$ dmesg | grep sd
[ 0.000000] Kernel command line: console=ttyTCU0,115200 video=tegrafb no_console_suspend=1 earlycon=tegra_comb_uart,mmio32,0x0c168000 gpt ug
[ 0.738390] iommu: Adding device 3460000.sdhci to group 6
[ 0.739015] iommu: Adding device 3440000.sdhci to group 7
[ 0.802869] GPIO line 266 (vcc-ssd-en) hogged as output/high
[ 0.818006] vdd-sdmmc3-sw: 3300 mV
[ 0.818380] vdd-1v8-sd: 1800 mV
[ 0.977556] vddio-sdmmc1-3v3: at 3300 mV
[ 4.321178] sd: No Scsi addr parsed to reserve index
[ 5.362853] sdhci: Secure Digital Host Controller Interface driver
[ 5.368269] sdhci: Copyright© Pierre Ossman
[ 5.372715] sdhci-pltfm: SDHCI platform and OF driver helper
[ 5.379429] sdhci-tegra 3460000.sdhci: Client registration for eMC Successful
[ 5.390585] sdhci-tegra 3440000.sdhci: Got CD GPIO
[ 5.397499] sdhci-tegra 3440000.sdhci: Client registration for eMC Successful
[ 5.403996] sdhci-tegra 3440000.sdhci: wakeup init done, cdirq 321
[ 5.435798] mmc0: SDHCI controller on 3460000.sdhci [3460000.sdhci] using ADMA 64-bit with 64 bit addr
[ 5.455842] mmc1: SDHCI controller on 3440000.sdhci [3440000.sdhci] using ADMA 64-bit with 64 bit addr
[ 5.477595] mmc0: mmc_decode_ext_csd: CMDQ supported: depth: 31, cmdq_support: 1
[ 7.044345] vdd-sdmmc3-sw: disabling
[ 7.044451] vdd-1v8-sd: disabling
[ 7.325166] cgroup: cgroup2: unknown option “nsdelegate”
[ 7.389648] systemd-sysv-generator[2203]: Native unit for gpsd.service already exists, skipping.
dts_changes_for_sd.txt (2.3 KB)

We have done the attached changes in dtsi for the same.

please share the full dmesg as an attachment. No need to grep it.

The patch here should be sufficient for sdmmc3.

Hi Wayne.

PFA complete dmesg logs. We have also verified the dtsi entries.
tegra194-fixed-regulator-p3668.dtsi
sdhci_sd: sdhci@3440000 {complete_dmesg_logs.txt (78.8 KB)
mmc-ocr-mask = <0x0>;
cd-inverted;
cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 2) 0>;
nvidia,cd-wakeup-capable;
mmc-ocr-mask = <0>;
cd-inverted;
vmmc-supply = <&p3668_vdd_sdmmc3_sw>;
nvidia,vmmc-always-on;
status = “okay”;
};
tegra194-fixed-regulator-p3668.dtsi
p3668_vdd_sdmmc3_sw: regulator@106 {
compatible = “regulator-fixed”;
reg = <106>;
regulator-name = “vdd-sdmmc3-sw”;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
// gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 2) 0>;
enable-active-high;
};

Are you sure your sdmmc controller is set to “okay”? You can check it from /proc/device-tree.

Hi Wayne,

We have verified this.
cat /proc/device-tree/sdhci@3440000
Okay

and do you see other nodes have correct setting as your change?

Hi Wayne,

I think so, other changes are also getting reflected. I am attaching the tegra194-p3668-all-p3509-0000.dtb.txt (192.9 KB) dtb file here for your reference.

Hi,

Then why there is no cd-gpios under sdhci@3440000 in your dtb?

Apologies. I attached the wrong file mistakenly.
This is the correct dtb file.tegra194-p3668-all-p3509-0000.dtb.txt (194.7 KB)

Looks good to me. It is probably a board design issue.

Okay Wayne,

We will probe the signals again and let you know if we find anything.

The card enumeration is even not starting. If you hotplug the card and dmesg does not show anything new, then please check the signals from cd gpios or your vmmc-supply.

Hi Wayne,

  1. We have verified the power supply of SD card (1.8 V) is coming. Please confirm that it can be 1.8V or we must supply 3.3V to it.

  2. We have verified the card-detect gpio. We have also vallidated this gpio by exporting it and toggling its value.

  3. We are not getting any clock on SD-card inserstion.

The load switch to SD slot should be 3.3v.