/** * @file IxFeatureCtrl.h * * @date 30-Jan-2003 * @brief This file contains the public API of the IXP400 Feature Control * component. * * * @par * IXP400 SW Release version 2.0 * * -- Copyright Notice -- * * @par * Copyright 2001-2005, Intel Corporation. * All rights reserved. * * @par * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Intel Corporation nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * @par * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @par * -- End of Copyright Notice -- */ /* ------------------------------------------------------ Doxygen group definitions ------------------------------------------------------ */ /** * @defgroup IxFeatureCtrlAPI IXP400 Feature Control (IxFeatureCtrl) API * * @brief The Public API for the IXP400 Feature Control. * * @{ */ #ifndef IXFEATURECTRL_H #define IXFEATURECTRL_H /* * User defined include files */ #include "IxOsal.h" /* * #defines and macros */ /************************************************************* * The following are IxFeatureCtrlComponentCheck return values. ************************************************************/ /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_COMPONENT_DISABLED * * @brief Hardware Component is disabled/unavailable. * Return status by ixFeatureCtrlComponentCheck() */ #define IX_FEATURE_CTRL_COMPONENT_DISABLED 0 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_COMPONENT_ENABLED * * @brief Hardware Component is available. * Return status by ixFeatureCtrlComponentCheck() */ #define IX_FEATURE_CTRL_COMPONENT_ENABLED 1 /*********************************************************************************** * Product ID in XScale CP15 - Register 0 * - It contains information on the maximum XScale Core Frequency and * Silicon Stepping. * - XScale Core Frequency Id indicates only the maximum XScale frequency * achievable and not the running XScale frequency (maybe stepped down). * - The register is read by using ixFeatureCtrlProductIdRead. * - Usage example: * productId = ixFeatureCtrlProductIdRead(); * if( (productId & IX_FEATURE_CTRL_SILICON_STEPPING_MASK) == * IX_FEATURE_CTRL_SILICON_TYPE_A0 ) * if( (productId & IX_FEATURE_CTRL_XSCALE_FREQ_MASK) == * IX_FEATURE_CTRL_XSCALE_FREQ_533 ) * * 31 28 27 24 23 20 19 16 15 12 11 9 8 4 3 0 * -------------------------------------------------------------------------------- * | 0x6 | 0x9 | 0x0 | 0x5 | 0x4 | Device ID | XScale Core Freq Id | Si Stepping Id | * -------------------------------------------------------------------------------- * * Maximum Achievable XScale Core Frequency Id : 533MHz - 0x1C * 400MHz - 0x1D * 266MHz - 0x1F * * THE CORE FREQUENCY ID IS NOT APPLICABLE TO IXP46X <\b> * * The above is applicable to IXP42X only. CP15 in IXP46X does not contain any * Frequency ID. * * Si Stepping Id : A - 0x0 * B - 0x1 * * XScale Core freq Id - Device ID [11:9] : IXP42X - 0x0 * IXP46X - 0x1 *************************************************************************************/ /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_SILICON_TYPE_A0 * * @brief This is the value of A0 Silicon in product ID. */ #define IX_FEATURE_CTRL_SILICON_TYPE_A0 0 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_SILICON_TYPE_B0 * * @brief This is the value of B0 Silicon in product ID. */ #define IX_FEATURE_CTRL_SILICON_TYPE_B0 1 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_SILICON_STEPPING_MASK * * @brief This is the mask of silicon stepping in product ID. */ #define IX_FEATURE_CTRL_SILICON_STEPPING_MASK 0xF /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_DEVICE_TYPE_MASK * * @brief This is the mask of silicon stepping in product ID. */ #define IX_FEATURE_CTRL_DEVICE_TYPE_MASK (0x7) /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET * * @brief This is the mask of silicon stepping in product ID. */ #define IX_FEATURE_CTRL_DEVICE_TYPE_OFFSET 9 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_XSCALE_FREQ_533 * * @brief This is the value of 533MHz XScale Core in product ID. */ #define IX_FEATURE_CTRL_XSCALE_FREQ_533 ((0x1C)<<4) /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_XSCALE_FREQ_400 * * @brief This is the value of 400MHz XScale Core in product ID. */ #define IX_FEATURE_CTRL_XSCALE_FREQ_400 ((0x1D)<<4) /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_XSCALE_FREQ_266 * * @brief This is the value of 266MHz XScale Core in product ID. */ #define IX_FEATURE_CTRL_XSCALE_FREQ_266 ((0x1F)<<4) /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURE_CTRL_XSCALE_FREQ_MASK * * @brief This is the mask of XScale Core in product ID. */ #define IX_FEATURE_CTRL_XSCALE_FREQ_MASK ((0xFF)<<4) /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_UTOPIA_32PHY * * @brief Maximum UTOPIA PHY available is 32. * */ #define IX_FEATURECTRL_REG_UTOPIA_32PHY 0x0 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_UTOPIA_16PHY * * @brief Maximum UTOPIA PHY available is 16. * */ #define IX_FEATURECTRL_REG_UTOPIA_16PHY 0x1 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_UTOPIA_8PHY * * @brief Maximum UTOPIA PHY available to is 8. * */ #define IX_FEATURECTRL_REG_UTOPIA_8PHY 0x2 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_UTOPIA_4PHY * * @brief Maximum UTOPIA PHY available to is 4. * */ #define IX_FEATURECTRL_REG_UTOPIA_4PHY 0x3 #ifdef __ixp46X /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_XSCALE_533FREQ * * @brief Maximum frequency available to IXP46x is 533 MHz. * */ #define IX_FEATURECTRL_REG_XSCALE_533FREQ 0x0 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_XSCALE_667FREQ * * @brief Maximum frequency available to IXP46x is 667 MHz. * */ #define IX_FEATURECTRL_REG_XSCALE_667FREQ 0x1 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_XSCALE_400FREQ * * @brief Maximum frequency available to IXP46x is 400 MHz. * */ #define IX_FEATURECTRL_REG_XSCALE_400FREQ 0x2 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_REG_XSCALE_266FREQ * * @brief Maximum frequency available to IXP46x is 266 MHz. * */ #define IX_FEATURECTRL_REG_XSCALE_266FREQ 0x3 #endif /* __ixp46X */ /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE * * @brief Component selected is not available for device * */ #define IX_FEATURECTRL_COMPONENT_NOT_AVAILABLE 0x0000 /** * @ingroup IxFeatureCtrlAPI * * @def IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE * * @brief Component selected is not available for device * */ #define IX_FEATURECTRL_COMPONENT_ALWAYS_AVAILABLE 0xffff /** * @defgroup IxFeatureCtrlSwConfig Software Configuration for Access Component * * @ingroup IxFeatureCtrlAPI * * @brief This section describes software configuration in access component. The * configuration can be changed at run-time. ixFeatureCtrlSwConfigurationCheck( ) * will be used across applicable access component to check the configuration. * ixFeatureCtrlSwConfigurationWrite( ) is used to write the software configuration. * * @note All software configurations are default to be enabled. * * @{ */ /** * @ingroup IxFeatureCtrlSwConfig * * @def IX_FEATURE_CTRL_SWCONFIG_DISABLED * * @brief Software configuration is disabled. * */ #define IX_FEATURE_CTRL_SWCONFIG_DISABLED 0 /** * @ingroup IxFeatureCtrlSwConfig * * @def IX_FEATURE_CTRL_SWCONFIG_ENABLED * * @brief Software configuration is enabled. * */ #define IX_FEATURE_CTRL_SWCONFIG_ENABLED 1 /** * Section for enums **/ /** * @ingroup IxFeatureCtrlBuildDevice * * @enum IxFeatureCtrlBuildDevice * * @brief Indicates software build type. * * Default build type is IXP42X * */ typedef enum { IX_FEATURE_CTRL_SW_BUILD_IXP42X = 0, /** * - if(IX_FEATURE_CTRL_COMPONENT_DISABLED != * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_ETH0))
* - if(IX_FEATURE_CTRL_COMPONENT_ENABLED == * ixFeatureCtrlComponentCheck(IX_FEATURECTRL_PCI))
* * This function is typically called during component initialization time. * * @param componentType @ref IxFeatureCtrlComponentType [in] - the type of a component as * defined above as IX_FEATURECTRL_XXX (Exp: IX_FEATURECTRL_PCI, IX_FEATURECTRL_ETH0) * * @return * - IX_FEATURE_CTRL_COMPONENT_ENABLED if component is available * - IX_FEATURE_CTRL_COMPONENT_DISABLED if component is unavailable */ PUBLIC IX_STATUS ixFeatureCtrlComponentCheck (IxFeatureCtrlComponentType componentType); /** * @ingroup IxFeatureCtrlAPI * * @fn IxFeatureCtrlProductId ixFeatureCtrlProductIdRead (void) * * @brief This function will return IXP400 product ID i.e. CP15, * Register 0. * * @return * - IxFeatureCtrlProductId - the value of product ID. * */ PUBLIC IxFeatureCtrlProductId ixFeatureCtrlProductIdRead (void) ; /** * @ingroup IxFeatureCtrlAPI * * @fn IX_STATUS ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType) * * @brief This function checks whether the specified software configuration is * enabled or disabled. * * Usage Example:
* - if(IX_FEATURE_CTRL_SWCONFIG_DISABLED != * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING))
* - if(IX_FEATURE_CTRL_SWCONFIG_ENABLED == * ixFeatureCtrlSwConfigurationCheck(IX_FEATURECTRL_ETH_LEARNING))
* * This function is typically called during access component initialization time. * * @param swConfigType @ref IxFeatureCtrlSwConfig [in] - the type of a software configuration * defined in IxFeatureCtrlSwConfig enumeration. * * @return * - IX_FEATURE_CTRL_SWCONFIG_ENABLED if software configuration is enabled. * - IX_FEATURE_CTRL_SWCONFIG_DISABLED if software configuration is disabled. */ PUBLIC IX_STATUS ixFeatureCtrlSwConfigurationCheck (IxFeatureCtrlSwConfig swConfigType); /** * @ingroup IxFeatureCtrlAPI * * @fn void ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled) * * @brief This function enable/disable the specified software configuration. * * Usage Example:
* - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, TRUE) is used * to enable Ethernet Learning Feature
* - ixFeatureCtrlSwConfigurationWrite(IX_FEATURECTRL_ETH_LEARNING, FALSE) is used * to disable Ethernet Learning Feature
* * @param swConfigType IxFeatureCtrlSwConfig [in] - the type of a software configuration * defined in IxFeatureCtrlSwConfig enumeration. * @param enabled BOOL [in] - To enable(TRUE) / disable (FALSE) the specified software * configuration. * * @return none * */ PUBLIC void ixFeatureCtrlSwConfigurationWrite (IxFeatureCtrlSwConfig swConfigType, BOOL enabled); /** * @ingroup IxFeatureCtrlAPI * * @fn void ixFeatureCtrlIxp400SwVersionShow (void) * * @brief This function shows the current software release information for IXP400 * * @return none * */ PUBLIC void ixFeatureCtrlIxp400SwVersionShow (void); #endif /* IXFEATURECTRL_H */ /** * @} defgroup IxFeatureCtrlAPI */