From: Purna Chandra Mandal <purna.mandal@microchip.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 16/18] drivers: mmc: PIC32MZ[DA] SDHCI errata fix when JTAG is not connected.
Date: Thu, 17 Dec 2015 23:04:23 +0530 [thread overview]
Message-ID: <5672F21F.9040808@microchip.com> (raw)
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
reply other threads:[~2015-12-17 17:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5672F21F.9040808@microchip.com \
--to=purna.mandal@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.