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 27
27
};
28
28
};
29
29
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 {
31
40
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
33
42
* (Zephyr) and the NWP (Network Processor). 3 memory
34
43
* configurations are
35
44
* possible:
36
- * - 196kB
37
- * - 256kB
38
- * - 320kB
45
+ * - 195kB
46
+ * - 255kB
47
+ * - 319kB
39
48
* Less memory is allocated to Zephyr, more memory is allocated
40
49
* to NWP, better are the WiFi and BLE performances.
41
50
*/
42
- reg = <0x00000000 DT_SIZE_K(256 )>;
51
+ reg = <0x00000400 DT_SIZE_K(255 )>;
43
52
};
44
53
45
54
sram_dma1: memory-dma@24061c00 {
Original file line number Diff line number Diff line change 22
22
23
23
LOG_MODULE_REGISTER (siwx91x_nwp );
24
24
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 ));
28
28
29
29
int siwg91x_get_nwp_config (int wifi_oper_mode , sl_wifi_device_configuration_t * get_config )
30
30
{
@@ -49,11 +49,12 @@ int siwg91x_get_nwp_config(int wifi_oper_mode, sl_wifi_device_configuration_t *g
49
49
50
50
__ASSERT (get_config , "get_config cannot be NULL" );
51
51
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 )) {
53
54
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 )) {
55
56
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 )) {
57
58
boot_config -> ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_352K_M4SS_320K ;
58
59
} else {
59
60
k_panic ();
You can’t perform that action at this time.
0 commit comments