]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/RTE/Device/ARMCM33_DSP_FP_TZ/system_ARMCM33.c
First Official Release of ARMV8M Support. This release removes Pre-Release from all...
[freertos] / FreeRTOS / Demo / CORTEX_MPU_M33F_Simulator_Keil_GCC / Secure / RTE / Device / ARMCM33_DSP_FP_TZ / system_ARMCM33.c
1 /**************************************************************************//**\r
2  * @file     system_ARMCM33.c\r
3  * @brief    CMSIS Device System Source File for\r
4  *           ARMCM33 Device Series\r
5  * @version  V5.00\r
6  * @date     02. November 2016\r
7  ******************************************************************************/\r
8 /*\r
9  * Copyright (c) 2009-2016 ARM Limited. All rights reserved.\r
10  *\r
11  * SPDX-License-Identifier: Apache-2.0\r
12  *\r
13  * Licensed under the Apache License, Version 2.0 (the License); you may\r
14  * not use this file except in compliance with the License.\r
15  * You may obtain a copy of the License at\r
16  *\r
17  * www.apache.org/licenses/LICENSE-2.0\r
18  *\r
19  * Unless required by applicable law or agreed to in writing, software\r
20  * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
22  * See the License for the specific language governing permissions and\r
23  * limitations under the License.\r
24  */\r
25 \r
26 #if defined (ARMCM33)\r
27   #include "ARMCM33.h"\r
28 #elif defined (ARMCM33_TZ)\r
29   #include "ARMCM33_TZ.h"\r
30 \r
31   #if defined (__ARM_FEATURE_CMSE) &&  (__ARM_FEATURE_CMSE == 3U)\r
32     #include "partition_ARMCM33.h"\r
33   #endif\r
34 #elif defined (ARMCM33_DSP_FP)\r
35   #include "ARMCM33_DSP_FP.h"\r
36 #elif defined (ARMCM33_DSP_FP_TZ)\r
37   #include "ARMCM33_DSP_FP_TZ.h"\r
38 \r
39   #if defined (__ARM_FEATURE_CMSE) &&  (__ARM_FEATURE_CMSE == 3U)\r
40     #include "partition_ARMCM33.h"\r
41   #endif\r
42 #else\r
43   #error device not specified!\r
44 #endif\r
45 \r
46 /*----------------------------------------------------------------------------\r
47   Define clocks\r
48  *----------------------------------------------------------------------------*/\r
49 #define  XTAL            ( 5000000UL)      /* Oscillator frequency */\r
50 \r
51 #define  SYSTEM_CLOCK    (5U * XTAL)\r
52 \r
53 \r
54 /*----------------------------------------------------------------------------\r
55   Externals\r
56  *----------------------------------------------------------------------------*/\r
57 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
58   extern uint32_t __Vectors;\r
59 #endif\r
60 \r
61 /*----------------------------------------------------------------------------\r
62   System Core Clock Variable\r
63  *----------------------------------------------------------------------------*/\r
64 uint32_t SystemCoreClock = SYSTEM_CLOCK;\r
65 \r
66 \r
67 /*----------------------------------------------------------------------------\r
68   System Core Clock update function\r
69  *----------------------------------------------------------------------------*/\r
70 void SystemCoreClockUpdate (void)\r
71 {\r
72   SystemCoreClock = SYSTEM_CLOCK;\r
73 }\r
74 \r
75 /*----------------------------------------------------------------------------\r
76   System initialization function\r
77  *----------------------------------------------------------------------------*/\r
78 void SystemInit (void)\r
79 {\r
80 \r
81 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)\r
82   SCB->VTOR = (uint32_t) &__Vectors;\r
83 #endif\r
84 \r
85 #if defined (__FPU_USED) && (__FPU_USED == 1U)\r
86   SCB->CPACR |= ((3U << 10U*2U) |           /* set CP10 Full Access */\r
87                  (3U << 11U*2U)  );         /* set CP11 Full Access */\r
88 #endif\r
89 \r
90 #ifdef UNALIGNED_SUPPORT_DISABLE\r
91   SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;\r
92 #endif\r
93 \r
94 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)\r
95   TZ_SAU_Setup();\r
96 #endif\r
97 \r
98   SystemCoreClock = SYSTEM_CLOCK;\r
99 }\r