IxNpeDl.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
  1. /**
  2. * @file IxNpeDl.h
  3. *
  4. * @date 14 December 2001
  5. * @brief This file contains the public API of the IXP400 NPE Downloader
  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. * @defgroup IxNpeDl IXP400 NPE-Downloader (IxNpeDl) API
  49. *
  50. * @brief The Public API for the IXP400 NPE Downloader
  51. *
  52. * @{
  53. */
  54. #ifndef IXNPEDL_H
  55. #define IXNPEDL_H
  56. /*
  57. * Put the user defined include files required
  58. */
  59. #include "IxOsalTypes.h"
  60. #include "IxNpeMicrocode.h"
  61. /*
  62. * #defines for function return types, etc.
  63. */
  64. /**
  65. * @def IX_NPEDL_PARAM_ERR
  66. *
  67. * @brief NpeDl function return value for a parameter error
  68. */
  69. #define IX_NPEDL_PARAM_ERR 2
  70. /**
  71. * @def IX_NPEDL_RESOURCE_ERR
  72. *
  73. * @brief NpeDl function return value for a resource error
  74. */
  75. #define IX_NPEDL_RESOURCE_ERR 3
  76. /**
  77. * @def IX_NPEDL_CRITICAL_NPE_ERR
  78. *
  79. * @brief NpeDl function return value for a Critical NPE error occuring during
  80. download. Assume NPE is left in unstable condition if this value is
  81. returned or NPE is hang / halt.
  82. */
  83. #define IX_NPEDL_CRITICAL_NPE_ERR 4
  84. /**
  85. * @def IX_NPEDL_CRITICAL_MICROCODE_ERR
  86. *
  87. * @brief NpeDl function return value for a Critical Microcode error
  88. * discovered during download. Assume NPE is left in unstable condition
  89. * if this value is returned.
  90. */
  91. #define IX_NPEDL_CRITICAL_MICROCODE_ERR 5
  92. /**
  93. * @def IX_NPEDL_DEVICE_ERR
  94. *
  95. * @brief NpeDl function return value when image being downloaded
  96. * is not meant for the device in use
  97. */
  98. #define IX_NPEDL_DEVICE_ERR 6
  99. /**
  100. * @defgroup NPEImageID IXP400 NPE Image ID Definition
  101. *
  102. * @ingroup IxNpeDl
  103. *
  104. * @brief Definition of NPE Image ID to be passed to ixNpeDlNpeInitAndStart()
  105. * as input of type UINT32 which has the following fields format:
  106. *
  107. * Field [Bit Location] <BR>
  108. * -------------------- <BR>
  109. * Device ID [31 - 28] <BR>
  110. * NPE ID [27 - 24] <BR>
  111. * NPE Functionality ID [23 - 16] <BR>
  112. * Major Release Number [15 - 8] <BR>
  113. * Minor Release Number [7 - 0] <BR>
  114. *
  115. *
  116. * @{
  117. */
  118. /**
  119. * @def IX_NPEDL_NPEIMAGE_FIELD_MASK
  120. *
  121. * @brief Mask for NPE Image ID's Field
  122. *
  123. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  124. * It will be removed in a future release.
  125. * See @ref ixNpeDlNpeInitAndStart for more information.
  126. */
  127. #define IX_NPEDL_NPEIMAGE_FIELD_MASK 0xff
  128. /**
  129. * @def IX_NPEDL_NPEIMAGE_NPEID_MASK
  130. *
  131. * @brief Mask for NPE Image NPE ID's Field
  132. *
  133. */
  134. #define IX_NPEDL_NPEIMAGE_NPEID_MASK 0xf
  135. /**
  136. * @def IX_NPEDL_NPEIMAGE_DEVICEID_MASK
  137. *
  138. * @brief Mask for NPE Image Device ID's Field
  139. *
  140. */
  141. #define IX_NPEDL_NPEIMAGE_DEVICEID_MASK 0xf
  142. /**
  143. * @def IX_NPEDL_NPEIMAGE_BIT_LOC_NPEID
  144. *
  145. * @brief Location of NPE ID field in term of bit.
  146. *
  147. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  148. * It will be removed in a future release.
  149. * See @ref ixNpeDlNpeInitAndStart for more information.
  150. */
  151. #define IX_NPEDL_NPEIMAGE_BIT_LOC_NPEID 24
  152. /**
  153. * @def IX_NPEDL_NPEIMAGE_BIT_LOC_FUNCTIONALITYID
  154. *
  155. * @brief Location of Functionality ID field in term of bit.
  156. *
  157. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  158. * It will be removed in a future release.
  159. * See @ref ixNpeDlNpeInitAndStart for more information.
  160. */
  161. #define IX_NPEDL_NPEIMAGE_BIT_LOC_FUNCTIONALITYID 16
  162. /**
  163. * @def IX_NPEDL_NPEIMAGE_BIT_LOC_MAJOR
  164. *
  165. * @brief Location of Major Release Number field in term of bit.
  166. *
  167. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  168. * It will be removed in a future release.
  169. * See @ref ixNpeDlNpeInitAndStart for more information.
  170. */
  171. #define IX_NPEDL_NPEIMAGE_BIT_LOC_MAJOR 8
  172. /**
  173. * @def IX_NPEDL_NPEIMAGE_BIT_LOC_MINOR
  174. *
  175. * @brief Location of Minor Release Number field in term of bit.
  176. *
  177. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  178. * It will be removed in a future release.
  179. * See @ref ixNpeDlNpeInitAndStart for more information.
  180. */
  181. #define IX_NPEDL_NPEIMAGE_BIT_LOC_MINOR 0
  182. /**
  183. * @} addtogroup NPEImageID
  184. */
  185. /**
  186. * @def ixNpeDlMicrocodeImageOverride(x)
  187. *
  188. * @brief Map old terminology that uses term "image" to new term
  189. * "image library"
  190. *
  191. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  192. * It will be removed in a future release.
  193. * See @ref ixNpeDlNpeInitAndStart for more information.
  194. */
  195. #define ixNpeDlMicrocodeImageOverride(x) ixNpeDlMicrocodeImageLibraryOverride(x)
  196. /**
  197. * @def IxNpeDlVersionId
  198. *
  199. * @brief Map old terminology that uses term "version" to new term
  200. * "image"
  201. *
  202. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  203. * It will be removed in a future release.
  204. * See @ref ixNpeDlNpeInitAndStart for more information.
  205. */
  206. #define IxNpeDlVersionId IxNpeDlImageId
  207. /**
  208. * @def ixNpeDlVersionDownload
  209. *
  210. * @brief Map old terminology that uses term "version" to new term
  211. * "image"
  212. *
  213. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  214. * It will be removed in a future release.
  215. * See @ref ixNpeDlNpeInitAndStart for more information.
  216. */
  217. #define ixNpeDlVersionDownload(x,y) ixNpeDlImageDownload(x,y)
  218. /**
  219. * @def ixNpeDlAvailableVersionsCountGet
  220. *
  221. * @brief Map old terminology that uses term "version" to new term
  222. * "image"
  223. *
  224. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  225. * It will be removed in a future release.
  226. * See @ref ixNpeDlNpeInitAndStart for more information.
  227. */
  228. #define ixNpeDlAvailableVersionsCountGet(x) ixNpeDlAvailableImagesCountGet(x)
  229. /**
  230. * @def ixNpeDlAvailableVersionsListGet
  231. *
  232. * @brief Map old terminology that uses term "version" to new term
  233. * "image"
  234. *
  235. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  236. * It will be removed in a future release.
  237. * See @ref ixNpeDlNpeInitAndStart for more information.
  238. */
  239. #define ixNpeDlAvailableVersionsListGet(x,y) ixNpeDlAvailableImagesListGet(x,y)
  240. /**
  241. * @def ixNpeDlLoadedVersionGet
  242. *
  243. * @brief Map old terminology that uses term "version" to new term
  244. * "image"
  245. *
  246. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  247. * It will be removed in a future release.
  248. * See @ref ixNpeDlNpeInitAndStart for more information.
  249. */
  250. #define ixNpeDlLoadedVersionGet(x,y) ixNpeDlLoadedImageGet(x,y)
  251. /**
  252. * @def clientImage
  253. *
  254. * @brief Map old terminology that uses term "image" to new term
  255. * "image library"
  256. *
  257. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  258. * It will be removed in a future release.
  259. * See @ref ixNpeDlNpeInitAndStart for more information.
  260. */
  261. #define clientImage clientImageLibrary
  262. /**
  263. * @def versionIdPtr
  264. *
  265. * @brief Map old terminology that uses term "version" to new term
  266. * "image"
  267. *
  268. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  269. * It will be removed in a future release.
  270. * See @ref ixNpeDlNpeInitAndStart for more information.
  271. */
  272. #define versionIdPtr imageIdPtr
  273. /**
  274. * @def numVersionsPtr
  275. *
  276. * @brief Map old terminology that uses term "version" to new term
  277. * "image"
  278. *
  279. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  280. * It will be removed in a future release.
  281. * See @ref ixNpeDlNpeInitAndStart for more information.
  282. */
  283. #define numVersionsPtr numImagesPtr
  284. /**
  285. * @def versionIdListPtr
  286. *
  287. * @brief Map old terminology that uses term "version" to new term
  288. * "image"
  289. *
  290. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  291. * It will be removed in a future release.
  292. * See @ref ixNpeDlNpeInitAndStart for more information.
  293. */
  294. #define versionIdListPtr imageIdListPtr
  295. /**
  296. * @def IxNpeDlBuildId
  297. *
  298. * @brief Map old terminology that uses term "buildId" to new term
  299. * "functionalityId"
  300. *
  301. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  302. * It will be removed in a future release.
  303. * See @ref ixNpeDlNpeInitAndStart for more information.
  304. */
  305. #define IxNpeDlBuildId IxNpeDlFunctionalityId
  306. /**
  307. * @def buildId
  308. *
  309. * @brief Map old terminology that uses term "buildId" to new term
  310. * "functionalityId"
  311. *
  312. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  313. * It will be removed in a future release.
  314. * See @ref ixNpeDlNpeInitAndStart for more information.
  315. */
  316. #define buildId functionalityId
  317. /**
  318. * @def IX_NPEDL_MicrocodeImage
  319. *
  320. * @brief Map old terminology that uses term "image" to new term
  321. * "image library"
  322. *
  323. * @warning <b>THIS #define HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  324. * It will be removed in a future release.
  325. * See @ref ixNpeDlNpeInitAndStart for more information.
  326. */
  327. #define IX_NPEDL_MicrocodeImage IX_NPEDL_MicrocodeImageLibrary
  328. /*
  329. * Typedefs
  330. */
  331. /**
  332. * @typedef IxNpeDlFunctionalityId
  333. * @brief Used to make up Functionality ID field of Image Id
  334. *
  335. * @warning <b>THIS typedef HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  336. * It will be removed in a future release.
  337. * See @ref ixNpeDlNpeInitAndStart for more information.
  338. */
  339. typedef UINT8 IxNpeDlFunctionalityId;
  340. /**
  341. * @typedef IxNpeDlMajor
  342. * @brief Used to make up Major Release field of Image Id
  343. *
  344. * @warning <b>THIS typedef HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  345. * It will be removed in a future release.
  346. * See @ref ixNpeDlNpeInitAndStart for more information.
  347. */
  348. typedef UINT8 IxNpeDlMajor;
  349. /**
  350. * @typedef IxNpeDlMinor
  351. * @brief Used to make up Minor Revision field of Image Id
  352. *
  353. * @warning <b>THIS typedef HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  354. * It will be removed in a future release.
  355. * See @ref ixNpeDlNpeInitAndStart for more information.
  356. */
  357. typedef UINT8 IxNpeDlMinor;
  358. /*
  359. * Enums
  360. */
  361. /**
  362. * @brief NpeId numbers to identify NPE A, B or C
  363. * @note In this context, for IXP425 Silicon (B0):<br>
  364. * - NPE-A has HDLC, HSS, AAL and UTOPIA Coprocessors.<br>
  365. * - NPE-B has Ethernet Coprocessor.<br>
  366. * - NPE-C has Ethernet, AES, DES and HASH Coprocessors.<br>
  367. * - IXP400 Product Line have different combinations of coprocessors.
  368. */
  369. typedef enum
  370. {
  371. IX_NPEDL_NPEID_NPEA = 0, /**< Identifies NPE A */
  372. IX_NPEDL_NPEID_NPEB, /**< Identifies NPE B */
  373. IX_NPEDL_NPEID_NPEC, /**< Identifies NPE C */
  374. IX_NPEDL_NPEID_MAX /**< Total Number of NPEs */
  375. } IxNpeDlNpeId;
  376. /*
  377. * Structs
  378. */
  379. /**
  380. * @brief Image Id to identify each image contained in an image library
  381. *
  382. * @warning <b>THIS struct HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  383. * It will be removed in a future release.
  384. * See @ref ixNpeDlNpeInitAndStart for more information.
  385. */
  386. typedef struct
  387. {
  388. IxNpeDlNpeId npeId; /**< NPE ID */
  389. IxNpeDlFunctionalityId functionalityId; /**< Build ID indicates functionality of image */
  390. IxNpeDlMajor major; /**< Major Release Number */
  391. IxNpeDlMinor minor; /**< Minor Revision Number */
  392. } IxNpeDlImageId;
  393. /*
  394. * Prototypes for interface functions
  395. */
  396. /**
  397. * @ingroup IxNpeDl
  398. *
  399. * @fn PUBLIC IX_STATUS ixNpeDlNpeInitAndStart (UINT32 imageId)
  400. *
  401. * @brief Stop, reset, download microcode (firmware) and finally start NPE.
  402. *
  403. * @param imageId UINT32 [in] - Id of the microcode image to download.
  404. *
  405. * This function locates the image specified by the <i>imageId</i> parameter
  406. * from the default microcode image library which is included internally by
  407. * this component.
  408. * It then stops and resets the NPE, loads the firmware image onto the NPE,
  409. * and then restarts the NPE.
  410. *
  411. * @note A list of valid image IDs is included in this header file.
  412. * See #defines with prefix IX_NPEDL_NPEIMAGE_...
  413. *
  414. * @note This function, along with @ref ixNpeDlCustomImageNpeInitAndStart
  415. * and @ref ixNpeDlLoadedImageFunctionalityGet, supercedes the following
  416. * functions which are deprecated and will be removed completely in a
  417. * future release:
  418. * - @ref ixNpeDlImageDownload
  419. * - @ref ixNpeDlAvailableImagesCountGet
  420. * - @ref ixNpeDlAvailableImagesListGet
  421. * - @ref ixNpeDlLatestImageGet
  422. * - @ref ixNpeDlLoadedImageGet
  423. * - @ref ixNpeDlMicrocodeImageLibraryOverride
  424. * - @ref ixNpeDlNpeExecutionStop
  425. * - @ref ixNpeDlNpeStopAndReset
  426. * - @ref ixNpeDlNpeExecutionStart
  427. *
  428. * @pre
  429. * - The Client is responsible for ensuring mutual access to the NPE.
  430. * @post
  431. * - The NPE Instruction Pipeline will be cleared if State Information
  432. * has been downloaded.
  433. * - If the download fails with a critical error, the NPE may
  434. * be left in an ususable state.
  435. * @return
  436. * - IX_SUCCESS if the download was successful;
  437. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  438. * - IX_NPEDL_CRITICAL_NPE_ERR if a critical NPE error occured during
  439. * download
  440. * - IX_NPEDL_CRITICAL_MICROCODE_ERR if a critical microcode error
  441. * occured during download
  442. * - IX_NPEDL_DEVICE_ERR if the image being loaded is not meant for
  443. * the device currently running.
  444. * - IX_FAIL if NPE is not available or image is failed to be located.
  445. * A warning is issued if the NPE is not present.
  446. */
  447. PUBLIC IX_STATUS
  448. ixNpeDlNpeInitAndStart (UINT32 npeImageId);
  449. /**
  450. * @ingroup IxNpeDl
  451. *
  452. * @fn PUBLIC IX_STATUS ixNpeDlCustomImageNpeInitAndStart (UINT32 *imageLibrary,
  453. UINT32 imageId)
  454. *
  455. * @brief Stop, reset, download microcode (firmware) and finally start NPE
  456. *
  457. * @param imageId UINT32 [in] - Id of the microcode image to download.
  458. *
  459. * This function locates the image specified by the <i>imageId</i> parameter
  460. * from the specified microcode image library which is pointed to by the
  461. * <i>imageLibrary</i> parameter.
  462. * It then stops and resets the NPE, loads the firmware image onto the NPE,
  463. * and then restarts the NPE.
  464. *
  465. * This is a facility for users who wish to use an image from an external
  466. * library of NPE firmware images. To use a standard image from the
  467. * built-in library, see @ref ixNpeDlNpeInitAndStart instead.
  468. *
  469. * @note A list of valid image IDs is included in this header file.
  470. * See #defines with prefix IX_NPEDL_NPEIMAGE_...
  471. *
  472. * @note This function, along with @ref ixNpeDlNpeInitAndStart
  473. * and @ref ixNpeDlLoadedImageFunctionalityGet, supercedes the following
  474. * functions which are deprecated and will be removed completely in a
  475. * future release:
  476. * - @ref ixNpeDlImageDownload
  477. * - @ref ixNpeDlAvailableImagesCountGet
  478. * - @ref ixNpeDlAvailableImagesListGet
  479. * - @ref ixNpeDlLatestImageGet
  480. * - @ref ixNpeDlLoadedImageGet
  481. * - @ref ixNpeDlMicrocodeImageLibraryOverride
  482. * - @ref ixNpeDlNpeExecutionStop
  483. * - @ref ixNpeDlNpeStopAndReset
  484. * - @ref ixNpeDlNpeExecutionStart
  485. *
  486. * @pre
  487. * - The Client is responsible for ensuring mutual access to the NPE.
  488. * - The image library supplied must be in the correct format for use
  489. * by the NPE Downloader (IxNpeDl) component. Details of the library
  490. * format are contained in the Functional Specification document for
  491. * IxNpeDl.
  492. * @post
  493. * - The NPE Instruction Pipeline will be cleared if State Information
  494. * has been downloaded.
  495. * - If the download fails with a critical error, the NPE may
  496. * be left in an ususable state.
  497. * @return
  498. * - IX_SUCCESS if the download was successful;
  499. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  500. * - IX_NPEDL_CRITICAL_NPE_ERR if a critical NPE error occured during
  501. * download
  502. * - IX_NPEDL_CRITICAL_MICROCODE_ERR if a critical microcode error
  503. * occured during download
  504. * - IX_NPEDL_DEVICE_ERR if the image being loaded is not meant for
  505. * the device currently running.
  506. * - IX_FAIL if NPE is not available or image is failed to be located.
  507. * A warning is issued if the NPE is not present.
  508. */
  509. PUBLIC IX_STATUS
  510. ixNpeDlCustomImageNpeInitAndStart (UINT32 *imageLibrary,
  511. UINT32 npeImageId);
  512. /**
  513. * @ingroup IxNpeDl
  514. *
  515. * @fn PUBLIC IX_STATUS ixNpeDlLoadedImageFunctionalityGet (IxNpeDlNpeId npeId,
  516. UINT8 *functionalityId)
  517. *
  518. * @brief Gets the functionality of the image last loaded on a particular NPE
  519. *
  520. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE.
  521. * @param functionalityId UINT8* [out] - the functionality ID of the image
  522. * last loaded on the NPE.
  523. *
  524. * This function retrieves the functionality ID of the image most recently
  525. * downloaded successfully to the specified NPE. If the NPE does not contain
  526. * a valid image, this function returns a FAIL status.
  527. *
  528. * @warning This function is not intended for general use, as a knowledge of
  529. * how to interpret the functionality ID is required. As such, this function
  530. * should only be used by other Access Layer components of the IXP400 Software
  531. * Release.
  532. *
  533. * @pre
  534. *
  535. * @post
  536. *
  537. * @return
  538. * - IX_SUCCESS if the operation was successful
  539. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  540. * - IX_FAIL if the NPE does not have a valid image loaded
  541. */
  542. PUBLIC IX_STATUS
  543. ixNpeDlLoadedImageFunctionalityGet (IxNpeDlNpeId npeId,
  544. UINT8 *functionalityId);
  545. /**
  546. * @ingroup IxNpeDl
  547. *
  548. * @fn IX_STATUS ixNpeDlMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary)
  549. *
  550. * @brief This instructs NPE Downloader to use client-supplied microcode image library.
  551. *
  552. * @param clientImageLibrary UINT32* [in] - Pointer to the client-supplied
  553. * NPE microcode image library
  554. *
  555. * This function sets NPE Downloader to use a client-supplied microcode image library
  556. * instead of the standard image library which is included by the NPE Downloader.
  557. * <b>This function is provided mainly for increased testability and should not
  558. * be used in normal circumstances.</b> When not used, NPE Downloader will use
  559. * a "built-in" image library, local to this component, which should always contain the
  560. * latest microcode for the NPEs.
  561. *
  562. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  563. * It will be removed in a future release.
  564. * See @ref ixNpeDlCustomImageNpeInitAndStart.
  565. *
  566. * @pre
  567. * - <i>clientImageLibrary</i> should point to a microcode image library valid for use
  568. * by the NPE Downloader component.
  569. *
  570. * @post
  571. * - the client-supplied image library will be used for all subsequent operations
  572. * performed by the NPE Downloader
  573. *
  574. * @return
  575. * - IX_SUCCESS if the operation was successful
  576. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  577. * - IX_FAIL if the client-supplied image library did not contain a valid signature
  578. */
  579. PUBLIC IX_STATUS
  580. ixNpeDlMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary);
  581. /**
  582. * @ingroup IxNpeDl
  583. *
  584. * @fn PUBLIC IX_STATUS ixNpeDlImageDownload (IxNpeDlImageId *imageIdPtr,
  585. BOOL verify)
  586. *
  587. * @brief Stop, reset, download microcode and finally start NPE.
  588. *
  589. * @param imageIdPtr @ref IxNpeDlImageId* [in] - Pointer to Id of the microcode
  590. * image to download.
  591. * @param verify BOOL [in] - ON/OFF option to verify the download. If ON
  592. * (verify == TRUE), the Downloader will read back
  593. * each word written to the NPE registers to
  594. * ensure the download operation was successful.
  595. *
  596. * Using the <i>imageIdPtr</i>, this function locates a particular image of
  597. * microcode in the microcode image library in memory, and downloads the microcode
  598. * to a particular NPE.
  599. *
  600. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  601. * It will be removed in a future release.
  602. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  603. *
  604. * @pre
  605. * - The Client is responsible for ensuring mutual access to the NPE.
  606. * - The Client should use ixNpeDlLatestImageGet() to obtain the latest
  607. * version of the image before attempting download.
  608. * @post
  609. * - The NPE Instruction Pipeline will be cleared if State Information
  610. * has been downloaded.
  611. * - If the download fails with a critical error, the NPE may
  612. * be left in an ususable state.
  613. * @return
  614. * - IX_SUCCESS if the download was successful;
  615. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  616. * - IX_NPEDL_CRITICAL_NPE_ERR if a critical NPE error occured during
  617. * download
  618. * - IX_PARAM_CRITICAL_MICROCODE_ERR if a critical microcode error
  619. * occured during download
  620. * - IX_FAIL if NPE is not available or image is failed to be located.
  621. * A warning is issued if the NPE is not present.
  622. */
  623. PUBLIC IX_STATUS
  624. ixNpeDlImageDownload (IxNpeDlImageId *imageIdPtr,
  625. BOOL verify);
  626. /**
  627. * @ingroup IxNpeDl
  628. *
  629. * @fn PUBLIC IX_STATUS ixNpeDlAvailableImagesCountGet (UINT32 *numImagesPtr)
  630. *
  631. * @brief Get the number of Images available in a microcode image library
  632. *
  633. * @param numImagesPtr UINT32* [out] - A pointer to the number of images in
  634. * the image library.
  635. *
  636. * Gets the number of images available in the microcode image library.
  637. * Then returns this in a variable pointed to by <i>numImagesPtr</i>.
  638. *
  639. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  640. * It will be removed in a future release.
  641. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  642. *
  643. * @pre
  644. * - The Client should declare the variable to which numImagesPtr points
  645. *
  646. * @post
  647. *
  648. * @return
  649. * - IX_SUCCESS if the operation was successful
  650. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  651. * - IX_FAIL otherwise
  652. */
  653. PUBLIC IX_STATUS
  654. ixNpeDlAvailableImagesCountGet (UINT32 *numImagesPtr);
  655. /**
  656. * @ingroup IxNpeDl
  657. *
  658. * @fn PUBLIC IX_STATUS ixNpeDlAvailableImagesListGet (IxNpeDlImageId *imageIdListPtr,
  659. UINT32 *listSizePtr)
  660. *
  661. * @brief Get a list of the images available in a microcode image library
  662. *
  663. * @param imageIdListPtr @ref IxNpeDlImageId* [out] - Array to contain list of
  664. * image Ids (memory
  665. * allocated by Client).
  666. * @param listSizePtr UINT32* [inout] - As an input, this param should point
  667. * to the max number of Ids the
  668. * <i>imageIdListPtr</i> array can
  669. * hold. NpeDl will replace the input
  670. * value of this parameter with the
  671. * number of image Ids actually filled
  672. * into the array before returning.
  673. *
  674. * Finds list of images available in the microcode image library.
  675. * Fills these into the array pointed to by <i>imageIdListPtr</i>
  676. *
  677. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  678. * It will be removed in a future release.
  679. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  680. *
  681. * @pre
  682. * - The Client should declare the variable to which numImagesPtr points
  683. * - The Client should create an array (<i>imageIdListPtr</i>) large
  684. * enough to contain all the image Ids in the image library
  685. *
  686. * @post
  687. *
  688. * @return
  689. * - IX_SUCCESS if the operation was successful
  690. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  691. * - IX_FAIL otherwise
  692. */
  693. PUBLIC IX_STATUS
  694. ixNpeDlAvailableImagesListGet (IxNpeDlImageId *imageIdListPtr,
  695. UINT32 *listSizePtr);
  696. /**
  697. * @ingroup IxNpeDl
  698. *
  699. * @fn PUBLIC IX_STATUS ixNpeDlLoadedImageGet (IxNpeDlNpeId npeId,
  700. IxNpeDlImageId *imageIdPtr)
  701. *
  702. * @brief Gets the Id of the image currently loaded on a particular NPE
  703. *
  704. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE.
  705. * @param imageIdPtr @ref IxNpeDlImageId* [out] - Pointer to the where the
  706. * image id should be stored.
  707. *
  708. * If an image of microcode was previously downloaded successfully to the NPE
  709. * by NPE Downloader, this function returns in <i>imageIdPtr</i> the image
  710. * Id of that image loaded on the NPE.
  711. *
  712. * @pre
  713. * - The Client has allocated memory to the <i>imageIdPtr</i> pointer.
  714. *
  715. * @post
  716. *
  717. * @return
  718. * - IX_SUCCESS if the operation was successful
  719. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  720. * - IX_FAIL if the NPE doesn't currently have a image loaded
  721. */
  722. PUBLIC IX_STATUS
  723. ixNpeDlLoadedImageGet (IxNpeDlNpeId npeId,
  724. IxNpeDlImageId *imageIdPtr);
  725. /**
  726. * @fn PUBLIC IX_STATUS ixNpeDlLatestImageGet (IxNpeDlNpeId npeId, IxNpeDlFunctionalityId
  727. functionalityId, IxNpeDlImageId *imageIdPtr)
  728. *
  729. * @brief This instructs NPE Downloader to get Id of the latest version for an
  730. * image that is specified by the client.
  731. *
  732. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE.
  733. * @param functionalityId @ref IxNpeDlFunctionalityId [in] - functionality of the image
  734. * @param imageIdPtr @ref IxNpeDlImageId* [out] - Pointer to the where the
  735. * image id should be stored.
  736. *
  737. * This function sets NPE Downloader to return the id of the latest version for
  738. * image. The user will select the image by providing a particular NPE
  739. * (specifying <i>npeId</i>) with particular functionality (specifying
  740. * <i>FunctionalityId</i>). The most recent version available as determined by the
  741. * highest Major and Minor revision numbers is returned in <i>imageIdPtr</i>.
  742. *
  743. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  744. * It will be removed in a future release.
  745. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  746. *
  747. * @return
  748. * - IX_SUCCESS if the operation was successful
  749. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  750. * - IX_FAIL otherwise
  751. */
  752. PUBLIC IX_STATUS
  753. ixNpeDlLatestImageGet (IxNpeDlNpeId npeId,
  754. IxNpeDlFunctionalityId functionalityId,
  755. IxNpeDlImageId *imageIdPtr);
  756. /**
  757. * @ingroup IxNpeDl
  758. *
  759. * @fn PUBLIC IX_STATUS ixNpeDlNpeStopAndReset (IxNpeDlNpeId npeId)
  760. *
  761. * @brief Stops and Resets an NPE
  762. *
  763. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE.
  764. *
  765. * This function performs a soft NPE reset by writing reset values to
  766. * particular NPE registers. Note that this does not reset NPE co-processors.
  767. * This implicitly stops NPE code execution before resetting the NPE.
  768. *
  769. * @note It is no longer necessary to call this function before downloading
  770. * a new image to the NPE. It is left on the API only to allow greater control
  771. * of NPE execution if required. Where appropriate, use @ref ixNpeDlNpeInitAndStart
  772. * or @ref ixNpeDlCustomImageNpeInitAndStart instead.
  773. *
  774. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  775. * It will be removed in a future release.
  776. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  777. *
  778. * @pre
  779. * - The Client is responsible for ensuring mutual access to the NPE.
  780. *
  781. * @post
  782. *
  783. * @return
  784. * - IX_SUCCESS if the operation was successful
  785. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  786. * - IX_FAIL otherwise
  787. * - IX_NPEDL_CRITICAL_NPE_ERR failed to reset NPE due to timeout error.
  788. * Timeout error could happen if NPE hang
  789. */
  790. PUBLIC IX_STATUS
  791. ixNpeDlNpeStopAndReset (IxNpeDlNpeId npeId);
  792. /**
  793. * @ingroup IxNpeDl
  794. *
  795. * @fn PUBLIC IX_STATUS ixNpeDlNpeExecutionStart (IxNpeDlNpeId npeId)
  796. *
  797. * @brief Starts code execution on a NPE
  798. *
  799. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE
  800. *
  801. * Starts execution of code on a particular NPE. A client would typically use
  802. * this after a download to NPE is performed, to start/restart code execution
  803. * on the NPE.
  804. *
  805. * @note It is no longer necessary to call this function after downloading
  806. * a new image to the NPE. It is left on the API only to allow greater control
  807. * of NPE execution if required. Where appropriate, use @ref ixNpeDlNpeInitAndStart
  808. * or @ref ixNpeDlCustomImageNpeInitAndStart instead.
  809. *
  810. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  811. * It will be removed in a future release.
  812. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  813. *
  814. * @pre
  815. * - The Client is responsible for ensuring mutual access to the NPE.
  816. * - Note that this function does not set the NPE Next Program Counter
  817. * (NextPC), so it should be set beforehand if required by downloading
  818. * appropriate State Information (using ixNpeDlVersionDownload()).
  819. *
  820. * @post
  821. *
  822. * @return
  823. * - IX_SUCCESS if the operation was successful
  824. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  825. * - IX_FAIL otherwise
  826. */
  827. PUBLIC IX_STATUS
  828. ixNpeDlNpeExecutionStart (IxNpeDlNpeId npeId);
  829. /**
  830. * @ingroup IxNpeDl
  831. *
  832. * @fn PUBLIC IX_STATUS ixNpeDlNpeExecutionStop (IxNpeDlNpeId npeId)
  833. *
  834. * @brief Stops code execution on a NPE
  835. *
  836. * @param npeId @ref IxNpeDlNpeId [in] - Id of the target NPE
  837. *
  838. * Stops execution of code on a particular NPE. This would typically be used
  839. * by a client before a download to NPE is performed, to stop code execution on
  840. * an NPE, unless ixNpeDlNpeStopAndReset() is used instead. Unlike
  841. * ixNpeDlNpeStopAndReset(), this function only halts the NPE and leaves
  842. * all registers and settings intact. This is useful, for example, between
  843. * stages of a multi-stage download, to stop the NPE prior to downloading the
  844. * next image while leaving the current state of the NPE intact..
  845. *
  846. * @warning <b>THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.</b>
  847. * It will be removed in a future release.
  848. * See @ref ixNpeDlNpeInitAndStart and @ref ixNpeDlCustomImageNpeInitAndStart.
  849. *
  850. * @pre
  851. * - The Client is responsible for ensuring mutual access to the NPE.
  852. *
  853. * @post
  854. *
  855. * @return
  856. * - IX_SUCCESS if the operation was successful
  857. * - IX_NPEDL_PARAM_ERR if a parameter error occured
  858. * - IX_FAIL otherwise
  859. */
  860. PUBLIC IX_STATUS
  861. ixNpeDlNpeExecutionStop (IxNpeDlNpeId npeId);
  862. /**
  863. * @ingroup IxNpeDl
  864. *
  865. * @fn PUBLIC IX_STATUS ixNpeDlUnload (void)
  866. *
  867. * @brief This function will uninitialise the IxNpeDl component.
  868. *
  869. * This function will uninitialise the IxNpeDl component. It should only be
  870. * called once, and only if the IxNpeDl component has already been initialised by
  871. * calling any of the following functions:
  872. * - @ref ixNpeDlNpeInitAndStart
  873. * - @ref ixNpeDlCustomImageNpeInitAndStart
  874. * - @ref ixNpeDlImageDownload (deprecated)
  875. * - @ref ixNpeDlNpeStopAndReset (deprecated)
  876. * - @ref ixNpeDlNpeExecutionStop (deprecated)
  877. * - @ref ixNpeDlNpeExecutionStart (deprecated)
  878. *
  879. * If possible, this function should be called before a soft reboot or unloading
  880. * a kernel module to perform any clean up operations required for IxNpeDl.
  881. *
  882. * The following actions will be performed by this function:
  883. * - Unmapping of any kernel memory mapped by IxNpeDl
  884. *
  885. * @return
  886. * - IX_SUCCESS if the operation was successful
  887. * - IX_FAIL otherwise
  888. */
  889. PUBLIC IX_STATUS
  890. ixNpeDlUnload (void);
  891. /**
  892. * @ingroup IxNpeDl
  893. *
  894. * @fn PUBLIC void ixNpeDlStatsShow (void)
  895. *
  896. * @brief This function will display run-time statistics from the IxNpeDl
  897. * component
  898. *
  899. * @return none
  900. */
  901. PUBLIC void
  902. ixNpeDlStatsShow (void);
  903. /**
  904. * @ingroup IxNpeDl
  905. *
  906. * @fn PUBLIC void ixNpeDlStatsReset (void)
  907. *
  908. * @brief This function will reset the statistics of the IxNpeDl component
  909. *
  910. * @return none
  911. */
  912. PUBLIC void
  913. ixNpeDlStatsReset (void);
  914. #endif /* IXNPEDL_H */
  915. /**
  916. * @} defgroup IxNpeDl
  917. */