]>
Commit | Line | Data |
---|---|---|
ba94a1bb WD |
1 | /** |
2 | * @file IxFeatureCtrl.h | |
3 | * | |
4 | * @date 30-Jan-2003 | |
5 | ||
6 | * @brief This file contains the public API of the IXP400 Feature Control | |
7 | * component. | |
8 | * | |
9 | * | |
10 | * @par | |
11 | * IXP400 SW Release version 2.0 | |
12 | * | |
13 | * -- Copyright Notice -- | |
14 | * | |
15 | * @par | |
16 | * Copyright 2001-2005, Intel Corporation. | |
17 | * All rights reserved. | |
18 | * | |
19 | * @par | |
20 | * Redistribution and use in source and binary forms, with or without | |
21 | * modification, are permitted provided that the following conditions | |
22 | * are met: | |
23 | * 1. Redistributions of source code must retain the above copyright | |
24 | * notice, this list of conditions and the following disclaimer. | |
25 | * 2. Redistributions in binary form must reproduce the above copyright | |
26 | * notice, this list of conditions and the following disclaimer in the | |
27 | * documentation and/or other materials provided with the distribution. | |
28 | * 3. Neither the name of the Intel Corporation nor the names of its contributors | |
29 | * may be used to endorse or promote products derived from this software | |
30 | * without specific prior written permission. | |
31 | * | |
32 | * @par | |
33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' | |
34 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
35 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
36 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | |
37 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
38 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
39 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
40 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
41 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
42 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
43 | * SUCH DAMAGE. | |
44 | * | |
45 | * @par | |
46 | * -- End of Copyright Notice -- | |
47 | */ | |
48 | /* ------------------------------------------------------ | |
49 | Doxygen group definitions | |
50 | ------------------------------------------------------ */ | |
51 | /** | |
52 | * @defgroup IxFeatureCtrlAPI IXP400 Feature Control (IxFeatureCtrl) API | |
53 | * | |
54 | * @brief The Public API for the IXP400 Feature Control. | |
55 | * | |
56 | * @{ | |
57 | */ | |
58 | ||
59 | #ifndef IXFEATURECTRL_H | |
60 | #define IXFEATURECTRL_H | |
61 | ||
62 | /* | |
63 | * User defined include files | |
64 | */ | |
65 | #include "IxOsal.h" | |
66 | ||
67 | /* | |
68 | * #defines and macros | |
69 | */ | |
70 | ||
71 | /************************************************************* | |
72 | * The following are IxFeatureCtrlComponentCheck return values. | |
73 | ************************************************************/ | |
74 | ||
75 | /** | |
76 | * @ingroup IxFeatureCtrlAPI | |
77 | * | |
78 | * @def IX_FEATURE_CTRL_COMPONENT_DISABLED | |
79 | * | |
80 | * @brief Hardware Component is disabled/unavailable. | |
81 | * Return status by ixFeatureCtrlComponentCheck() | |
82 | */ | |
83 | #define IX_FEATURE_CTRL_COMPONENT_DISABLED 0 | |
84 | ||
85 | /** | |
86 | * @ingroup IxFeatureCtrlAPI | |
87 | * | |
88 | * @def IX_FEATURE_CTRL_COMPONENT_ENABLED | |
89 | * | |
90 | * @brief Hardware Component is available. | |
91 | * Return status by ixFeatureCtrlComponentCheck() | |
92 | */ | |
93 | #define IX_FEATURE_CTRL_COMPONENT_ENABLED 1 | |
94 | ||
95 | /*********************************************************************************** | |
96 | * Product ID in XScale CP15 - Register 0 | |
97 | * - It contains information on the maximum XScale Core Frequency and | |
98 | * Silicon Stepping. | |
99 | * - XScale Core Frequency Id indicates only the maximum XScale frequency | |
100 | * achievable and not the running XScale frequency (maybe stepped down). | |
101 | * - The register is read by using ixFeatureCtrlProductIdRead. | |
102 | * - Usage example: | |
103 | * productId = ixFeatureCtrlProductIdRead(); | |
104 | * if( (productId & IX_FEATURE_CTRL_SILICON_STEPPING_MASK) == | |
105 | * IX_FEATURE_CTRL_SILICON_TYPE_A0 ) | |
106 | * if( (productId & IX_FEATURE_CTRL_XSCALE_FREQ_MASK) == | |
107 | * IX_FEATURE_CTRL_XSCALE_FREQ_533 ) | |
108 | * | |
109 | * 31 28 27 24 23 20 19 16 15 12 11 9 8 4 3 0 | |
110 | * -------------------------------------------------------------------------------- | |
111 | * | 0x6 | 0x9 | 0x0 | 0x5 | 0x4 | Device ID | XScale Core Freq Id | Si Stepping Id | | |
112 | * -------------------------------------------------------------------------------- | |
113 | * | |
114 | * Maximum Achievable XScale Core Frequency Id : 533MHz - 0x1C | |
115 | * 400MHz - 0x1D | |
116 | * 266MHz - 0x1F | |
117 | * | |
118 | * <b>THE CORE FREQUENCY ID IS NOT APPLICABLE TO IXP46X <\b> | |
119 | * | |
120 | * The above is applicable to IXP42X only. CP15 in IXP46X does not contain any | |
121 | * Frequency ID. | |
122 | * | |
123 | * Si Stepping Id : A - 0x0 | |
124 | * B - 0x1 | |
125 | * | |
126 | * XScale Core freq Id - Device ID [11:9] : IXP42X - 0x0 | |
127 | * IXP46X - 0x1 | |
128 | *************************************************************************************/ | |
129 | ||
130 | /** | |
131 | * @ingroup IxFeatureCtrlAPI | |
132 | * | |
133 | * @def IX_FEATURE_CTRL_SILICON_TYPE_A0 | |
134 | * | |
135 | * @brief This is the value of A0 Silicon in product ID. | |
136 | */ | |
137 | #define IX_FEATURE_CTRL_SILICON_TYPE_A0 0 | |
138 | ||
139 | /** | |
140 | * @ingroup IxFeatureCtrlAPI | |
141 | * | |
142 | * @def IX_FEATURE_CTRL_SILICON_TYPE_B0 | |
143 | * | |
144 | * @brief This is the value of B0 Silicon in product ID. | |
145 | */ | |
146 | #define IX_FEATURE_CTRL_SILICON_TYPE_B0 1 | |
147 | ||
148 | /** | |
149 | * @ingroup IxFeatureCtrlAPI | |
150 | * | |
151 | * @def IX_FEATURE_CTRL_SILICON_STEPPING_MASK | |
152 | * | |
153 | * @brief This is the mask of silicon stepping in product ID. | |
154 | */ | |
155 | #define IX_FEATURE_CTRL_SILICON_STEPPING_MASK 0xF | |
156 | ||
157 | /** | |
158 | * @ingroup IxFeatureCtrlAPI | |
159 | * | |
160 | * @def IX_FEATURE_CTRL_DEVICE_TYPE_MASK | |
161 | * | |
162 | * @brief This is the mask of silicon stepping in product ID. | |
163 | */ | |
164 | #define IX_FEATURE_CTRL_DEVICE_TYPE_MASK (0x7) | |
165 | ||
166 | /** | |
167 | * @ingroup IxFeatureCtrlAPI | |
168 | * | |
169 | * @def IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET | |
170 | * | |
171 | * @brief This is the mask of silicon stepping in product ID. | |
172 | */ | |
173 | #define IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET 9 | |
174 | ||
175 | ||
176 | /** | |
177 | * @ingroup IxFeatureCtrlAPI | |
178 | * | |
179 | * @def IX_FEATURE_CTRL_XSCALE_FREQ_533 | |
180 | * | |
181 | * @brief This is the value of 533MHz XScale Core in product ID. | |
182 | */ | |
183 | #define IX_FEATURE_CTRL_XSCALE_FREQ_533 ((0x1C)<<4) | |
184 | ||
185 | /** | |
186 | * @ingroup IxFeatureCtrlAPI | |
187 | * | |
188 | * @def IX_FEATURE_CTRL_XSCALE_FREQ_400 | |
189 | * | |
190 | * @brief This is the value of 400MHz XScale Core in product ID. | |
191 | */ | |
192 | #define IX_FEATURE_CTRL_XSCALE_FREQ_400 ((0x1D)<<4) | |
193 | ||
194 | /** | |
195 | * @ingroup IxFeatureCtrlAPI | |
196 | * | |
197 | * @def IX_FEATURE_CTRL_XSCALE_FREQ_266 | |
198 | * | |
199 | * @brief This is the value of 266MHz XScale Core in product ID. | |
200 | */ | |
201 | #define IX_FEATURE_CTRL_XSCALE_FREQ_266 ((0x1F)<<4) | |
202 | ||
203 | /** | |
204 | * @ingroup IxFeatureCtrlAPI | |
205 | * | |
206 | * @def IX_FEATURE_CTRL_XSCALE_FREQ_MASK | |
207 | * | |
208 | * @brief This is the mask of XScale Core in product ID. | |
209 | */ | |
210 | #define IX_FEATURE_CTRL_XSCALE_FREQ_MASK ((0xFF)<<4) | |
211 | ||
212 | /** | |
213 | * @ingroup IxFeatureCtrlAPI | |
214 | * | |
215 | * @def IX_FEATURECTRL_REG_UTOPIA_32PHY | |
216 | * | |
217 | * @brief Maximum UTOPIA PHY available is 32. | |
218 | * | |
219 | */ | |
220 | #define IX_FEATURECTRL_REG_UTOPIA_32PHY 0x0 | |
221 | ||
222 | /** | |
223 | * @ingroup IxFeatureCtrlAPI | |
224 | * | |
225 | * @def IX_FEATURECTRL_REG_UTOPIA_16PHY | |
226 | * | |
227 | * @brief Maximum UTOPIA PHY available is 16. | |
228 | * | |
229 | */ | |
230 | #define IX_FEATURECTRL_REG_UTOPIA_16PHY 0x1 | |
231 | ||
232 | /** | |
233 | * @ingroup IxFeatureCtrlAPI | |
234 | * | |
235 | * @def IX_FEATURECTRL_REG_UTOPIA_8PHY | |
236 | * | |
237 | * @brief Maximum UTOPIA PHY available to is 8. | |
238 | * | |
239 | */ | |
240 | #define IX_FEATURECTRL_REG_UTOPIA_8PHY 0x2 | |
241 | ||
242 | /** | |
243 | * @ingroup IxFeatureCtrlAPI | |
244 | * | |
245 | * @def IX_FEATURECTRL_REG_UTOPIA_4PHY | |
246 | * | |
247 | * @brief Maximum UTOPIA PHY available to is 4. | |
248 | * | |
249 | */ | |
250 | #define IX_FEATURECTRL_REG_UTOPIA_4PHY 0x3 | |
251 | ||
252 | #ifdef __ixp46X | |
253 | ||
254 | /** | |
255 | * @ingroup IxFeatureCtrlAPI | |
256 | * | |
257 | * @def IX_FEATURECTRL_REG_XSCALE_533FREQ | |
258 | * | |
259 | * @brief Maximum frequency available to IXP46x is 533 MHz. | |
260 | * | |
261 | */ | |
262 | #define IX_FEATURECTRL_REG_XSCALE_533FREQ 0x0 | |
263 | ||
264 | /** | |
265 | * @ingroup IxFeatureCtrlAPI | |
266 | * | |
267 | * @def IX_FEATURECTRL_REG_XSCALE_667FREQ | |
268 | * | |
269 | * @brief Maximum frequency available to IXP46x is 667 MHz. | |
270 | * | |
271 | */ | |
272 | #define IX_FEATURECTRL_REG_XSCALE_667FREQ 0x1 | |
273 | ||
274 | /** | |
275 | * @ingroup IxFeatureCtrlAPI | |
276 | * | |
277 | * @def IX_FEATURECTRL_REG_XSCALE_400FREQ | |
278 | * | |
279 | * @brief Maximum frequency available to IXP46x is 400 MHz. | |
280 | * | |
281 | */ | |
282 | #define IX_FEATURECTRL_REG_XSCALE_400FREQ 0x2 | |
283 | ||
284 | /** | |
285 | * @ingroup IxFeatureCtrlAPI | |
286 | * | |
287 | * @def IX_FEATURECTRL_REG_XSCALE_266FREQ | |
288 | * | |
289 | * @brief Maximum frequency available to IXP46x is 266 MHz. | |
290 | * | |
291 | */ | |
292 | #define IX_FEATURECTRL_REG_XSCALE_266FREQ 0x3 | |
293 | ||
294 | #endif /* __ixp46X */ | |
295 | ||
296 | /** | |
297 | * @ingroup IxFeatureCtrlAPI | |
298 | * | |
299 | * @def IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE | |
300 | * | |
301 | * @brief Component selected is not available for device | |
302 | * | |
303 | */ | |
304 | #define IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE 0x0000 | |
305 | ||
306 | /** | |
307 | * @ingroup IxFeatureCtrlAPI | |
308 | * | |
309 | * @def IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE | |
310 | * | |
311 | * @brief Component selected is not available for device | |
312 | * | |
313 | */ | |
314 | #define IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE 0xffff | |
315 | ||
316 | /** | |
317 | * @defgroup IxFeatureCtrlSwConfig Software Configuration for Access Component | |
318 | * | |
319 | * @ingroup IxFeatureCtrlAPI | |
320 | * | |
321 | * @brief This section describes software configuration in access component. The | |
322 | * configuration can be changed at run-time. ixFeatureCtrlSwConfigurationCheck( ) | |
323 | * will be used across applicable access component to check the configuration. | |
324 | * ixFeatureCtrlSwConfigurationWrite( ) is used to write the software configuration. | |
325 | * | |
326 | * @note <b>All software configurations are default to be enabled.</b> | |
327 | * | |
328 | * @{ | |
329 | */ | |
330 | /** | |
331 | * @ingroup IxFeatureCtrlSwConfig | |
332 | * | |
333 | * @def IX_FEATURE_CTRL_SWCONFIG_DISABLED | |
334 | * | |
335 | * @brief Software configuration is disabled. | |
336 | * | |
337 | */ | |
338 | #define IX_FEATURE_CTRL_SWCONFIG_DISABLED 0 | |
339 | ||
340 | /** | |
341 | * @ingroup IxFeatureCtrlSwConfig | |
342 | * | |
343 | * @def IX_FEATURE_CTRL_SWCONFIG_ENABLED | |
344 | * | |
345 | * @brief Software configuration is enabled. | |
346 | * | |
347 | */ | |
348 | #define IX_FEATURE_CTRL_SWCONFIG_ENABLED 1 | |
349 | ||
350 | /** | |
351 | * Section for enums | |
352 | **/ | |
353 | ||
354 | /** | |
355 | * @ingroup IxFeatureCtrlBuildDevice | |
356 | * | |
357 | * @enum IxFeatureCtrlBuildDevice | |
358 | * | |
359 | * @brief Indicates software build type. | |
360 | * | |
361 | * Default build type is IXP42X | |
362 | * | |
363 | */ | |
364 | typedef enum | |
365 | { | |
366 | IX_FEATURE_CTRL_SW_BUILD_IXP42X = 0, /**<Build type is IXP42X */ | |
367 | IX_FEATURE_CTRL_SW_BUILD_IXP46X /**<Build type is IXP46X */ | |
368 | } IxFeatureCtrlBuildDevice; | |
369 | ||
370 | /** | |
371 | * @ingroup IxFeatureCtrlSwConfig | |
372 | * | |
373 | * @enum IxFeatureCtrlSwConfig | |
374 | * | |
375 | * @brief Enumeration for software configuration in access components. | |
376 | * | |
377 | * Entry for new run-time software configuration should be added here. | |
378 | */ | |
379 | typedef enum | |
380 | { | |
381 | IX_FEATURECTRL_ETH_LEARNING = 0, /**< EthDB Learning Feature */ | |
382 | IX_FEATURECTRL_ORIGB0_DISPATCHER, /**< IXP42X B0 and IXP46X dispatcher without | |
383 | livelock prevention functionality Feature */ | |
384 | IX_FEATURECTRL_SWCONFIG_MAX /**< Maximum boudary for IxFeatureCtrlSwConfig */ | |
385 | } IxFeatureCtrlSwConfig; | |
386 | ||
387 | ||
388 | /************************************************************************ | |
389 | * IXP400 Feature Control Register | |
390 | * - It contains the information (available/unavailable) of IXP425&IXP46X | |
391 | * hardware components in their corresponding bit location. | |
392 | * - Bit value of 0 means the hardware component is available | |
393 | * or not software disabled. Hardware component that is available | |
394 | * can be software disabled. | |
395 | * - Bit value of 1 means the hardware is unavailable or software | |
396 | * disabled.Hardware component that is unavailable cannot be software | |
397 | * enabled. | |
398 | * - Use ixFeatureCtrlHwCapabilityRead() to read the hardware component's | |
399 | * availability. | |
400 | * - Use ixFeatureCtrlRead() to get the current IXP425/IXP46X feature control | |
401 | * register value. | |
402 | * | |
403 | * Bit Field Description (Hardware Component Availability) | |
404 | * --- --------------------------------------------------- | |
405 | * 0 RComp Circuitry | |
406 | * 1 USB Controller | |
407 | * 2 Hashing Coprocessor | |
408 | * 3 AES Coprocessor | |
409 | * 4 DES Coprocessor | |
410 | * 5 HDLC Coprocessor | |
411 | * 6 AAL Coprocessor - Always available in IXP46X | |
412 | * 7 HSS Coprocesspr | |
413 | * 8 Utopia Coprocessor | |
414 | * 9 Ethernet 0 Coprocessor | |
415 | * 10 Ethernet 1 Coprocessor | |
416 | * 11 NPE A | |
417 | * 12 NPE B | |
418 | * 13 NPE C | |
419 | * 14 PCI Controller | |
420 | * 15 ECC/TimeSync Coprocessor - Only applicable to IXP46X | |
421 | * 16-17 Utopia PHY Limit Status : 0x0 - 32 PHY | |
422 | * 0x1 - 16 PHY | |
423 | * 0x2 - 8 PHY | |
424 | * 0x3 - 4 PHY | |
425 | * | |
426 | * Portions below are only applicable to IXP46X | |
427 | * 18 USB Host Coprocessor | |
428 | * 19 NPE A Ethernet - 0 for Enable if Utopia = 1 | |
429 | * 20 NPE B Ethernet coprocessor 1-3. | |
430 | * 21 RSA Crypto Block coprocessor. | |
431 | * 22-23 Processor frequency : 0x0 - 533 MHz | |
432 | * 0x1 - 667 MHz | |
433 | * 0x2 - 400 MHz | |
434 | * 0x3 - 266 MHz | |
435 | * 24-31 Reserved | |
436 | * | |
437 | ************************************************************************/ | |
438 | /*Section generic to both IXP42X and IXP46X*/ | |
439 | ||
440 | /** | |
441 | * @ingroup IxFeatureCtrlAPI | |
442 | * | |
443 | * @enum IxFeatureCtrlComponentType | |
444 | * | |
445 | * @brief Enumeration for components availavble | |
446 | * | |
447 | */ | |
448 | typedef enum | |
449 | { | |
450 | IX_FEATURECTRL_RCOMP = 0, /**<bit location for RComp Circuitry*/ | |
451 | IX_FEATURECTRL_USB, /**<bit location for USB Controller*/ | |
452 | IX_FEATURECTRL_HASH, /**<bit location for Hashing Coprocessor*/ | |
453 | IX_FEATURECTRL_AES, /**<bit location for AES Coprocessor*/ | |
454 | IX_FEATURECTRL_DES, /**<bit location for DES Coprocessor*/ | |
455 | IX_FEATURECTRL_HDLC, /**<bit location for HDLC Coprocessor*/ | |
456 | IX_FEATURECTRL_AAL, /**<bit location for AAL Coprocessor*/ | |
457 | IX_FEATURECTRL_HSS, /**<bit location for HSS Coprocessor*/ | |
458 | IX_FEATURECTRL_UTOPIA, /**<bit location for UTOPIA Coprocessor*/ | |
459 | IX_FEATURECTRL_ETH0, /**<bit location for Ethernet 0 Coprocessor*/ | |
460 | IX_FEATURECTRL_ETH1, /**<bit location for Ethernet 1 Coprocessor*/ | |
461 | IX_FEATURECTRL_NPEA, /**<bit location for NPE A*/ | |
462 | IX_FEATURECTRL_NPEB, /**<bit location for NPE B*/ | |
463 | IX_FEATURECTRL_NPEC, /**<bit location for NPE C*/ | |
464 | IX_FEATURECTRL_PCI, /**<bit location for PCI Controller*/ | |
465 | IX_FEATURECTRL_ECC_TIMESYNC, /**<bit location for TimeSync Coprocessor*/ | |
466 | IX_FEATURECTRL_UTOPIA_PHY_LIMIT, /**<bit location for Utopia PHY Limit Status*/ | |
467 | IX_FEATURECTRL_UTOPIA_PHY_LIMIT_BIT2, /**<2nd bit of PHY limit status*/ | |
468 | IX_FEATURECTRL_USB_HOST_CONTROLLER, /**<bit location for USB host controller*/ | |
469 | IX_FEATURECTRL_NPEA_ETH, /**<bit location for NPE-A Ethernet Disable*/ | |
470 | IX_FEATURECTRL_NPEB_ETH, /**<bit location for NPE-B Ethernet 1-3 Coprocessors Disable*/ | |
471 | IX_FEATURECTRL_RSA, /**<bit location for RSA Crypto block Coprocessors Disable*/ | |
472 | IX_FEATURECTRL_XSCALE_MAX_FREQ, /**<bit location for XScale max frequency*/ | |
473 | IX_FEATURECTRL_XSCALE_MAX_FREQ_BIT2, /**<2nd xscale max freq bit NOT TO BE USED */ | |
474 | IX_FEATURECTRL_MAX_COMPONENTS | |
475 | } IxFeatureCtrlComponentType; | |
476 | ||
477 | /** | |
478 | * @ingroup IxFeatureCtrlDeviceId | |
479 | * | |
480 | * @enum IxFeatureCtrlDeviceId | |
481 | * | |
482 | * @brief Enumeration for device type. | |
483 | * | |
484 | * @warning This enum is closely related to the npe image. Its format should comply | |
485 | * with formats used in the npe image ImageID. This is indicated by the | |
486 | * first nibble of the image ID. This should also be in sync with the | |
487 | * with what is defined in CP15. Current available formats are | |
488 | * - IXP42X - 0000 | |
489 | * - IXP46X - 0001 | |
490 | * | |
491 | */ | |
492 | typedef enum | |
493 | { | |
494 | IX_FEATURE_CTRL_DEVICE_TYPE_IXP42X = 0, /**<Device type is IXP42X */ | |
495 | IX_FEATURE_CTRL_DEVICE_TYPE_IXP46X, /**<Device type is IXP46X */ | |
496 | IX_FEATURE_CTRL_DEVICE_TYPE_MAX /**<Max devices */ | |
497 | } IxFeatureCtrlDeviceId; | |
498 | ||
499 | ||
500 | /** | |
501 | * @} addtogroup IxFeatureCtrlSwConfig | |
502 | */ | |
503 | ||
504 | /* | |
505 | * Typedefs | |
506 | */ | |
507 | ||
508 | /** | |
509 | * @ingroup IxFeatureCtrlAPI | |
510 | * | |
511 | * @typedef IxFeatureCtrlReg | |
512 | * | |
513 | * @brief Feature Control Register that contains hardware components' | |
514 | * availability information. | |
515 | */ | |
516 | typedef UINT32 IxFeatureCtrlReg; | |
517 | ||
518 | /** | |
519 | * @ingroup IxFeatureCtrlAPI | |
520 | * | |
521 | * @typedef IxFeatureCtrlProductId | |
522 | * | |
523 | * @brief Product ID of Silicon that contains Silicon Stepping and | |
524 | * Maximum XScale Core Frequency information. | |
525 | */ | |
526 | typedef UINT32 IxFeatureCtrlProductId; | |
527 | ||
528 | /* | |
529 | * Prototypes for interface functions | |
530 | */ | |
531 | ||
532 | /** | |
533 | * @ingroup IxFeatureCtrlAPI | |
534 | * | |
535 | * @fn IxFeatureCtrlReg ixFeatureCtrlRead (void) | |
536 | * | |
537 | * @brief This function reads out the CURRENT value of Feature Control Register. | |
538 | * The current value may not be the same as that of the hardware component | |
539 | * availability. | |
540 | * | |
541 | * The bit location of each hardware component is defined above. | |
542 | * A value of '1' in bit means the hardware component is not available. A value of '0' | |
543 | * means the hardware component is available. | |
544 | * | |
545 | * @return | |
546 | * - IxFeatureCtrlReg - the current value of IXP400 Feature Control Register | |
547 | */ | |
548 | PUBLIC IxFeatureCtrlReg | |
549 | ixFeatureCtrlRead (void); | |
550 | ||
551 | /** | |
552 | * @ingroup IxFeatureCtrlAPI | |
553 | * | |
554 | * @fn IxFeatureDeviceId ixFeatureCtrlDeviceRead (void) | |
555 | * | |
556 | * @brief This function gets the type of device that the software is currently running | |
557 | * on | |
558 | * | |
559 | * This function reads the feature Ctrl register specifically to obtain the device id. | |
560 | * The definitions of the avilable IDs are as above. | |
561 | * | |
562 | * @return | |
563 | * - IxFeatureCtrlDeviceId - the type of device currently running | |
564 | */ | |
565 | IxFeatureCtrlDeviceId | |
566 | ixFeatureCtrlDeviceRead (void); | |
567 | ||
568 | /** | |
569 | * @ingroup IxFeatureCtrlAPI | |
570 | * | |
571 | * @fn IxFeatureCtrlBuildDevice ixFeatureCtrlSoftwareBuildGet (void) | |
572 | * | |
573 | * @brief This function refers to the value set by the compiler flag to determine | |
574 | * the type of device the software is built for. | |
575 | * | |
576 | * The function reads the compiler flag to determine the device the software is | |
577 | * built for. When the user executes build in the command line, | |
578 | * a compile time flag (__ixp42X/__ixp46X is set. This API reads this | |
579 | * flag and returns the software build type to the calling client. | |
580 | * | |
581 | * @return | |
582 | * - IxFeatureCtrlBuildDevice - the type of device software is built for. | |
583 | */ | |
584 | IxFeatureCtrlBuildDevice | |
585 | ixFeatureCtrlSoftwareBuildGet (void); | |
586 | ||
587 | /** | |
588 | * @ingroup IxFeatureCtrlAPI | |
589 | * | |
590 | * @fn IxFeatureCtrlReg ixFeatureCtrlHwCapabilityRead (void) | |
591 | * | |
592 | * @brief This function reads out the hardware capability of a silicon type as defined in | |
593 | * feature control register.This value is different from that returned by | |
594 | * ixFeatureCtrlRead() because this function returns the actual hardware component | |
595 | * availability. | |
596 | * | |
597 | * The bit location of each hardware component is defined above. | |
598 | * A value of '1' in bit means the hardware component is not available. A value of '0' | |
599 | * means the hardware component is available. | |
600 | * | |
601 | * @return | |
602 | * - IxFeatureCtrlReg - the hardware capability of IXP400. | |
603 | * | |
604 | * @warning | |
605 | * - This function must not be called when IXP400 is running as the result | |
606 | * is undefined. | |
607 | */ | |
608 | PUBLIC IxFeatureCtrlReg | |
609 | ixFeatureCtrlHwCapabilityRead (void); | |
610 | ||
611 | /** | |
612 | * @ingroup IxFeatureCtrlAPI | |
613 | * | |
614 | * @fn void ixFeatureCtrlWrite (IxFeatureCtrlReg expUnitReg) | |
615 | * | |
616 | * @brief This function write the value stored in IxFeatureCtrlReg expUnitReg | |
617 | * to the Feature Control Register. | |
618 | * | |
619 | * The bit location of each hardware component is defined above. | |
620 | * The write is only effective on available hardware components. Writing '1' in a | |
621 | * bit will software disable the respective hardware component. A '0' will mean that | |
622 | * the hardware component will remain to be operable. | |
623 | * | |
624 | * @param expUnitReg @ref IxFeatureCtrlReg [in] - The value to be written to feature control | |
625 | * register. | |
626 | * | |
627 | * @return none | |
628 | * | |
629 | */ | |
630 | PUBLIC void | |
631 | ixFeatureCtrlWrite (IxFeatureCtrlReg expUnitReg); | |
632 | ||
633 | /** | |
634 | * @ingroup IxFeatureCtrlAPI | |
635 | * | |
636 | * @fn IX_STATUS ixFeatureCtrlComponentCheck (IxFeatureCtrlComponentType componentType) | |
637 | * | |
638 | * @brief This function will check the availability of hardware component specified | |
639 | * as componentType value. | |
640 | * | |
641 | * Usage Example:<br> | |
642 | * - if(IX_FEATURE_CTRL_COMPONENT_DISABLED != | |
643 | * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_ETH0)) <br> | |
644 | * - if(IX_FEATURE_CTRL_COMPONENT_ENABLED == | |
645 | * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_PCI)) <br> | |
646 | * | |
647 | * This function is typically called during component initialization time. | |
648 | * | |
649 | * @param componentType @ref IxFeatureCtrlComponentType [in] - the type of a component as | |
650 | * defined above as IX_FEATURECTRL_XXX (Exp: IX_FEATURECTRL_PCI, IX_FEATURECTRL_ETH0) | |
651 | ||
652 | * | |
653 | * @return | |
654 | * - IX_FEATURE_CTRL_COMPONENT_ENABLED if component is available | |
655 | * - IX_FEATURE_CTRL_COMPONENT_DISABLED if component is unavailable | |
656 | */ | |
657 | PUBLIC IX_STATUS | |
658 | ixFeatureCtrlComponentCheck (IxFeatureCtrlComponentType componentType); | |
659 | ||
660 | /** | |
661 | * @ingroup IxFeatureCtrlAPI | |
662 | * | |
663 | * @fn IxFeatureCtrlProductId ixFeatureCtrlProductIdRead (void) | |
664 | * | |
665 | * @brief This function will return IXP400 product ID i.e. CP15, | |
666 | * Register 0. | |
667 | * | |
668 | * @return | |
669 | * - IxFeatureCtrlProductId - the value of product ID. | |
670 | * | |
671 | */ | |
672 | PUBLIC IxFeatureCtrlProductId | |
673 | ixFeatureCtrlProductIdRead (void) ; | |
674 | ||
675 | /** | |
676 | * @ingroup IxFeatureCtrlAPI | |
677 | * | |
678 | * @fn IX_STATUS ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType) | |
679 | * | |
680 | * @brief This function checks whether the specified software configuration is | |
681 | * enabled or disabled. | |
682 | * | |
683 | * Usage Example:<br> | |
684 | * - if(IX_FEATURE_CTRL_SWCONFIG_DISABLED != | |
685 | * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING)) <br> | |
686 | * - if(IX_FEATURE_CTRL_SWCONFIG_ENABLED == | |
687 | * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING)) <br> | |
688 | * | |
689 | * This function is typically called during access component initialization time. | |
690 | * | |
691 | * @param swConfigType @ref IxFeatureCtrlSwConfig [in] - the type of a software configuration | |
692 | * defined in IxFeatureCtrlSwConfig enumeration. | |
693 | * | |
694 | * @return | |
695 | * - IX_FEATURE_CTRL_SWCONFIG_ENABLED if software configuration is enabled. | |
696 | * - IX_FEATURE_CTRL_SWCONFIG_DISABLED if software configuration is disabled. | |
697 | */ | |
698 | PUBLIC IX_STATUS | |
699 | ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType); | |
700 | ||
701 | /** | |
702 | * @ingroup IxFeatureCtrlAPI | |
703 | * | |
704 | * @fn void ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled) | |
705 | * | |
706 | * @brief This function enable/disable the specified software configuration. | |
707 | * | |
708 | * Usage Example:<br> | |
472d5460 | 709 | * - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, true) is used |
ba94a1bb | 710 | * to enable Ethernet Learning Feature <br> |
472d5460 | 711 | * - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, false) is used |
ba94a1bb WD |
712 | * to disable Ethernet Learning Feature <br> |
713 | * | |
714 | * @param swConfigType IxFeatureCtrlSwConfig [in] - the type of a software configuration | |
715 | * defined in IxFeatureCtrlSwConfig enumeration. | |
472d5460 | 716 | * @param enabled BOOL [in] - To enable(true) / disable (false) the specified software |
ba94a1bb WD |
717 | * configuration. |
718 | * | |
719 | * @return none | |
720 | * | |
721 | */ | |
722 | PUBLIC void | |
723 | ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled); | |
724 | ||
725 | /** | |
726 | * @ingroup IxFeatureCtrlAPI | |
727 | * | |
728 | * @fn void ixFeatureCtrlIxp400SwVersionShow (void) | |
729 | * | |
730 | * @brief This function shows the current software release information for IXP400 | |
731 | * | |
732 | * @return none | |
733 | * | |
734 | */ | |
735 | PUBLIC void | |
736 | ixFeatureCtrlIxp400SwVersionShow (void); | |
737 | ||
738 | #endif /* IXFEATURECTRL_H */ | |
739 | ||
740 | /** | |
741 | * @} defgroup IxFeatureCtrlAPI | |
742 | */ |