[U-Boot] [PATCH v1 16/18] drivers: mmc: PIC32MZ[DA] SDHCI errata fix when JTAG is not connected.

Purna Chandra Mandal purna.mandal at microchip.com
Thu Dec 17 18:34:23 CET 2015


From: Sandeep Sheriker Mallikarjun <sandeep.sheriker at microchip.com>

In PIC32MZ[DA] SoC JTAG and Card_Detect signal are muxed. These created one h/w bug;
SDHCI will not detect micro-SD card if JTAG is not connected. To fix this errata,
 - set Card_Detect_Signal_Selection bit in SDHC HostControl register and
 - clear CardDetectTestLevel bit in SDHC HostControl register.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal at microchip.com>
---

 drivers/mmc/sdhci.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 02d71b9..f32fe67 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -424,6 +424,18 @@ static void sdhci_set_ios(struct mmc *mmc)
     if (host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)
         ctrl &= ~SDHCI_CTRL_HISPD;
 
+#if defined(CONFIG_PIC32_SDHCI)
+    /*
+    * In PIC32MZ[DA] due to h/w bug SDHCI fails detecting card when JTAG
+    * is not connected.
+    * To work-around this problem:
+    *  - set Card_Detect_Signal_Selection bit in SDHCI_Host_Control register
+    *  - clear Card_Detect_Test_Level bit in SDHCI_Host_Control register
+    */
+    ctrl |= SDHCI_CTRL_CD_TEST;
+    ctrl &= ~SDHCI_CTRL_CD_TEST_INS;
+#endif
+
     sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 }
 
-- 
1.8.3.1



More information about the U-Boot mailing list