Commit graph

70 commits

Author SHA1 Message Date
S Mohamed Fiaz
132247e2cd soc: silabs: siwx91x: Add siwx91x Power Manager driver
This commit enables the Power Manager driver
support for the siwx91x device.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-06-13 10:08:38 -07:00
Arunmani Alagarsamy
112c8e6939 soc: silabs: siwg917: Restore missing config and update default settings
Commit `2844850` inadvertently omitted
`SL_SI91X_CUSTOM_FEAT_SOC_CLK_CONFIG_160MHZ`. This commit restores
the missing flag to ensure proper SOC clock setup.

Additionally, `SL_SI91X_CUSTOM_FEAT_LIMIT_PACKETS_PER_STA` is now enabled
as the default setting, aligning with the driver Kconfig.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-06-04 17:04:24 +02:00
Muzaffar Ahmed
9600995af8 drivers: wifi: siwx91x: Fix NWP bootup assert
Fixed the assert related to AP mode / Hidden SSID in NWP bootup

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-27 11:51:17 +02:00
Jérôme Pouiller
d7f1c0ad5f drivers: wifi: siwx91x: Add support for Enhanced Legacy Power Save
Siwx91x support a specific mode slightly better than the old legacy PS
mode.

This mode has to be set on the NWP boot, so it is not easy to configure
it during the runtime. Hence, this patch only provide a compile time
option to enable it.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-05-23 17:20:34 +02:00
Arunmani Alagarsamy
2844850de8 soc: silabs: siwg917: Refactor siwx91x_get_nwp_config
Refactor siwx91x_get_nwp_config function to reduce its
Cognitive Complexity from 34 to below the allowed limit of 25
as per SonarQube guidelines. Extracted configuration logic into
smaller helper functions.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
88846ddc81 drivers: wifi: siwx91x: Add Wi-Fi mgmt events
- Implement event handling for AP and STA modes
- Enable configurations for security (PSK), aggregation,
  and hidden PSK credentials

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
4c1a91fa63 drivers: wifi: siwx91x: Enable AP configuration support
- Adds support for configuring client maximum inactivity timeout.
- Adds support for bandwidth, It supports 20MHZ only.
- Adds support for setting the maximum number of clients and
  hidden SSID mode by rebooting the NWP device.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
0459bd8638 drivers: wifi: siwx91x: Replace opermode flags
Replaced SL_SI91X_CLIENT_MODE and SL_SI91X_ACCESS_POINT_MODE with
WIFI_STA_MODE and WIFI_SOFTAP_MODE, respectively, for AP configuration
command intergration.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Martin Hoff
ea95e2d7f0 soc: silabs: siwx91x: add missing kconfig for ns16550 driver variant
The ns16550 UART driver has multiple variant Kconfig options. To
successfully run the uart_basic_api test, the correct variant must be
selected. This commit adds the missing Kconfig option.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-05-19 16:36:21 +02:00
Martin Hoff
cfb0a80df4 dts: arm: silabs: change siwg917 board ram start address
The first 1 KB is reserved for the NWP (Network Coprocessor). This
change also resolves the null pointer error issue, as a .data or a
_ramfunc might get the address 0x0.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-05-15 17:54:02 +02:00
Muzaffar Ahmed
a73f20214a drivers: wifi: siwx91x: Fix boot_config
Enable and rearrange some features in the boot config.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-15 16:16:54 +02:00
Muzaffar Ahmed
d6e106b5f0 drivers: wifi: siwx91x: Introduce flag for LIMIT_PACKET_BUF_PER_STA
Introduced WIFI_SILABS_SIWX91X_LIMIT_PACKET_BUF_PER_STA.
This flag limits packet queues in AP mode.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-15 16:16:54 +02:00
Aksel Skauge Mellbye
6a7cbff9b2 soc: silabs: siwx91x: Initialize NWP sufficiently early
The NWP provides Bluetooth, Wi-Fi and crypto services, and must
be initialized before any users of these. Mbed TLS is initialized
at priority level 40 (kernel default priority), ensure that the
NWP is initialized before that.

Make the priority configurable to allow users to tweak the init
sequence.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-05-14 16:27:27 +02:00
Martin Hoff
a05506a256 soc: silabs: add missing kconfig resource for siwx91x
Fixes the missing Kconfig resource for the siwx91x SoC. This ensures
that soc_early_init_hook function is correctly called for the siwg917
SoC during initialization.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-05-13 22:19:16 -04:00
Jérôme Pouiller
2bbafa7072 soc: silabs: siwx91x: Allow alternative memory partition
Chip siwx91x has 672kB of SRAM shared between the Cortex-M4 (Zephyr) and
the NWP (Network Processor). 3 memory configurations are possible for
the Cortex-M4:
  - 196kB
  - 256kB
  - 320kB

Less memory is allocated to Zephyr, more memory is allocated to NWP,
better are the WiFi and BLE performances.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-04-17 17:23:32 +02:00
Jérôme Pouiller
164bbdf294 drivers: dma: siwx91x: Use DT to declare descriptors
Silabs siwx91x hardware use specific memory areas to store descriptors
for DMA requests. These areas are tightly coupled between the CPU and
the hardware. This helps in reducing the wait cycles.

Until now these addresses was also hard coded in the DT and in the
linker script. This patch leverage the zephyr,memory-region driver to
centralize the information in the DT.

Then, with this new implementation, the memory mapping is easier to
understand for the reader.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-04-17 17:23:32 +02:00
Sai Santhosh Malae
ee55bdc3c2 drivers: timer: siwx91x: Remove sleeptimer as default soc timer
Remove sleeptimer as default soc timer and it should be only
used as soc timer if PM is enabled.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-16 17:08:13 +02:00
Nitin Pandey
50e36095dd driver: wifi: siwx91x: Add roaming configuration
- Defined Kconfig macros for Roam config
- Added set roam configuration API call
  after BGSCAN

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-14 23:06:20 +02:00
Aksel Skauge Mellbye
64a4c593e1 drivers: pinctrl: silabs: Add support for fixed routes
Add support for fixed GPIO routes that don't have a configurable
route register, but still require mode configuration and enabling.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-04-07 08:54:38 +02:00
S Mohamed Fiaz
701be0c331 driver: sleeptimer: siwx917: Add siwx91x Sleeptimer driver
This commit enables the Sleeptimer driver support for the siwx917 device.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-04-03 06:24:54 +02:00
Arunmani Alagarsamy
b578b06970 drivers: wifi: siwx91x: Add run time opermode
This commit enables the device to change its operating mode
at runtime.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-03-20 12:17:22 +01:00
Aksel Skauge Mellbye
7dc6fb442f drivers: timer: silabs: Fix calculation of next tick
In the case where more than a full tick was unannounced when
sys_clock_set_timeout() was called, the timer driver would
subtract it from the next timeout. However, this is already
done by the caller through the elapsed() function in timeout.c,
leading to the timer interrupt firing too early.

With this fix, SYS_CLOCK_TICKS_PER_SEC can be increased to the
full speed of the low frequency timer. The underlying sleeptimer
API must be called with a timeout of at least 1, and will if needed
increase the value to the minimum value required by the hardware.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-03-18 16:42:42 +01:00
Aksel Skauge Mellbye
faf40c6a68 soc: silabs: Use configdefault for default values
Use configdefault to avoid weakening dependencies of defconfig
symbols.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-03-18 16:42:42 +01:00
Martin Hoff
fbd97a1983 soc: silabs: silabs_s2: Activate Zero Latency IRQ with level 2
silabs_s2 uses simplicity_sdk hal library, which already have by default
a zero latency IRQs mechanism with a hardcoded value. In order to be
aligned with simplicity_sdk, we need to activate Zero Latency IRQ in
Zephyr by default. The level (2) depends on the hardcoded
value in simplicity_sdk (CORE_ATOMIC_BASE_PRIORITY_LEVEL). Without this
fix, if you use an IRQ with a priority of 0 or 1, irq_lock() and
irq_unlock() have no effect for this IRQ.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-13 09:11:42 +01:00
Jérôme Pouiller
1544354862 drivers: wifi: Introduce SiWx91x WiFi driver
This driver allow to use Zephyr native IP stack or the IP stack provided
by HAL / WiseConnect.

The WiseConnect implementation may take advantage of the specific
features provided by the 917 (power consumption, speed,
validation...).

Some notable features are not available with this interface:
  - It seems Zephyr does not provide API to offload multicast membership
    management. User should be to directly call WiseConnect APIs
  - Support for ICMP frames is difficult. Note that WiseConnect
    automatically answer to ping request. It is just not possible to
    send ping requests and receive ping responses.
  - Zephyr and WiseConnect both support TLS offloading. However this
    patch does not implement it.
  - Reentrancy in the WiseConnect side is uncertain.

This implementation has been tested with samples/net/wifi/ (which relies
on subsys/net/lib/shell).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Jérôme Pouiller
aa6914dc56 drivers: bluetooth: Introduce SiWx91x HCI driver
Driver was tested with a custom application which enabled the BT_SHELL.
Basic functionalities were verified:
 - Scanning
 - Advertising
 - Connecting

Configuration needed for the test:
 - CONFIG_BT=y
 - CONFIG_BT_PERIPHERAL=y
 - CONFIG_BT_CENTRAL=y
 - CONFIG_BT_SHELL=y
 - CONFIG_SHELL=y

Co-authored-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Jérôme Pouiller
4391e4c960 soc: silabs: siwg917: Initialize the NWP
Network Processor (NWP) is used to run WiFi, Bluetooth and Flash
drivers.

Co-authored-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Jérôme Pouiller
3fad258adc boards: silabs: siwx91x: Add support for DMAs
Report DMA configuration in the board definitions.

Note the addresses of the DMA buffers are hardcoded in the HAL. So,
these areas have to be declared in the linker file.

Co-authored-by: Sai Santhosh Malae <santhosh.malae@silabs.com>
Signed-off-by: Sai Santhosh Malae <santhosh.malae@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Jérôme Pouiller
d413936fb1 drivers: pinctrl: Introduce support for SiWx91x
This device is included on Silabs SiWx91x series. The current driver is
able to manage "High Power" and "Ultra Low Power" pins.

Co-authored-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Jérôme Pouiller
aac0b343b5 soc: silabs: Introduce new SoC SiWG917
Introduce minimal support for Silicon Labs SiWx91x family. SiWx91x
provide many device and especially Bluetooth and Wifi connectivity. This
patch prepare Zephyr to receive further drivers.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Aksel Skauge Mellbye
e2660e50d6 soc: silabs: Distinguish Gecko SDK from SiSDK HAL
When the SiSDK HAL was introduced, a corresponding Kconfig option
was not. Update Series 2 SoCs to use the new option.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-02-04 09:19:53 +01:00
Christian Galante
dd7547420b soc: silabs: add configuration to enable acmp module
The ACMP module is enabled with this change in the gecko
and simplicity_sdk hal libraries for development on silabs
devices. This is a pre-requisite for implementing the
comparator driver that is compatible with silabs acmp
peripherals.

Signed-off-by: Christian Galante <christian.galante@silabs.com>
2025-02-03 11:16:57 +01:00
Aksel Skauge Mellbye
120691a155 drivers: pinctrl: silabs: Add support for analog bus allocation
The GPIO peripheral on Silabs Series 2 devices is responsible for
allocating analog buses to analog peripherals. Enable support for
this in the pinctrl driver. Since these bus allocations are not
digital pins, introduce a new property silabs,analog-bus for this
purpose.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-30 18:30:01 +01:00
Bastien Beauchamp
ec1a2c6f47 soc: silabs: Fix the PRIMASK for Silabs S2 SoCs
sl_power_manager_sleep() doesn't expect the PRIMASK to be set when called.
Setting BASEPRI to 0 was moved to sl_power_manager_is_ok_to_sleep(),
this function is called after sl_power_manager_sleep() has set the PRIMASK.
Added sli_power_manager_on_wakeup() to force a clock restore before the
interrupt are handled. Added a call to retrieve the startup measurements,
reducing the early wakeup time.

Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
2025-01-23 19:23:27 +01:00
Bastien Beauchamp
19756be822 soc: silabs: Fix double WFI for Silabs S2 SoCs
k_cpu_idle() and sl_power_manager_sleep() call WFI.
Remove the call to k_cpu_idle() and add back its tracing and
hook functions.

Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
2025-01-23 19:23:27 +01:00
Bastien Beauchamp
d163d4268e soc: silabs: Fix EM4 enter for Silabs S2 SoCs
Fix PM_STATE_SOFT_OFF to properly enter EM4.

Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
2025-01-23 19:23:27 +01:00
Kalle Kietäväinen
fe5abd0344 drivers: bluetooth: silabs: Add separate thread for BT Link Layer
The BT Link Layer needs to get runtime in a timely manner to keep
connections alive and handle other time-critical tasks. This is achieved by
adding a separate thread for it with a meta-IRQ priority, which means it
can preempt other threads. The driver also has an RX thread that passes HCI
messages from the controller to the host stack. This can be a lower
priority cooperative thread, as it doesn't have strict timing requirements.

Signed-off-by: Kalle Kietäväinen <kalle.kietavainen@silabs.com>
2025-01-21 11:11:36 +01:00
Aksel Skauge Mellbye
2d3539b19a soc: silabs: Add support for xG29 device family
Add EFR32MG29 and EFR32BG29 device families.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-20 16:34:50 +01:00
Aksel Skauge Mellbye
09efa2c187 soc: silabs: Make soc.h generic for Series 2
All series 2 devices should be able to use the same soc.h.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-20 16:34:50 +01:00
Jérôme Pouiller
05578ab51f soc: silabs: Hide clock options for Series-2
Silabs Series-2 (all the EFR32xg2x chips) use the new clock driver
introduced in commit bda8ae8c3f ("drivers: clock_control: silabs: Add
clock control driver"). This driver get all the configuration from the
Device Tree.

The CMU (Clock Management Unit) options (CMU_HFXO_FREQ, CMU_HFRCO_FREQ,
CMU_NEED_LFXO, CMU_HFCLK_HFXO, etc...) are now only used for Series-0
and Series-1. It does not make sense to bother the users with them.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-01-07 20:34:12 +01:00
Daniel Fuchs
f0fee215ab soc: introduce the EFR32MG24B210F1536IM48
The EFR32MG24B210F1536IM48 has 4 more GPIOs than the
EFR32MG24B310F1536IM48, and does not support the high accuracy
mode for the IADC.

Signed-off-by: Daniel Fuchs <software@sagacioussuricata.com>
2024-12-30 08:43:12 +01:00
Yishai Jaffe
5694b24a6e soc: silabs: Add support for SiLabs EFR32ZG23 SoC
Add support for Silicon Labs EFR32ZG23 SoC.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-18 20:32:46 +01:00
Martin Hoff
5d3221bdf8 soc: silabs: add dma support in soc kconfig
Update Kconfig to support LDMA.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2024-12-16 18:24:51 +01:00
Aksel Skauge Mellbye
f3246cda17 drivers: pinctrl: silabs: Add pinctrl driver for digital bus
Silicon Labs Series 2 and newer devices do alternate function
configuration fundamentally differently from Series 0 and 1. Pin routing
is done in a centralized fashion in the GPIO peripheral, as opposed to
having ROUTE registers in every peripheral. The concept of alternate
function location numbers also does not exist, functions are directly
assigned to GPIOs by their port and pin number.

This commit adds a new pinctrl driver for devices that use DBUS. It fully
makes use of pinctrl design principles as outlined in the Zephyr
documentation. The previous driver hard-codes pin properties such as filter
and pull-up/down in the driver itself, while the new driver leaves this up
to the user as configurable DeviceTree properties. The previous driver has
hard-coded support for UART, SPI and I2C, while the new driver has generic
support for all DBUS signals.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Jamie McCrae
2f800cea8f soc: Remove re-defining some defined types
Removes re-defining some Kconfigs that are already defined
e.g. in arch

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-18 07:41:23 -05:00
Aksel Skauge Mellbye
8fc5514a94 soc: silabs: Only initialize HFXO Manager if HFXO is enabled
Only initialize the HFXO Manager HAL driver if the HFXO is enabled in
DeviceTree, the device uses SYSRTC for timekeeping, and Power Manager
is enabled. HFXO Manager integrates with the Sleeptimer HAL driver for
SYSRTC to autonomously wake the HFXO prior to Sleeptimer wakeup from
deep sleep. It is not needed on devices that don't have HFXO-SYSRTC
integration, and it is not needed if the application doesn't use deep
sleep.

Add missing call to init_hardware() prior to init().

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-25 14:09:36 +02:00
Aksel Skauge Mellbye
8d4fa7be0b soc: silabs: Remove counter dependency for pm
Power Manager no longer requires the Counter driver. This seems to have
been a hack to get the Sleeptimer HAL included in the build, as the
Sleeptimer is the real dependency of the Silabs Power Manager HAL.

Since Sleeptimer is now used for the OS timer, this hack is not needed.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-24 17:51:01 +02:00
Aksel Skauge Mellbye
51194bf03f soc: silabs: Default to sleeptimer for OS timer on Series 2
Disable BURTC timer in board defconfigs, as it's no longer used.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-24 17:51:01 +02:00
Aksel Skauge Mellbye
da6ddc92cd drivers: timer: silabs: Add sleeptimer timer driver
Add OS timer implementation making use of the Sleeptimer HAL.
Sleeptimer integrates tightly with the Silabs Power Manager HAL,
and must be used as the OS timer to achieve optimal power consumption
when using the radio.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-24 17:51:01 +02:00
Aksel Skauge Mellbye
d12de2d6b4 soc: silabs: Add soc_prep_hook() for Series 2
CMSIS SystemInit is not used in Zephyr. Implement the functionality
that isn't already done by Zephyr startup using soc_prep_hook().

The reason the lack of TrustZone init did not create immediately obvious
issues previously is that SMU faults can only happen if the SMU clock is
enabled.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-24 14:07:25 +02:00