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