From patchwork Tue Oct 10 09:30:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaotian Jing X-Patchwork-Id: 9995565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0ACA60216 for ; Tue, 10 Oct 2017 09:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C553E27EED for ; Tue, 10 Oct 2017 09:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9D3C28450; Tue, 10 Oct 2017 09:52:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1FBAF27EED for ; Tue, 10 Oct 2017 09:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ua7lGnr4FopVsrX6WBs2vUoTl4ZHx1YMomRIRfBX/Tg=; b=CmcqX+xJcF1NlT n6i/3NHNj6L16b40sVvXS22hDxRy61bjpo21d4MCqosi7mmlIHHKBxk5Ad24h8grG6X6Zpn2Gr/4g ZktqFUkQUFeJFPK3ta4xFqmdgY38MxJxbVRqqd7/4P08FO3cEBJFWP/LqS4VbP/7o7tFADSqXy73k zHyEiAdeisAERHWbitXaStTV9cENLNksd2pjDKiL7KydF6dRNOYe2Wnhtuy5HYQrzo3u3GwHHlq2h S9SZjmV8/xEtnPh2PT/Nr9OURx2Nrp20MlCpY+aoFddZleguGcFUdl9JASOtK7pRb/4wRWMP/s8P8 OLswFHnc11p/55Z8DrNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e1rCW-0000lb-5F; Tue, 10 Oct 2017 09:51:48 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1rA9-0005rJ-5O; Tue, 10 Oct 2017 09:49:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v/bqEvRfcikaps+cRRh0c7iTJOnXXrYJoFjO98aq/sY=; b=qSFnkjf7ZeXcyIczwG/hs170S 3aETT/JvW2RsnY3DKL3ZylreSltalgDnbF25Kw9MiB1SYxUGV9DLhlwUIl+TY9715g9weWLh6vD56 tA8sFHsaW+2MAnxY8c8homsOjWoIU0Zt78yTO2EUYHV3DfEBLXRiKy2OBTZg4qxJaH8pWJ6GO1YAp sp0smhG+/abvZlAuYjhmPuw5Hb+05LP1vzFcWDlp2Rj7t7AwKZePm3Al44eGpxC2Xmb1DDmpbFCjJ paq6hjbfVDdvYwjzxrN+/bcDTghByxWGm9/weDsx7o9fXIxttiFU65JW1jMdzl2/ZQfv5lTXgMEga PbC8KM1AQ==; Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1qss-0003aj-Vp; Tue, 10 Oct 2017 09:31:31 +0000 X-UUID: 22d6964b8182456fbedd35854c474144-20171010 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1647885227; Tue, 10 Oct 2017 17:30:57 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 10 Oct 2017 17:30:56 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 10 Oct 2017 17:30:55 +0800 From: Chaotian Jing To: Ulf Hansson Subject: [PATCH v4 07/12] mmc: mediatek: add busy_check support Date: Tue, 10 Oct 2017 17:30:26 +0800 Message-ID: <1507627831-29323-8-git-send-email-chaotian.jing@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1507627831-29323-1-git-send-email-chaotian.jing@mediatek.com> References: <1507627831-29323-1-git-send-email-chaotian.jing@mediatek.com> MIME-Version: 1.0 X-MTK: N X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, srv_heupstream@mediatek.com, Catalin Marinas , Linus Walleij , Will Deacon , linux-kernel@vger.kernel.org, yong mao , Phong LE , Rob Herring , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Matthias Brugger , linux-mmc@vger.kernel.org, Chaotian Jing , Heiner Kallweit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP bit7 of PATCH_BIT1 has different meaning in new design, to compatible with previous platform, clear this bit in new platform. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index ebec2b4..187fe8a 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -316,6 +316,7 @@ struct mtk_mmc_compatible { bool pad_tune0; bool async_fifo; bool data_tune; + bool busy_check; }; struct msdc_tune_para { @@ -380,6 +381,7 @@ struct msdc_host { .pad_tune0 = false, .async_fifo = false, .data_tune = false, + .busy_check = false, }; static const struct mtk_mmc_compatible mt8173_compat = { @@ -388,6 +390,7 @@ struct msdc_host { .pad_tune0 = false, .async_fifo = false, .data_tune = false, + .busy_check = false, }; static const struct mtk_mmc_compatible mt2701_compat = { @@ -396,6 +399,7 @@ struct msdc_host { .pad_tune0 = true, .async_fifo = true, .data_tune = true, + .busy_check = false, }; static const struct mtk_mmc_compatible mt2712_compat = { @@ -404,6 +408,7 @@ struct msdc_host { .pad_tune0 = true, .async_fifo = true, .data_tune = true, + .busy_check = true, }; static const struct of_device_id msdc_of_ids[] = { @@ -1280,6 +1285,8 @@ static void msdc_init_hw(struct msdc_host *host) sdr_set_field(host->base + MSDC_PATCH_BIT, MSDC_CKGEN_MSDC_DLY_SEL, 1); writel(0xffff4089, host->base + MSDC_PATCH_BIT1); sdr_set_bits(host->base + EMMC50_CFG0, EMMC50_CFG_CFCSTS_SEL); + if (host->dev_comp->busy_check) + sdr_clr_bits(host->base + MSDC_PATCH_BIT1, (1 << 7)); if (host->dev_comp->async_fifo) { sdr_set_field(host->base + MSDC_PATCH_BIT2, MSDC_PB2_RESPWAIT, 3);