IxNpeDlImageMgr_p.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. /**
  2. * @file IxNpeDlImageMgr_p.h
  3. *
  4. * @author Intel Corporation
  5. * @date 14 December 2001
  6. * @brief This file contains the private API for the ImageMgr module
  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 IxNpeDlImageMgr_p IxNpeDlImageMgr_p
  49. *
  50. * @brief The private API for the IxNpeDl ImageMgr module
  51. *
  52. * @{
  53. */
  54. #ifndef IXNPEDLIMAGEMGR_P_H
  55. #define IXNPEDLIMAGEMGR_P_H
  56. /*
  57. * Put the user defined include files required.
  58. */
  59. #include "IxNpeDl.h"
  60. #include "IxOsalTypes.h"
  61. /*
  62. * #defines and macros
  63. */
  64. /**
  65. * @def IX_NPEDL_IMAGEMGR_SIGNATURE
  66. *
  67. * @brief Signature found as 1st word in a microcode image library
  68. */
  69. #define IX_NPEDL_IMAGEMGR_SIGNATURE 0xDEADBEEF
  70. /**
  71. * @def IX_NPEDL_IMAGEMGR_END_OF_HEADER
  72. *
  73. * @brief Marks end of header in a microcode image library
  74. */
  75. #define IX_NPEDL_IMAGEMGR_END_OF_HEADER 0xFFFFFFFF
  76. /**
  77. * @def IX_NPEDL_IMAGEID_NPEID_OFFSET
  78. *
  79. * @brief Offset from LSB of NPE ID field in Image ID
  80. */
  81. #define IX_NPEDL_IMAGEID_NPEID_OFFSET 24
  82. /**
  83. * @def IX_NPEDL_IMAGEID_DEVICEID_OFFSET
  84. *
  85. * @brief Offset from LSB of Device ID field in Image ID
  86. */
  87. #define IX_NPEDL_IMAGEID_DEVICEID_OFFSET 28
  88. /**
  89. * @def IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET
  90. *
  91. * @brief Offset from LSB of Functionality ID field in Image ID
  92. */
  93. #define IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET 16
  94. /**
  95. * @def IX_NPEDL_IMAGEID_MAJOR_OFFSET
  96. *
  97. * @brief Offset from LSB of Major revision field in Image ID
  98. */
  99. #define IX_NPEDL_IMAGEID_MAJOR_OFFSET 8
  100. /**
  101. * @def IX_NPEDL_IMAGEID_MINOR_OFFSET
  102. *
  103. * @brief Offset from LSB of Minor revision field in Image ID
  104. */
  105. #define IX_NPEDL_IMAGEID_MINOR_OFFSET 0
  106. /**
  107. * @def IX_NPEDL_NPEID_FROM_IMAGEID_GET
  108. *
  109. * @brief Macro to extract NPE ID field from Image ID
  110. */
  111. #define IX_NPEDL_NPEID_FROM_IMAGEID_GET(imageId) \
  112. (((imageId) >> IX_NPEDL_IMAGEID_NPEID_OFFSET) & \
  113. IX_NPEDL_NPEIMAGE_NPEID_MASK)
  114. /**
  115. * @def IX_NPEDL_DEVICEID_FROM_IMAGEID_GET
  116. *
  117. * @brief Macro to extract NPE ID field from Image ID
  118. */
  119. #define IX_NPEDL_DEVICEID_FROM_IMAGEID_GET(imageId) \
  120. (((imageId) >> IX_NPEDL_IMAGEID_DEVICEID_OFFSET) & \
  121. IX_NPEDL_NPEIMAGE_DEVICEID_MASK)
  122. /**
  123. * @def IX_NPEDL_FUNCTIONID_FROM_IMAGEID_GET
  124. *
  125. * @brief Macro to extract Functionality ID field from Image ID
  126. */
  127. #define IX_NPEDL_FUNCTIONID_FROM_IMAGEID_GET(imageId) \
  128. (((imageId) >> IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET) & \
  129. IX_NPEDL_NPEIMAGE_FIELD_MASK)
  130. /**
  131. * @def IX_NPEDL_MAJOR_FROM_IMAGEID_GET
  132. *
  133. * @brief Macro to extract Major revision field from Image ID
  134. */
  135. #define IX_NPEDL_MAJOR_FROM_IMAGEID_GET(imageId) \
  136. (((imageId) >> IX_NPEDL_IMAGEID_MAJOR_OFFSET) & \
  137. IX_NPEDL_NPEIMAGE_FIELD_MASK)
  138. /**
  139. * @def IX_NPEDL_MINOR_FROM_IMAGEID_GET
  140. *
  141. * @brief Macro to extract Minor revision field from Image ID
  142. */
  143. #define IX_NPEDL_MINOR_FROM_IMAGEID_GET(imageId) \
  144. (((imageId) >> IX_NPEDL_IMAGEID_MINOR_OFFSET) & \
  145. IX_NPEDL_NPEIMAGE_FIELD_MASK)
  146. /*
  147. * Prototypes for interface functions
  148. */
  149. /**
  150. * @fn IX_STATUS ixNpeDlImageMgrMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary)
  151. *
  152. * @brief This instructs NPE Downloader to use client-supplied microcode image library.
  153. *
  154. * This function sets NPE Downloader to use a client-supplied microcode image library
  155. * instead of the standard image library which is included by the NPE Downloader.
  156. *
  157. * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
  158. * It will be removed in a future release.
  159. * See API header file IxNpeDl.h for more information.
  160. *
  161. * @pre
  162. * - <i>clientImageLibrary</i> should point to a microcode image library valid for use
  163. * by the NPE Downloader component.
  164. *
  165. * @post
  166. * - the client-supplied image uibrary will be used for all subsequent operations
  167. * performed by the NPE Downloader
  168. *
  169. * @return
  170. * - IX_SUCCESS if the operation was successful
  171. * - IX_FAIL if the client-supplied image library did not contain a valid signature
  172. */
  173. IX_STATUS
  174. ixNpeDlImageMgrMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary);
  175. /**
  176. * @fn IX_STATUS ixNpeDlImageMgrImageListExtract (IxNpeDlImageId *imageListPtr,
  177. UINT32 *numImages)
  178. *
  179. * @brief Extracts a list of images available in the NPE microcode image library.
  180. *
  181. * @param IxNpeDlImageId* [out] imageListPtr - pointer to array to contain
  182. * a list of images. If NULL,
  183. * only the number of images
  184. * is returned (in
  185. * <i>numImages</i>)
  186. * @param UINT32* [inout] numImages - As input, it points to a variable
  187. * containing the number of images which
  188. * can be stored in the
  189. * <i>imageListPtr</i> array. Its value
  190. * is ignored as input if
  191. * <i>imageListPtr</i> is NULL. As an
  192. * output, it will contain number of
  193. * images in the image library.
  194. *
  195. * This function reads the header of the microcode image library and extracts a list of the
  196. * images available in the image library. It can also be used to find the number of
  197. * images in the image library.
  198. *
  199. * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
  200. * It will be removed in a future release.
  201. * See API header file IxNpeDl.h for more information.
  202. *
  203. * @pre
  204. * - if <i>imageListPtr</i> != NULL, <i>numImages</i> should reflect the
  205. * number of image Id elements the <i>imageListPtr</i> can contain.
  206. *
  207. * @post
  208. * - <i>numImages</i> will reflect the number of image Id's found in the
  209. * microcode image library.
  210. *
  211. * @return
  212. * - IX_SUCCESS if the operation was successful
  213. * - IX_FAIL otherwise
  214. */
  215. IX_STATUS
  216. ixNpeDlImageMgrImageListExtract (IxNpeDlImageId *imageListPtr,
  217. UINT32 *numImages);
  218. /**
  219. * @fn IX_STATUS ixNpeDlImageMgrImageLocate (IxNpeDlImageId *imageId,
  220. UINT32 **imagePtr,
  221. UINT32 *imageSize)
  222. *
  223. * @brief Finds a image block in the NPE microcode image library.
  224. *
  225. * @param IxNpeDlImageId* [in] imageId - the id of the image to locate
  226. * @param UINT32** [out] imagePtr - pointer to the image in memory
  227. * @param UINT32* [out] imageSize - size (in 32-bit words) of image
  228. *
  229. * This function examines the header of the microcode image library for the location
  230. * and size of the specified image.
  231. *
  232. * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
  233. * It will be removed in a future release.
  234. * See API header file IxNpeDl.h for more information.
  235. *
  236. * @pre
  237. *
  238. * @post
  239. *
  240. * @return
  241. * - IX_SUCCESS if the operation was successful
  242. * - IX_FAIL otherwise
  243. */
  244. IX_STATUS
  245. ixNpeDlImageMgrImageLocate (IxNpeDlImageId *imageId,
  246. UINT32 **imagePtr,
  247. UINT32 *imageSize);
  248. /**
  249. * @fn IX_STATUS ixNpeDlImageMgrLatestImageExtract (IxNpeDlImageId *imageId)
  250. *
  251. * @brief Finds the most recent version of an image in the NPE image library.
  252. *
  253. * @param IxNpeDlImageId* [inout] imageId - the id of the image
  254. *
  255. * This function determines the most recent version of a specified image by its
  256. * higest major release and minor revision numbers
  257. *
  258. * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
  259. * It will be removed in a future release.
  260. * See API header file IxNpeDl.h for more information.
  261. *
  262. * @pre
  263. *
  264. * @post
  265. *
  266. * @return
  267. * - IX_SUCCESS if the operation was successful
  268. * - IX_FAIL otherwise
  269. */
  270. IX_STATUS
  271. ixNpeDlImageMgrLatestImageExtract (IxNpeDlImageId *imageId);
  272. /**
  273. * @fn void ixNpeDlImageMgrStatsShow (void)
  274. *
  275. * @brief This function will display the statistics of the IxNpeDl ImageMgr
  276. * module
  277. *
  278. * @return none
  279. */
  280. void
  281. ixNpeDlImageMgrStatsShow (void);
  282. /**
  283. * @fn void ixNpeDlImageMgrStatsReset (void)
  284. *
  285. * @brief This function will reset the statistics of the IxNpeDl ImageMgr
  286. * module
  287. *
  288. * @return none
  289. */
  290. void
  291. ixNpeDlImageMgrStatsReset (void);
  292. /**
  293. * @fn IX_STATUS ixNpeDlImageMgrImageGet (UINT32 *imageLibrary,
  294. UINT32 imageId,
  295. UINT32 **imagePtr,
  296. UINT32 *imageSize)
  297. *
  298. * @brief Finds a image block in the NPE microcode image library.
  299. *
  300. * @param UINT32* [in] imageLibrary - the image library to use
  301. * @param UINT32 [in] imageId - the id of the image to locate
  302. * @param UINT32** [out] imagePtr - pointer to the image in memory
  303. * @param UINT32* [out] imageSize - size (in 32-bit words) of image
  304. *
  305. * This function examines the header of the specified microcode image library
  306. * for the location and size of the specified image. It returns a pointer to
  307. * the image in the <i>imagePtr</i> parameter.
  308. * If no image library is specified (imageLibrary == NULL), then the default
  309. * built-in image library will be used.
  310. *
  311. * @pre
  312. *
  313. * @post
  314. *
  315. * @return
  316. * - IX_SUCCESS if the operation was successful
  317. * - IX_FAIL otherwise
  318. */
  319. IX_STATUS
  320. ixNpeDlImageMgrImageFind (UINT32 *imageLibrary,
  321. UINT32 imageId,
  322. UINT32 **imagePtr,
  323. UINT32 *imageSize);
  324. #endif /* IXNPEDLIMAGEMGR_P_H */
  325. /**
  326. * @} defgroup IxNpeDlImageMgr_p
  327. */