Skip to content

Commit

Permalink
Bluetooth: hci_uart: Use DT for the hci_uart UART
Browse files Browse the repository at this point in the history
Use Device Tree,and in particular a new 'bt-c2h-uart' to select which
UART is being used to communicate with an external BLE Host when acting
as a Controller.

Signed-off-by: Carles Cufi <[email protected]>
  • Loading branch information
carlescufi committed Jun 26, 2019
1 parent c063034 commit 3b3bbc1
Show file tree
Hide file tree
Showing 28 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions boards/arm/96b_nitrogen/96b_nitrogen.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/bbc_microbit/bbc_microbit.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/bl652_dvk/bl652_dvk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/bl654_dvk/bl654_dvk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/curie_ble/curie_ble.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf51_ble400/nrf51_ble400.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf51_blenano/nrf51_blenano.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf51_pca10028/nrf51_pca10028.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf51_vbluno51/nrf51_vbluno51.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52811_pca10056/nrf52811_pca10056.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52832_mdk/nrf52832_mdk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_blip/nrf52840_blip.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_mdk/nrf52840_mdk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_papyr/nrf52840_papyr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_pca10059/nrf52840_pca10059.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52_blenano2/nrf52_blenano2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52_pca10040/nrf52_pca10040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52_pca20020/nrf52_pca20020.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52_sparkfun/nrf52_sparkfun.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52_vbluno52/nrf52_vbluno52.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/reel_board/reel_board.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/hci_uart/nrf52840_pca10090.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ CONFIG_BOARD_PCA10090_NRF52840_RESET_P1_02=y
CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_1_NRF_FLOW_CONTROL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_BT_CTLR_TO_HOST_UART_DEV_NAME="UART_1"
2 changes: 1 addition & 1 deletion samples/bluetooth/hci_uart/nrf52840_pca10090.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/ {
chosen {
zephyr,bt-uart=&uart1;
zephyr,bt-c2h-uart=&uart1;
};
};

Expand Down
1 change: 1 addition & 0 deletions scripts/dts/extract/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'zephyr,console' : 'DT_UART_CONSOLE_ON_DEV_NAME',
'zephyr,shell-uart' : 'DT_UART_SHELL_ON_DEV_NAME',
'zephyr,bt-uart' : 'DT_BT_UART_ON_DEV_NAME',
'zephyr,bt-c2h-uart' : 'DT_BT_C2H_UART_ON_DEV_NAME',
'zephyr,uart-pipe' : 'DT_UART_PIPE_ON_DEV_NAME',
'zephyr,bt-mon-uart' : 'DT_BT_MONITOR_ON_DEV_NAME',
'zephyr,uart-mcumgr' : 'DT_UART_MCUMGR_ON_DEV_NAME'
Expand Down
1 change: 1 addition & 0 deletions subsys/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ endif # BT_CONN

config BT_CTLR_TO_HOST_UART_DEV_NAME
string "Device Name of UART Device to an external Bluetooth Host"
default "$(dt_str_val,DT_BT_C2H_UART_ON_DEV_NAME)" if HAS_DTS
default "UART_0"
depends on BT_HCI_RAW
help
Expand Down

0 comments on commit 3b3bbc1

Please sign in to comment.