35#ifndef PARTITION_CMSDK_ARMv8MML_H
36#define PARTITION_CMSDK_ARMv8MML_H
45#define SAU_INIT_CTRL 1
51#define SAU_INIT_CTRL_ENABLE 1
60#define SAU_INIT_CTRL_ALLNS 0
73#define SAU_REGIONS_MAX 8
79#define SAU_INIT_REGION0 1
84#define SAU_INIT_START0 0x00000000
89#define SAU_INIT_END0 0x001FFFFF
96#define SAU_INIT_NSC0 1
105#define SAU_INIT_REGION1 1
110#define SAU_INIT_START1 0x00200000
115#define SAU_INIT_END1 0x003FFFFF
122#define SAU_INIT_NSC1 0
131#define SAU_INIT_REGION2 1
136#define SAU_INIT_START2 0x20200000
141#define SAU_INIT_END2 0x203FFFFF
148#define SAU_INIT_NSC2 0
157#define SAU_INIT_REGION3 1
162#define SAU_INIT_START3 0x40000000
167#define SAU_INIT_END3 0x40040000
174#define SAU_INIT_NSC3 0
183#define SAU_INIT_REGION4 0
188#define SAU_INIT_START4 0x00000000
193#define SAU_INIT_END4 0x00000000
200#define SAU_INIT_NSC4 0
209#define SAU_INIT_REGION5 0
214#define SAU_INIT_START5 0x00000000
219#define SAU_INIT_END5 0x00000000
226#define SAU_INIT_NSC5 0
235#define SAU_INIT_REGION6 0
240#define SAU_INIT_START6 0x00000000
245#define SAU_INIT_END6 0x00000000
252#define SAU_INIT_NSC6 0
261#define SAU_INIT_REGION7 0
266#define SAU_INIT_START7 0x00000000
271#define SAU_INIT_END7 0x00000000
278#define SAU_INIT_NSC7 0
290#define SCB_CSR_AIRCR_INIT 1
298#define SCB_CSR_DEEPSLEEPS_VAL 1
306#define SCB_AIRCR_SYSRESETREQS_VAL 1
314#define SCB_AIRCR_PRIS_VAL 1
322#define SCB_AIRCR_BFHFNMINS_VAL 0
331#define TZ_FPU_NS_USAGE 1
339#define SCB_NSACR_CP10_11_VAL 3
347#define FPU_FPCCR_TS_VAL 0
355#define FPU_FPCCR_CLRONRETS_VAL 0
363#define FPU_FPCCR_CLRONRET_VAL 1
376#define NVIC_INIT_ITNS0 1
413#define NVIC_INIT_ITNS0_VAL 0x0000122B
422#define NVIC_INIT_ITNS1 1
450#define NVIC_INIT_ITNS1_VAL 0x00000000
467#define SAU_INIT_REGION(n) \
468 SAU->RNR = (n & SAU_RNR_REGION_Msk); \
469 SAU->RBAR = (SAU_INIT_START##n & SAU_RBAR_BADDR_Msk); \
470 SAU->RLAR = (SAU_INIT_END##n & SAU_RLAR_LADDR_Msk) | \
471 ((SAU_INIT_NSC##n << SAU_RLAR_NSC_Pos) & SAU_RLAR_NSC_Msk) | 1U
481#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
483 #if defined (SAU_INIT_REGION0) && (SAU_INIT_REGION0 == 1U)
487 #if defined (SAU_INIT_REGION1) && (SAU_INIT_REGION1 == 1U)
491 #if defined (SAU_INIT_REGION2) && (SAU_INIT_REGION2 == 1U)
495 #if defined (SAU_INIT_REGION3) && (SAU_INIT_REGION3 == 1U)
499 #if defined (SAU_INIT_REGION4) && (SAU_INIT_REGION4 == 1U)
503 #if defined (SAU_INIT_REGION5) && (SAU_INIT_REGION5 == 1U)
507 #if defined (SAU_INIT_REGION6) && (SAU_INIT_REGION6 == 1U)
511 #if defined (SAU_INIT_REGION7) && (SAU_INIT_REGION7 == 1U)
520 #if defined (SAU_INIT_CTRL) && (SAU_INIT_CTRL == 1U)
525 #if defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U)
526 SCB->SCR = (SCB->SCR & ~(SCB_SCR_SLEEPDEEPS_Msk )) |
529 SCB->AIRCR = (SCB->AIRCR & ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_SYSRESETREQS_Msk |
530 SCB_AIRCR_BFHFNMINS_Msk | SCB_AIRCR_PRIS_Msk )) |
531 ((0x05FAU << SCB_AIRCR_VECTKEY_Pos) & SCB_AIRCR_VECTKEY_Msk) |
537 #if defined (__FPU_USED) && (__FPU_USED == 1U) && \
538 defined (TZ_FPU_NS_USAGE) && (TZ_FPU_NS_USAGE == 1U)
540 SCB->NSACR = (SCB->NSACR & ~(SCB_NSACR_CP10_Msk | SCB_NSACR_CP10_Msk)) |
543 FPU->FPCCR = (FPU->FPCCR & ~(FPU_FPCCR_TS_Msk | FPU_FPCCR_CLRONRETS_Msk | FPU_FPCCR_CLRONRET_Msk)) |
549 #if defined (NVIC_INIT_ITNS0) && (NVIC_INIT_ITNS0 == 1U)
553 #if defined (NVIC_INIT_ITNS1) && (NVIC_INIT_ITNS1 == 1U)
#define __STATIC_INLINE
Definition compiler.h:14
__STATIC_INLINE void TZ_SAU_Setup(void)
Setup a SAU Region.
Definition partition_CMSDK_ARMv8MML.h:478
#define FPU_FPCCR_TS_VAL
Definition partition_CMSDK_ARMv8MML.h:347
#define FPU_FPCCR_CLRONRETS_VAL
Definition partition_CMSDK_ARMv8MML.h:355
#define SAU_INIT_CTRL_ALLNS
Definition partition_CMSDK_ARMv8MML.h:60
#define SCB_CSR_DEEPSLEEPS_VAL
Definition partition_CMSDK_ARMv8MML.h:298
#define SCB_NSACR_CP10_11_VAL
Definition partition_CMSDK_ARMv8MML.h:339
#define SAU_INIT_CTRL_ENABLE
Definition partition_CMSDK_ARMv8MML.h:51
#define SAU_INIT_REGION(n)
Definition partition_CMSDK_ARMv8MML.h:467
#define SCB_AIRCR_SYSRESETREQS_VAL
Definition partition_CMSDK_ARMv8MML.h:306
#define FPU_FPCCR_CLRONRET_VAL
Definition partition_CMSDK_ARMv8MML.h:363
#define NVIC_INIT_ITNS1_VAL
Definition partition_CMSDK_ARMv8MML.h:450
#define SCB_AIRCR_BFHFNMINS_VAL
Definition partition_CMSDK_ARMv8MML.h:322
#define SCB_AIRCR_PRIS_VAL
Definition partition_CMSDK_ARMv8MML.h:314
#define NVIC_INIT_ITNS0_VAL
Definition partition_CMSDK_ARMv8MML.h:413