From patchwork Tue May 8 02:48:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levin X-Patchwork-Id: 10385201 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 9FEA160353 for ; Tue, 8 May 2018 02:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F336289C5 for ; Tue, 8 May 2018 02:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8104928BB3; Tue, 8 May 2018 02:51:28 +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 F3325289C5 for ; Tue, 8 May 2018 02:51:27 +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=vfI4QncauOkg50lepUv8w/U+gOX9gfW0oBQD6k+0SE0=; b=t4ZCEXMNXx4hgLxsZTJO9U7jM3 DOoZmhq5cVQcaarvhdcd2PNNba7ogfRQPhV76RJ0vbGS3XFcIME2II9fHJrRWgLILNJwzomWaM2eP NfMucsy4lqctKBUF2+oC5nhiMYoqc4OoGPUMYUJJmDNgzI1uvXGBKqnWISB0KGbE9spu4cItketak IVZTb1y1gY43JfcWaFitUcQbb6fJT/22OYxQzfJLlypqyRmPE4a7e3I0O95i0GSmD1nAhyxTbUwHO JHN1fM9OPjKSnkXa00nIFnawncWI7shCKAfxi4/oFAjG4h8Nw2vCsNG4J0P6EP4FeUhTSznrjPuNB hBu1aS5g==; 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 1fFsio-0005L5-0H; Tue, 08 May 2018 02:51:22 +0000 Received: from regular1.263xmail.com ([211.150.99.131]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFshQ-0003Rb-FM; Tue, 08 May 2018 02:49:58 +0000 Received: from djw?t-chip.com.cn (unknown [192.168.167.87]) by regular1.263xmail.com (Postfix) with ESMTP id DEE8262AA; Tue, 8 May 2018 10:49:42 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id D86FD3A3; Tue, 8 May 2018 10:49:40 +0800 (CST) X-RL-SENDER: djw@t-chip.com.cn X-FST-TO: linux-rockchip@lists.infradead.org X-SENDER-IP: 59.33.107.187 X-LOGIN-NAME: djw@t-chip.com.cn X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: djw@t-chip.com.cn X-DNS-TYPE: 7 Received: from unknown (187.107.33.59.broad.zs.gd.dynamic.163data.com.cn [59.33.107.187]) by smtp.263.net (Postfix) whith SMTP id 19231R4AT48; Tue, 08 May 2018 10:49:42 +0800 (CST) From: djw@t-chip.com.cn To: linux-rockchip@lists.infradead.org Subject: [PATCH v0 2/2] arm64: dts: rockchip: Add sdmmc UHS support for roc-rk3328-cc Date: Tue, 8 May 2018 10:48:24 +0800 Message-Id: <1525747704-8537-3-git-send-email-djw@t-chip.com.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525747704-8537-1-git-send-email-djw@t-chip.com.cn> References: <1525747704-8537-1-git-send-email-djw@t-chip.com.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180507_194957_033425_954BD4D0 X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Wayne Chou , Heiko Stuebner , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org, David Wu , William Wu , Rocky Hao , Levin Du , "David S. Miller" , Liang Chen , Joseph Chen MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Levin Du In roc-rk3328-cc board, the signal voltage of sdmmc is supplied by the vcc_sdio regulator, which is a mux between 1.8V and 3.3V, controlled by a special output only gpio pin. However, this pin, not being a normal gpio in the rockchip pinctrl, is set by bit 1 of system register GRF_SOC_CON10. Therefore a new gpio controller using gpio-syscon driver is defined in order to use regulator-gpio. If the signal voltage changes, the io domain needs to change correspondingly. To use this feature, the following options are required in kernel config: - CONFIG_GPIO_SYSCON=y - CONFIG_POWER_AVS=y - CONFIG_ROCKCHIP_IODOMAIN=y Signed-off-by: Levin Du --- arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts index 246c317..792cb04 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -14,6 +14,12 @@ stdout-path = "serial2:1500000n8"; }; + gpio_syscon10: gpio-syscon10 { + compatible = "rockchip,rk3328-gpio-syscon10"; + gpio-controller; + #gpio-cells = <2>; + }; + gmac_clkin: external-gmac-clock { compatible = "fixed-clock"; clock-frequency = <125000000>; @@ -41,6 +47,19 @@ vin-supply = <&vcc_io>; }; + vcc_sdio: sdmmcio-regulator { + compatible = "regulator-gpio"; + gpios = <&gpio_syscon10 1 GPIO_ACTIVE_HIGH>; + states = <1800000 0x1 + 3300000 0x0>; + regulator-name = "vcc_sdio"; + regulator-type = "voltage"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; + vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator { compatible = "regulator-fixed"; enable-active-high; @@ -208,6 +227,18 @@ }; }; +&io_domains { + status = "okay"; + + vccio1-supply = <&vcc_io>; + vccio2-supply = <&vcc18_emmc>; + vccio3-supply = <&vcc_sdio>; + vccio4-supply = <&vcc_18>; + vccio5-supply = <&vcc_io>; + vccio6-supply = <&vcc_io>; + pmuio-supply = <&vcc_io>; +}; + &pinctrl { pmic { pmic_int_l: pmic-int-l { @@ -227,10 +258,15 @@ cap-mmc-highspeed; cap-sd-highspeed; disable-wp; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; max-frequency = <150000000>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>; vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vcc_sdio>; status = "okay"; };