Commit 6a7cbff9 authored by Aksel Skauge Mellbye's avatar Aksel Skauge Mellbye Committed by Benjamin Cabé
Browse files

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: default avatarAksel Skauge Mellbye <aksel.mellbye@silabs.com>
parent 39e56e9a
Loading
Loading
Loading
Loading
+8 −0
Changes for soc/silabs/silabs_siwx91x/Kconfig: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -19,4 +19,12 @@ config SOC_SILABS_SLEEPTIMER
	help
	  The Sleeptimer HAL module is used for SIWX91X.

config SIWX91X_NWP_INIT_PRIORITY
	int "SiWx91x Network Processor init priority"
	default 39
	help
	  Initialization priority of the SiWx91x Network Processor. NWP init must
	  have a higher priority than services that depend on it, such as Bluetooth,
	  Wi-Fi and crypto.

endif # SOC_FAMILY_SILABS_SIWX91X
+5 −1
Changes for soc/silabs/silabs_siwx91x/siwg917/nwp.c: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -193,7 +193,11 @@ static int siwg917_nwp_init(void)

	return 0;
}
SYS_INIT(siwg917_nwp_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#if defined(CONFIG_MBEDTLS_INIT)
BUILD_ASSERT(CONFIG_SIWX91X_NWP_INIT_PRIORITY < CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
	     "mbed TLS must be initialized after the NWP.");
#endif
SYS_INIT(siwg917_nwp_init, POST_KERNEL, CONFIG_SIWX91X_NWP_INIT_PRIORITY);

/* IRQn 74 is used for communication with co-processor */
Z_ISR_DECLARE(74, 0, IRQ074_Handler, 0);