IxNpeDlNpeMgr_p.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /**
  2. * @file IxNpeDlNpeMgr_p.h
  3. *
  4. * @author Intel Corporation
  5. * @date 14 December 2001
  6. * @brief This file contains the private API for the NpeMgr 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 IxNpeDlNpeMgr_p IxNpeDlNpeMgr_p
  49. *
  50. * @brief The private API for the IxNpeDl NpeMgr module
  51. *
  52. * @{
  53. */
  54. #ifndef IXNPEDLNPEMGR_P_H
  55. #define IXNPEDLNPEMGR_P_H
  56. /*
  57. * Put the user defined include files required.
  58. */
  59. #include "IxNpeDl.h"
  60. #include "IxOsalTypes.h"
  61. /*
  62. * Function Prototypes
  63. */
  64. /**
  65. * @fn void ixNpeDlNpeMgrInit (void)
  66. *
  67. * @brief Initialises the NpeMgr module
  68. *
  69. * @param none
  70. *
  71. * This function initialises the NpeMgr module.
  72. * It should be called before any other function in this module is called.
  73. * It only needs to be called once, but can be called multiple times safely.
  74. * The code will ASSERT on failure.
  75. *
  76. * @pre
  77. * - It must be called before any other function in this module
  78. *
  79. * @post
  80. * - NPE Configuration Register memory space will be mapped using
  81. * IxOsal. This memory will not be unmapped by this module.
  82. *
  83. * @return none
  84. */
  85. void
  86. ixNpeDlNpeMgrInit (void);
  87. /**
  88. * @fn IX_STATUS ixNpeMhNpeMgrUninit (void)
  89. *
  90. * @brief This function will uninitialise the IxNpeDlNpeMgr sub-component.
  91. *
  92. * This function will uninitialise the IxNpeDlNpeMgr sub-component.
  93. * It should only be called once, and only if the IxNpeDlNpeMgr sub-component
  94. * has already been initialised by calling @ref ixNpeDlNpeMgrInit().
  95. * No other IxNpeDlNpeMgr sub-component API functions should be called
  96. * until @ref ixNpeDlNpeMgrInit() is called again.
  97. * If possible, this function should be called before a soft reboot or unloading
  98. * a kernel module to perform any clean up operations required for IxNpeMh.
  99. *
  100. * @return
  101. * - IX_SUCCESS if the operation was successful
  102. * - IX_FAIL otherwise
  103. */
  104. IX_STATUS ixNpeDlNpeMgrUninit (void);
  105. /**
  106. * @fn IX_STATUS ixNpeDlNpeMgrImageLoad (IxNpeDlNpeId npeId,
  107. UINT32 *imageCodePtr,
  108. BOOL verify)
  109. *
  110. * @brief Loads a image of microcode onto an NPE
  111. *
  112. * @param IxNpeDlNpeId [in] npeId - Id of target NPE
  113. * @param UINT32* [in] imageCodePtr - pointer to image code in image to be
  114. * downloaded
  115. * @param BOOL [in] verify - if TRUE, verify each word written to
  116. * NPE memory.
  117. *
  118. * This function loads a image containing blocks of microcode onto a
  119. * particular NPE. If the <i>verify</i> option is ON, NpeDl will read back each
  120. * word written and verify that it was written successfully
  121. *
  122. * @pre
  123. * - The NPE should be stopped beforehand
  124. *
  125. * @post
  126. * - The NPE Instruction Pipeline may be flushed clean
  127. *
  128. * @return
  129. * - IX_SUCCESS if the download was successful
  130. * - IX_FAIL if the download failed
  131. * - IX_NPEDL_CRITICAL_NPE_ERR if the download failed due to timeout error
  132. * where NPE is not responding
  133. */
  134. IX_STATUS
  135. ixNpeDlNpeMgrImageLoad (IxNpeDlNpeId npeId, UINT32 *imageCodePtr,
  136. BOOL verify);
  137. /**
  138. * @fn IX_STATUS ixNpeDlNpeMgrNpeReset (IxNpeDlNpeId npeId)
  139. *
  140. * @brief sets a NPE to RESET state
  141. *
  142. * @param IxNpeDlNpeId [in] npeId - id of target NPE
  143. *
  144. * This function performs a soft NPE reset by writing reset values to the
  145. * Configuration Bus Execution Control registers, the Execution Context Stack
  146. * registers, the Physical Register file, and the Context Store registers for
  147. * each context number. It also clears inFIFO, outFIFO and Watchpoint FIFO.
  148. * It does not reset NPE Co-processors.
  149. *
  150. * @pre
  151. * - The NPE should be stopped beforehand
  152. *
  153. * @post
  154. * - NPE NextProgram Counter (NextPC) will be set to a fixed initial value,
  155. * such as 0. This should be explicitly set by downloading State
  156. * Information before starting NPE Execution.
  157. * - The NPE Instruction Pipeline will be in a clean state.
  158. *
  159. * @return
  160. * - IX_SUCCESS if the operation was successful
  161. * - IX_FAIL if the operation failed
  162. * - IX_NPEDL_CRITICAL_NPE_ERR if the operation failed due to NPE hang
  163. */
  164. IX_STATUS
  165. ixNpeDlNpeMgrNpeReset (IxNpeDlNpeId npeId);
  166. /**
  167. * @fn IX_STATUS ixNpeDlNpeMgrNpeStart (IxNpeDlNpeId npeId)
  168. *
  169. * @brief Starts NPE Execution
  170. *
  171. * @param IxNpeDlNpeId [in] npeId - Id of target NPE
  172. *
  173. * Ensures only background Execution Stack Level is Active, clears instruction
  174. * pipeline, and starts Execution on a NPE by sending a Start NPE command to
  175. * the NPE. Checks the execution status of the NPE to verify that it is
  176. * running.
  177. *
  178. * @pre
  179. * - The NPE should be stopped beforehand.
  180. * - Note that this function does not set the NPE Next Program Counter
  181. * (NextPC), so it should be set beforehand if required by downloading
  182. * appropriate State Information.
  183. *
  184. * @post
  185. *
  186. * @return
  187. * - IX_SUCCESS if the operation was successful
  188. * - IX_FAIL otherwise
  189. */
  190. IX_STATUS
  191. ixNpeDlNpeMgrNpeStart (IxNpeDlNpeId npeId);
  192. /**
  193. * @fn IX_STATUS ixNpeDlNpeMgrNpeStop (IxNpeDlNpeId npeId)
  194. *
  195. * @brief Halts NPE Execution
  196. *
  197. * @param IxNpeDlNpeId [in] npeId - id of target NPE
  198. *
  199. * Stops execution on an NPE by sending a Stop NPE command to the NPE.
  200. * Checks the execution status of the NPE to verify that it has stopped.
  201. *
  202. * @pre
  203. *
  204. * @post
  205. *
  206. * @return
  207. * - IX_SUCCESS if the operation was successful
  208. * - IX_FAIL otherwise
  209. */
  210. IX_STATUS
  211. ixNpeDlNpeMgrNpeStop (IxNpeDlNpeId npeId);
  212. /**
  213. * @fn void ixNpeDlNpeMgrStatsShow (void)
  214. *
  215. * @brief This function will display statistics of the IxNpeDl NpeMgr module
  216. *
  217. * @return none
  218. */
  219. void
  220. ixNpeDlNpeMgrStatsShow (void);
  221. /**
  222. * @fn void ixNpeDlNpeMgrStatsReset (void)
  223. *
  224. * @brief This function will reset the statistics of the IxNpeDl NpeMgr module
  225. *
  226. * @return none
  227. */
  228. void
  229. ixNpeDlNpeMgrStatsReset (void);
  230. #endif /* IXNPEDLIMAGEMGR_P_H */
  231. /**
  232. * @} defgroup IxNpeDlNpeMgr_p
  233. */