@@ -26,11 +26,78 @@ extern "C" {
2626
2727#include <zephyr/irq.h>
2828
29- #define MCU_OTPM_BASE (0x30080000UL)
29+ #define MCU_REMAPPED_BASE (0x00000000UL)
30+ /* The max. remapped memory size supported. */
31+ #define MCU_REMAPPED_SIZE (0x02000000UL)
32+
33+ /*
34+ * OTP memory base address; should be used when accessed by
35+ * peripheral devices (DMA, CRYPTO etc.).
36+ */
37+ #define MCU_OTP_M_P_BASE (0x30080000UL)
38+ /* The max. supported OTP region size */
39+ #define MCU_OTP_M_P_SIZE (0x00010000UL)
40+
41+ /* OTP memory base address (not remapped) */
42+ #define MCU_OTP_M_BASE (0x10080000UL)
43+ /* The max. supported OTP region size */
44+ #define MCU_OTP_M_SIZE (0x00010000UL)
45+
46+ #define MCU_ROM_BASE (0x900000UL)
47+ #define MCU_ROM_SIZE (0x20000UL)
48+
49+ /* Actual memory size integrated into SoC */
3050#define MCU_OTPM_SIZE (4096)
3151#define MCU_OTPM_CS_OFFSET (0x0c00)
3252#define MCU_OTPM_CS_LENGTH (0x0400)
3353
54+ /*
55+ * QSPI Flash memory based address. Accesses are done through the AHB code bus (cached).
56+ * The region size available is restricted according to CACHE_FLASH_REG (up to 32MB).
57+ */
58+ #define MCU_QSPIF_M_CACHED_BASE (0x16000000UL)
59+ #define MCU_QSPIF_M_CACHED_SIZE (0x2000000UL)
60+
61+ /*
62+ * QSPIC Flash memory base address. Accesses are done through the AHB system bus (not cached).
63+ * Using this address space the whole Flash memory can be accesed (up to 32MB).
64+ */
65+ #define MCU_QSPIF_M_BASE (0x36000000UL)
66+ #define MCU_QSPIF_M_SIZE (0x2000000UL)
67+
68+ /* System RAM base address (not cached) */
69+ #define MCU_SYSRAM_M_BASE (0x20000000UL)
70+ #define MCU_SYSRAM_M_SIZE (0x80000UL)
71+
72+ /* QSPIC2 RAM memory base address */
73+ #define MCU_QSPIR_M_BASE (0x32000000UL)
74+ #define MCU_QSPIR_M_SIZE (0x2000000UL)
75+
76+
77+ #define WITHIN_RANGE (_a , _s , _e ) (((uint32_t)(_a) >= (uint32_t)(_s)) && ((uint32_t)(_a) < (uint32_t)(_e)))
78+
79+ /* True if the address provided is within the remapped region. Otherwise, false. */
80+ #define IS_REMAPPED_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_REMAPPED_BASE, MCU_REMAPPED_BASE + MCU_REMAPPED_SIZE)
81+
82+ /* True if the address provided is within the OTP region. Otherwise, false. */
83+ #define IS_OTP_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_OTP_M_BASE, MCU_OTP_M_BASE + MCU_OTP_M_SIZE)
84+
85+ /* True if the address provided is within the remapped OTP region. Otherwise, false. */
86+ #define IS_OTP_P_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_OTP_M_P_BASE, MCU_OTP_M_P_BASE + MCU_OTP_M_P_SIZE)
87+
88+ /* True if the address provided is within the SYSRAM region (no cached). Otherwise, false. */
89+ #define IS_SYSRAM_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_SYSRAM_M_BASE, MCU_SYSRAM_M_BASE + MCU_SYSRAM_M_SIZE)
90+
91+ /* True if the address provided is within the Flash region (not cached). Otherwise, false. */
92+ #define IS_QSPIF_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_QSPIF_M_BASE, MCU_QSPIF_M_BASE + MCU_QSPIF_M_SIZE)
93+
94+ /* True if the address provided is within the Flash region (cached). Otherwise, false. */
95+ #define IS_QSPIF_CACHED_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_QSPIF_M_CACHED_BASE, MCU_QSPIF_M_CACHED_BASE + \
96+ MCU_QSPIF_M_CACHED_SIZE)
97+
98+ /* True if the address provided is within the PSRAM region size. Otherwise, false */
99+ #define IS_QSPIR_ADDRESS (_a ) WITHIN_RANGE(_a, MCU_QSPIR_M_BASE, MCU_QSPIR_M_BASE + MCU_QSPIR_M_SIZE)
100+
34101#define MCU_TRIMV_GROUP_ID_MAX (18)
35102
36103#define MCU_RCX_CAL_REF_CNT (100)
0 commit comments