File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed
soc/silabs/silabs_siwx91x/siwg917 Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 2727 };
2828 };
2929
30- sram0: memory@0 {
30+ /* The first 1KB of SRAM is reserved for the NWP (Network Processor).
31+ * It also protects against null pointer exceptions.
32+ */
33+ nwp_reserved: memory@0 {
34+ compatible = "zephyr,memory-region","mmio-sram";
35+ reg = <0x00000000 DT_SIZE_K(1)>;
36+ zephyr,memory-region = "NWP_RESERVED_RAM";
37+ };
38+
39+ sram0: memory@400 {
3140 compatible = "mmio-sram";
32- /* siwx91x has 672kB of SRAM shared between the Cortex-M4
41+ /* siwx91x has 671kB of SRAM shared between the Cortex-M4
3342 * (Zephyr) and the NWP (Network Processor). 3 memory
3443 * configurations are
3544 * possible:
36- * - 196kB
37- * - 256kB
38- * - 320kB
45+ * - 195kB
46+ * - 255kB
47+ * - 319kB
3948 * Less memory is allocated to Zephyr, more memory is allocated
4049 * to NWP, better are the WiFi and BLE performances.
4150 */
42- reg = <0x00000000 DT_SIZE_K(256 )>;
51+ reg = <0x00000400 DT_SIZE_K(255 )>;
4352 };
4453
4554 sram_dma1: memory-dma@24061c00 {
Original file line number Diff line number Diff line change 2222
2323LOG_MODULE_REGISTER (siwx91x_nwp );
2424
25- BUILD_ASSERT (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (196 ) ||
26- DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (256 ) ||
27- DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (320 ));
25+ BUILD_ASSERT (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (195 ) ||
26+ DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (255 ) ||
27+ DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (319 ));
2828
2929int siwg91x_get_nwp_config (int wifi_oper_mode , sl_wifi_device_configuration_t * get_config )
3030{
@@ -49,11 +49,12 @@ int siwg91x_get_nwp_config(int wifi_oper_mode, sl_wifi_device_configuration_t *g
4949
5050 __ASSERT (get_config , "get_config cannot be NULL" );
5151
52- if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (196 )) {
52+ /* The size does not match exactly because 1 KB is reserved at the start of the RAM */
53+ if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (195 )) {
5354 boot_config -> ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_480K_M4SS_192K ;
54- } else if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (256 )) {
55+ } else if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (255 )) {
5556 boot_config -> ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_416K_M4SS_256K ;
56- } else if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (320 )) {
57+ } else if (DT_REG_SIZE (DT_CHOSEN (zephyr_sram )) == KB (319 )) {
5758 boot_config -> ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_352K_M4SS_320K ;
5859 } else {
5960 k_panic ();
You can’t perform that action at this time.
0 commit comments