Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bluetooth overlays #3682

Merged
merged 2 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions arch/arm/boot/dts/bcm2708-rpi-bt.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-2.0

&uart0 {
bt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <3000000>;
shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};

&uart1 {
minibt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <460800>;
shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};

/ {
__overrides__ {
krnbt = <&bt>,"status";
krnbt_baudrate = <&bt>,"max-speed:0";
};
};
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm2708-rpi-zero-w.dts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "bcm2708-rpi.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm2708-rpi-bt.dtsi"

/ {
pelwell marked this conversation as resolved.
Show resolved Hide resolved
compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "bcm283x-rpi-lan7515.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
#include "bcm271x-rpi-bt.dtsi"

/ {
compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm2710-rpi-3-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "bcm283x-rpi-smsc9514.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
#include "bcm271x-rpi-bt.dtsi"

/ {
compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/boot/dts/bcm2711-rpi-4-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
// Downstream rpi- changes

#include "bcm270x.dtsi"
#include "bcm271x-rpi-bt.dtsi"

/ {
soc {
Expand Down Expand Up @@ -287,8 +288,6 @@
&uart0 {
pinctrl-0 = <&uart0_pins &bt_pins>;
status = "okay";

/delete-node/ bluetooth;
};

&uart1 {
Expand Down
26 changes: 26 additions & 0 deletions arch/arm/boot/dts/bcm271x-rpi-bt.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-2.0

&uart0 {
bt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <3000000>;
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};

&uart1 {
minibt: bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <460800>;
shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};

/ {
__overrides__ {
krnbt = <&bt>,"status";
krnbt_baudrate = <&bt>,"max-speed:0";
};
};
12 changes: 10 additions & 2 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ Params:
i2s Set to "on" to enable the i2s interface
(default "off")

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

krnbt_baudrate Set the baudrate of the PL011 UART when used
with krnbt=on

spi Set to "on" to enable the spi interfaces
(default "off")

Expand Down Expand Up @@ -1748,8 +1755,9 @@ Info: Switch the onboard Bluetooth function on Pi 3B, 3B+, 3A+, 4B and Zero W
in which case use /dev/serial1 instead because it will always be
correct. Furthermore, you must also set core_freq and core_freq_min to
the same value in config.txt or the miniuart will not work.
Load: dtoverlay=miniuart-bt
Params: <None>
Load: dtoverlay=miniuart-bt,<param>=<val>
Params: krnbt Set to "on" to enable autoprobing of Bluetooth
driver without need of hciattach/btattach


Name: mmc
Expand Down
13 changes: 11 additions & 2 deletions arch/arm/boot/dts/overlays/disable-bt-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
sudo systemctl disable hciuart
*/

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

/{
compatible = "brcm,bcm2835";

Expand All @@ -28,6 +30,13 @@
};

fragment@2 {
target = <&bt>;
__overlay__ {
status = "disabled";
};
};

fragment@3 {
target = <&uart0_pins>;
__overlay__ {
brcm,pins;
Expand All @@ -36,7 +45,7 @@
};
};

fragment@3 {
fragment@4 {
target = <&bt_pins>;
__overlay__ {
brcm,pins;
Expand All @@ -45,7 +54,7 @@
};
};

fragment@4 {
fragment@5 {
target-path = "/aliases";
__overlay__ {
serial0 = "/soc/serial@7e201000";
Expand Down
21 changes: 17 additions & 4 deletions arch/arm/boot/dts/overlays/miniuart-bt-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
this overlay is used.
*/

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

/{
compatible = "brcm,bcm2835";

Expand All @@ -28,6 +30,13 @@
};

fragment@1 {
target = <&bt>;
__overlay__ {
status = "disabled";
};
};

fragment@2 {
target = <&uart1>;
__overlay__ {
pinctrl-names = "default";
Expand All @@ -36,7 +45,7 @@
};
};

fragment@2 {
fragment@3 {
target = <&uart0_pins>;
__overlay__ {
brcm,pins;
Expand All @@ -45,7 +54,7 @@
};
};

fragment@3 {
fragment@4 {
target = <&uart1_pins>;
__overlay__ {
brcm,pins = <32 33>;
Expand All @@ -54,7 +63,7 @@
};
};

fragment@4 {
fragment@5 {
target = <&gpio>;
__overlay__ {
fake_bt_cts: fake_bt_cts {
Expand All @@ -64,11 +73,15 @@
};
};

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

__overrides__ {
krnbt = <&minibt>,"status";
};
};
3 changes: 2 additions & 1 deletion arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_SPI=y
CONFIG_SERIAL_DEV_BUS=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
pelwell marked this conversation as resolved.
Show resolved Hide resolved
CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
CONFIG_RAW_DRIVER=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_SPI=y
CONFIG_SERIAL_DEV_BUS=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
CONFIG_RAW_DRIVER=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_SPI=y
CONFIG_SERIAL_DEV_BUS=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
CONFIG_RAW_DRIVER=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_SPI=y
CONFIG_SERIAL_DEV_BUS=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
CONFIG_RAW_DRIVER=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm64/configs/bcmrpi3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_SPI=y
CONFIG_SERIAL_DEV_BUS=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
CONFIG_RAW_DRIVER=y
Expand Down