Skip to content

Commit

Permalink
dts: Bluetooth: Add new DTS binding for the SoftDevice Controller
Browse files Browse the repository at this point in the history
The SoftDevice Controller is a different controller than
the open source link layer with a different set of quirks.
It should therefore have its own device tree binding.

This commit converts the SoftDevice Controller driver
to use this new DTS binding instead of reusing the existing one.

This commit updates or adds additional overlays for
existing samples, applications and tests that were using the
open source link layer.

Updating migration guide will be done in a separate commit.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
  • Loading branch information
rugeGerritsen authored and rlubos committed Sep 3, 2024
1 parent 3a4f7c4 commit b97558b
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@
compatible = "nordic,nrf-spim";
status = "okay";
};

&bt_hci_controller {
status = "okay";
};

&bt_hci_sdc {
status = "disabled";
};

/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
};

/* Configure DTS nodes used for USB next HID support. */
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
Expand Down Expand Up @@ -59,3 +63,11 @@
num-isoin-endpoints = <0>;
num-isoout-endpoints = <0>;
};

&bt_hci_controller {
status = "okay";
};

&bt_hci_sdc {
status = "disabled";
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
};

/* Configure DTS nodes used for USB next HID support. */
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
Expand Down Expand Up @@ -51,3 +55,12 @@
num-isoin-endpoints = <0>;
num-isoout-endpoints = <0>;
};

&bt_hci_controller {
status = "okay";
};


&bt_hci_sdc {
status = "disabled";
};
11 changes: 11 additions & 0 deletions dts/bindings/bluetooth/nordic,bt-hci-sdc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Bluetooth HCI provided by the SoftDevice Controller

compatible: "nordic,bt-hci-sdc"

include: bt-hci.yaml

properties:
bt-hci-name:
default: "SDC"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
24 changes: 24 additions & 0 deletions samples/bluetooth/direction_finding_central/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if(NOT SB_CONFIG_SOC_NRF5340_CPUAPP)
if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET)
list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET})
list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split)
set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE)
endif()
if(SB_CONFIG_SECURE_BOOT_BUILD_S1_VARIANT_IMAGE AND NOT "bt-ll-sw-split" IN_LIST s1_image_SNIPPET)
list(APPEND s1_image_SNIPPET ${SNIPPET})
list(APPEND s1_image_SNIPPET bt-ll-sw-split)
set(s1_image_SNIPPET ${s1_image_SNIPPET} CACHE STRING "" FORCE)
endif()
endif()

if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET)
list(APPEND ipc_radio_SNIPPET ${SNIPPET})
list(APPEND ipc_radio_SNIPPET bt-ll-sw-split)
set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if(NOT SB_CONFIG_SOC_NRF5340_CPUAPP)
if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET)
list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET})
list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split)
set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE)
endif()
if(SB_CONFIG_SECURE_BOOT_BUILD_S1_VARIANT_IMAGE AND NOT "bt-ll-sw-split" IN_LIST s1_image_SNIPPET)
list(APPEND s1_image_SNIPPET ${SNIPPET})
list(APPEND s1_image_SNIPPET bt-ll-sw-split)
set(s1_image_SNIPPET ${s1_image_SNIPPET} CACHE STRING "" FORCE)
endif()
endif()

if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET)
list(APPEND ipc_radio_SNIPPET ${SNIPPET})
list(APPEND ipc_radio_SNIPPET bt-ll-sw-split)
set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if(NOT SB_CONFIG_SOC_NRF5340_CPUAPP)
if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET)
list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET})
list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split)
set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE)
endif()
if(SB_CONFIG_SECURE_BOOT_BUILD_S1_VARIANT_IMAGE AND NOT "bt-ll-sw-split" IN_LIST s1_image_SNIPPET)
list(APPEND s1_image_SNIPPET ${SNIPPET})
list(APPEND s1_image_SNIPPET bt-ll-sw-split)
set(s1_image_SNIPPET ${s1_image_SNIPPET} CACHE STRING "" FORCE)
endif()
endif()

if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET)
list(APPEND ipc_radio_SNIPPET ${SNIPPET})
list(APPEND ipc_radio_SNIPPET bt-ll-sw-split)
set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE)
endif()
24 changes: 24 additions & 0 deletions samples/bluetooth/direction_finding_peripheral/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if(NOT SB_CONFIG_SOC_NRF5340_CPUAPP)
if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET)
list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET})
list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split)
set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE)
endif()
if(SB_CONFIG_SECURE_BOOT_BUILD_S1_VARIANT_IMAGE AND NOT "bt-ll-sw-split" IN_LIST s1_image_SNIPPET)
list(APPEND s1_image_SNIPPET ${SNIPPET})
list(APPEND s1_image_SNIPPET bt-ll-sw-split)
set(s1_image_SNIPPET ${s1_image_SNIPPET} CACHE STRING "" FORCE)
endif()
endif()

if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET)
list(APPEND ipc_radio_SNIPPET ${SNIPPET})
list(APPEND ipc_radio_SNIPPET bt-ll-sw-split)
set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE)
endif()
19 changes: 19 additions & 0 deletions samples/debug/ppi_trace/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if(SB_CONFIG_SOC_SERIES_NRF52X)
if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET)
list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET})
list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split)
set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE)
endif()
endif()

if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET)
list(APPEND ipc_radio_SNIPPET ${SNIPPET})
list(APPEND ipc_radio_SNIPPET bt-ll-sw-split)
set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE)
endif()
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "ecdh.h"

#define DT_DRV_COMPAT zephyr_bt_hci_ll_sw_split
#define DT_DRV_COMPAT nordic_bt_hci_sdc

#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL
#include "zephyr/logging/log.h"
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "ecdh.h"
#include "radio_nrf5_txp.h"

#define DT_DRV_COMPAT zephyr_bt_hci_ll_sw_split
#define DT_DRV_COMPAT nordic_bt_hci_sdc

#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL
#include "zephyr/logging/log.h"
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/nrfx_integration_test/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tests:
tags: drivers ci_build sysbuild ci_tests_drivers_nrfx_integration_test
extra_configs:
- CONFIG_NRFX_AND_BT_LL_SW_SPLIT=y
extra_args: SNIPPET="bt-ll-sw-split"
platform_allow:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpunet
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 21c97d07da26177a3d1cc000f523e3fe73569d63
revision: fb6ca20a06ba31a3dc1b86d6986d48ad4a5760b0
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down

0 comments on commit b97558b

Please sign in to comment.