IxFeatureCtrl.h 23 KB

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