From patchwork Thu Apr 26 14:07:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 10366035 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 2F7EA6032C for ; Thu, 26 Apr 2018 14:13:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CC592911E for ; Thu, 26 Apr 2018 14:13:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 101A929121; Thu, 26 Apr 2018 14:13:11 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 1102D2911F for ; Thu, 26 Apr 2018 14:13:09 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=NnmN1rFyl6RRkooTmlI3MY2FBAUZohBhM9IPTwN+Mw4=; b=gLYRwHkYOkNlW7t2RwLsHPQ8sb a1M92p+I9xikh6GOUvLKqF4n9MzpkNu1fz/NAcIGI8mVXTdcw+stYMuIOV8pOzE269gB3fJegmgAx 5AcDO1yx2/HPyL8dRy6yBo75Syf7Hqml4y3kX0dwyNtvg86egYzd5mcFOUeqs6WjA2uafpxpR3YNb W1K2ltP+wDR1+Muw5UUVJfxuq0KCzuezWVkFzerHnH4FQXe/C3fEaCzwAF0jeWqyzEPzswVgktKX8 qcvjX/wDW/j9DOiwePlb3Lt+xz6/uNmMibGi75y0dhuYKCJQnn6qWVwD9IyF/gajUwPO3ZHGyImPI 5KrEG1wQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fBhdp-0007HU-Qh; Thu, 26 Apr 2018 14:12:57 +0000 Received: from coral.maple.relay.mailchannels.net ([23.83.214.39]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fBhaG-00042f-V7 for linux-arm-kernel@lists.infradead.org; Thu, 26 Apr 2018 14:09:33 +0000 X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 608F628247A; Thu, 26 Apr 2018 14:09:00 +0000 (UTC) Received: from hermes.aosc.io (unknown [100.96.15.28]) (Authenticated sender: lmn-TZDUIOWCRQMW) by relay.mailchannels.net (Postfix) with ESMTPA id 87DE1280AD6; Thu, 26 Apr 2018 14:08:59 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from hermes.aosc.io (hermes.aosc.io [100.96.15.1]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.14.1); Thu, 26 Apr 2018 14:09:00 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io X-MailChannels-Auth-Id: lmn-TZDUIOWCRQMW X-Whispering-Stretch: 6091d5917afe38cb_1524751740216_1030427380 X-MC-Loop-Signature: 1524751740215:1778661543 X-MC-Ingress-Time: 1524751740215 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id F3CFB5BC92; Thu, 26 Apr 2018 14:08:54 +0000 (UTC) From: Icenowy Zheng To: Ulf Hansson , Rob Herring , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 1/3] mmc: sunxi: add support for the MMC controller on H6 Date: Thu, 26 Apr 2018 22:07:26 +0800 Message-Id: <20180426140728.43155-2-icenowy@aosc.io> In-Reply-To: <20180426140728.43155-1-icenowy@aosc.io> References: <20180426140728.43155-1-icenowy@aosc.io> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180426_070917_178803_A56C6299 X-CRM114-Status: GOOD ( 16.62 ) 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: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 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 The new Allwinner H6 SoC have 3 MMC controllers. The first and second ones are similar to the ones on A64, but the third one adds EMCE (Embedded Crypto Engine) support which does hardware transparent crypto on the eMMC. As we still do not have support for EMCE, and the support of it is disabled by defualt, we just duplicate the A64 mmc configurations and change the compatible string. Signed-off-by: Icenowy Zheng --- Documentation/devicetree/bindings/mmc/sunxi-mmc.txt | 2 ++ drivers/mmc/host/sunxi-mmc.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt b/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt index 132e0007d7d6..e6aa5c7a5e12 100644 --- a/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt +++ b/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt @@ -16,6 +16,8 @@ Required properties: * "allwinner,sun9i-a80-mmc" * "allwinner,sun50i-a64-emmc" * "allwinner,sun50i-a64-mmc" + * "allwinner,sun50i-h6-emmc" + * "allwinner,sun50i-h6-mmc" - reg : mmc controller base registers - clocks : a list with 4 phandle + clock specifier pairs - clock-names : must contain "ahb", "mmc", "output" and "sample" diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 97c6b79b7d6f..05e2b5fd7aa4 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1168,6 +1168,20 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = { .can_calibrate = true, }; +static const struct sunxi_mmc_cfg sun50i_h6_cfg = { + .idma_des_size_bits = 16, + .clk_delays = NULL, + .can_calibrate = true, + .mask_data0 = true, + .needs_new_timings = true, +}; + +static const struct sunxi_mmc_cfg sun50i_h6_emmc_cfg = { + .idma_des_size_bits = 13, + .clk_delays = NULL, + .can_calibrate = true, +}; + static const struct of_device_id sunxi_mmc_of_match[] = { { .compatible = "allwinner,sun4i-a10-mmc", .data = &sun4i_a10_cfg }, { .compatible = "allwinner,sun5i-a13-mmc", .data = &sun5i_a13_cfg }, @@ -1176,6 +1190,8 @@ static const struct of_device_id sunxi_mmc_of_match[] = { { .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg }, { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, + { .compatible = "allwinner,sun50i-h6-mmc", .data = &sun50i_h6_cfg }, + { .compatible = "allwinner,sun50i-h6-emmc", .data = &sun50i_h6_emmc_cfg }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);