ARM: dts: rockchip: Add brcm bluetooth for rk3288-veyron
authorAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Wed, 27 Nov 2019 22:39:09 +0000 (14:39 -0800)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 10 Dec 2019 22:31:48 +0000 (23:31 +0100)
This enables the Broadcom uart bluetooth driver on uart0 and gives it
ownership of its gpios. In order to use this, you must enable the
following kconfig options:
- CONFIG_BT_HCIUART_BCM
- CONFIG_SERIAL_DEV

This is applicable to rk3288-veyron series boards that use the bcm43540
wifi+bt chips.

As part of this change, also refactor the pinctrl across the various
boards. All the boards using broadcom bluetooth shouldn't touch the
bt_dev_wake pin.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20191127223909.253873-2-abhishekpandit@chromium.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm/boot/dts/rk3288-veyron-brain.dts
arch/arm/boot/dts/rk3288-veyron-broadcom-bluetooth.dtsi [new file with mode: 0644]
arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
arch/arm/boot/dts/rk3288-veyron-fievel.dts
arch/arm/boot/dts/rk3288-veyron-jaq.dts
arch/arm/boot/dts/rk3288-veyron-jerry.dts
arch/arm/boot/dts/rk3288-veyron-mickey.dts
arch/arm/boot/dts/rk3288-veyron-minnie.dts
arch/arm/boot/dts/rk3288-veyron-pinky.dts
arch/arm/boot/dts/rk3288-veyron-speedy.dts
arch/arm/boot/dts/rk3288-veyron.dtsi

index 406146cbff296fc2ff3bc98e0c4ad78297d099de..aa33d09184ad53a391489f25c7051e8a3cae3750 100644 (file)
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "rk3288-veyron.dtsi"
+#include "rk3288-veyron-broadcom-bluetooth.dtsi"
 
 / {
        model = "Google Brain";
 };
 
 &pinctrl {
+       pinctrl-names = "default";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+       >;
+
        hdmi {
                vcc50_hdmi_en: vcc50-hdmi-en {
                        rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
diff --git a/arch/arm/boot/dts/rk3288-veyron-broadcom-bluetooth.dtsi b/arch/arm/boot/dts/rk3288-veyron-broadcom-bluetooth.dtsi
new file mode 100644 (file)
index 0000000..a10d25a
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Veyron (and derivatives) fragment for the Broadcom 43450 bluetooth
+ * chip.
+ *
+ * Copyright 2019 Google, Inc
+ */
+
+&uart0 {
+       bluetooth {
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_host_wake_l>, <&bt_enable_l>,
+                           <&bt_dev_wake>;
+
+               compatible = "brcm,bcm43540-bt";
+               host-wakeup-gpios       = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
+               shutdown-gpios          = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
+               device-wakeup-gpios     = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+               max-speed               = <3000000>;
+               brcm,bt-pcm-int-params  = [01 02 00 01 01];
+       };
+};
index ffb60f880b3965153d02226c2e3f8da5d9a40c79..05112c25176d3f1afbdb13cc1d79bc2cd3173abc 100644 (file)
 };
 
 &pinctrl {
-       pinctrl-0 = <
-               /* Common for sleep and wake, but no owners */
-               &ddr0_retention
-               &ddrio_pwroff
-               &global_pwroff
-
-               /* Wake only */
-               &suspend_l_wake
-               &bt_dev_wake_awake
-       >;
-       pinctrl-1 = <
-               /* Common for sleep and wake, but no owners */
-               &ddr0_retention
-               &ddrio_pwroff
-               &global_pwroff
-
-               /* Sleep only */
-               &suspend_l_sleep
-               &bt_dev_wake_sleep
-       >;
-
        buttons {
                ap_lid_int_l: ap-lid-int-l {
                        rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
index 9a0f55085839d9b9b495949784c61ea9aceb9d30..7e7ef8e06b8dd37553a8c7d6048b349a05f5a51c 100644 (file)
@@ -18,8 +18,6 @@
                     "google,veyron-fievel-rev0", "google,veyron-fievel",
                     "google,veyron", "rockchip,rk3288";
 
-       /delete-node/ bt-activity;
-
        vccsys: vccsys {
                compatible = "regulator-fixed";
                regulator-name = "vccsys";
index a4966e505a2fb98be9d58ae15c017851f3bc7288..171ba6185b6d391d50591039e6b73221e14e5c1a 100644 (file)
 };
 
 &pinctrl {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Wake only */
+               &suspend_l_wake
+               &bt_dev_wake_awake
+       >;
+       pinctrl-1 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Sleep only */
+               &suspend_l_sleep
+               &bt_dev_wake_sleep
+       >;
+
        buck-5v {
                drv_5v: drv-5v {
                        rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
index a6ee44f0fe13b18f789a37abf03d7016e295845c..66f00d28801a139de232e49349cbfffbbeb1b44d 100644 (file)
 };
 
 &pinctrl {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Wake only */
+               &suspend_l_wake
+               &bt_dev_wake_awake
+       >;
+       pinctrl-1 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Sleep only */
+               &suspend_l_sleep
+               &bt_dev_wake_sleep
+       >;
+
        buck-5v {
                drv_5v: drv-5v {
                        rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
index 06a6a9554c484df9ad5f4b98f11043ef76355b64..ffd1121d19bed7d5d1e3c26d3f3db3af36f778ee 100644 (file)
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "rk3288-veyron.dtsi"
+#include "rk3288-veyron-broadcom-bluetooth.dtsi"
 
 / {
        model = "Google Mickey";
 };
 
 &pinctrl {
+       pinctrl-names = "default";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+       >;
+
        hdmi {
                power_hdmi_on: power-hdmi-on {
                        rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
index c833716dbe480983772d783fc10555a09a2b1679..39f76e02875fd412caed90541bbf3d96d0cc847a 100644 (file)
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "rk3288-veyron-chromebook.dtsi"
+#include "rk3288-veyron-broadcom-bluetooth.dtsi"
 
 / {
        model = "Google Minnie";
 };
 
 &pinctrl {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Wake only */
+               &suspend_l_wake
+       >;
+       pinctrl-1 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Sleep only */
+               &suspend_l_sleep
+       >;
+
        buck-5v {
                drv_5v: drv-5v {
                        rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
index f420499f300ac29c156327d60952a81c5b4e4836..71e6629cc2089304739eaac20dd13ddffb2b1d4c 100644 (file)
 };
 
 &pinctrl {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Wake only */
+               &suspend_l_wake
+               &bt_dev_wake_awake
+       >;
+       pinctrl-1 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Sleep only */
+               &suspend_l_sleep
+               &bt_dev_wake_sleep
+       >;
+
        /delete-node/ lcd;
 
        backlight {
index 2f2989bc3f9c37b8eea24e10155998ba1fafe1b5..e354c61a45e7e8c5e174c7817abc940571c5b2ff 100644 (file)
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "rk3288-veyron-chromebook.dtsi"
+#include "rk3288-veyron-broadcom-bluetooth.dtsi"
 #include "cros-ec-sbs.dtsi"
 
 / {
 };
 
 &pinctrl {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Wake only */
+               &suspend_l_wake
+       >;
+       pinctrl-1 = <
+               /* Common for sleep and wake, but no owners */
+               &ddr0_retention
+               &ddrio_pwroff
+               &global_pwroff
+
+               /* Sleep only */
+               &suspend_l_sleep
+       >;
+
        buck-5v {
                drv_5v: drv-5v {
                        rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
index 7525e3dd1fc10d5d02ad55ee0e3542c6afe4398f..54a6838d73f511e88f3665d126a0d8341a011d3f 100644 (file)
                reg = <0x0 0x0 0x0 0x80000000>;
        };
 
-       bt_activity: bt-activity {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&bt_host_wake>;
-
-               /*
-                * HACK: until we have an LPM driver, we'll use an
-                * ugly GPIO key to allow Bluetooth to wake from S3.
-                * This is expected to only be used by BT modules that
-                * use UART for comms.  For BT modules that talk over
-                * SDIO we should use a wakeup mechanism related to SDIO.
-                *
-                * Use KEY_RESERVED here since that will work as a wakeup but
-                * doesn't get reported to higher levels (so doesn't confuse
-                * Chrome).
-                */
-               bt-wake {
-                       label = "BT Wakeup";
-                       gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_RESERVED>;
-                       wakeup-source;
-               };
-
-       };
 
        power_button: power-button {
                compatible = "gpio-keys";
                clocks = <&rk808 RK808_CLKOUT1>;
                clock-names = "ext_clock";
                pinctrl-names = "default";
-               pinctrl-0 = <&bt_enable_l>, <&wifi_enable_h>;
+               pinctrl-0 = <&wifi_enable_h>;
 
                /*
-                * Depending on the actual card populated GPIO4 D4 and D5
+                * Depending on the actual card populated GPIO4 D4
                 * correspond to one of these signals on the module:
                 *
                 * D4:
                 * - SDIO_RESET_L_WL_REG_ON
                 * - PDN (power down when low)
-                *
-                * D5:
-                * - BT_I2S_WS_BT_RFDISABLE_L
-                * - No connect
                 */
-               reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>,
-                             <&gpio4 RK_PD5 GPIO_ACTIVE_LOW>;
+               reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
        };
 
        vcc_5v: vcc-5v {
 };
 
 &pinctrl {
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <
-               /* Common for sleep and wake, but no owners */
-               &ddr0_retention
-               &ddrio_pwroff
-               &global_pwroff
-
-               /* Wake only */
-               &bt_dev_wake_awake
-       >;
-       pinctrl-1 = <
-               /* Common for sleep and wake, but no owners */
-               &ddr0_retention
-               &ddrio_pwroff
-               &global_pwroff
-
-               /* Sleep only */
-               &bt_dev_wake_sleep
-       >;
-
        pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
                bias-disable;
                drive-strength = <8>;
                bt_dev_wake_awake: bt-dev-wake-awake {
                        rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_output_high>;
                };
+
+               bt_dev_wake: bt-dev-wake {
+                       rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
        };
 
        tpm {