1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 34 35
36
37 package ti.sysbios.family.arm.msp432e4.init;
38
39 import xdc.rov.ViewInfo;
40
41 /*!
42 * ======== Boot ========
43 * MSP432E Boot Support.
44 *
45 * The Boot module supports boot initialization for the MSP432E devices.
46 * A special boot init function is created based on the configuration
47 * settings for this module. This function is hooked into the
48 * xdc.runtime.Reset.fxns[] array and called very early at boot time (prior
49 * to cinit processing).
50 *
51 * The code to support the boot module is placed in a separate section
52 * named `".text:.bootCodeSection"` to allow placement of this section in
53 * the linker .cmd file if necessary. This section is a subsection of the
54 * `".text"` section so this code will be placed into the .text section unless
55 * explicitly placed, either through
56 * `{@link xdc.cfg.Program#sectMap Program.sectMap}` or through a linker
57 * command file.
58 */
59 @Template("./Boot.xdt")
60 module Boot
61 {
62 metaonly struct ModuleView {
63 Bool configureClock;
64 String xtal;
65 String oscSrc;
66 Bool pllBypass;
67 Bool ioscDisable;
68 Bool moscDisable;
69 }
70
71 @Facet
72 metaonly config ViewInfo.Instance rovViewInfo =
73 ViewInfo.create({
74 viewMap: [
75 [
76 'Module',
77 {
78 type: ViewInfo.MODULE,
79 viewInitFxn: 'viewInitModule',
80 structName: 'ModuleView'
81 }
82 ],
83 ]
84 });
85
86 metaonly enum XtalFreq {
87 XTAL_5MHZ = 0x00000000, /*! 5 MHz */
88 XTAL_6MHZ = 0x00000040, /*! 6 MHz */
89 XTAL_8MHZ = 0x00000080, /*! 8 MHz */
90 XTAL_10MHZ = 0x000000C0, /*! 10 MHz */
91 XTAL_12MHZ = 0x00000100, /*! 12 MHz */
92 XTAL_16MHZ = 0x00000140, /*! 16 MHz */
93 XTAL_18MHZ = 0x00000180, /*! 18 MHz */
94 XTAL_20MHZ = 0x000001C0, /*! 20 MHz */
95 XTAL_24MHZ = 0x00000200, /*! 24 MHz */
96 XTAL_25MHZ = 0x00000240 /*! 25 MHz */
97 }
98
99 metaonly enum OscSrc {
100 OSCSRC_MAIN = 0x00000000, /*! Main oscillator */
101 OSCSRC_INT = 0x00000010, /*! Internal oscillator */
102 OSCSRC_INT4 = 0x00000020, /*! Internal oscillator / 4 */
103 OSCSRC_INT30 = 0x00000030, /*! Internal 30 KHz oscillator */
104 OSCSRC_EXT4_19 = 0x80000028, /*! External 4.19 MHz */
105 OSCSRC_EXT32 = 0x80000038 /*! External 32 KHz */
106 }
107
108 metaonly enum VcoFreq {
109 VCO_480 = 0xF1000000, /*! VCO is 480 MHz */
110 VCO_320 = 0xF0000000 /*! VCO is 320 MHz */
111 }
112
113 /*!
114 * Clock configuration flag, default is true.
115 */
116 metaonly config Bool configureClock = true;
117
118 /*! Crystal Value */
119 metaonly config XtalFreq xtal = XTAL_25MHZ;
120
121 /*! Oscillator Source */
122 metaonly config OscSrc oscSrc = OSCSRC_MAIN;
123
124 /*! VCO frequency */
125 metaonly config VcoFreq vcoFreq = VCO_480;
126
127 /*! PLL Bypass flag */
128 metaonly config Bool pllBypass = false;
129
130 /*! Internal Oscillator Disable flag */
131 metaonly config Bool ioscDisable = false;
132
133 /*! Main Oscillator Disable flag */
134 metaonly config Bool moscDisable = false;
135
136 /*!
137 * @_nodoc
138 * Enhanced Clocking Mode.
139 * This config parameter has been deprecated.
140 */
141 metaonly config Bool enhancedClockMode = true;
142
143 /*!
144 * Desired CPU Clock Frequency in Hz.
145 */
146 metaonly config UInt cpuFrequency = 120000000;
147
148 149 150 151 152 153 154 155 156 157 158 159 160 161
162 @DirectCall
163 ULong sysCtlClockFreqSet(ULong ulConfig, ULong ulSysClock);
164
165 /*!
166 * @_nodoc
167 * ======== registerFreqListener ========
168 * Register a module to be notified whenever the frequency changes.
169 *
170 * The registered module must have a function named 'fireFrequencyUpdate'
171 * which takes the new frequency as an argument.
172 */
173 function registerFreqListener();
174
175 internal:
176
177 178 179 180 181 182 183 184 185 186 187
188 ULong sysCtlClockFreqSetI(ULong ulConfig, ULong ulSysClock);
189
190 191 192 193 194 195 196
197 Void init();
198
199 /*!
200 * computed RCC value based on settings
201 */
202 metaonly config UInt ulConfig;
203
204 /*!
205 * computed cpu frequency based on clock settings
206 */
207 metaonly config UInt computedCpuFrequency;
208
209 };