From patchwork Sat Aug 8 21:05:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 6976041 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9357D9F358 for ; Sat, 8 Aug 2015 21:06:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 547EF20561 for ; Sat, 8 Aug 2015 21:06:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85F542054B for ; Sat, 8 Aug 2015 21:06:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOBJw-0007ur-EY; Sat, 08 Aug 2015 21:06:24 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOBJv-0007uZ-GA for linux-rockchip@bombadil.infradead.org; Sat, 08 Aug 2015 21:06:23 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZOBJs-0005R8-Js for linux-rockchip@lists.infradead.org; Sat, 08 Aug 2015 21:06:22 +0000 Received: from ip923444b5.dynamic.kabel-deutschland.de ([146.52.68.181] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZOBJS-0007yf-Fb; Sat, 08 Aug 2015 23:05:54 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Michael Trimarchi Subject: Re: [RFC PATCH] ARM: dts: rockchip: Add wifi support for firefly Date: Sat, 08 Aug 2015 23:05:53 +0200 Message-ID: <5702275.SOOuh5NPWf@diego> User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <1438956725-4188-1-git-send-email-michael@amarulasolutions.com> References: <1438956725-4188-1-git-send-email-michael@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150808_170620_838023_E72302CE X-CRM114-Status: GOOD ( 32.44 ) X-Spam-Score: -3.0 (---) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, romain.perier@gmail.com, linux-mmc@vger.kernel.org, dianders@chromium.org, FUKAUMI Naoki Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Michael, Am Freitag, 7. August 2015, 16:12:05 schrieb Michael Trimarchi: > This patch enable wifi support for the firefly board. > Card answer to me that support from 2.0V but regulator is connected > to 1.8V, so voltage capability is wrong. In order to avoid this > we just defined a fixed regulator trigger by the wifi enable gpio > that report 2.0V. > > Signed-off-by: Michael Trimarchi > --- > arch/arm/boot/dts/rk3288-firefly.dtsi | 43 > +++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 > deletions(-) > > diff --git a/arch/arm/boot/dts/rk3288-firefly.dtsi > b/arch/arm/boot/dts/rk3288-firefly.dtsi index 0b42372..fcf234e 100644 > --- a/arch/arm/boot/dts/rk3288-firefly.dtsi > +++ b/arch/arm/boot/dts/rk3288-firefly.dtsi > @@ -116,6 +116,28 @@ > vin-supply = <&vcc_io>; > }; > > + io_domains: io-domains { > + compatible = "rockchip,rk3288-io-voltage-domain"; > + rockchip,grf = <&grf>; > + > + wifi-supply = <&vcc_18>; > + audio-supply = <&vcca_33>; > + }; should be a separate patch and include the other interesting io-domains as well. > + > + vcc_wifi: wifi-regulator { > + compatible = "regulator-fixed"; > + enable-active-high; > + gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>; > + pinctrl-names = "default"; > + pinctrl-0 = <&sdio0_pwr>; > + regulator-name = "vcc_wifi"; > + regulator-min-microvolt = <2000000>; > + regulator-max-microvolt = <2000000>; > + startup-delay-us = <100000>; > + regulator-always-on; > + vin-supply = <&vcc_io>; > + }; > + > vcc_flash: flash-regulator { > compatible = "regulator-fixed"; > regulator-name = "vcc_flash"; > @@ -437,13 +459,30 @@ > &sdio0 { > broken-cd; > bus-width = <4>; > + clock-freq-min-max = <400000 50000000>; > disable-wp; > non-removable; > + cap-sd-highspeed; > num-slots = <1>; > pinctrl-names = "default"; > - pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>; > - vmmc-supply = <&vcc_18>; > + pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>; > + > + sd-uhs-sdr50; > + sd-uhs-sdr104; > + sd-uhs-ddr50; we don't have mmc tuning capabilities yet, so please no sd-uhs-* stuff. That way you should also be able to leave out the clock-freq-min-max above, as regular "highspeed" does not venture above the 50MHz limit. > + cap-sdio-irq; > + > + vmmc-supply = <&vcc_wifi>; the original supply is actually wrong in the dts. vcc_18 is the io voltage used on the pins _to_ the card, not to supply the card itself. So vcc_18 is actually the so called vqmmc-supply. vmmc-supply is done regularly from vcc_io. So your voltage hack above can go away too. Bringup should also use a mmc-power-sequency so you can make sure the rtc_clock is running, which is also needed by the wifi module. > status = "okay"; missing #address-cells and #size-cells values for the subnodes > + > + brcmf: bcrmf@0 { > + compatible = "brcm,bcm4329-fmac"; > + interrupt-parent = <&gpio4>; > + reg = <0>; > + interrupts = <30 IRQ_TYPE_EDGE_FALLING>; > + interrupt-names = "host-wake"; > + status = "okay"; > + }; > }; > > &sdmmc { I took the liberty to move stuff around how it should look like, but did not find the time to actually test this. So maybe you can take a look at the attached patches. Heiko From 62bd4e7d8e78296089a675575df4354e605723c9 Mon Sep 17 00:00:00 2001 From: Michael Trimarchi Date: Fri, 7 Aug 2015 16:12:05 +0200 Subject: [PATCH 3/3] ARM: dts: rockchip: Add wifi support for firefly This patch enables wifi support for the firefly board. The core supply of the wifi modules comes from vcc_io but aliased to vbat_wl, so add this alias too to make reading the schematics easier. Signed-off-by: Michael Trimarchi --- arch/arm/boot/dts/rk3288-firefly.dtsi | 38 ++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk3288-firefly.dtsi b/arch/arm/boot/dts/rk3288-firefly.dtsi index 0b2b496..506bd00 100644 --- a/arch/arm/boot/dts/rk3288-firefly.dtsi +++ b/arch/arm/boot/dts/rk3288-firefly.dtsi @@ -110,6 +110,17 @@ }; }; + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&hym8563>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_reg_on>; + + /* On the module itself this is WL_REG_ON */ + reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>; + }; + vcc_sys: vsys-regulator { compatible = "regulator-fixed"; regulator-name = "vcc_sys"; @@ -428,6 +439,12 @@ }; }; + sdio { + wifi_reg_on: wifi-reg-on { + rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + sdmmc { sdmmc_pwr: sdmmc-pwr { rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>; @@ -457,15 +474,30 @@ }; &sdio0 { + status = "okay"; + broken-cd; bus-width = <4>; disable-wp; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; non-removable; num-slots = <1>; pinctrl-names = "default"; - pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>; - vmmc-supply = <&vcc_18>; - status = "okay"; + pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>; + vmmc-supply = <&vcc_io>; + vqmmc-supply = <&vccio_wl>; + + brcmf: bcrmf@0 { + compatible = "brcm,bcm4329-fmac"; + reg = <0>; + interrupt-parent = <&gpio4>; + interrupts = <30 IRQ_TYPE_EDGE_FALLING>; + interrupt-names = "host-wake"; + status = "okay"; + }; }; &sdmmc { -- 2.1.4