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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>