1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
From 2b704b4ac2202a3fae96c20125c78c4bd4b29064 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Tue, 14 Feb 2023 11:20:58 +0000
Subject: [PATCH] ARM: dts: bcm27xx: Enable kernel Bluetooth
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>
---
arch/arm/boot/dts/bcm2708-rpi-bt.dtsi | 18 ++++++++++++++---
arch/arm/boot/dts/bcm271x-rpi-bt.dtsi | 18 ++++++++++++++---
arch/arm/boot/dts/overlays/README | 11 ++++++++--
.../boot/dts/overlays/disable-bt-overlay.dts | 7 +------
.../boot/dts/overlays/miniuart-bt-overlay.dts | 20 ++++++-------------
5 files changed, 46 insertions(+), 28 deletions(-)
--- a/arch/arm/boot/dts/bcm2708-rpi-bt.dtsi
+++ b/arch/arm/boot/dts/bcm2708-rpi-bt.dtsi
@@ -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";
};
};
--- a/arch/arm/boot/dts/bcm271x-rpi-bt.dtsi
+++ b/arch/arm/boot/dts/bcm271x-rpi-bt.dtsi
@@ -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";
};
};
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -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.
@@ -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
--- a/arch/arm/boot/dts/overlays/disable-bt-overlay.dts
+++ b/arch/arm/boot/dts/overlays/disable-bt-overlay.dts
@@ -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>
--- a/arch/arm/boot/dts/overlays/miniuart-bt-overlay.dts
+++ b/arch/arm/boot/dts/overlays/miniuart-bt-overlay.dts
@@ -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";
};
};
@@ -57,23 +57,13 @@
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";
@@ -81,13 +71,15 @@
};
};
- fragment@7 {
+ fragment@6 {
target = <&minibt>;
minibt_frag: __overlay__ {
+ status = "okay";
};
};
__overrides__ {
krnbt = <&minibt_frag>,"status";
+ krnbt_baudrate = <&minibt_frag>,"max-speed:0";
};
};
|