All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 16/18] drivers: mmc: PIC32MZ[DA] SDHCI errata fix when JTAG is not connected.
@ 2015-12-17 17:34 Purna Chandra Mandal
  0 siblings, 0 replies; only message in thread
From: Purna Chandra Mandal @ 2015-12-17 17:34 UTC (permalink / raw)
  To: u-boot

From: Sandeep Sheriker Mallikarjun <sandeep.sheriker@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@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-17 17:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-17 17:34 [U-Boot] [PATCH v1 16/18] drivers: mmc: PIC32MZ[DA] SDHCI errata fix when JTAG is not connected Purna Chandra Mandal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.