From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755578AbcASOdy (ORCPT ); Tue, 19 Jan 2016 09:33:54 -0500 Received: from mail-bl2nam02on0064.outbound.protection.outlook.com ([104.47.38.64]:2737 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754602AbcASOdp (ORCPT ); Tue, 19 Jan 2016 09:33:45 -0500 X-Greylist: delayed 902 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jan 2016 09:33:44 EST 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; 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 CC: , , , , Harini Katakam , Punnaiah Choudary Kalluri , Anirudha Sarangi , P L Sai Krishna 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 Content-Type: text/plain 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) && -- 2.1.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: P L Sai Krishna 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> References: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org 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 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 List-Id: devicetree@vger.kernel.org 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) && -- 2.1.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: lakshmi.sai.krishna.potthuri@xilinx.com (P L Sai Krishna) Date: Tue, 19 Jan 2016 19:47:33 +0530 Subject: [LINUX PATCH 3/5] mmc: host: Added DT support to use SDIO in standard speed. In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> References: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com> Message-ID: <1453213055-35563-3-git-send-email-lakshmis@xilinx.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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) && -- 2.1.2