From patchwork Tue Jan 19 14:17:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Potthuri X-Patchwork-Id: 8062861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A05D5BEEE5 for ; Tue, 19 Jan 2016 14:20:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C74F5203FB for ; Tue, 19 Jan 2016 14:20:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1ADC2039E for ; Tue, 19 Jan 2016 14:20:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aLX86-0005ow-Dh; Tue, 19 Jan 2016 14:19:30 +0000 Received: from mail-sn1nam02on0078.outbound.protection.outlook.com ([104.47.36.78] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aLX7f-0005Xm-6V for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2016 14:19:06 +0000 Received: from SN1NAM02FT032.eop-nam02.prod.protection.outlook.com (10.152.72.52) by SN1NAM02HT015.eop-nam02.prod.protection.outlook.com (10.152.73.91) with Microsoft SMTP Server (TLS) id 15.1.355.15; Tue, 19 Jan 2016 14:18:40 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT032.mail.protection.outlook.com (10.152.72.126) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Tue, 19 Jan 2016 14:18:38 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aLX7G-0005zK-8X; Tue, 19 Jan 2016 06:18:38 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1aLX7G-0001tF-2o; Tue, 19 Jan 2016 06:18:38 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u0JEIXja010418; Tue, 19 Jan 2016 06:18:33 -0800 Received: from [172.23.146.172] (helo=xhdl3764.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1aLX7B-0001sL-1g; Tue, 19 Jan 2016 06:18:33 -0800 Received: by xhdl3764.xilinx.com (Postfix, from userid 14964) id 3F7E51A203C9; Tue, 19 Jan 2016 19:48:32 +0530 (IST) From: P L Sai Krishna To: Michal Simek , Soren Brinkmann , Ulf Hansson , Kevin Hao , Emil Lenchak , Tobias Klauser , Sudeep Holla , Adrian Hunter , Jisheng Zhang , "Ivan T. Ivanov" , Scott Branden , Vincent Yang , Haibo Chen , Marek Vasut , "ludovic.desroches@atmel.com" , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , "Kumar Gala" , Suman Tripathi , Shawn Lin Subject: [LINUX PATCH 3/5] mmc: host: Added DT support to use SDIO in standard speed. Date: Tue, 19 Jan 2016 19:47:33 +0530 Message-ID: <1453213055-35563-3-git-send-email-lakshmis@xilinx.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> References: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22074.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(1220700001)(106466001)(87936001)(50226001)(5001960100002)(50986999)(2950100001)(2906002)(48376002)(92566002)(81156007)(11100500001)(90966002)(4326007)(45336002)(46386002)(103686003)(47776003)(6806005)(2501003)(86362001)(107886002)(4001430100002)(52956003)(33646002)(19580395003)(36386004)(1096002)(5001770100001)(76176999)(5003940100001)(19580405001)(63266004)(189998001)(586003)(5008740100001)(229853001)(50466002)(36756003)(42186005)(7059030)(107986001)(921003)(1121003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT015; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e7624748-1c79-4118-279c-08d320db6da1 X-Exchange-Antispam-Report-Test: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:SN1NAM02HT015; UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: <89055bf5369745c89c6613824cf060b0@SN1NAM02HT015.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13017025)(5005006)(13015025)(13024025)(8121501046)(13018025)(520078)(10201501046)(3002001); SRVR:SN1NAM02HT015; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT015; X-Forefront-PRVS: 0826B2F01B X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2016 14:18:38.9201 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT015 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160119_061903_518512_6C07AA9D X-CRM114-Status: GOOD ( 12.10 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Harini Katakam , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, P L Sai Krishna , Anirudha Sarangi , Punnaiah Choudary Kalluri , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the controller is used in High Speed Mode (Zynq-7000 data output on rising edge of the clock) the hold time requirement for the JEDEC/MMC 4.41 Specification is NOT met. In Standard Speed Mode (Zynq-7000 data output on falling edge of the clock) an extra half clock period is added to the clock to out delay meeting the hold time requirement. This patch adds device tree property 'broken-mmc-highspeed' to sdhci node to force the controller to use in standard speed as a workaround. Signed-off-by: Emil Lenchak Signed-off-by: P L Sai Krishna --- drivers/mmc/host/sdhci-pltfm.c | 3 +++ drivers/mmc/host/sdhci.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 223c5eb..37df5cb 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -102,6 +102,9 @@ void sdhci_get_of_property(struct platform_device *pdev) of_device_is_compatible(np, "fsl,mpc8536-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; + if (of_get_property(np, "broken-mmc-highspeed", NULL)) + host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT; + of_property_read_u32(np, "clock-frequency", &pltfm_host->clock); if (of_find_property(np, "keep-power-in-suspend", NULL)) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 8b064cd..5cc07d6 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3114,7 +3114,8 @@ int sdhci_add_host(struct sdhci_host *host) if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23) mmc->caps &= ~MMC_CAP_CMD23; - if (caps[0] & SDHCI_CAN_DO_HISPD) + if ((caps[0] & SDHCI_CAN_DO_HISPD) && + !(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)) mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&