From 58249488e0acb67deecae08cb784e223ba9042fe Mon Sep 17 00:00:00 2001 From: srningap <107042150+srningap@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:34:49 +0530 Subject: [PATCH] [Silabs] Adds wifi-sdk v3.1.0 and required changes for it (#29204) * Adds wifi-sdk 3.1.0 and required changes for it * updated path in gni for dual-flash * restyled * Updated gni with board specific path * Added time unit and fix for soc ble range issue * restyled --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 1 + src/platform/silabs/rs911x/rsi_ble_config.h | 11 +++++- src/platform/silabs/rs911x/wfx_sl_ble_init.c | 8 ++-- third_party/silabs/SiWx917_sdk.gni | 38 ++++++++++--------- third_party/silabs/silabs_board.gni | 5 +++ third_party/silabs/wifi_sdk | 2 +- 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 9b2b543a330055..d7477b1fa7b494 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -130,6 +130,7 @@ void sl_ble_event_handling_task(void) // Requests the connection parameters change with the remote device rsi_ble_conn_params_update(event_msg.resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS, BLE_MAX_CONNECTION_INTERVAL_MS, BLE_SLAVE_LATENCY_MS, BLE_TIMEOUT_MS); + rsi_ble_set_data_len(event_msg.resp_enh_conn.dev_addr, RSI_BLE_TX_OCTETS, RSI_BLE_TX_TIME); } break; case RSI_BLE_DISCONN_EVENT: { diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index 1b6040542ba674..60b64ff12ab17d 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -60,6 +60,14 @@ #define ADD_DEVICE_TO_WHITELIST (0x01) #define DELETE_DEVICE_FROM_WHITELIST (0x02) +#define CLEAR_ACCEPTLIST (0x00) +#define ADD_DEVICE_TO_ACCEPTLIST (0x01) +#define DELETE_DEVICE_FROM_ACCEPTLIST (0x02) + +#define RSI_BLE_TX_OCTETS 251 +#define RSI_BLE_TX_TIME 2120 // microseconds +#define RSI_BLE_CS_DATA_LENGTH 240 + #define ALL_PHYS (0x00) #define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE (0) @@ -263,7 +271,8 @@ #define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map #ifdef CHIP_9117 #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ - (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | FRONT_END_SWITCH_SEL2) + (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | \ + SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0) #else #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)) #endif diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.c b/src/platform/silabs/rs911x/wfx_sl_ble_init.c index 1344847962b5d1..376fc4321dcd57 100644 --- a/src/platform/silabs/rs911x/wfx_sl_ble_init.c +++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.c @@ -351,10 +351,10 @@ void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_t uint32_t rsi_ble_add_matter_service(void) { - uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; - custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; - custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; - uint8_t data[230] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; + uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; + custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; + custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; + uint8_t data[RSI_BLE_CS_DATA_LENGTH] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; static const uuid_t custom_characteristic_RX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE, .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED }, diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 79fbf8516347c6..aefc3033ecfb47 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -73,26 +73,28 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/si91x/sl_net/inc", # siwx917_soc component + "${wifi_sdk_root}/components/siwx917_soc/boards/config/${silabs_board_lower}", + "${wifi_sdk_root}/components/siwx917_soc/boards/inc", + "${wifi_sdk_root}/components/siwx917_soc/core/chip/inc", "${wifi_sdk_root}/components/siwx917_soc/core/config", - "${wifi_sdk_root}/components/siwx917_soc/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/config", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/CMSIS/Driver/Include", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/rom_driver/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/config", - "${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/inc", - "${wifi_sdk_root}/components/siwx917_soc/wifi_inc", + "${wifi_sdk_root}/components/siwx917_soc/hal/inc", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/inc", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/wifi_inc", # wifi component "${wifi_sdk_root}/components/protocol/wifi/inc", # si91x_support component "${wifi_sdk_root}/components/si91x_support/inc", - "${wifi_sdk_root}/components/si91x_support/brd4325b", - "${wifi_sdk_root}/components/si91x_support/siwx917_soc", # wifi_resources component "${wifi_sdk_root}/resources/certificates", @@ -170,6 +172,7 @@ template("siwx917_sdk") { "FLASH_PAGE_SIZE", "SL_NVM3_PRESENT", "ROM_WIRELESS", + "BRD4325A", #TODO: should be removed after SoC macro clean-up ] if (silabs_board == "BRD4325B") { @@ -326,14 +329,13 @@ template("siwx917_sdk") { # si91x_support component "${wifi_sdk_root}/components/si91x_support/src/sl_utility.c", - "${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/src/rsi_board.c", + "${wifi_sdk_root}/components/siwx917_soc/boards/src/rsi_board.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_deepsleep_soc.c", + "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_system_config.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/system_si91x.c", "${wifi_sdk_root}/components/siwx917_soc/core/config/src/rsi_nvic_priorities_config.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/UDMA.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/USART.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/ipmu_apis.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/rsi_system_config_9117.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/clock_update.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_egpio.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_udma.c", @@ -347,13 +349,13 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_temp_sensor.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_ulpss_clk.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/src/sl_si91x_usart.c", - "${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_ram.c", - "${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_rom.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_platform.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_platform_wireless.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_si91x_bus.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_si91x_timer.c", - "${wifi_sdk_root}/components/siwx917_soc/sli_siwx917_soc.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_ram.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_rom.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform_wireless.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_bus.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_timer.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sli_siwx917_soc.c", # modified hal "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c", @@ -372,7 +374,7 @@ template("siwx917_sdk") { "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_event_handler.c", "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_m4.c", "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_platform_init.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_nvm3_hal_flash.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", # mbedtls "${chip_root}/third_party/mbedtls/repo/library/aes.c", @@ -415,14 +417,14 @@ template("siwx917_sdk") { if (silabs_board == "BRD4325B") { sources += [ "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_dual_flash_intf.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_dual_flash_intf.c", ] } if (wifi_soc_common_flash) { sources += [ "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_common_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_common_flash_intf.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c", ] } diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index d7dce160de622b..236be2e9e8bc47 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -15,6 +15,7 @@ declare_args() { # EFR32 board used silabs_board = "" + silabs_board_lower = "" # LCD is enabled by default # Boards BRD4166A, BRD2601B, BRD2703A and BRD4319A do not have a LCD so they disable it explicitly @@ -106,6 +107,7 @@ if (silabs_board == "BRD4304A") { disable_lcd = true show_qr_code = false wifi_soc = true + silabs_board_lower = "brd4325b" } else if (silabs_board == "BRD4325C") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -113,6 +115,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4325c" } else if (silabs_board == "BRD4325G") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -120,6 +123,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4325g" } else if (silabs_board == "BRD4338A") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -127,6 +131,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4338a" } else if (silabs_board == "BRD4180A") { assert( false, diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index 0f0cdcdc249b8d..f84bf6683b124b 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit 0f0cdcdc249b8de03cb57b5095b290125f42030c +Subproject commit f84bf6683b124b62475cd456869c6db7c21ae24e