IxFeatureCtrl.h 21 KB

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