Skip to content

Commit

Permalink
ARM: dts: bcm27xx: Enable kernel Bluetooth
Browse files Browse the repository at this point in the history
Change the base Device Tree files so that by default the kernel is
responsible for initialisation of the onboard Bluetooth modems.
Use dtparam=krnbt=off to revert to the old behaviour.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
  • Loading branch information
pelwell committed Apr 26, 2023
1 parent 49dc409 commit ec08e93
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 28 deletions.
18 changes: 15 additions & 3 deletions arch/arm/boot/dts/bcm2708-rpi-bt.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@
compatible = "brcm,bcm43438-bt";
max-speed = <3000000>;
shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
status = "disabled";
local-bd-address = [ 00 00 00 00 00 00 ];
fallback-bd-address; // Don't override a valid address
status = "okay";
};
};

&uart1 {
minibt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <460800>;
max-speed = <230400>;
shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
local-bd-address = [ 00 00 00 00 00 00 ];
fallback-bd-address; // Don't override a valid address
status = "disabled";
};
};

/ {
aliases {
bluetooth = &bt;
};

__overrides__ {
bdaddr = <&bt>,"local-bd-address[",
<&bt>,"fallback-bd-address?=0",
<&minibt>,"local-bd-address[",
<&minibt>,"fallback-bd-address?=0";
krnbt = <&bt>,"status";
krnbt_baudrate = <&bt>,"max-speed:0";
krnbt_baudrate = <&bt>,"max-speed:0", <&minibt>,"max-speed:0";
};
};
18 changes: 15 additions & 3 deletions arch/arm/boot/dts/bcm271x-rpi-bt.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@
compatible = "brcm,bcm43438-bt";
max-speed = <3000000>;
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
status = "disabled";
local-bd-address = [ 00 00 00 00 00 00 ];
fallback-bd-address; // Don't override a valid address
status = "okay";
};
};

&uart1 {
minibt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <460800>;
max-speed = <230400>;
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
local-bd-address = [ 00 00 00 00 00 00 ];
fallback-bd-address; // Don't override a valid address
status = "disabled";
};
};

/ {
aliases {
bluetooth = &bt;
};

__overrides__ {
bdaddr = <&bt>,"local-bd-address[",
<&bt>,"fallback-bd-address?=0",
<&minibt>,"local-bd-address[",
<&minibt>,"fallback-bd-address?=0";
krnbt = <&bt>,"status";
krnbt_baudrate = <&bt>,"max-speed:0";
krnbt_baudrate = <&bt>,"max-speed:0", <&minibt>,"max-speed:0";
};
};
11 changes: 9 additions & 2 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ Params:
See /sys/kernel/debug/raspberrypi_axi_monitor
for the results.

bdaddr Set an alternative Bluetooth address (BDADDR).
The value should be a 6-byte hexadecimal value,
with or without colon separators, written least-
significant-byte first. For example,
bdaddr=06:05:04:03:02:01
will set the BDADDR to 01:02:03:04:05:06.

cam0_reg Enables CAM 0 regulator.
Only required on CM1 & 3.

Expand Down Expand Up @@ -219,9 +226,9 @@ Params:
i2s Set to "on" to enable the i2s interface
(default "off")

krnbt Set to "on" to enable autoprobing of Bluetooth
krnbt Set to "off" to disable autoprobing of Bluetooth
driver without need of hciattach/btattach
(default "off")
(default "on")

krnbt_baudrate Set the baudrate of the PL011 UART when used
with krnbt=on
Expand Down
7 changes: 1 addition & 6 deletions arch/arm/boot/dts/overlays/disable-bt-overlay.dts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/dts-v1/;
/plugin/;

/* Disable Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15.
To disable the systemd service that initialises the modem so it doesn't use
the UART:

sudo systemctl disable hciuart
*/
/* Disable Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15. */

#include <dt-bindings/gpio/gpio.h>

Expand Down
20 changes: 6 additions & 14 deletions arch/arm/boot/dts/overlays/miniuart-bt-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
target = <&uart1>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins &bt_pins &fake_bt_cts>;
pinctrl-0 = <&uart1_pins>;
status = "okay";
};
};
Expand All @@ -57,37 +57,29 @@
fragment@4 {
target = <&uart1_pins>;
__overlay__ {
brcm,pins = <32 33>;
brcm,pins = <32 33 30 31>;
brcm,function = <2>; /* alt5=UART1 */
brcm,pull = <0 2>;
brcm,pull = <0 2 2 0>;
};
};

fragment@5 {
target = <&gpio>;
__overlay__ {
fake_bt_cts: fake_bt_cts {
brcm,pins = <31>;
brcm,function = <1>; /* output */
};
};
};

fragment@6 {
target-path = "/aliases";
__overlay__ {
serial0 = "/soc/serial@7e201000";
serial1 = "/soc/serial@7e215040";
};
};

fragment@7 {
fragment@6 {
target = <&minibt>;
minibt_frag: __overlay__ {
status = "okay";
};
};

__overrides__ {
krnbt = <&minibt_frag>,"status";
krnbt_baudrate = <&minibt_frag>,"max-speed:0";
};
};

0 comments on commit ec08e93

Please sign in to comment.