1#
2# Copyright (c) 2024 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7menuconfig SOC_FLASH_NRF_RRAM
8	bool "Nordic Semiconductor flash driver for nRF RRAM"
9	default y
10	depends on DT_HAS_NORDIC_RRAM_CONTROLLER_ENABLED
11	select NRFX_RRAMC if !BUILD_WITH_TFM
12	select FLASH_HAS_DRIVER_ENABLED
13	select FLASH_HAS_PAGE_LAYOUT
14	select FLASH_HAS_NO_EXPLICIT_ERASE
15	select FLASH_NRF_FORCE_ALT
16	select MPU_ALLOW_FLASH_WRITE if ARM_MPU
17	help
18	  Enables Nordic Semiconductor flash driver for nRF RRAM controllers.
19	  The entire contiguous block of RRAM gets logically divided into pages,
20	  but partial erase is always supported.
21
22if SOC_FLASH_NRF_RRAM
23
24config NRF_RRAM_WRITE_BUFFER_SIZE
25	int "Internal write-buffer size"
26	default 32 if !SOC_FLASH_NRF_RADIO_SYNC_NONE
27	default 1
28	range 0 32
29	help
30	  Number of 128-bit words.
31	  Maximum buffer size can be configured to the value of 32 (128-bit words).
32	  Set 0 to disable write-buffer.
33
34config NRF_RRAM_READYNEXT_TIMEOUT_VALUE
35	int "Preload timeout value for waiting for a next write in RRAMC clock cycles"
36	default 128
37	range 0 4095
38	help
39	  Set 0 to disable ready next timeout counter.
40
41choice SOC_FLASH_NRF_RADIO_SYNC_CHOICE
42	prompt "Nordic nRFx flash driver synchronization"
43	default SOC_FLASH_NRF_RADIO_SYNC_TICKER if BT_LL_SW_SPLIT
44	default SOC_FLASH_NRF_RADIO_SYNC_NONE
45	help
46	  synchronization between flash memory driver and radio.
47
48config SOC_FLASH_NRF_RADIO_SYNC_TICKER
49	bool "Nordic nRFx flash driver synchronized with radio"
50	depends on BT_LL_SW_SPLIT
51	help
52	  Enable synchronization between flash memory driver and radio using
53	  BLE LL controller ticker API.
54
55config SOC_FLASH_NRF_RADIO_SYNC_NONE
56	bool "none"
57	help
58	  disable synchronization between flash memory driver and radio.
59endchoice
60
61config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER
62	int "Multiplier for flash operation timeouts [x0.1]"
63	depends on !SOC_FLASH_NRF_RADIO_SYNC_NONE
64	default 15
65	help
66	  This is a multiplier that will be divided by 10 that is applied
67	  to the flash erase and write operations timeout. The base for
68	  the multiplication would allow erasing all nRF flash pages in
69	  blocking mode.
70
71config NRF_RRAM_REGION_ADDRESS_RESOLUTION
72	hex
73	default 0x400
74	help
75	  RRAMC's region protection address resolution.
76	  Applies to region with configurable start address.
77
78config NRF_RRAM_REGION_SIZE_UNIT
79	hex
80	default 0x400
81	help
82	  Base unit for the size of RRAMC's region protection.
83
84endif # SOC_FLASH_NRF_RRAM
85