Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: rockchip: Add brcm bluetooth for rk3288-veyron

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>

authored by

Abhishek Pandit-Subedi and committed by
Heiko Stuebner
8784692d e42617b8

+155 -75
+9
arch/arm/boot/dts/rk3288-veyron-brain.dts
··· 7 7 8 8 /dts-v1/; 9 9 #include "rk3288-veyron.dtsi" 10 + #include "rk3288-veyron-broadcom-bluetooth.dtsi" 10 11 11 12 / { 12 13 model = "Google Brain"; ··· 41 40 }; 42 41 43 42 &pinctrl { 43 + pinctrl-names = "default"; 44 + pinctrl-0 = < 45 + /* Common for sleep and wake, but no owners */ 46 + &ddr0_retention 47 + &ddrio_pwroff 48 + &global_pwroff 49 + >; 50 + 44 51 hdmi { 45 52 vcc50_hdmi_en: vcc50-hdmi-en { 46 53 rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+22
arch/arm/boot/dts/rk3288-veyron-broadcom-bluetooth.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 + /* 3 + * Google Veyron (and derivatives) fragment for the Broadcom 43450 bluetooth 4 + * chip. 5 + * 6 + * Copyright 2019 Google, Inc 7 + */ 8 + 9 + &uart0 { 10 + bluetooth { 11 + pinctrl-names = "default"; 12 + pinctrl-0 = <&bt_host_wake_l>, <&bt_enable_l>, 13 + <&bt_dev_wake>; 14 + 15 + compatible = "brcm,bcm43540-bt"; 16 + host-wakeup-gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>; 17 + shutdown-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>; 18 + device-wakeup-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; 19 + max-speed = <3000000>; 20 + brcm,bt-pcm-int-params = [01 02 00 01 01]; 21 + }; 22 + };
-21
arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
··· 136 136 }; 137 137 138 138 &pinctrl { 139 - pinctrl-0 = < 140 - /* Common for sleep and wake, but no owners */ 141 - &ddr0_retention 142 - &ddrio_pwroff 143 - &global_pwroff 144 - 145 - /* Wake only */ 146 - &suspend_l_wake 147 - &bt_dev_wake_awake 148 - >; 149 - pinctrl-1 = < 150 - /* Common for sleep and wake, but no owners */ 151 - &ddr0_retention 152 - &ddrio_pwroff 153 - &global_pwroff 154 - 155 - /* Sleep only */ 156 - &suspend_l_sleep 157 - &bt_dev_wake_sleep 158 - >; 159 - 160 139 buttons { 161 140 ap_lid_int_l: ap-lid-int-l { 162 141 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
-2
arch/arm/boot/dts/rk3288-veyron-fievel.dts
··· 18 18 "google,veyron-fievel-rev0", "google,veyron-fievel", 19 19 "google,veyron", "rockchip,rk3288"; 20 20 21 - /delete-node/ bt-activity; 22 - 23 21 vccsys: vccsys { 24 22 compatible = "regulator-fixed"; 25 23 regulator-name = "vccsys";
+22
arch/arm/boot/dts/rk3288-veyron-jaq.dts
··· 273 273 }; 274 274 275 275 &pinctrl { 276 + pinctrl-names = "default", "sleep"; 277 + pinctrl-0 = < 278 + /* Common for sleep and wake, but no owners */ 279 + &ddr0_retention 280 + &ddrio_pwroff 281 + &global_pwroff 282 + 283 + /* Wake only */ 284 + &suspend_l_wake 285 + &bt_dev_wake_awake 286 + >; 287 + pinctrl-1 = < 288 + /* Common for sleep and wake, but no owners */ 289 + &ddr0_retention 290 + &ddrio_pwroff 291 + &global_pwroff 292 + 293 + /* Sleep only */ 294 + &suspend_l_sleep 295 + &bt_dev_wake_sleep 296 + >; 297 + 276 298 buck-5v { 277 299 drv_5v: drv-5v { 278 300 rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+22
arch/arm/boot/dts/rk3288-veyron-jerry.dts
··· 418 418 }; 419 419 420 420 &pinctrl { 421 + pinctrl-names = "default", "sleep"; 422 + pinctrl-0 = < 423 + /* Common for sleep and wake, but no owners */ 424 + &ddr0_retention 425 + &ddrio_pwroff 426 + &global_pwroff 427 + 428 + /* Wake only */ 429 + &suspend_l_wake 430 + &bt_dev_wake_awake 431 + >; 432 + pinctrl-1 = < 433 + /* Common for sleep and wake, but no owners */ 434 + &ddr0_retention 435 + &ddrio_pwroff 436 + &global_pwroff 437 + 438 + /* Sleep only */ 439 + &suspend_l_sleep 440 + &bt_dev_wake_sleep 441 + >; 442 + 421 443 buck-5v { 422 444 drv_5v: drv-5v { 423 445 rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+9
arch/arm/boot/dts/rk3288-veyron-mickey.dts
··· 7 7 8 8 /dts-v1/; 9 9 #include "rk3288-veyron.dtsi" 10 + #include "rk3288-veyron-broadcom-bluetooth.dtsi" 10 11 11 12 / { 12 13 model = "Google Mickey"; ··· 412 411 }; 413 412 414 413 &pinctrl { 414 + pinctrl-names = "default"; 415 + pinctrl-0 = < 416 + /* Common for sleep and wake, but no owners */ 417 + &ddr0_retention 418 + &ddrio_pwroff 419 + &global_pwroff 420 + >; 421 + 415 422 hdmi { 416 423 power_hdmi_on: power-hdmi-on { 417 424 rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
+21
arch/arm/boot/dts/rk3288-veyron-minnie.dts
··· 7 7 8 8 /dts-v1/; 9 9 #include "rk3288-veyron-chromebook.dtsi" 10 + #include "rk3288-veyron-broadcom-bluetooth.dtsi" 10 11 11 12 / { 12 13 model = "Google Minnie"; ··· 345 344 }; 346 345 347 346 &pinctrl { 347 + pinctrl-names = "default", "sleep"; 348 + pinctrl-0 = < 349 + /* Common for sleep and wake, but no owners */ 350 + &ddr0_retention 351 + &ddrio_pwroff 352 + &global_pwroff 353 + 354 + /* Wake only */ 355 + &suspend_l_wake 356 + >; 357 + pinctrl-1 = < 358 + /* Common for sleep and wake, but no owners */ 359 + &ddr0_retention 360 + &ddrio_pwroff 361 + &global_pwroff 362 + 363 + /* Sleep only */ 364 + &suspend_l_sleep 365 + >; 366 + 348 367 buck-5v { 349 368 drv_5v: drv-5v { 350 369 rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+22
arch/arm/boot/dts/rk3288-veyron-pinky.dts
··· 64 64 }; 65 65 66 66 &pinctrl { 67 + pinctrl-names = "default", "sleep"; 68 + pinctrl-0 = < 69 + /* Common for sleep and wake, but no owners */ 70 + &ddr0_retention 71 + &ddrio_pwroff 72 + &global_pwroff 73 + 74 + /* Wake only */ 75 + &suspend_l_wake 76 + &bt_dev_wake_awake 77 + >; 78 + pinctrl-1 = < 79 + /* Common for sleep and wake, but no owners */ 80 + &ddr0_retention 81 + &ddrio_pwroff 82 + &global_pwroff 83 + 84 + /* Sleep only */ 85 + &suspend_l_sleep 86 + &bt_dev_wake_sleep 87 + >; 88 + 67 89 /delete-node/ lcd; 68 90 69 91 backlight {
+21
arch/arm/boot/dts/rk3288-veyron-speedy.dts
··· 7 7 8 8 /dts-v1/; 9 9 #include "rk3288-veyron-chromebook.dtsi" 10 + #include "rk3288-veyron-broadcom-bluetooth.dtsi" 10 11 #include "cros-ec-sbs.dtsi" 11 12 12 13 / { ··· 280 279 }; 281 280 282 281 &pinctrl { 282 + pinctrl-names = "default", "sleep"; 283 + pinctrl-0 = < 284 + /* Common for sleep and wake, but no owners */ 285 + &ddr0_retention 286 + &ddrio_pwroff 287 + &global_pwroff 288 + 289 + /* Wake only */ 290 + &suspend_l_wake 291 + >; 292 + pinctrl-1 = < 293 + /* Common for sleep and wake, but no owners */ 294 + &ddr0_retention 295 + &ddrio_pwroff 296 + &global_pwroff 297 + 298 + /* Sleep only */ 299 + &suspend_l_sleep 300 + >; 301 + 283 302 buck-5v { 284 303 drv_5v: drv-5v { 285 304 rockchip,pins = <7 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+7 -52
arch/arm/boot/dts/rk3288-veyron.dtsi
··· 23 23 reg = <0x0 0x0 0x0 0x80000000>; 24 24 }; 25 25 26 - bt_activity: bt-activity { 27 - compatible = "gpio-keys"; 28 - pinctrl-names = "default"; 29 - pinctrl-0 = <&bt_host_wake>; 30 - 31 - /* 32 - * HACK: until we have an LPM driver, we'll use an 33 - * ugly GPIO key to allow Bluetooth to wake from S3. 34 - * This is expected to only be used by BT modules that 35 - * use UART for comms. For BT modules that talk over 36 - * SDIO we should use a wakeup mechanism related to SDIO. 37 - * 38 - * Use KEY_RESERVED here since that will work as a wakeup but 39 - * doesn't get reported to higher levels (so doesn't confuse 40 - * Chrome). 41 - */ 42 - bt-wake { 43 - label = "BT Wakeup"; 44 - gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>; 45 - linux,code = <KEY_RESERVED>; 46 - wakeup-source; 47 - }; 48 - 49 - }; 50 26 51 27 power_button: power-button { 52 28 compatible = "gpio-keys"; ··· 58 82 clocks = <&rk808 RK808_CLKOUT1>; 59 83 clock-names = "ext_clock"; 60 84 pinctrl-names = "default"; 61 - pinctrl-0 = <&bt_enable_l>, <&wifi_enable_h>; 85 + pinctrl-0 = <&wifi_enable_h>; 62 86 63 87 /* 64 - * Depending on the actual card populated GPIO4 D4 and D5 88 + * Depending on the actual card populated GPIO4 D4 65 89 * correspond to one of these signals on the module: 66 90 * 67 91 * D4: 68 92 * - SDIO_RESET_L_WL_REG_ON 69 93 * - PDN (power down when low) 70 - * 71 - * D5: 72 - * - BT_I2S_WS_BT_RFDISABLE_L 73 - * - No connect 74 94 */ 75 - reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>, 76 - <&gpio4 RK_PD5 GPIO_ACTIVE_LOW>; 95 + reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>; 77 96 }; 78 97 79 98 vcc_5v: vcc-5v { ··· 452 481 }; 453 482 454 483 &pinctrl { 455 - pinctrl-names = "default", "sleep"; 456 - pinctrl-0 = < 457 - /* Common for sleep and wake, but no owners */ 458 - &ddr0_retention 459 - &ddrio_pwroff 460 - &global_pwroff 461 - 462 - /* Wake only */ 463 - &bt_dev_wake_awake 464 - >; 465 - pinctrl-1 = < 466 - /* Common for sleep and wake, but no owners */ 467 - &ddr0_retention 468 - &ddrio_pwroff 469 - &global_pwroff 470 - 471 - /* Sleep only */ 472 - &bt_dev_wake_sleep 473 - >; 474 - 475 484 pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma { 476 485 bias-disable; 477 486 drive-strength = <8>; ··· 572 621 573 622 bt_dev_wake_awake: bt-dev-wake-awake { 574 623 rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_output_high>; 624 + }; 625 + 626 + bt_dev_wake: bt-dev-wake { 627 + rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 575 628 }; 576 629 }; 577 630