Skip to content

Commit

Permalink
soc: riscv: telink_b9x: Auto calculation of SETTINGS_NVS_SECTOR_COUNT
Browse files Browse the repository at this point in the history
- Set the sector count of NVS as the storage partition size divided by the sector size (4 KB)

Signed-off-by: Borys Nykytiuk <[email protected]>
  • Loading branch information
BorysNykytiuk committed Aug 13, 2024
1 parent 585f52b commit ba02c5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion boards/riscv/tlsr9118bdk40d/tlsr9118bdk40d-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
telink,ipc-interface = &ipc0;
zephyr,entropy = &trng0;
zephyr,code-partition = &slot0_partition;
zephyr,storage-partition = &storage_partition;
};
};

Expand Down
7 changes: 7 additions & 0 deletions soc/riscv/riscv-privilege/telink_b9x/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ config COMMON_LIBC_MALLOC
config COMMON_LIBC_MALLOC_ARENA_SIZE
default 8192

# Workaround for not being able to have commas in macro arguments
DT_LABEL_Z_STORAGE := $(dt_nodelabel_path,storage_partition)

# Set the sector count of NVS as the storage partition size divided by the sector size (4 KB)
config SETTINGS_NVS_SECTOR_COUNT
default $(shell,expr $(dt_node_reg_size_int,$(DT_LABEL_Z_STORAGE),0,K) / 4)

config OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE
default 2048 if NET_L2_OPENTHREAD && NETWORKING

Expand Down
5 changes: 3 additions & 2 deletions soc/riscv/riscv-privilege/telink_w91/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ config COMMON_LIBC_MALLOC_ARENA_SIZE
default 8192

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_STORAGE := zephyr,storage-partition
DT_LABEL_Z_STORAGE := $(dt_nodelabel_path,storage_partition)

# Set the sector count of NVS as the storage partition size divided by the sector size (4 KB)
config SETTINGS_NVS_SECTOR_COUNT
default $(shell,expr $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_STORAGE),0,K) / 4)
default $(shell,expr $(dt_node_reg_size_int,$(DT_LABEL_Z_STORAGE),0,K) / 4)


config OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE
default 2048 if NET_L2_OPENTHREAD && NETWORKING
Expand Down

0 comments on commit ba02c5d

Please sign in to comment.