From patchwork Sun Sep 2 10:05:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Summers X-Patchwork-Id: 10585093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 388DB112B for ; Sun, 2 Sep 2018 10:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28BD429AB5 for ; Sun, 2 Sep 2018 10:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C74A29ACB; Sun, 2 Sep 2018 10:06:06 +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,RCVD_IN_DNSWL_NONE autolearn=ham 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 70B6029AB5 for ; Sun, 2 Sep 2018 10:06:05 +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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=DjkfyhQX0nX5AxpbvVZBF37Q6LBIAPui0nGdVov03kY=; b=tlfvNZQeTzeLJ+dWj6SqsX93qk LdSd2bkWJqlD5Caaq/6egL8CZ9z8jjSfzmuNHIaQxMCz16Vs8pmYGBSkzrgGBhzd9ggC5hvrdU4GL SaDvTbFBEpgiss5rVE/fqPHnRp1e00183R0ChVA9gAnFz5wyrZWqEZ0QMMffhdmP/51W4QI6tjeLe Wx7XaVkUAHS3iItDM8VSyXqDxjsMjT3j08/FFb/6IrhxF03onFIKaCth/6lcegLGXkucrvNnjwzsr rJ35EqzYuvIZ9wwHlH9vYAZ25SmFd05N4as/3jcvtyeOdyATLvN5hn87wit2NYG7qwAwWb14tSDe3 4fJvWyAQ==; 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 1fwPGc-00061M-Hz; Sun, 02 Sep 2018 10:06:02 +0000 Received: from mail-gw.unlimitedwebhosting.co.uk ([149.255.60.84]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fwPGZ-0005A9-63 for linux-rockchip@lists.infradead.org; Sun, 02 Sep 2018 10:06:01 +0000 Received: from uwhbsf01.unlimitedwebhosting.co.uk (mail-gw.unlimitedwebhosting.co.uk [149.255.60.72]) by mail-gw.unlimitedwebhosting.co.uk (Postfix) with ESMTPS id B5804633E28F for ; Sun, 2 Sep 2018 11:05:06 +0100 (BST) X-ASG-Debug-ID: 1535882706-05541365c96d73b30001-fBy1Pp Received: from cloud515.unlimitedwebhosting.co.uk (cloud515.unlimitedwebhosting.co.uk [149.255.58.109]) by uwhbsf01.unlimitedwebhosting.co.uk with ESMTP id m0rcXXFNRBhkWCna (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 02 Sep 2018 11:05:06 +0100 (BST) X-Barracuda-Envelope-From: beagleboard@davidjohnsummers.uk X-Barracuda-Effective-Source-IP: cloud515.unlimitedwebhosting.co.uk[149.255.58.109] X-Barracuda-Apparent-Source-IP: 149.255.58.109 Received: from 240.42.113.87.dyn.plus.net ([87.113.42.240]:63282 helo=[192.168.1.65]) by cloud515.unlimitedwebhosting.co.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1fwPFf-004QDg-OC; Sun, 02 Sep 2018 11:05:03 +0100 To: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org From: beagleboard@davidjohnsummers.uk Subject: [3/3] Device Tree for ASUS Tinker Board S : Enable WiFi Message-ID: X-ASG-Orig-Subj: [3/3] Device Tree for ASUS Tinker Board S : Enable WiFi Date: Sun, 2 Sep 2018 11:05:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Content-Language: en-GB X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud515.unlimitedwebhosting.co.uk X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - davidjohnsummers.uk X-Get-Message-Sender-Via: cloud515.unlimitedwebhosting.co.uk: authenticated_id: davidjoh/from_h X-Authenticated-Sender: cloud515.unlimitedwebhosting.co.uk: beagleboard@davidjohnsummers.uk X-Barracuda-Connect: cloud515.unlimitedwebhosting.co.uk[149.255.58.109] X-Barracuda-Start-Time: 1535882706 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://149.255.60.72:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at unlimitedwebhosting.co.uk X-Barracuda-Scan-Msg-Size: 6308 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.0 tests=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.56736 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180902_030559_518493_3AD3271B X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. 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: Heiko Stuebner Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables wifi on the ASUS tinker board S. Its based on: https://github.com/TinkerBoard/debian_kernel/commit/6a3128ade33f758887048578ada61a4b7ab8e678 The changes here are more extensive, basic communication is via sdio0, but can also be seen that connections are set up to the RK808 e.g. the power management chip. Now I believe the original tinker board also had wi-fi - so why this isn't enabled on the rk3288-tinker.dts isn't clear to me. I suspect it should be on both. Regards, David Summers.                 #size-cells = <0>; @@ -101,6 +147,14 @@                 startup-delay-us = <100000>;                 vin-supply = <&vcc_io>;         }; + +       vcc_flash: flash-regulator { +               compatible = "regulator-fixed"; +               regulator-name = "vcc_flash"; +               regulator-min-microvolt = <1800000>; +               regulator-max-microvolt = <1800000>; +               vin-supply = <&vcc_io>; +       };  };  &cpu0 { @@ -389,6 +443,15 @@                 };         }; +       sdio-pwrseq { +               wifi_enable_h: wifi-enable-h { +                       rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>; +               }; +               chip_enable_h: chip-enable-h { +                       rockchip,pins = <4 27 RK_FUNC_GPIO &pcfg_pull_none>; +               }; +       }; +         sdmmc {                 sdmmc_bus4: sdmmc-bus4 {                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>, @@ -420,6 +483,12 @@                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;                 };         }; + +       wireless-bluetooth { +               uart0_gpios: uart0-gpios { +                       rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>; +               }; +       };  };  &pwm0 { @@ -431,6 +500,24 @@         status ="okay";  }; +&sdio0 { +       status = "okay"; +       clock-frequency = <50000000>; +       clock-freq-min-max = <200000 50000000>; +       bus-width = <4>; +       cap-sd-highspeed; +       cap-sdio-irq; +       disable-wp; +       keep-power-in-suspend; +       mmc-pwrseq = <&sdio_pwrseq>; +       non-removable; +       num-slots = <1>; +       pinctrl-names = "default"; +       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; +       sd-uhs-sdr104; +       supports-sdio; +}; +  &sdmmc {         bus-width = <4>;         cap-mmc-highspeed; @@ -451,6 +552,8 @@  };  &uart0 { +       pinctrl-names = "default"; +       pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;         status = "okay";  }; diff --git a/arch/arm/boot/dts/rk3288-tinkerS.dts b/arch/arm/boot/dts/rk3288-tinkerS.dts index 9d113418a9c9..2465cddf2f26 100644 --- a/arch/arm/boot/dts/rk3288-tinkerS.dts +++ b/arch/arm/boot/dts/rk3288-tinkerS.dts @@ -21,6 +21,27 @@                 device_type = "memory";         }; +       wireless-bluetooth { +               compatible = "bluetooth-platdata"; +               uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>; +               pinctrl-names = "default","rts_gpio"; +               pinctrl-0 = <&uart0_rts>; +               pinctrl-1 = <&uart0_gpios>; +               BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>; +               BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>; +               BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>; +               status = "okay"; +       }; + +       wireless-wlan { +               compatible = "wlan-platdata"; +               rockchip,grf = <&grf>; +               wifi_chip_type = "ap6212"; +               sdio_vref = <1800>; +               WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>; +               status = "okay"; +       }; +         ext_gmac: external-gmac-clock {                 compatible = "fixed-clock";                 #clock-cells = <0>; @@ -28,7 +49,32 @@                 clock-output-names = "ext_gmac";         }; -       gpio-keys { +       io-domains { +               compatible = "rockchip,rk3288-io-voltage-domain"; +               rockchip,grf = <&grf>; +               flash0-supply = <&vcc_flash>; +               gpio30-supply = <&vcc_io>; +               wifi-supply = <&vcc_18>; +               sdcard-supply = <&vccio_sd>; +       }; + +       sdio_pwrseq: sdio-pwrseq { +               compatible = "mmc-pwrseq-simple"; +               clocks = <&rk808 1>; +               clock-names = "ext_clock"; +               pinctrl-names = "default"; +               pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>; + +               /* +                * On the module itself this is one of these (depending +                * on the actual card populated): +                * - SDIO_RESET_L_WL_REG_ON +                * - PDN (power down when low) +                */ +               reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 27 GPIO_ACTIVE_LOW>; +       }; + +gpio-keys {                 compatible = "gpio-keys";                 #address-cells = <1>;