1 /******************************************************************************
2 * @file system_<Device>.c
3 * @brief CMSIS Cortex-A Device Peripheral Access Layer
5 * @date 10. January 2018
6 ******************************************************************************/
8 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
10 * SPDX-License-Identifier: Apache-2.0
12 * Licensed under the Apache License, Version 2.0 (the License); you may
13 * not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
16 * www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
26 #include "<Device>.h" /* ToDo: replace '<Device>' with your device name */
29 /*----------------------------------------------------------------------------
31 *----------------------------------------------------------------------------*/
32 /* ToDo: add here your necessary defines for device initialization
33 following is an example for different system frequencies */
34 #define XTAL (12000000U) /* Oscillator frequency */
36 #define SYSTEM_CLOCK (5 * XTAL)
39 /*----------------------------------------------------------------------------
40 System Core Clock Variable
41 *----------------------------------------------------------------------------*/
42 /* ToDo: initialize SystemCoreClock with the system core clock frequency value
43 achieved after system intitialization.
44 This means system core clock frequency after call to SystemInit() */
45 uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Clock Frequency (Core Clock)*/
49 /*----------------------------------------------------------------------------
51 *----------------------------------------------------------------------------*/
53 void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
55 /* ToDo: add code to calculate the system frequency based upon the current
57 This function can be used to retrieve the system core clock frequeny
58 after user changed register sittings. */
59 SystemCoreClock = SYSTEM_CLOCK;
63 /*----------------------------------------------------------------------------
65 *----------------------------------------------------------------------------*/
66 void SystemInit (void)
68 /* ToDo: add code to initialize the system
69 Do not use global variables because this function is called before
70 reaching pre-main. RW section may be overwritten afterwards. */
71 SystemCoreClock = SYSTEM_CLOCK;
73 // Invalidate entire Unified TLB
76 // Invalidate entire branch predictor array
81 // Invalidate instruction cache and flush branch target cache
86 // Invalidate data cache
87 L1C_InvalidateDCacheAll();
89 // Create Translation Table
90 MMU_CreateTranslationTable();
99 #if (__L2C_PRESENT == 1)
104 #if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))