SD Card not detected

Hi WayneWWW,

I’ve attached power sequence.

Hi Karis,

Thanks for sharing. Please also add below patch to the kernel driver and then try to reproduce this the error again (which causes system hang).

This patch would enable more register values for us to debug.

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index f2e6ed3..261220e 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -403,7 +403,7 @@
 	u32 trim_delay;
 	u8 i;
 
-	pr_debug("======= %s: Tuning windows =======\n",
+	pr_err("======= %s: Tuning windows =======\n",
 				mmc_hostname(host->mmc));
 	reg = sdhci_readl(host, SDHCI_VNDR_TUN_CTRL0_0);
 	for (i = 0; i <= TUNING_WORD_SEL_MASK; i++) {
@@ -411,7 +411,7 @@
 		reg |= i;
 		sdhci_writel(host, reg, SDHCI_VNDR_TUN_CTRL0_0);
 		tuning_status = sdhci_readl(host, SDHCI_TEGRA_VNDR_TUNING_STATUS0);
-		pr_debug("%s: tuning window[%d]: %#x\n",
+		pr_err("%s: tuning window[%d]: %#x\n",
 			mmc_hostname(host->mmc), i, tuning_status);
 	}
 	reg = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -419,35 +419,35 @@
 	tap_delay &= SDHCI_CLOCK_CTRL_TAP_MASK;
 	trim_delay = reg >> SDHCI_CLOCK_CTRL_TRIM_SHIFT;
 	trim_delay &= SDHCI_CLOCK_CTRL_TRIM_MASK;
-	pr_debug("sdhci: Tap value: %u | Trim value: %u\n", tap_delay,
+	pr_err("sdhci: Tap value: %u | Trim value: %u\n", tap_delay,
 			trim_delay);
-	pr_debug("==================================\n");
+	pr_err("==================================\n");
 
-	pr_debug("Vendor clock ctrl: %#x\n",
+	pr_err("Vendor clock ctrl: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL));
-	pr_debug("Vendor SysSW ctrl: %#x\n",
+	pr_err("Vendor SysSW ctrl: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL));
-	pr_debug("Vendor Err interrupt status : %#x\n",
+	pr_err("Vendor Err interrupt status : %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_ERR_INTR_STATUS));
-	pr_debug("Vendor Cap overrides: %#x\n",
+	pr_err("Vendor Cap overrides: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_CAP_OVERRIDES));
-	pr_debug("Vendor Misc ctrl: %#x\n",
+	pr_err("Vendor Misc ctrl: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL));
-	pr_debug("Vendor Misc ctrl_1: %#x\n",
+	pr_err("Vendor Misc ctrl_1: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL_1));
-	pr_debug("Vendor Misc ctrl_2: %#x\n",
+	pr_err("Vendor Misc ctrl_2: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL_2));
-	pr_debug("Vendor IO trim ctrl: %#x\n",
+	pr_err("Vendor IO trim ctrl: %#x\n",
 		sdhci_readl(host, SDMMC_VNDR_IO_TRIM_CTRL_0));
-	pr_debug("Vendor Tuning ctrl: %#x\n",
+	pr_err("Vendor Tuning ctrl: %#x\n",
 		sdhci_readl(host, SDHCI_VNDR_TUN_CTRL0_0));
-	pr_debug("SDMEM comp padctrl: %#x\n",
+	pr_err("SDMEM comp padctrl: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_SDMEM_COMP_PADCTRL));
-	pr_debug("Autocal config: %#x\n",
+	pr_err("Autocal config: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_AUTO_CAL_CONFIG));
-	pr_debug("Autocal status: %#x\n",
+	pr_err("Autocal status: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_AUTO_CAL_STATUS));
-	pr_debug("Tuning Status1: %#x\n",
+	pr_err("Tuning Status1: %#x\n",
 		sdhci_readl(host, SDHCI_TEGRA_VNDR_TUNING_STATUS1));
 }
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e355775..0c3bfed 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2772,6 +2772,7 @@
 		else {
 			pr_err("%s: CMD CRC or end bit error, int mask %#x\n",
 				mmc_hostname(host->mmc), (unsigned)intmask);
+				sdhci_dumpregs(host);
 			host->cmd->error = -EILSEQ;
 		}

Hi WayneWWW,

I’ve attached patch_with_sd.log and patch_after_10S_boot.log
patch_with_sd.log (58.2 KB)
patch_after_10S_boot.log (48.8 KB)

Hi Karis,

You said you are using rel-32.2.1, right?

Hi WayneWWW,

YES!
Do you have any good news about sdcard?

Hi Karis,

Could you check if removing below property in device tree make any difference?

nvidia,min-tap-delay ;
nvidia,max-tap-delay ;

BTW, I notice you didn’t share your dts file at all. Could you share full dts here too?

Also, please share the the schematic.

Hi WayneWWW,

The attachment in #3

The attachment in #11

The SD_POWER_SW_ON pin is always enabled.

Ok thanks. Please try #26 first.

Hi WayneWWW,

Thanks you !!!
SDcard and the system are work fine.I will test and check more again.
I Decompile dtb to remove property.I would like to know how to remove delay property in dts?

1 Like

Hi Karis,

Do you mean you remove it by “/delete-property/”?

You may need to look into tegra210-p3448-0002-p3449-0000-b00.dts (and it includes other dtsi too) and search where is sdhci@700b0400 defined. There may be multiple files have it.

Anyway, removing by using “/delete-property/” should also work too.

1 Like

Hi WayneWWW,

Yes! but I would like to know which property I should remove,is nvidia,min-tap-delay or tap-delay?
I used command (find |grep -r nvidia,min-tap-delay),but I didn’t find any about that.

nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-sdhci.dtsi has it.

1 Like

Hi Karis,

Have you resolved your issue?

Hi WayneWWW,

Yes! SDcard has worked fine. Thank you!

Hi WayneWWW,

I use command dmesg-w.

After I unplug sd card, the dmesg is output the same message, and it not stop.

Karis

Hi Karis,

It has been 2 months since your last update. Is there any change you’ve made in device tree?

Hi WayneWWW,

No, I just check it again.

Thanks!

Karis

Hi WayneWWW,

Any ideas?

Thank you.

Karis