From patchwork Thu Dec 17 17:34:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Purna Chandra Mandal X-Patchwork-Id: 558482 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B9E49140187 for ; Fri, 18 Dec 2015 04:36:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71D23399D; Thu, 17 Dec 2015 18:36:16 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FuCZCC8QZYVR; Thu, 17 Dec 2015 18:36:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC3934BC94; Thu, 17 Dec 2015 18:36:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11FFB4BC94 for ; Thu, 17 Dec 2015 18:36:13 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n_XRqhE7Q8DO for ; Thu, 17 Dec 2015 18:36:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from email.microchip.com (exsmtp03.microchip.com [198.175.253.49]) by theia.denx.de (Postfix) with ESMTPS id 908E14BC45 for ; Thu, 17 Dec 2015 18:36:12 +0100 (CET) Received: from [10.41.20.11] (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.181.6; Thu, 17 Dec 2015 10:36:10 -0700 To: From: Purna Chandra Mandal Message-ID: <5672F21F.9040808@microchip.com> Date: Thu, 17 Dec 2015 23:04:23 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Cc: Sandeep Sheriker Mallikarjun - C17018 , Pantelis Antoniou Subject: [U-Boot] [PATCH v1 16/18] drivers: mmc: PIC32MZ[DA] SDHCI errata fix when JTAG is not connected. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Sandeep Sheriker Mallikarjun 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 Signed-off-by: Purna Chandra Mandal --- 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); }