@@ -42,10 +42,35 @@ CY_PROT_PCMASK3 + CY_PROT_PCMASK4)
42
42
43
43
#define ALL_SUBREGIONS (0x0)
44
44
45
+
46
+ /* protected rom region size */
47
+
48
+ #if PSA_SECURE_ROM_SIZE == 0x20000
49
+ #define CY_PROT_ROM_REGION_SIZE CY_PROT_SIZE_128KB /* 0x20000 */
50
+ #elif PSA_SECURE_ROM_SIZE == 0x40000
51
+ #define CY_PROT_ROM_REGION_SIZE CY_PROT_SIZE_256KB /* 0x40000 */
52
+ #elif PSA_SECURE_ROM_SIZE == 0x80000
53
+ #define CY_PROT_ROM_REGION_SIZE CY_PROT_SIZE_512KB /* 0x80000 */
54
+ #else
55
+ #error unsupported protected rom region size - not aligned or out of range
56
+ #endif
57
+
58
+
59
+ /* protected ram region size */
60
+
61
+ #if PSA_SECURE_RAM_SIZE == 0x10000
62
+ #define CY_PROT_RAM_REGION_SIZE CY_PROT_SIZE_64KB /* 0x10000 */
63
+ #elif PSA_SECURE_RAM_SIZE == 0x20000
64
+ #define CY_PROT_RAM_REGION_SIZE CY_PROT_SIZE_128KB /* 0x20000 */
65
+ #else
66
+ #error unsupported protected ram region size - not aligned or out of range
67
+ #endif
68
+
69
+
45
70
const cy_smpu_region_config_t flash_spm_smpu_config [] = {
46
71
{ /* FLASH_PC1_SPM */
47
72
.address = (uint32_t * )PSA_SECURE_ROM_START , /* 0x10000000 */
48
- .regionSize = CY_PROT_SIZE_512KB , /* 0x80000 */
73
+ .regionSize = CY_PROT_ROM_REGION_SIZE ,
49
74
.subregions = ALL_SUBREGIONS ,
50
75
.userPermission = CY_PROT_PERM_RWX ,
51
76
.privPermission = CY_PROT_PERM_RWX ,
@@ -62,7 +87,7 @@ const cy_smpu_region_config_t flash_spm_smpu_config[] = {
62
87
const cy_smpu_region_config_t sram_spm_smpu_config [] = {
63
88
{ /* SRAM_SPM_PRIV - must include SRAM_SPM_PUB area */
64
89
.address = (uint32_t * )PSA_SECURE_RAM_START , /* 0x08020000 */
65
- .regionSize = CY_PROT_SIZE_64KB , /* 0x10000 */
90
+ .regionSize = CY_PROT_RAM_REGION_SIZE ,
66
91
.subregions = ALL_SUBREGIONS , /* 0xC0, /*Size 0xC000 ALL_SUBREGIONS,*/
67
92
.userPermission = CY_PROT_PERM_DISABLED ,
68
93
.privPermission = CY_PROT_PERM_RWX ,
0 commit comments