Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: bluetooth: Rename Silabs HCI driver #80155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,7 @@ Silabs Platforms:
- dts/arm/silabs/
- dts/bindings/*/silabs*
- drivers/*/*gecko*
- drivers/bluetooth/hci/slz_hci*
- drivers/bluetooth/hci/hci_silabs_*
jhedberg marked this conversation as resolved.
Show resolved Hide resolved
jhedberg marked this conversation as resolved.
Show resolved Hide resolved
- drivers/*/*silabs*
labels:
- "platform: Silabs"
Expand Down
4 changes: 2 additions & 2 deletions drivers/bluetooth/hci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if(CONFIG_DT_HAS_ST_HCI_STM32WBA_ENABLED)
zephyr_blobs_verify(MODULE hal_stm32 REQUIRED)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c)
zephyr_library_sources_ifdef(CONFIG_BT_SILABS_HCI slz_hci.c)
if(CONFIG_DT_HAS_SILABS_BT_HCI_ENABLED)
zephyr_library_sources_ifdef(CONFIG_BT_SILABS_EFR32 hci_silabs_efr32.c)
if(CONFIG_DT_HAS_SILABS_BT_HCI_EFR32_ENABLED)
jhedberg marked this conversation as resolved.
Show resolved Hide resolved
zephyr_blobs_verify(MODULE hal_silabs REQUIRED)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_PSOC6_BLESS hci_ifx_psoc6_bless.c)
Expand Down
8 changes: 4 additions & 4 deletions drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ config BT_STM32WBA
help
ST STM32WBA HCI Bluetooth interface

config BT_SILABS_HCI
config BT_SILABS_EFR32
bool
default y
depends on DT_HAS_SILABS_BT_HCI_ENABLED
depends on DT_HAS_SILABS_BT_HCI_EFR32_ENABLED
depends on ZEPHYR_HAL_SILABS_MODULE_BLOBS
depends on !PM || SOC_GECKO_PM_BACKEND_PMGR
select SOC_GECKO_USE_RAIL
Expand Down Expand Up @@ -260,9 +260,9 @@ config BT_DRV_RX_STACK_SIZE
help
Stack size for the HCI driver's RX thread.

config BT_SILABS_HCI_BUFFER_MEMORY
config BT_SILABS_EFR32_BUFFER_MEMORY
int "Silicon Labs Bluetooth Library memory buffer size"
depends on BT_SILABS_HCI
depends on BT_SILABS_EFR32
default 6144
help
Select the size of allocated memory buffer for the Silicon Labs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bt_hci_driver_slz);
LOG_MODULE_REGISTER(bt_hci_driver_efr32);

#define DT_DRV_COMPAT silabs_bt_hci
#define DT_DRV_COMPAT silabs_bt_hci_efr32

struct hci_data {
bt_hci_recv_t recv;
Expand All @@ -24,12 +24,12 @@
#define SL_BT_CONFIG_ACCEPT_LIST_SIZE 1
#define SL_BT_CONFIG_MAX_CONNECTIONS 1
#define SL_BT_CONFIG_USER_ADVERTISERS 1
#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_HCI_BUFFER_MEMORY
#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_EFR32_BUFFER_MEMORY
#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX CONFIG_BT_BUF_ACL_TX_COUNT
#define SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD 1
#define SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT 3
#define SL_BT_SILABS_LL_STACK_SIZE 1024

Check notice on line 32 in drivers/bluetooth/hci/hci_silabs_efr32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/bluetooth/hci/hci_silabs_efr32.c:32 -#define SL_BT_CONFIG_ACCEPT_LIST_SIZE 1 -#define SL_BT_CONFIG_MAX_CONNECTIONS 1 -#define SL_BT_CONFIG_USER_ADVERTISERS 1 -#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_EFR32_BUFFER_MEMORY -#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX CONFIG_BT_BUF_ACL_TX_COUNT -#define SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD 1 -#define SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT 3 -#define SL_BT_SILABS_LL_STACK_SIZE 1024 +#define SL_BT_CONFIG_ACCEPT_LIST_SIZE 1 +#define SL_BT_CONFIG_MAX_CONNECTIONS 1 +#define SL_BT_CONFIG_USER_ADVERTISERS 1 +#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_EFR32_BUFFER_MEMORY +#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX CONFIG_BT_BUF_ACL_TX_COUNT +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD 1 +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT 3 +#define SL_BT_SILABS_LL_STACK_SIZE 1024
static K_KERNEL_STACK_DEFINE(slz_ll_stack, SL_BT_SILABS_LL_STACK_SIZE);
static struct k_thread slz_ll_thread;

Expand Down Expand Up @@ -162,7 +162,7 @@
slz_thread_func, NULL, NULL, NULL,
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0,
K_NO_WAIT);

Check notice on line 165 in drivers/bluetooth/hci/hci_silabs_efr32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/bluetooth/hci/hci_silabs_efr32.c:165 - k_thread_create(&slz_ll_thread, slz_ll_stack, - K_KERNEL_STACK_SIZEOF(slz_ll_stack), + k_thread_create(&slz_ll_thread, slz_ll_stack, K_KERNEL_STACK_SIZEOF(slz_ll_stack), slz_thread_func, NULL, NULL, NULL, - K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, - K_NO_WAIT); + K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT);
rail_isr_installer();
sl_rail_util_pa_init();

Expand Down Expand Up @@ -195,7 +195,7 @@
ret = sl_btctrl_init_basic(SL_BT_CONFIG_MAX_CONNECTIONS,
SL_BT_CONFIG_USER_ADVERTISERS,
SL_BT_CONFIG_ACCEPT_LIST_SIZE);
if (ret) {

Check notice on line 198 in drivers/bluetooth/hci/hci_silabs_efr32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/bluetooth/hci/hci_silabs_efr32.c:198 - ret = sl_btctrl_init_basic(SL_BT_CONFIG_MAX_CONNECTIONS, - SL_BT_CONFIG_USER_ADVERTISERS, - SL_BT_CONFIG_ACCEPT_LIST_SIZE); + ret = sl_btctrl_init_basic(SL_BT_CONFIG_MAX_CONNECTIONS, SL_BT_CONFIG_USER_ADVERTISERS, + SL_BT_CONFIG_ACCEPT_LIST_SIZE);
LOG_ERR("Failed to initialize the controller %d", ret);
goto deinit;
}
Expand All @@ -217,7 +217,7 @@
if (status != RAIL_STATUS_NO_ERROR) {
LOG_ERR("RAIL: failed to initialize power management, status=%d",
status);
ret = -EIO;

Check notice on line 220 in drivers/bluetooth/hci/hci_silabs_efr32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/bluetooth/hci/hci_silabs_efr32.c:220 - LOG_ERR("RAIL: failed to initialize power management, status=%d", - status); + LOG_ERR("RAIL: failed to initialize power management, status=%d", status);
goto deinit;
}
}
Expand Down Expand Up @@ -260,6 +260,6 @@
}; \
DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &hci_data_##inst, NULL, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv)

Check notice on line 263 in drivers/bluetooth/hci/hci_silabs_efr32.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/bluetooth/hci/hci_silabs_efr32.c:263 - .open = slz_bt_open, - .send = slz_bt_send, + .open = slz_bt_open, + .send = slz_bt_send, }; -#define HCI_DEVICE_INIT(inst) \ - static struct hci_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) +#define HCI_DEVICE_INIT(inst) \ + static struct hci_data hci_data_##inst = {}; \ + DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &hci_data_##inst, NULL, POST_KERNEL, \ + CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv)
/* Only one instance supported right now */
HCI_DEVICE_INIT(0)
2 changes: 1 addition & 1 deletion dts/arm/silabs/efr32bg2x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
};

bt_hci_silabs: bt_hci_silabs {
compatible = "silabs,bt-hci";
compatible = "silabs,bt-hci-efr32";
status = "disabled";
};
};
Expand Down
2 changes: 1 addition & 1 deletion dts/arm/silabs/efr32mg.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
};

bt_hci_silabs: bt_hci_silabs {
compatible = "silabs,bt-hci";
compatible = "silabs,bt-hci-efr32";
status = "disabled";
};

Expand Down
2 changes: 1 addition & 1 deletion dts/arm/silabs/efr32mg24.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@


bt_hci_silabs: bt_hci_silabs {
compatible = "silabs,bt-hci";
compatible = "silabs,bt-hci-efr32";
status = "disabled";
};
};
Expand Down
2 changes: 1 addition & 1 deletion dts/arm/silabs/efr32xg13p.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
};

bt_hci_silabs: bt_hci_silabs {
compatible = "silabs,bt-hci";
compatible = "silabs,bt-hci-efr32";
status = "disabled";
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
description: Bluetooth HCI on Silabs boards

compatible: "silabs,bt-hci"
compatible: "silabs,bt-hci-efr32"

include: bt-hci.yaml

properties:
bt-hci-name:
default: "sl:bt"
default: "efr32"
bt-hci-bus:
default: "virtual"
bt-hci-quirks:
Expand Down
4 changes: 2 additions & 2 deletions modules/hal_silabs/simplicity_sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ if(CONFIG_SOC_GECKO_HAS_RADIO)
)

# sl_protocol_crypto
zephyr_library_sources_ifdef(CONFIG_BT_SILABS_HCI
zephyr_library_sources_ifdef(CONFIG_BT_SILABS_EFR32
${SECURITY_DIR}/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c
${SECURITY_DIR}/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c
)

if(CONFIG_BT_SILABS_HCI)
if(CONFIG_BT_SILABS_EFR32)
# prebuilt libs
add_prebuilt_library(liblinklayer protocol/bluetooth/bgstack/ll/lib/libbluetooth_controller_efr32xg${SILABS_DEVICE_FAMILY_NUMBER}_gcc_release.a)
add_prebuilt_library(libbgcommon protocol/bluetooth/bgcommon/lib/build/gcc/cortex-m33/bgcommon/release/libbgcommon.a)
Expand Down
Loading