33 #ifndef CONFIG_USE_CLOCK_HFXOSC_PLL
34 #if IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC) || \
35 IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL) || \
36 IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC)
37 #define CONFIG_USE_CLOCK_HFXOSC_PLL 0
39 #define CONFIG_USE_CLOCK_HFXOSC_PLL 1
43 #ifndef CONFIG_USE_CLOCK_HFXOSC
44 #define CONFIG_USE_CLOCK_HFXOSC 0
47 #ifndef CONFIG_USE_CLOCK_HFROSC_PLL
48 #define CONFIG_USE_CLOCK_HFROSC_PLL 0
51 #ifndef CONFIG_USE_CLOCK_HFROSC
52 #define CONFIG_USE_CLOCK_HFROSC 0
55 #if CONFIG_USE_CLOCK_HFXOSC_PLL && \
56 (CONFIG_USE_CLOCK_HFROSC_PLL || CONFIG_USE_CLOCK_HFROSC || \
57 CONFIG_USE_CLOCK_HFXOSC)
58 #error "Cannot use HFXOSC_PLL with other clock configurations"
61 #if CONFIG_USE_CLOCK_HFXOSC && \
62 (CONFIG_USE_CLOCK_HFROSC_PLL || CONFIG_USE_CLOCK_HFROSC || \
63 CONFIG_USE_CLOCK_HFXOSC_PLL)
64 #error "Cannot use HFXOSC with other clock configurations"
67 #if CONFIG_USE_CLOCK_HFROSC_PLL && \
68 (CONFIG_USE_CLOCK_HFXOSC_PLL || CONFIG_USE_CLOCK_HFXOSC || \
69 CONFIG_USE_CLOCK_HFROSC)
70 #error "Cannot use HFROSC_PLL with other clock configurations"
73 #if CONFIG_USE_CLOCK_HFROSC && \
74 (CONFIG_USE_CLOCK_HFXOSC_PLL || CONFIG_USE_CLOCK_HFXOSC || \
75 CONFIG_USE_CLOCK_HFROSC_PLL)
76 #error "Cannot use HFROSC with other clock configurations"
79 #define CONFIG_CLOCK_PLL_R (1)
80 #ifndef CONFIG_CLOCK_PLL_F
81 #define CONFIG_CLOCK_PLL_F (39)
83 #ifndef CONFIG_CLOCK_PLL_Q
84 #define CONFIG_CLOCK_PLL_Q (1)
87 #if CONFIG_USE_CLOCK_HFXOSC_PLL
88 #define CLOCK_PLL_INPUT_CLOCK MHZ(16)
89 #define CLOCK_PLL_REFR (CLOCK_PLL_INPUT_CLOCK / \
90 (CONFIG_CLOCK_PLL_R + 1))
91 #define CLOCK_PLL_VCO (CLOCK_PLL_REFR * \
92 (2 * (CONFIG_CLOCK_PLL_F + 1)))
93 #define CLOCK_PLL_OUT (CLOCK_PLL_VCO / \
94 (1 << CONFIG_CLOCK_PLL_Q))
95 #define CLOCK_CORECLOCK (CLOCK_PLL_OUT)
98 #if CLOCK_PLL_REFR != MHZ(8)
99 #error "Only R=2 can be used when using HFXOSC"
101 #if (CLOCK_PLL_VCO < MHZ(384)) || (CLOCK_PLL_VCO > MHZ(768))
103 "VCO frequency must be in the range [384MHz - 768MHz], check the CLOCK_PLL_F value"
105 #if (CLOCK_PLL_OUT < MHZ(48)) || (CLOCK_PLL_OUT > MHZ(384))
107 "PLL output frequency must be in the range [48MHz - 384MHz], check the CLOCK_PLL_Q value"
110 #elif CONFIG_USE_CLOCK_HFXOSC
111 #define CLOCK_CORECLOCK MHZ(16)
118 #ifndef CONFIG_CLOCK_DESIRED_FREQUENCY
119 #define CONFIG_CLOCK_DESIRED_FREQUENCY MHZ(320)
122 #ifndef CONFIG_CLOCK_HFROSC_TRIM
123 #define CONFIG_CLOCK_HFROSC_TRIM (6)
125 #ifndef CONFIG_CLOCK_HFROSC_DIV
126 #define CONFIG_CLOCK_HFROSC_DIV (1)
Common macros and compiler attributes/pragmas configuration.