Skip to content

Commit

Permalink
bluetooth: Rename rpmsg HCI driver and sample to ipc
Browse files Browse the repository at this point in the history
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <[email protected]>
  • Loading branch information
carlescufi committed Oct 27, 2023
1 parent 78bf8eb commit 01ad365
Show file tree
Hide file tree
Showing 67 changed files with 207 additions and 173 deletions.
2 changes: 1 addition & 1 deletion boards/arm/bl5340_dvk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the bl5340_dvk_cpunet for
another board. For example hci_ipc on the bl5340_dvk_cpunet for
Bluetooth applications.

endif # BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/bl5340_dvk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ config MBOX_NRFX_IPC
if BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

config BT_HCI_VS
default y if BT
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/bl5340_dvk/bl5340_dvk_cpuapp_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,display = &ili9340;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
};

/* Main LEDs and buttons are on an I2C TCA9538 GPIO port expander */
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/bl5340_dvk/bl5340_dvk_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
zephyr,sram = &sram1;
zephyr,flash = &flash1;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
};

aliases {
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf5340_audio_dk_nrf5340/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/nrf5340_audio_dk_nrf5340/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
watchdog0 = &wdt0;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
zephyr,sram = &sram1;
zephyr,flash = &flash1;
zephyr,code-partition = &slot0_partition;
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf5340dk_nrf5340/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ config MBOX_NRFX_IPC
if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,sram = &sram1;
zephyr,flash = &flash1;
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/pan1783_evb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_PAN1783_EVB_CPUAPP
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/pan1783_evb/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ config MBOX_NRFX_IPC
if BOARD_PAN1783_EVB_CPUAPP

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

endif # BOARD_PAN1783_EVB_CPUAPP

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/pan1783_evb/pan1783_evb_cpuapp_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/pan1783_evb/pan1783_evb_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,sram = &sram1;
zephyr,flash = &flash1;
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/raytac_mdbt53_db_40_nrf5340/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/raytac_mdbt53_db_40_nrf5340/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
zephyr,sram = &sram1;
zephyr,flash = &flash1;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
};

/* These aliases are provided for compatibility with samples */
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/raytac_mdbt53v_db_40_nrf5340/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/raytac_mdbt53v_db_40_nrf5340/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
zephyr,sram = &sram1;
zephyr,flash = &flash1;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
};


Expand Down
2 changes: 1 addition & 1 deletion boards/arm/thingy53_nrf5340/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ config DOMAIN_CPUNET_BOARD
help
The board which will be used for CPUNET domain when creating a multi
image application where one or more images should be located on
another board. For example hci_rpmsg on the nRF5340_cpunet for
another board. For example hci_ipc on the nRF5340_cpunet for
Bluetooth applications.

endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/thingy53_nrf5340/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ endif # BOARD_THINGY53_NRF5340_CPUAPP_NS
if !TRUSTED_EXECUTION_SECURE

choice BT_HCI_BUS_TYPE
default BT_RPMSG if BT
default BT_HCI_IPC if BT
endchoice

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC

config BT_HAS_HCI_VS
default BT
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
zephyr,uart-mcumgr = &cdc_acm_uart;
zephyr,bt-mon-uart = &cdc_acm_uart;
zephyr,bt-c2h-uart = &cdc_acm_uart;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,sram = &sram1;
zephyr,flash = &flash1;
Expand Down
4 changes: 2 additions & 2 deletions boards/posix/nrf_bsim/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ config BT_CTLR
depends on BT

config HEAP_MEM_POOL_SIZE
default 4096 if BT_RPMSG
default 4096 if BT_HCI_IPC
default 4096 if NRF_802154_SER_HOST && BOARD_NRF5340BSIM_NRF5340_CPUAPP
default 4096 if NRF_802154_SER_RADIO && BOARD_NRF5340BSIM_NRF5340_CPUNET

Expand All @@ -62,7 +62,7 @@ config IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET
default y if IPC_SERVICE_BACKEND_RPMSG

choice BT_HCI_BUS_TYPE
default BT_RPMSG
default BT_HCI_IPC
endchoice

endif # BOARD_NRF5340BSIM_NRF5340_CPUAPP
Expand Down
2 changes: 1 addition & 1 deletion boards/posix/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

chosen {
zephyr,flash = &flash0;
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
};

Expand Down
2 changes: 1 addition & 1 deletion boards/posix/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
};

chosen {
zephyr,bt-hci-rpmsg-ipc = &ipc0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
/delete-property/ zephyr,flash-controller;
Expand Down
7 changes: 7 additions & 0 deletions doc/releases/migration-guide-3.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Bootloader
Bluetooth
=========

* The HCI implementation for both the Host and the Controller sides has been
renamed for the IPC transport. The ``CONFIG_BT_RPMSG`` Kconfig option is now
:kconfig:option:`CONFIG_BT_HCI_IPC`, and the ``zephyr,bt-hci-rpmsg-ipc``
Devicetree chosen is now ``zephyr,bt-hci-ipc``. The existing sample has also
been renamed, from ``samples/bluetooth/hci_rpmsg`` to
``samples/bluetooth/hci_ipc``.

Networking
==========

Expand Down
15 changes: 14 additions & 1 deletion drivers/bluetooth/hci/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# SPDX-License-Identifier: Apache-2.0

# Remove after 3.7.0 is released
if(CONFIG_BT_RPMSG)
message(FATAL_ERROR "CONFIG_BT_RPMSG has been renamed to CONFIG_BT_HCI_IPC")
endif()

# Remove after 3.7.0 is released
if(CONFIG_BT_HCI_IPC)
dt_chosen(chosen_hci_rpmsg PROPERTY "zephyr,bt-hci-rpmsg-ipc")
if(DEFINED chosen_hci_rpmsg)
message(FATAL_ERROR "zephyr,bt-hci-rpmsg-ipc has been renamed to zephyr,bt-hci-ipc")
endif()
endif()

zephyr_library_sources_ifdef(CONFIG_BT_B91 hci_b91.c)
zephyr_library_sources_ifdef(CONFIG_BT_CYW43XXX cyw43xxx.c)
zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c)
zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c)
zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c)
zephyr_library_sources_ifdef(CONFIG_BT_RPMSG rpmsg.c)
zephyr_library_sources_ifdef(CONFIG_BT_HCI_IPC ipc.c)
zephyr_library_sources_ifdef(CONFIG_BT_SPI spi.c)
zephyr_library_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c)
zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c)
Expand Down
Loading

0 comments on commit 01ad365

Please sign in to comment.