1 /*
2 ** ###################################################################
3 **     Processors:          MIMX8MD6CVAHZ
4 **                          MIMX8MD6DVAJZ
5 **
6 **     Compilers:           Keil ARM C/C++ Compiler
7 **                          GNU C Compiler
8 **                          IAR ANSI C/C++ Compiler for ARM
9 **
10 **     Reference manual:    IMX8MDQLQRM, Rev. 0, Jan. 2018
11 **     Version:             rev. 4.0, 2018-01-26
12 **     Build:               b180903
13 **
14 **     Abstract:
15 **         Provides a system configuration function and a global variable that
16 **         contains the system frequency. It configures the device and initializes
17 **         the oscillator (PLL) that is part of the microcontroller device.
18 **
19 **     Copyright 2016 Freescale Semiconductor, Inc.
20 **     Copyright 2016-2018 NXP
21 **     All rights reserved.
22 **
23 **     SPDX-License-Identifier: BSD-3-Clause
24 **
25 **     http:                 www.nxp.com
26 **     mail:                 support@nxp.com
27 **
28 **     Revisions:
29 **     - rev. 1.0 (2017-01-10)
30 **         Initial version.
31 **     - rev. 2.0 (2017-04-27)
32 **         Rev.B Header EAR1
33 **     - rev. 3.0 (2017-07-19)
34 **         Rev.C Header EAR2
35 **     - rev. 4.0 (2018-01-26)
36 **         Rev.D Header RFP
37 **
38 ** ###################################################################
39 */
40 
41 /*!
42  * @file MIMX8MD6_cm4
43  * @version 4.0
44  * @date 2018-01-26
45  * @brief Device specific configuration file for MIMX8MD6_cm4 (header file)
46  *
47  * Provides a system configuration function and a global variable that contains
48  * the system frequency. It configures the device and initializes the oscillator
49  * (PLL) that is part of the microcontroller device.
50  */
51 
52 #ifndef _SYSTEM_MIMX8MD6_cm4_H_
53 #define _SYSTEM_MIMX8MD6_cm4_H_                  /**< Symbol preventing repeated inclusion */
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #include <stdint.h>
60 
61 
62 /* i.MX8MQ Definitions */
63 #ifndef DISABLE_WDOG
64   #define DISABLE_WDOG      1
65 #endif
66 /* Define clock source values */
67 #define CLK_P_N_FREQ                      0u                  /* The value could be changeD according to the  actual usage */
68 #define CPU_XTAL_SOSC_CLK_25MHZ           25000000u           /* Value of the external System Oscillator Clock(SOSC) frequency in Hz */
69 #define CPU_XTAL_SOSC_CLK_27MHZ           27000000u           /* Value of the external System Oscillator Clock(SOSC) frequency in Hz */
70 #define CPU_HDMI_PHY_CLK_27MHZ            27000000u           /* Value of the HDMI PHY 27M clock frequency in Hz*/
71 #define DEFAULT_SYSTEM_CLOCK              266666666u          /* Default System clock value */
72 
73 
74 /**
75  * @brief System clock frequency (core clock)
76  *
77  * The system clock frequency supplied to the SysTick timer and the processor
78  * core clock. This variable can be used by the user application to setup the
79  * SysTick timer or configure other parameters. It may also be used by debugger to
80  * query the frequency of the debug timer or configure the trace clock speed
81  * SystemCoreClock is initialized with a correct predefined value.
82  */
83 extern uint32_t SystemCoreClock;
84 
85 /**
86  * @brief Setup the microcontroller system.
87  *
88  * Typically this function configures the oscillator (PLL) that is part of the
89  * microcontroller device. For systems with variable clock speed it also updates
90  * the variable SystemCoreClock. SystemInit is called from startup_device file.
91  */
92 void SystemInit (void);
93 
94 /**
95  * @brief Updates the SystemCoreClock variable.
96  *
97  * It must be called whenever the core clock is changed during program
98  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
99  * the current core clock.
100  */
101 void SystemCoreClockUpdate (void);
102 
103 /**
104  * @brief SystemInit function hook.
105  *
106  * This weak function allows to call specific initialization code during the
107  * SystemInit() execution.This can be used when an application specific code needs
108  * to be called as close to the reset entry as possible (for example the Multicore
109  * Manager MCMGR_EarlyInit() function call).
110  * NOTE: No global r/w variables can be used in this hook function because the
111  * initialization of these variables happens after this function.
112  */
113 void SystemInitHook (void);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif  /* _SYSTEM_MIMX8MD6_cm4_H_ */
120