arm64: dts: rockchip: add BT/wifi nodes to Pinephone Pro
authorTom Fitzhenry <tom@tom-fitzhenry.me.uk>
Sun, 2 Oct 2022 09:28:09 +0000 (20:28 +1100)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 17 Oct 2022 12:02:36 +0000 (14:02 +0200)
Pinephone Pro includes a AzureWave AW-CM256SM wifi (sdio0) and
bt (uart0) combo module, which is based on Cypress
CYP43455 (BCM43455).

The CYP43455 datasheet ("Power-Up Sequence and Timing") documents:
* needing to wait 10ms between consecutive WL_REG_ON toggles
* needing to wait 110ms between power-on and SDIO access.

Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Reviewed-by: Ondřej Jirman <megi@xff.cz>
Link: https://lore.kernel.org/r/20221002092809.451501-1-tom@tom-fitzhenry.me.uk
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

index 2e058c3..04403a7 100644 (file)
                regulator-max-microvolt = <1800000>;
                vin-supply = <&vcc3v3_sys>;
        };
+
+       wifi_pwrseq: sdio-wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk818 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_enable_h_pin>;
+               /*
+                * Wait between power-on and SDIO access for CYP43455
+                * POR circuit.
+                */
+               post-power-on-delay-ms = <110>;
+               /*
+                * Wait between consecutive toggles for CYP43455 CBUCK
+                * regulator discharge.
+                */
+               power-off-delay-us = <10000>;
+
+               /* WL_REG_ON on module */
+               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+       };
 };
 
 &cpu_l0 {
                };
        };
 
+       sdio-pwrseq {
+               wifi_enable_h_pin: wifi-enable-h-pin {
+                       rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        sound {
                vcc1v8_codec_en: vcc1v8-codec-en {
                        rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
                };
        };
+
+       wireless-bluetooth {
+               bt_wake_pin: bt-wake-pin {
+                       rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_host_wake_pin: bt-host-wake-pin {
+                       rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_reset_pin: bt-reset-pin {
+                       rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&sdio0 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       disable-wp;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+       sd-uhs-sdr104;
+       status = "okay";
 };
 
 &sdmmc {
        status = "okay";
 };
 
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+       uart-has-rtscts;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm4345c5";
+               clocks = <&rk818 1>;
+               clock-names = "lpo";
+               device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
+               host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+               max-speed = <1500000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
+               shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+               vbat-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc_1v8>;
+       };
+};
+
 &uart2 {
        status = "okay";
 };