Subversion Repositories FuelGauge

Rev

Blame | Last modification | View Log | Download | RSS feed

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