Skip to content

Commit

Permalink
Bluetooth: drivers: Convert H4 (UART) HCI driver to new API
Browse files Browse the repository at this point in the history
Convert the H4 driver to the new HCI driver API. This includes updating
also any boards that use the driver, i.e. adding the appropriate
devicetree node and chosen property to them.

The bsim HCI UART definitions are removed from dts, since these would
conflict with the native controller HCI instance (see next commit).

Signed-off-by: Johan Hedberg <[email protected]>
  • Loading branch information
jhedberg committed May 5, 2024
1 parent 856fe90 commit 56f4706
Show file tree
Hide file tree
Showing 13 changed files with 334 additions and 222 deletions.
19 changes: 12 additions & 7 deletions boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
zephyr,console = &usart1;
zephyr,shell-uart = &usart1;
zephyr,uart-mcumgr = &usart1;
zephyr,bt-uart = &uart7;
zephyr,bt-hci = &bt_hci;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,canbus = &fdcan2;
Expand Down Expand Up @@ -98,12 +98,17 @@
status = "okay";
hw-flow-control;

murata-1dx {
compatible = "infineon,cyw43xxx-bt-hci";
bt-reg-on-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
bt-host-wake-gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>;
bt-dev-wake-gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>;
fw-download-speed = <115200>;
bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";

murata-1dx {
compatible = "infineon,cyw43xxx-bt-hci";
bt-reg-on-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
bt-host-wake-gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>;
bt-dev-wake-gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>;
fw-download-speed = <115200>;
};
};
};

Expand Down
7 changes: 6 additions & 1 deletion boards/ite/it82xx2_evb/it82xx2_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
chosen {
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,bt-uart = &uart2;
zephyr,bt-hci = &bt_hci;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash-controller = &flashctrl;
Expand Down Expand Up @@ -115,6 +115,11 @@
status = "okay";
current-speed = <460800>;
clock-frequency = <1843200>;

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};

&ite_uart1_wrapper {
Expand Down
7 changes: 6 additions & 1 deletion boards/ite/it8xxx2_evb/it8xxx2_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
chosen {
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,bt-uart = &uart2;
zephyr,bt-hci = &bt_hci;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash-controller = &flashctrl;
Expand Down Expand Up @@ -105,6 +105,11 @@
status = "okay";
current-speed = <460800>;
clock-frequency = <1843200>;

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};
&ite_uart1_wrapper {
status = "okay";
Expand Down
2 changes: 0 additions & 2 deletions boards/native/nrf_bsim/nrf52_bsim.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
zephyr,flash = &flash0;
/* UART used by the BT controller UART HCI driver by default: */
zephyr,bt-c2h-uart = &uart1;
/* UART used by the BT host UART HCI driver by default: */
zephyr,bt-uart = &uart1;
};

soc {
Expand Down
7 changes: 6 additions & 1 deletion boards/nxp/hexiwear/hexiwear_mk64f12.dts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
zephyr,code-partition = &slot0_partition;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-uart = &uart4;
zephyr,bt-hci = &bt_hci;
};

leds {
Expand Down Expand Up @@ -153,6 +153,11 @@
current-speed = <115200>;
pinctrl-0 = <&uart4_default>;
pinctrl-names = "default";

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};

&gpioa {
Expand Down
7 changes: 6 additions & 1 deletion boards/qemu/cortex_m3/qemu_cortex_m3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-uart = &uart2;
zephyr,bt-hci = &bt_hci;
zephyr,uart-pipe = &uart1;
zephyr,bt-mon-uart = &uart2;
};
Expand All @@ -39,6 +39,11 @@
&uart2 {
status = "okay";
current-speed = <115200>;

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};

&eth {
Expand Down
7 changes: 6 additions & 1 deletion boards/qemu/x86/qemu_x86.dts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
zephyr,sram = &dram0;
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,bt-hci = &bt_hci;
zephyr,shell-uart = &uart0;
zephyr,bt-uart = &uart1;
zephyr,uart-pipe = &uart1;
zephyr,bt-mon-uart = &uart1;
zephyr,code-partition = &slot0_partition;
Expand Down Expand Up @@ -126,6 +126,11 @@
&uart1 {
status = "okay";
current-speed = <115200>;

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};

&hpet {
Expand Down
7 changes: 6 additions & 1 deletion boards/shields/frdm_kw41z/frdm_kw41z.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@

/ {
chosen {
zephyr,bt-uart = &arduino_serial;
zephyr,bt-hci = &bt_hci;
};
};

&arduino_serial {
status = "okay";
current-speed = <115200>;

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};
7 changes: 6 additions & 1 deletion boards/st/b_u585i_iot02a/b_u585i_iot02a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,bt-uart=&uart4;
zephyr,bt-hci = &bt_hci;
};

aliases {
Expand Down Expand Up @@ -71,4 +71,9 @@
pinctrl-names = "default";
current-speed = <100000>;
status = "okay";

bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};
9 changes: 8 additions & 1 deletion boards/up-bridge-the-gap/up_squared/up_squared.dts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
zephyr,sram = &dram0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-uart = &uart1;
zephyr,bt-hci = &bt_hci;
zephyr,uart-pipe = &uart1;
zephyr,bt-mon-uart = &uart1;
};
Expand All @@ -49,3 +49,10 @@
};
};
};

&uart1 {
bt_hci: bt_hci {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};
1 change: 1 addition & 0 deletions drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ choice BT_HCI_BUS_TYPE
config BT_H4
bool "H:4 UART"
select BT_UART
depends on DT_HAS_ZEPHYR_BT_HCI_UART_ENABLED
help
Bluetooth H:4 UART driver. Requires hardware flow control
lines to be available.
Expand Down
Loading

0 comments on commit 56f4706

Please sign in to comment.