1 2 3 4 5 6 7 8 9 10 11
12
13 14 15 16
17
18 package ti.catalog.arm.cortexm3.concertoInit;
19
20 import xdc.rov.ViewInfo;
21
22 /*!
23 * ======== Boot ========
24 * Concerto M3 Boot Support.
25 *
26 * The Boot module supports boot initialization for the Concerto M3 core.
27 * A special boot init function is created based on the configuration
28 * settings for this module. This function is hooked into the
29 * xdc.runtime.Reset.fxns[] array and called very early at boot time (prior
30 * to cinit processing).
31 *
32 * The code to support the boot module is placed in a separate section
33 * named `".text:.bootCodeSection"` to allow placement of this section in
34 * the linker .cmd file if necessary. This section is a subsection of the
35 * `".text"` section so this code will be placed into the .text section unless
36 * explicitly placed, either through
37 * `{@link xdc.cfg.Program#sectMap Program.sectMap}` or through a linker
38 * command file.
39 */
40 @Template("./Boot.xdt")
41 @NoRuntime
42 module Boot
43 {
44 /*! System PLL Fractional Multiplier (SPLLFMULT) value */
45 metaonly enum FractMult {
46 Fract_0 = 0x000, /*! Fractional multiplier is 0 */
47 Fract_25 = 0x100, /*! Fractional multiplier is 0.25 */
48 Fract_50 = 0x200, /*! Fractional multiplier is 0.5 */
49 Fract_75 = 0x300 /*! Fractional multiplier is 0.75 */
50 }
51
52 /*! System Clock Divider (SYSDIVSEL) value */
53 metaonly enum SysDiv {
54 Div_1 = 0x0, /*! Divide by 1 */
55 Div_2 = 0x1, /*! Divide by 2 */
56 Div_4 = 0x2, /*! Divide by 4 */
57 Div_8 = 0x3 /*! Divide by 8 */
58 };
59
60 /*! M3 Subsystem Clock Divider (M3SSDIVSEL) value */
61 metaonly enum M3Div {
62 M3Div_1 = 0x0, /*! Divide by 1 */
63 M3Div_2 = 0x1, /*! Divide by 2 */
64 M3Div_4 = 0x2 /*! Divide by 4 */
65 };
66
67 metaonly struct ModuleView {
68 Bool configureClocks;
69 UInt OSCCLK;
70 UInt SPLLIMULT;
71 String SPLLFMULT;
72 String SYSDIVSEL;
73 String M3SSDIVSEL;
74 Bool bootC28;
75 }
76
77 @Facet
78 metaonly config ViewInfo.Instance rovViewInfo =
79 ViewInfo.create({
80 viewMap: [
81 [
82 'Module',
83 {
84 type: ViewInfo.MODULE,
85 viewInitFxn: 'viewInitModule',
86 structName: 'ModuleView'
87 }
88 ],
89 ]
90 });
91
92 /*!
93 * Clock configuration flag, default is false.
94 *
95 * Set to true to configure the PLL and system and M3 subsystem clock
96 * dividers.
97 */
98 config Bool configureClocks = false;
99
100 /*!
101 * ======== sharedMemoryEnable ========
102 * Shared RAM memory enable mask.
103 *
104 * This parameter is used for writing the MEMCNF register.
105 * By default, all shared RAM segments will be enabled at runtime.
106 * To disable a shared RAM segment, set the corresponding bit to 0.
107 * If any data is loaded to a shared RAM segment, the segment must
108 * be enabled prior to loading the program through other means.
109 */
110 config Bits32 sharedMemoryEnable = 0xffffffff;
111
112 /*!
113 * ======== sharedMemoryOwnerMask ========
114 * Shared RAM owner select mask.
115 *
116 * This parameter is used for writing the MSxMSEL register.
117 * By default, each value of each shared RAM select bit is '0'.
118 * This means the M3 is the owner and has write access based upon
119 * the sharedMemoryAccess bits. Setting a '1' in any bit position
120 * makes the C28 the owner of that shared RAM segment.
121 */
122 config Bits32 sharedMemoryOwnerMask = 0;
123
124 /*!
125 * ======== sharedMemoryAccess ========
126 * Shared RAM owner write access.
127 *
128 * This parameter is used for writing the MSxSRCR registers.
129 * It determines the owner write access for each shared RAM segment.
130 * By default, the owner is allowed to fetch, DMA write, and CPU write.
131 */
132 config Bits32 sharedMemoryAccess[8];
133
134 /*!
135 * OSCCLK input frequency to PLL, in MHz. Default is 20 MHz.
136 *
137 * This is the frequency of the oscillator clock (OSCCLK) input to the
138 * PLL.
139 */
140 metaonly config UInt OSCCLK = 20;
141
142 /*! System PLL Integer Multiplier (SPLLIMULT) value */
143 metaonly config UInt SPLLIMULT = 1;
144
145 /*! System PLL Fractional Multiplier (SPLLFMULT) value */
146 metaonly config FractMult SPLLFMULT = Fract_0;
147
148 /*! System Clock Divider (SYSDIVSEL) value */
149 metaonly config SysDiv SYSDIVSEL = Div_8;
150
151 /*! M3 Subsystem Clock Divider (M3SSDIVSEL) value */
152 metaonly config M3Div M3SSDIVSEL = M3Div_4;
153
154 /*!
155 * Flash controller wait states configuration flag, default is true.
156 *
157 * Set to true to configure the Flash controller wait states. The number
158 * of wait states is computed based upon the CPU frequency.
159 */
160 metaonly config Bool configureFlashWaitStates = true;
161
162 /*!
163 * Flash controller program cache enable flag, default is true.
164 *
165 * Set to true to enable the Flash controller's program cache.
166 */
167 metaonly config Bool enableFlashProgramCache = true;
168
169 /*!
170 * Flash controller data cache enable flag, default is true.
171 *
172 * Set to true to enable the Flash controller's data cache.
173 */
174 metaonly config Bool enableFlashDataCache = true;
175
176 /*!
177 * Function to be called when Limp mode is detected.
178 *
179 * This function is called when the Boot module is about to configure
180 * the PLL, but finds the device operating in Limp mode (i.e., the mode
181 * when a missing OSCCLK input has been detected).
182 *
183 * If this function is not specified by the application, a default
184 * function will be used, which spins in an infinite loop.
185 */
186 metaonly config Fxn limpAbortFunction;
187
188 /*!
189 * Boot from Flash flag. Default is true.
190 *
191 * Set to true to enable booting the M3 from Flash.
192 */
193 metaonly config Bool bootFromFlash = true;
194
195 /*!
196 * Initiate booting of the C28 processor. Default is false.
197 *
198 * Set to true to enable the M3 to initiate boot of the C28.
199 *
200 * If enabled, this will occur after the optional clock configuration
201 * step, enabled by `{@link #configureClocks}`.
202 */
203 metaonly config Bool bootC28 = false;
204
205 /*!
206 * Initialize C28 RAM regions before booting the C28 processor.
207 * Default is true.
208 *
209 * Set to true to enable initialization of these C28 RAM regions: M1,
210 * CtoM, LO, L1, L2, and L3. RAM locations will be zeroed, and the ECC or
211 * parity bits will be initialized.
212 */
213 metaonly config Bool initC28RAMs = true;
214
215 /*!
216 * Configure Shared RAM regions before booting the C28 processor.
217 * Default is true.
218 *
219 * Set to true to enable Shared RAM regions S0-S7, to set the
220 * owner of each region and the write access permissions for the onwer.
221 */
222 metaonly config Bool configSharedRAMs = true;
223
224 /*!
225 * @_nodoc
226 * ======== getFrequency ========
227 * Gets the resulting M3 CPU frequency (in Hz) given the Clock
228 * configuration parameters.
229 *
230 */
231 UInt32 getFrequency();
232
233 /*!
234 * @_nodoc
235 * ======== registerFreqListener ========
236 * Register a module to be notified whenever the frequency changes.
237 *
238 * The registered module must have a function named 'fireFrequencyUpdate'
239 * which takes the new frequency as an argument.
240 */
241 function registerFreqListener();
242
243 internal:
244
245
246 metaonly config UInt timestampFreq;
247
248
249 metaonly config String displayFrequency;
250
251
252 metaonly config String displayFrequency28;
253
254
255 metaonly config UInt flashWaitStates = 3;
256
257
258 metaonly config Bits32 MSxSRCR[2];
259
260 };
261 262 263
264