2 * @file IxFeatureCtrl.h
6 * @brief This file contains the public API of the IXP400 Feature Control
11 * IXP400 SW Release version 2.0
13 * -- Copyright Notice --
16 * Copyright 2001-2005, Intel Corporation.
17 * All rights reserved.
20 * SPDX-License-Identifier: BSD-3-Clause
22 * -- End of Copyright Notice --
24 /* ------------------------------------------------------
25 Doxygen group definitions
26 ------------------------------------------------------ */
28 * @defgroup IxFeatureCtrlAPI IXP400 Feature Control (IxFeatureCtrl) API
30 * @brief The Public API for the IXP400 Feature Control.
35 #ifndef IXFEATURECTRL_H
36 #define IXFEATURECTRL_H
39 * User defined include files
47 /*************************************************************
48 * The following are IxFeatureCtrlComponentCheck return values.
49 ************************************************************/
52 * @ingroup IxFeatureCtrlAPI
54 * @def IX_FEATURE_CTRL_COMPONENT_DISABLED
56 * @brief Hardware Component is disabled/unavailable.
57 * Return status by ixFeatureCtrlComponentCheck()
59 #define IX_FEATURE_CTRL_COMPONENT_DISABLED 0
62 * @ingroup IxFeatureCtrlAPI
64 * @def IX_FEATURE_CTRL_COMPONENT_ENABLED
66 * @brief Hardware Component is available.
67 * Return status by ixFeatureCtrlComponentCheck()
69 #define IX_FEATURE_CTRL_COMPONENT_ENABLED 1
71 /***********************************************************************************
72 * Product ID in XScale CP15 - Register 0
73 * - It contains information on the maximum XScale Core Frequency and
75 * - XScale Core Frequency Id indicates only the maximum XScale frequency
76 * achievable and not the running XScale frequency (maybe stepped down).
77 * - The register is read by using ixFeatureCtrlProductIdRead.
79 * productId = ixFeatureCtrlProductIdRead();
80 * if( (productId & IX_FEATURE_CTRL_SILICON_STEPPING_MASK) ==
81 * IX_FEATURE_CTRL_SILICON_TYPE_A0 )
82 * if( (productId & IX_FEATURE_CTRL_XSCALE_FREQ_MASK) ==
83 * IX_FEATURE_CTRL_XSCALE_FREQ_533 )
85 * 31 28 27 24 23 20 19 16 15 12 11 9 8 4 3 0
86 * --------------------------------------------------------------------------------
87 * | 0x6 | 0x9 | 0x0 | 0x5 | 0x4 | Device ID | XScale Core Freq Id | Si Stepping Id |
88 * --------------------------------------------------------------------------------
90 * Maximum Achievable XScale Core Frequency Id : 533MHz - 0x1C
94 * <b>THE CORE FREQUENCY ID IS NOT APPLICABLE TO IXP46X <\b>
96 * The above is applicable to IXP42X only. CP15 in IXP46X does not contain any
99 * Si Stepping Id : A - 0x0
102 * XScale Core freq Id - Device ID [11:9] : IXP42X - 0x0
104 *************************************************************************************/
107 * @ingroup IxFeatureCtrlAPI
109 * @def IX_FEATURE_CTRL_SILICON_TYPE_A0
111 * @brief This is the value of A0 Silicon in product ID.
113 #define IX_FEATURE_CTRL_SILICON_TYPE_A0 0
116 * @ingroup IxFeatureCtrlAPI
118 * @def IX_FEATURE_CTRL_SILICON_TYPE_B0
120 * @brief This is the value of B0 Silicon in product ID.
122 #define IX_FEATURE_CTRL_SILICON_TYPE_B0 1
125 * @ingroup IxFeatureCtrlAPI
127 * @def IX_FEATURE_CTRL_SILICON_STEPPING_MASK
129 * @brief This is the mask of silicon stepping in product ID.
131 #define IX_FEATURE_CTRL_SILICON_STEPPING_MASK 0xF
134 * @ingroup IxFeatureCtrlAPI
136 * @def IX_FEATURE_CTRL_DEVICE_TYPE_MASK
138 * @brief This is the mask of silicon stepping in product ID.
140 #define IX_FEATURE_CTRL_DEVICE_TYPE_MASK (0x7)
143 * @ingroup IxFeatureCtrlAPI
145 * @def IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET
147 * @brief This is the mask of silicon stepping in product ID.
149 #define IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET 9
153 * @ingroup IxFeatureCtrlAPI
155 * @def IX_FEATURE_CTRL_XSCALE_FREQ_533
157 * @brief This is the value of 533MHz XScale Core in product ID.
159 #define IX_FEATURE_CTRL_XSCALE_FREQ_533 ((0x1C)<<4)
162 * @ingroup IxFeatureCtrlAPI
164 * @def IX_FEATURE_CTRL_XSCALE_FREQ_400
166 * @brief This is the value of 400MHz XScale Core in product ID.
168 #define IX_FEATURE_CTRL_XSCALE_FREQ_400 ((0x1D)<<4)
171 * @ingroup IxFeatureCtrlAPI
173 * @def IX_FEATURE_CTRL_XSCALE_FREQ_266
175 * @brief This is the value of 266MHz XScale Core in product ID.
177 #define IX_FEATURE_CTRL_XSCALE_FREQ_266 ((0x1F)<<4)
180 * @ingroup IxFeatureCtrlAPI
182 * @def IX_FEATURE_CTRL_XSCALE_FREQ_MASK
184 * @brief This is the mask of XScale Core in product ID.
186 #define IX_FEATURE_CTRL_XSCALE_FREQ_MASK ((0xFF)<<4)
189 * @ingroup IxFeatureCtrlAPI
191 * @def IX_FEATURECTRL_REG_UTOPIA_32PHY
193 * @brief Maximum UTOPIA PHY available is 32.
196 #define IX_FEATURECTRL_REG_UTOPIA_32PHY 0x0
199 * @ingroup IxFeatureCtrlAPI
201 * @def IX_FEATURECTRL_REG_UTOPIA_16PHY
203 * @brief Maximum UTOPIA PHY available is 16.
206 #define IX_FEATURECTRL_REG_UTOPIA_16PHY 0x1
209 * @ingroup IxFeatureCtrlAPI
211 * @def IX_FEATURECTRL_REG_UTOPIA_8PHY
213 * @brief Maximum UTOPIA PHY available to is 8.
216 #define IX_FEATURECTRL_REG_UTOPIA_8PHY 0x2
219 * @ingroup IxFeatureCtrlAPI
221 * @def IX_FEATURECTRL_REG_UTOPIA_4PHY
223 * @brief Maximum UTOPIA PHY available to is 4.
226 #define IX_FEATURECTRL_REG_UTOPIA_4PHY 0x3
231 * @ingroup IxFeatureCtrlAPI
233 * @def IX_FEATURECTRL_REG_XSCALE_533FREQ
235 * @brief Maximum frequency available to IXP46x is 533 MHz.
238 #define IX_FEATURECTRL_REG_XSCALE_533FREQ 0x0
241 * @ingroup IxFeatureCtrlAPI
243 * @def IX_FEATURECTRL_REG_XSCALE_667FREQ
245 * @brief Maximum frequency available to IXP46x is 667 MHz.
248 #define IX_FEATURECTRL_REG_XSCALE_667FREQ 0x1
251 * @ingroup IxFeatureCtrlAPI
253 * @def IX_FEATURECTRL_REG_XSCALE_400FREQ
255 * @brief Maximum frequency available to IXP46x is 400 MHz.
258 #define IX_FEATURECTRL_REG_XSCALE_400FREQ 0x2
261 * @ingroup IxFeatureCtrlAPI
263 * @def IX_FEATURECTRL_REG_XSCALE_266FREQ
265 * @brief Maximum frequency available to IXP46x is 266 MHz.
268 #define IX_FEATURECTRL_REG_XSCALE_266FREQ 0x3
270 #endif /* __ixp46X */
273 * @ingroup IxFeatureCtrlAPI
275 * @def IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE
277 * @brief Component selected is not available for device
280 #define IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE 0x0000
283 * @ingroup IxFeatureCtrlAPI
285 * @def IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE
287 * @brief Component selected is not available for device
290 #define IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE 0xffff
293 * @defgroup IxFeatureCtrlSwConfig Software Configuration for Access Component
295 * @ingroup IxFeatureCtrlAPI
297 * @brief This section describes software configuration in access component. The
298 * configuration can be changed at run-time. ixFeatureCtrlSwConfigurationCheck( )
299 * will be used across applicable access component to check the configuration.
300 * ixFeatureCtrlSwConfigurationWrite( ) is used to write the software configuration.
302 * @note <b>All software configurations are default to be enabled.</b>
307 * @ingroup IxFeatureCtrlSwConfig
309 * @def IX_FEATURE_CTRL_SWCONFIG_DISABLED
311 * @brief Software configuration is disabled.
314 #define IX_FEATURE_CTRL_SWCONFIG_DISABLED 0
317 * @ingroup IxFeatureCtrlSwConfig
319 * @def IX_FEATURE_CTRL_SWCONFIG_ENABLED
321 * @brief Software configuration is enabled.
324 #define IX_FEATURE_CTRL_SWCONFIG_ENABLED 1
331 * @ingroup IxFeatureCtrlBuildDevice
333 * @enum IxFeatureCtrlBuildDevice
335 * @brief Indicates software build type.
337 * Default build type is IXP42X
342 IX_FEATURE_CTRL_SW_BUILD_IXP42X = 0, /**<Build type is IXP42X */
343 IX_FEATURE_CTRL_SW_BUILD_IXP46X /**<Build type is IXP46X */
344 } IxFeatureCtrlBuildDevice;
347 * @ingroup IxFeatureCtrlSwConfig
349 * @enum IxFeatureCtrlSwConfig
351 * @brief Enumeration for software configuration in access components.
353 * Entry for new run-time software configuration should be added here.
357 IX_FEATURECTRL_ETH_LEARNING = 0, /**< EthDB Learning Feature */
358 IX_FEATURECTRL_ORIGB0_DISPATCHER, /**< IXP42X B0 and IXP46X dispatcher without
359 livelock prevention functionality Feature */
360 IX_FEATURECTRL_SWCONFIG_MAX /**< Maximum boudary for IxFeatureCtrlSwConfig */
361 } IxFeatureCtrlSwConfig;
364 /************************************************************************
365 * IXP400 Feature Control Register
366 * - It contains the information (available/unavailable) of IXP425&IXP46X
367 * hardware components in their corresponding bit location.
368 * - Bit value of 0 means the hardware component is available
369 * or not software disabled. Hardware component that is available
370 * can be software disabled.
371 * - Bit value of 1 means the hardware is unavailable or software
372 * disabled.Hardware component that is unavailable cannot be software
374 * - Use ixFeatureCtrlHwCapabilityRead() to read the hardware component's
376 * - Use ixFeatureCtrlRead() to get the current IXP425/IXP46X feature control
379 * Bit Field Description (Hardware Component Availability)
380 * --- ---------------------------------------------------
383 * 2 Hashing Coprocessor
387 * 6 AAL Coprocessor - Always available in IXP46X
389 * 8 Utopia Coprocessor
390 * 9 Ethernet 0 Coprocessor
391 * 10 Ethernet 1 Coprocessor
396 * 15 ECC/TimeSync Coprocessor - Only applicable to IXP46X
397 * 16-17 Utopia PHY Limit Status : 0x0 - 32 PHY
402 * Portions below are only applicable to IXP46X
403 * 18 USB Host Coprocessor
404 * 19 NPE A Ethernet - 0 for Enable if Utopia = 1
405 * 20 NPE B Ethernet coprocessor 1-3.
406 * 21 RSA Crypto Block coprocessor.
407 * 22-23 Processor frequency : 0x0 - 533 MHz
413 ************************************************************************/
414 /*Section generic to both IXP42X and IXP46X*/
417 * @ingroup IxFeatureCtrlAPI
419 * @enum IxFeatureCtrlComponentType
421 * @brief Enumeration for components availavble
426 IX_FEATURECTRL_RCOMP = 0, /**<bit location for RComp Circuitry*/
427 IX_FEATURECTRL_USB, /**<bit location for USB Controller*/
428 IX_FEATURECTRL_HASH, /**<bit location for Hashing Coprocessor*/
429 IX_FEATURECTRL_AES, /**<bit location for AES Coprocessor*/
430 IX_FEATURECTRL_DES, /**<bit location for DES Coprocessor*/
431 IX_FEATURECTRL_HDLC, /**<bit location for HDLC Coprocessor*/
432 IX_FEATURECTRL_AAL, /**<bit location for AAL Coprocessor*/
433 IX_FEATURECTRL_HSS, /**<bit location for HSS Coprocessor*/
434 IX_FEATURECTRL_UTOPIA, /**<bit location for UTOPIA Coprocessor*/
435 IX_FEATURECTRL_ETH0, /**<bit location for Ethernet 0 Coprocessor*/
436 IX_FEATURECTRL_ETH1, /**<bit location for Ethernet 1 Coprocessor*/
437 IX_FEATURECTRL_NPEA, /**<bit location for NPE A*/
438 IX_FEATURECTRL_NPEB, /**<bit location for NPE B*/
439 IX_FEATURECTRL_NPEC, /**<bit location for NPE C*/
440 IX_FEATURECTRL_PCI, /**<bit location for PCI Controller*/
441 IX_FEATURECTRL_ECC_TIMESYNC, /**<bit location for TimeSync Coprocessor*/
442 IX_FEATURECTRL_UTOPIA_PHY_LIMIT, /**<bit location for Utopia PHY Limit Status*/
443 IX_FEATURECTRL_UTOPIA_PHY_LIMIT_BIT2, /**<2nd bit of PHY limit status*/
444 IX_FEATURECTRL_USB_HOST_CONTROLLER, /**<bit location for USB host controller*/
445 IX_FEATURECTRL_NPEA_ETH, /**<bit location for NPE-A Ethernet Disable*/
446 IX_FEATURECTRL_NPEB_ETH, /**<bit location for NPE-B Ethernet 1-3 Coprocessors Disable*/
447 IX_FEATURECTRL_RSA, /**<bit location for RSA Crypto block Coprocessors Disable*/
448 IX_FEATURECTRL_XSCALE_MAX_FREQ, /**<bit location for XScale max frequency*/
449 IX_FEATURECTRL_XSCALE_MAX_FREQ_BIT2, /**<2nd xscale max freq bit NOT TO BE USED */
450 IX_FEATURECTRL_MAX_COMPONENTS
451 } IxFeatureCtrlComponentType;
454 * @ingroup IxFeatureCtrlDeviceId
456 * @enum IxFeatureCtrlDeviceId
458 * @brief Enumeration for device type.
460 * @warning This enum is closely related to the npe image. Its format should comply
461 * with formats used in the npe image ImageID. This is indicated by the
462 * first nibble of the image ID. This should also be in sync with the
463 * with what is defined in CP15. Current available formats are
470 IX_FEATURE_CTRL_DEVICE_TYPE_IXP42X = 0, /**<Device type is IXP42X */
471 IX_FEATURE_CTRL_DEVICE_TYPE_IXP46X, /**<Device type is IXP46X */
472 IX_FEATURE_CTRL_DEVICE_TYPE_MAX /**<Max devices */
473 } IxFeatureCtrlDeviceId;
477 * @} addtogroup IxFeatureCtrlSwConfig
485 * @ingroup IxFeatureCtrlAPI
487 * @typedef IxFeatureCtrlReg
489 * @brief Feature Control Register that contains hardware components'
490 * availability information.
492 typedef UINT32 IxFeatureCtrlReg;
495 * @ingroup IxFeatureCtrlAPI
497 * @typedef IxFeatureCtrlProductId
499 * @brief Product ID of Silicon that contains Silicon Stepping and
500 * Maximum XScale Core Frequency information.
502 typedef UINT32 IxFeatureCtrlProductId;
505 * Prototypes for interface functions
509 * @ingroup IxFeatureCtrlAPI
511 * @fn IxFeatureCtrlReg ixFeatureCtrlRead (void)
513 * @brief This function reads out the CURRENT value of Feature Control Register.
514 * The current value may not be the same as that of the hardware component
517 * The bit location of each hardware component is defined above.
518 * A value of '1' in bit means the hardware component is not available. A value of '0'
519 * means the hardware component is available.
522 * - IxFeatureCtrlReg - the current value of IXP400 Feature Control Register
524 PUBLIC IxFeatureCtrlReg
525 ixFeatureCtrlRead (void);
528 * @ingroup IxFeatureCtrlAPI
530 * @fn IxFeatureDeviceId ixFeatureCtrlDeviceRead (void)
532 * @brief This function gets the type of device that the software is currently running
535 * This function reads the feature Ctrl register specifically to obtain the device id.
536 * The definitions of the avilable IDs are as above.
539 * - IxFeatureCtrlDeviceId - the type of device currently running
541 IxFeatureCtrlDeviceId
542 ixFeatureCtrlDeviceRead (void);
545 * @ingroup IxFeatureCtrlAPI
547 * @fn IxFeatureCtrlBuildDevice ixFeatureCtrlSoftwareBuildGet (void)
549 * @brief This function refers to the value set by the compiler flag to determine
550 * the type of device the software is built for.
552 * The function reads the compiler flag to determine the device the software is
553 * built for. When the user executes build in the command line,
554 * a compile time flag (__ixp42X/__ixp46X is set. This API reads this
555 * flag and returns the software build type to the calling client.
558 * - IxFeatureCtrlBuildDevice - the type of device software is built for.
560 IxFeatureCtrlBuildDevice
561 ixFeatureCtrlSoftwareBuildGet (void);
564 * @ingroup IxFeatureCtrlAPI
566 * @fn IxFeatureCtrlReg ixFeatureCtrlHwCapabilityRead (void)
568 * @brief This function reads out the hardware capability of a silicon type as defined in
569 * feature control register.This value is different from that returned by
570 * ixFeatureCtrlRead() because this function returns the actual hardware component
573 * The bit location of each hardware component is defined above.
574 * A value of '1' in bit means the hardware component is not available. A value of '0'
575 * means the hardware component is available.
578 * - IxFeatureCtrlReg - the hardware capability of IXP400.
581 * - This function must not be called when IXP400 is running as the result
584 PUBLIC IxFeatureCtrlReg
585 ixFeatureCtrlHwCapabilityRead (void);
588 * @ingroup IxFeatureCtrlAPI
590 * @fn void ixFeatureCtrlWrite (IxFeatureCtrlReg expUnitReg)
592 * @brief This function write the value stored in IxFeatureCtrlReg expUnitReg
593 * to the Feature Control Register.
595 * The bit location of each hardware component is defined above.
596 * The write is only effective on available hardware components. Writing '1' in a
597 * bit will software disable the respective hardware component. A '0' will mean that
598 * the hardware component will remain to be operable.
600 * @param expUnitReg @ref IxFeatureCtrlReg [in] - The value to be written to feature control
607 ixFeatureCtrlWrite (IxFeatureCtrlReg expUnitReg);
610 * @ingroup IxFeatureCtrlAPI
612 * @fn IX_STATUS ixFeatureCtrlComponentCheck (IxFeatureCtrlComponentType componentType)
614 * @brief This function will check the availability of hardware component specified
615 * as componentType value.
618 * - if(IX_FEATURE_CTRL_COMPONENT_DISABLED !=
619 * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_ETH0)) <br>
620 * - if(IX_FEATURE_CTRL_COMPONENT_ENABLED ==
621 * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_PCI)) <br>
623 * This function is typically called during component initialization time.
625 * @param componentType @ref IxFeatureCtrlComponentType [in] - the type of a component as
626 * defined above as IX_FEATURECTRL_XXX (Exp: IX_FEATURECTRL_PCI, IX_FEATURECTRL_ETH0)
630 * - IX_FEATURE_CTRL_COMPONENT_ENABLED if component is available
631 * - IX_FEATURE_CTRL_COMPONENT_DISABLED if component is unavailable
634 ixFeatureCtrlComponentCheck (IxFeatureCtrlComponentType componentType);
637 * @ingroup IxFeatureCtrlAPI
639 * @fn IxFeatureCtrlProductId ixFeatureCtrlProductIdRead (void)
641 * @brief This function will return IXP400 product ID i.e. CP15,
645 * - IxFeatureCtrlProductId - the value of product ID.
648 PUBLIC IxFeatureCtrlProductId
649 ixFeatureCtrlProductIdRead (void) ;
652 * @ingroup IxFeatureCtrlAPI
654 * @fn IX_STATUS ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType)
656 * @brief This function checks whether the specified software configuration is
657 * enabled or disabled.
660 * - if(IX_FEATURE_CTRL_SWCONFIG_DISABLED !=
661 * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING)) <br>
662 * - if(IX_FEATURE_CTRL_SWCONFIG_ENABLED ==
663 * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING)) <br>
665 * This function is typically called during access component initialization time.
667 * @param swConfigType @ref IxFeatureCtrlSwConfig [in] - the type of a software configuration
668 * defined in IxFeatureCtrlSwConfig enumeration.
671 * - IX_FEATURE_CTRL_SWCONFIG_ENABLED if software configuration is enabled.
672 * - IX_FEATURE_CTRL_SWCONFIG_DISABLED if software configuration is disabled.
675 ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType);
678 * @ingroup IxFeatureCtrlAPI
680 * @fn void ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled)
682 * @brief This function enable/disable the specified software configuration.
685 * - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, true) is used
686 * to enable Ethernet Learning Feature <br>
687 * - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, false) is used
688 * to disable Ethernet Learning Feature <br>
690 * @param swConfigType IxFeatureCtrlSwConfig [in] - the type of a software configuration
691 * defined in IxFeatureCtrlSwConfig enumeration.
692 * @param enabled BOOL [in] - To enable(true) / disable (false) the specified software
699 ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled);
702 * @ingroup IxFeatureCtrlAPI
704 * @fn void ixFeatureCtrlIxp400SwVersionShow (void)
706 * @brief This function shows the current software release information for IXP400
712 ixFeatureCtrlIxp400SwVersionShow (void);
714 #endif /* IXFEATURECTRL_H */
717 * @} defgroup IxFeatureCtrlAPI