Set SAU Region present flag for M2351 device and include security header file.

As per SAU documents, SAU is always present if the security extension is
available. The functionality differs if the SAU contains SAU regions.
If SAU regions are available it is configured with the macro __SAUREGION_PRESENT
pull/7631/head
Deepika 2017-09-11 16:57:51 -05:00 committed by Cruz Monrreal II
parent 0468bf2b6b
commit f1336c9f85
3 changed files with 4 additions and 3 deletions

View File

@ -179,6 +179,7 @@ typedef enum IRQn
/* -------- Configuration of the Cortex-ARMv8MBL Processor and Core Peripherals ------- */
#define __ARMv8MBL_REV 0x0000U /* Core revision r0p0 */
#define __SAU_PRESENT 1U /* SAU present */
#define __SAUREGION_PRESENT 1U /* SAU regions are present */
#define __MPU_PRESENT 1U /* MPU present */
#define __VTOR_PRESENT 1U /* VTOR present */
#define __NVIC_PRIO_BITS 2U /* Number of Bits used for Priority Levels */

View File

@ -452,7 +452,7 @@
__STATIC_INLINE void TZ_SAU_Setup(void)
{
#if defined (__SAU_PRESENT) && (__SAU_PRESENT == 1U)
#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
#if defined (SAU_INIT_REGION0) && (SAU_INIT_REGION0 == 1U)
SAU_INIT_REGION(0);
@ -488,13 +488,13 @@ __STATIC_INLINE void TZ_SAU_Setup(void)
/* repeat this for all possible SAU regions */
#endif /* defined (__SAUREGION_PRESENT ) && (__SAUREGION_PRESENT == 1U) */
#if defined (SAU_INIT_CTRL) && (SAU_INIT_CTRL == 1U)
SAU->CTRL = ((SAU_INIT_CTRL_ENABLE << SAU_CTRL_ENABLE_Pos) & SAU_CTRL_ENABLE_Msk) |
((SAU_INIT_CTRL_ALLNS << SAU_CTRL_ALLNS_Pos) & SAU_CTRL_ALLNS_Msk) ;
#endif
#endif /* defined (__SAU_PRESENT) && (__SAU_PRESENT == 1U) */
#if defined (SCB_CSR_AIRCR_INIT) && (SCB_CSR_AIRCR_INIT == 1U)
SCB->SCR = (SCB->SCR & ~(SCB_SCR_SLEEPDEEPS_Msk)) |

View File

@ -9,7 +9,7 @@
* Copyright (C) 2016 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
//#include <arm_cmse.h>
#include <arm_cmse.h>
#include <stdio.h>
#include <stdint.h>
#include "M2351.h"