Skip to content

Commit

Permalink
Bluetooth: controller: Update to new HCI driver API
Browse files Browse the repository at this point in the history
Update the native controller to the new HCI driver API. The devicetree
node is placed under existing `radio` nodes, which seemed like the most
intuitive option.

Signed-off-by: Johan Hedberg <[email protected]>
  • Loading branch information
jhedberg authored and nashif committed Jun 11, 2024
1 parent 3482a3b commit 44e0f5f
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
zephyr,shell-uart = &lpuart0;
zephyr,uart-pipe = &lpuart0;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci = &bt_hci_controller;
};
};

&bt_hci_controller {
status = "okay";
};

&m4_flash {
/*
* For more information, see:
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
menuconfig BT_DRIVERS
bool "Bluetooth drivers"
default y
depends on BT && !BT_CTLR
depends on BT

if BT_DRIVERS

Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf51822.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -73,6 +74,11 @@
reg = <0x40001000 0x1000>;
interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
status = "okay";

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52805.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -86,6 +87,11 @@
interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
status = "okay";
ble-2mbps-supported;

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52810.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -90,6 +91,11 @@
interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
status = "okay";
ble-2mbps-supported;

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52811.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -102,6 +103,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52820.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/ {

chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -98,6 +99,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52832.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -90,6 +91,11 @@
interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
status = "okay";
ble-2mbps-supported;

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52833.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -97,6 +98,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf52840.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -92,6 +93,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

uart0: uart@40002000 {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nordic/nrf5340_cpunet.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,flash-controller = &flash_controller;
};
Expand Down Expand Up @@ -100,6 +101,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "okay";
};
};

rng: random@41009000 {
Expand Down
8 changes: 8 additions & 0 deletions dts/arm/nordic/nrf54l15_cpuapp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {};
/delete-node/ &cpuflpr_clic;

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
};

soc {
compatible = "simple-bus";
interrupt-parent = <&cpuapp_nvic>;
Expand All @@ -29,6 +33,10 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {};
};
};

&bt_hci_controller {
status = "okay";
};

&cpuapp_ppb {
compatible = "simple-bus";
ranges;
Expand Down
13 changes: 13 additions & 0 deletions dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Bluetooth HCI provided by the native Zephyr Bluetooth Controller

compatible: "zephyr,bt-hci-ll-sw-split"

include: bt-hci.yaml

properties:
bt-hci-name:
default: "Controller"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_AUTO_DLE"]
5 changes: 5 additions & 0 deletions dts/common/nordic/nrf54l15.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@
compatible = "nordic,nrf-ieee802154";
status = "disabled";
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "disabled";
};
};

dppic20: dppic@c2000 {
Expand Down
5 changes: 5 additions & 0 deletions dts/riscv/openisa/rv32m1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -524,5 +524,10 @@
write-block-size = <8>;
};
};

bt_hci_controller: bt_hci_controller {
compatible = "zephyr,bt-hci-ll-sw-split";
status = "disabled";
};
};
};
1 change: 1 addition & 0 deletions subsys/bluetooth/controller/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ endchoice
config BT_CTLR_HCI
bool "Host Controller Interface (HCI)"
default y
depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED
help
Enable the Host Controller interface (HCI) in the Controller.
This should almost always be enabled, except in a few special
Expand Down
Loading

0 comments on commit 44e0f5f

Please sign in to comment.