From patchwork Mon Aug 26 03:18:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 11113923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4745E1398 for ; Mon, 26 Aug 2019 03:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23EF22173E for ; Mon, 26 Aug 2019 03:19:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aKbaMf3i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729617AbfHZDSx (ORCPT ); Sun, 25 Aug 2019 23:18:53 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43743 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfHZDSx (ORCPT ); Sun, 25 Aug 2019 23:18:53 -0400 Received: by mail-pl1-f195.google.com with SMTP id 4so9259212pld.10; Sun, 25 Aug 2019 20:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eEJ7QK2yA8QtwKk/jFpiizrreo9ZCT/dw31kH1OAjDQ=; b=aKbaMf3iq9PlX3Ydly/zPytKh/3KzTae2MX6e8fO7tqcage8p48acAPYVbQfR2cOxN OJN/F2VIXMLfpIK628pt73uNYZXfffmB5V5JOj6mwuzVgWUZElo/ZudVjsgdjFfKWik9 CQCSq5Lk7kY928gqbr60PCFLNOP9ivo4RPZCIbL9cEhp6jx7ih0pAtZbnRw2h7zI8B/M azx+Ow3tcnSXEJudpM/SAMj0yaUM/JncpBqWFlx961GnQHsYms2UP37uU4MOv1CiDkbr ZHuqrfj9YFXbYBVyXd3o4nX37zq5KVIXePDSV6ikdFZlZHRbzIyBfbMC0ea/eCHQF6tV OJIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eEJ7QK2yA8QtwKk/jFpiizrreo9ZCT/dw31kH1OAjDQ=; b=IUgDU4Vtr/uKfu+L+Y6csSln07M2c8wNF3wq16AtivbZ5SQVW2lUelK7qn0t1cc9xh 9vydlXup8QVuPn8RkNHQgWvAjdfEgAH8kEquDZK5UdWZL6ksWU1vXQ3liC/WfWyMarM2 UUzT2TOI7dem9eW95/NY3Ry7VFOJ1lFnhKY2FggNRzjkt+agOKtPVaQF6Dm3/h8N8xgY xdSdrn5Yk1XEudAqUUuHY8pm+1bsDqp8MwETDwUTg2+qu2B7oodidc4c5pPUqyVG9map l1onUytVPF+hhHtVMAkgTLxlmKAR3eDrOEjXpxWNMzvCEiZlI9uIEpAePUPHNnD2xvil 8kSA== X-Gm-Message-State: APjAAAXipryAVieKpW54bONiXyzw2T5wh9KKEyLu8/1/3S4KnayIQlFs INpAo8qfjyJc/CrnE3fTezHXhPQZ X-Google-Smtp-Source: APXvYqxBnMyuW/2Ku0SXqJs4rtxsPbRX+CjJX0FRh6L1hE7OpKxb7pxBLYZx9nSUK5f6DKp7v3o0wg== X-Received: by 2002:a17:902:f01:: with SMTP id 1mr16337169ply.337.1566789532653; Sun, 25 Aug 2019 20:18:52 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y23sm12565905pfr.86.2019.08.25.20.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 20:18:52 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Orson Zhai , Baolin Wang Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 1/5] mmc: sdhci-sprd: fixed incorrect clock divider Date: Mon, 26 Aug 2019 11:18:26 +0800 Message-Id: <20190826031830.30931-2-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826031830.30931-1-zhang.lyra@gmail.com> References: <20190826031830.30931-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Chunyan Zhang The register SDHCI_CLOCK_CONTROL should be cleared before config clock divider, otherwise the frequency configured maybe lower than we expected. Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-sprd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 6ee340a3fb3a..d5871865a1e9 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -217,10 +217,11 @@ static inline void _sdhci_sprd_set_clock(struct sdhci_host *host, struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); u32 div, val, mask; - div = sdhci_sprd_calc_div(sprd_host->base_rate, clk); + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); - clk |= ((div & 0x300) >> 2) | ((div & 0xFF) << 8); - sdhci_enable_clk(host, clk); + div = sdhci_sprd_calc_div(sprd_host->base_rate, clk); + div = ((div & 0x300) >> 2) | ((div & 0xFF) << 8); + sdhci_enable_clk(host, div); /* enable auto gate sdhc_enable_auto_gate */ val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI); From patchwork Mon Aug 26 03:18:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 11113913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D2E01399 for ; Mon, 26 Aug 2019 03:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 792672173E for ; Mon, 26 Aug 2019 03:19:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fFw50hwj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729625AbfHZDS7 (ORCPT ); Sun, 25 Aug 2019 23:18:59 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43925 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729522AbfHZDS4 (ORCPT ); Sun, 25 Aug 2019 23:18:56 -0400 Received: by mail-pf1-f194.google.com with SMTP id v12so10811413pfn.10; Sun, 25 Aug 2019 20:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/FIc4QaBXsWcQmRvb8jAc1XDRIewyQvawzEI4Q440V0=; b=fFw50hwjuuBIgrKHpwqmGHOmiBAV42sshCD1p743yGmGNghgndEcIodbbtnvM0PLRt W2Iny4F7pnH09tO2E7oma2qxb0UXRa+zfWtjij4DKIw7ynqn/AGV8CVJvtjTZrtef4I6 9FP1he4JMM8AMjEpGU9iRC/K9p97hd0CyCK+FsurX3dXPNGptRFsjI6CFQn7riXmcfhm hVepmA0ZofMPfwVuKqqmqjfKEa1FRmE6+IyFj2MEVyRq4tCPZWr0w62NiNNJ5UivAsP2 /cS5EllyW1hl6mbppzZvsOflN52gkdmHsWds5iqKOZKJZ9x4guKqZcGioZKbYCBGBrFv m4CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/FIc4QaBXsWcQmRvb8jAc1XDRIewyQvawzEI4Q440V0=; b=PIzJSFYNT1IGOCE51pY3LsFdKLhQ95NvrZQM8gc1TrgzH4aOcHdgr2iwzzNmLtlBK8 3zufBHY2AL4zx0TrCwZG2nM/iqYuYX+67HaQRYvbVuQUzfhs8xPtAWFJDNesFqLoa9DX 7bOjZYi/8pWrYqR3b/DoTvwtg3YDMdNNZYEjzGS+UD1yT4sYE0D75CN+gyn2dR71rcTj gVyI/i+OiYGcRUb5RNa3CU7JIyj90Ht9XRWnalbFaAiOK3l0ohleUtOgpXAHdid2al1K gMlDVHc+p7xBDu/HhJvNuYuAtRA8SxmKu5HGsTvmjrKd1C4nzIxsK23IdVs4J9GeFawt OSLA== X-Gm-Message-State: APjAAAUJlAnkGkerKb/1Fe+O1nCsWdYdFpiGaRcYw2EWVQCEbs0p8vyn sfY3YZ6u0vF1HvD5xq0jc8w= X-Google-Smtp-Source: APXvYqx2AO+6o+bv8ItxkVBL110+bvMgndV0QBQYXottFJzuo4Yn0a1kHsBLdyKZsQWgyYET6GByPQ== X-Received: by 2002:a65:5003:: with SMTP id f3mr589602pgo.335.1566789535830; Sun, 25 Aug 2019 20:18:55 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y23sm12565905pfr.86.2019.08.25.20.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 20:18:55 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Orson Zhai , Baolin Wang Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 2/5] mmc: sdhci-sprd: add get_ro hook function Date: Mon, 26 Aug 2019 11:18:27 +0800 Message-Id: <20190826031830.30931-3-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826031830.30931-1-zhang.lyra@gmail.com> References: <20190826031830.30931-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Chunyan Zhang sprd's sd host controller doesn't support write protect to sd card. Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-sprd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index d5871865a1e9..90cb2af91159 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -374,6 +374,11 @@ static unsigned int sdhci_sprd_get_max_timeout_count(struct sdhci_host *host) return 1 << 31; } +static unsigned int sdhci_sprd_get_ro(struct sdhci_host *host) +{ + return 0; +} + static struct sdhci_ops sdhci_sprd_ops = { .read_l = sdhci_sprd_readl, .write_l = sdhci_sprd_writel, @@ -386,6 +391,7 @@ static struct sdhci_ops sdhci_sprd_ops = { .set_uhs_signaling = sdhci_sprd_set_uhs_signaling, .hw_reset = sdhci_sprd_hw_reset, .get_max_timeout_count = sdhci_sprd_get_max_timeout_count, + .get_ro = sdhci_sprd_get_ro, }; static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) From patchwork Mon Aug 26 03:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 11113921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C76D1398 for ; Mon, 26 Aug 2019 03:19:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 576B322D6D for ; Mon, 26 Aug 2019 03:19:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dHBCEhI8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729518AbfHZDTO (ORCPT ); Sun, 25 Aug 2019 23:19:14 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44827 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729649AbfHZDS7 (ORCPT ); Sun, 25 Aug 2019 23:18:59 -0400 Received: by mail-pg1-f193.google.com with SMTP id i18so9659679pgl.11; Sun, 25 Aug 2019 20:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6BeSiLacM+7Sf7qkApv2ILwpaNC8CAg80TkB/80zAMU=; b=dHBCEhI8bkVnrMwYo7YJ8PhlPCqUep6tSWtsOokJAMP4et4c8vM9f4Dj7egMNymU04 CbeglpMLTmFGPV8yTEtHABw0nYZyw5HyA9y/LVok6uypta0JKZr+1eWykALD+BMUKO+H yh0an2x03stI7vwMoW1Q6kFl1RtFUZby53sS9ToXE4A1ZATgZXDT5UsVBumyeU2TjnEG tH8y1dzSy6yRTYFPnaxlpLzLIdqUiyyOX/oGD7h2A2IsuDp4z4aQUBiPCU5618yKPVuH lRSyKLlGeZsHntBXRwHTX+2oKsuMZSSmX1vpleu1pK4jFhQTH9oOhBPbujAuJ6YUXam3 H7hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6BeSiLacM+7Sf7qkApv2ILwpaNC8CAg80TkB/80zAMU=; b=QUv3hiixYmqhX/V+iyJBHX5lZ2QkvSlkM+WARVBIrL8TZDFiRqgZh4xyDfNiEXzYxh GSC6rergR8C77Vc0IUGo6lkRkHRpjVVkSZj8DJCfq8NSTgTVXO70+HclRx2UV7JScKAO ncP0Hc5YZLWt7kYHDUYJZgzKRcA9wRM00B2iBs/aS2AmrqjNEfoYDNk2ZLnfcQS723bj zN5rkXzigwvoLINRQLBH4sMtNLAidPwSLpZn/zWuGA4PK2VF456xQieC4QNdZa5K/pfv s7cznpVY66yms46cmgfObGzUgWs9s7LUXvfSkWoUZcZxWB8Vc9DlJ9g04N3Fs9MmH8CC /iVA== X-Gm-Message-State: APjAAAUEFG3wVA3M7swfgKHnYM6uwPotXODZOZ407x+LK4k7VjoPloIw 9CkUgvbdsar8AqbqFPMe13IF+2yE X-Google-Smtp-Source: APXvYqyrpOKfW/bqg6wcyNH+zve0gIXtYwD7oQT38XJCZ43UVMLJyAqS3R3Khc7CGWfEXdmnhaDeqA== X-Received: by 2002:a62:cd45:: with SMTP id o66mr1430131pfg.112.1566789538833; Sun, 25 Aug 2019 20:18:58 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y23sm12565905pfr.86.2019.08.25.20.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 20:18:58 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Orson Zhai , Baolin Wang Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 3/5] mmc: sdhci-sprd: add SDHCI_QUIRK2_PRESET_VALUE_BROKEN Date: Mon, 26 Aug 2019 11:18:28 +0800 Message-Id: <20190826031830.30931-4-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826031830.30931-1-zhang.lyra@gmail.com> References: <20190826031830.30931-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Chunyan Zhang The bit of PRESET_VAL_ENABLE in HOST_CONTROL2 register is reserved on sprd's sd host controller, set quirk2 to disable configuring this. Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-sprd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 90cb2af91159..27d0b57f3f89 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -510,7 +510,8 @@ static void sdhci_sprd_phy_param_parse(struct sdhci_sprd_host *sprd_host, static const struct sdhci_pltfm_data sdhci_sprd_pdata = { .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 | - SDHCI_QUIRK2_USE_32BIT_BLK_CNT, + SDHCI_QUIRK2_USE_32BIT_BLK_CNT | + SDHCI_QUIRK2_PRESET_VALUE_BROKEN, .ops = &sdhci_sprd_ops, }; From patchwork Mon Aug 26 03:18:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 11113915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11FF41399 for ; Mon, 26 Aug 2019 03:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2DF92173E for ; Mon, 26 Aug 2019 03:19:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A3/3vOqC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729522AbfHZDTC (ORCPT ); Sun, 25 Aug 2019 23:19:02 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44027 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729518AbfHZDTC (ORCPT ); Sun, 25 Aug 2019 23:19:02 -0400 Received: by mail-pg1-f195.google.com with SMTP id k3so9654333pgb.10; Sun, 25 Aug 2019 20:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gQzlqbeBy0rOgCuibxrwv7llgsxt3/gPsmmcGEamYmM=; b=A3/3vOqCSl0LJb39V9Jod6GpISEy6Jf4A8gF8gU9ihjlZMMUP7x5xtqO0ZubVHjltX ndMLp4GywdCBNxtJTuq6OXhda2ARtksCIKLn7WMcNj10yV1AJ2m0rwnakrjv+7wpGhF0 pJ41IvrKBmRfmQ4mOr3d1kwAJWUzp+bXiz59SCSBQcrfm5IGTRnw7Dbq5gCEocTASgp5 8vJ+vyMCyrynzhGREsWBuZJgtN35yK68OSOcrM2KgTFaOZKTyC273gJcx0XohM05KL4N 7hNH/LyATrtNpXhOCweXQUhenV/WA8w0Um+0fVp6i3zCT7aphQDPW/GOoL+rDGlKUIDo fW7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gQzlqbeBy0rOgCuibxrwv7llgsxt3/gPsmmcGEamYmM=; b=IUosqDY+USdiSKcTsduJ4vCLPmTfbS/9V1KT1xr/othwjpXdTBkyhEH11StsoLpC7f yhV9URA2E7vc65Vjta1SJ3IZ1jCGGTfXN3CdRNis5FmXaFvtIxdyRzaDGV8xD++kQnUh 4u9s1RNsCUFz/dfCOt5qHc0ibgeLxr8MDPvhPBeMFr73sITiRAL2RLyetO+WxPkuv/S2 gxrsiJrb2G5khh0xQUe6cVpjlQ0S4rv5ovrTD4Qesz2wwouSlfg80fBC1xMiF6zPnakk yvzffuEQbeJgXDigVCkjVphiBHUAOEe8stVdj/fzYkKfHC6TNRnaUd9j/KfoF31s0ewv JU3w== X-Gm-Message-State: APjAAAWMFYpjTqyko1pwm9+ovDM6ir1QBeUCQZ/2NF/Eos+rp1d0B3zA LEifdbbpQZgf9kUd6XNt454aO5Gj X-Google-Smtp-Source: APXvYqydnaG10dbmwma3vb52FGG0Qof19L9QcerzYmucYOBMA2Q3UfoiISjqleQiaDyFcHaGm2zZRg== X-Received: by 2002:a17:90a:22c9:: with SMTP id s67mr4736144pjc.22.1566789542040; Sun, 25 Aug 2019 20:19:02 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y23sm12565905pfr.86.2019.08.25.20.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 20:19:01 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Orson Zhai , Baolin Wang Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 4/5] mms: sdhci-sprd: add SDHCI_QUIRK_BROKEN_CARD_DETECTION Date: Mon, 26 Aug 2019 11:18:29 +0800 Message-Id: <20190826031830.30931-5-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826031830.30931-1-zhang.lyra@gmail.com> References: <20190826031830.30931-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Chunyan Zhang sprd's sd host controller doesn't support detection to card insert or remove. Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-sprd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 27d0b57f3f89..1fecf055682c 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -508,7 +508,8 @@ static void sdhci_sprd_phy_param_parse(struct sdhci_sprd_host *sprd_host, } static const struct sdhci_pltfm_data sdhci_sprd_pdata = { - .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, + .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 | SDHCI_QUIRK2_USE_32BIT_BLK_CNT | SDHCI_QUIRK2_PRESET_VALUE_BROKEN, From patchwork Mon Aug 26 03:18:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 11113917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7019A1398 for ; Mon, 26 Aug 2019 03:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D64D21744 for ; Mon, 26 Aug 2019 03:19:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="slhUxvnh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729684AbfHZDTG (ORCPT ); Sun, 25 Aug 2019 23:19:06 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34608 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729681AbfHZDTG (ORCPT ); Sun, 25 Aug 2019 23:19:06 -0400 Received: by mail-pg1-f193.google.com with SMTP id n9so9682388pgc.1; Sun, 25 Aug 2019 20:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vrKXb1c+fhWL6XvI6Q8/QhED1MUXcVFYoSihiJAZjTw=; b=slhUxvnhGpV6q597AQTrd/fdto0uqCVHTUkFdHIuxFjXjGw31s9GinpL1xDyvEM9KD ALUyg1Aruz9FyXfUSWbiINUptanxSXIg2ONksosjrl+TPEHh/nPOGP4QGSIYmFUKw5im e5IrhSYWlfawHlB8PvZeAlfZ9T15ue6Y1oR0TkcOKHzOcPAMK7VOYXxUqtfVMm4vtQbC BTtUQjDSn7ziAsWJISuPlckXsFOhrSkcEA4sKL24HSL4q+LHNcZamXsOttEEyAAoK9Y0 pTTqfSmD4svCfaKnT5dLKS9hoSTNoqVfvX9EKEed+Ywmpckg8p767hZHL1X5HwM8mvm0 2iAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vrKXb1c+fhWL6XvI6Q8/QhED1MUXcVFYoSihiJAZjTw=; b=JhrEH2AU3XiVakWiUzx0LaTkPMysFpLPEQiD0FglfnJP+2AkQN3lT+XFw8c0aloTIZ CW7SBFguo5scgEBqp+eLGGOI/Av6wklXyJT1KbOfFGY/D7lJBSlW/mtyZotXyA3TSoT/ x/j6YeMRuULhB/mDsxPiX056IofRtUbZBtb/OucgezNMMqoNqfcRo0yLxLz16mDu5768 rFX+ejUffy6UmmjH93L2hdnebgIn66PLKNTEjKSkMtjPgDZkR1dbSp9s0PEKJv7Ng18Q q01gg9FL52VTMV694/Slap0TvSN2hX5YTPmXjjDgn0s2Olr0j7HhpPhdXn+7eXL/+wsr NGZA== X-Gm-Message-State: APjAAAURCBdh+ij88GlJR8kpY8fThRUbD2Ef8FHwuo/rMZLtbfxEQwaf iWaD719zGY9KHvwrjs3nCRZUKU/J X-Google-Smtp-Source: APXvYqxFQi3ogEq2PItJyW2uQWyx/dSjwssauzEKVYeY3WomX4VlQwGScvONgZlEs6bzn6o3LPPb6A== X-Received: by 2002:a65:4546:: with SMTP id x6mr14195563pgr.266.1566789545234; Sun, 25 Aug 2019 20:19:05 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y23sm12565905pfr.86.2019.08.25.20.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 20:19:04 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Orson Zhai , Baolin Wang Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 5/5] mmc: sdhci-sprd: clear the UHS-I modes read from registers Date: Mon, 26 Aug 2019 11:18:30 +0800 Message-Id: <20190826031830.30931-6-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826031830.30931-1-zhang.lyra@gmail.com> References: <20190826031830.30931-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Chunyan Zhang sprd's sd host controller supports SDR50/SDR104/DDR50 though, the UHS-I mode used by the specific card can be selected via devicetree only. Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-sprd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 1fecf055682c..d3c3e95676f0 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -509,7 +509,8 @@ static void sdhci_sprd_phy_param_parse(struct sdhci_sprd_host *sprd_host, static const struct sdhci_pltfm_data sdhci_sprd_pdata = { .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_MISSING_CAPS, .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 | SDHCI_QUIRK2_USE_32BIT_BLK_CNT | SDHCI_QUIRK2_PRESET_VALUE_BROKEN, @@ -614,6 +615,16 @@ static int sdhci_sprd_probe(struct platform_device *pdev) sdhci_enable_v4_mode(host); + /* + * Supply the existing CAPS, but clear the UHS-I modes. This + * will allow these modes to be specified only by device + * tree properties through mmc_of_parse(). + */ + host->caps = sdhci_readl(host, SDHCI_CAPABILITIES); + host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); + host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 | + SDHCI_SUPPORT_DDR50); + ret = sdhci_setup_host(host); if (ret) goto pm_runtime_disable;