IxParityENAcc.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. /**
  2. * @file IxParityENAcc.h
  3. *
  4. * @author Intel Corporation
  5. * @date 24 Mar 2004
  6. *
  7. * @brief This file contains the public API for the IXP400 Parity Error
  8. * Notifier access component.
  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
  20. * Redistribution and use in source and binary forms, with or without
  21. * modification, are permitted provided that the following conditions
  22. * are met:
  23. * 1. Redistributions of source code must retain the above copyright
  24. * notice, this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright
  26. * notice, this list of conditions and the following disclaimer in the
  27. * documentation and/or other materials provided with the distribution.
  28. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * @par
  33. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  34. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  35. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  36. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  37. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  38. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  39. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  41. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  42. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  43. * SUCH DAMAGE.
  44. *
  45. * @par
  46. * -- End of Copyright Notice --
  47. */
  48. /**
  49. * @defgroup IxParityENAcc IXP400 Parity Error Notifier (IxParityENAcc) API
  50. *
  51. * @brief The public API for the Parity Error Notifier
  52. *
  53. * @{
  54. */
  55. #ifndef IXPARITYENACC_H
  56. #define IXPARITYENACC_H
  57. #ifdef __ixp46X
  58. #include "IxOsal.h"
  59. /*
  60. * #defines for function return types, etc.
  61. */
  62. /**
  63. * @ingroup IxParityENAcc
  64. *
  65. * @enum IxParityENAccStatus
  66. *
  67. * @brief The status as returend from the API
  68. */
  69. typedef enum /**< IxParityENAccStatus */
  70. {
  71. IX_PARITYENACC_SUCCESS = IX_SUCCESS, /**< The request is successful */
  72. IX_PARITYENACC_INVALID_PARAMETERS, /**< Invalid or NULL parameters passed */
  73. IX_PARITYENACC_NOT_INITIALISED, /**< Access layer has not been initialised before accessing the APIs */
  74. IX_PARITYENACC_ALREADY_INITIALISED, /**< Access layer has already been initialised */
  75. IX_PARITYENACC_OPERATION_FAILED, /**< Operation did not succeed due to hardware failure */
  76. IX_PARITYENACC_NO_PARITY /**< No parity condition exits or has already been cleared */
  77. } IxParityENAccStatus;
  78. /**
  79. * @ingroup IxParityENAcc
  80. *
  81. * @enum IxParityENAccParityType
  82. *
  83. * @brief Odd or Even Parity Type
  84. */
  85. typedef enum /**< IxParityENAccParityType */
  86. {
  87. IX_PARITYENACC_EVEN_PARITY, /**< Even Parity */
  88. IX_PARITYENACC_ODD_PARITY /**< Odd Parity */
  89. } IxParityENAccParityType;
  90. /**
  91. * @ingroup IxParityENAcc
  92. *
  93. * @enum IxParityENAccConfigOption
  94. *
  95. * @brief The parity error enable/disable configuration option
  96. */
  97. typedef enum /**< IxParityENAccConfigOption */
  98. {
  99. IX_PARITYENACC_DISABLE, /**< Disable parity error detection */
  100. IX_PARITYENACC_ENABLE /**< Enable parity error detection */
  101. } IxParityENAccConfigOption;
  102. /**
  103. * @ingroup IxParityENAcc
  104. *
  105. * @struct IxParityENAccNpeConfig
  106. *
  107. * @brief NPE parity detection is to be enabled/disabled
  108. */
  109. typedef struct /**< IxParityENAccNpeConfig */
  110. {
  111. IxParityENAccConfigOption ideEnabled; /**< NPE IMem, DMem and External */
  112. IxParityENAccParityType parityOddEven; /**< Parity - Odd or Even */
  113. } IxParityENAccNpeConfig ;
  114. /**
  115. * @ingroup IxParityENAcc
  116. *
  117. * @struct IxParityENAccMcuConfig
  118. *
  119. * @brief MCU pairty detection is to be enabled/disabled
  120. */
  121. typedef struct /**< IxParityENAccMcuConfig */
  122. {
  123. IxParityENAccConfigOption singlebitDetectEnabled; /**< Single-bit parity error detection */
  124. IxParityENAccConfigOption singlebitCorrectionEnabled; /**< Single-bit parity error correction */
  125. IxParityENAccConfigOption multibitDetectionEnabled; /**< Multi-bit parity error detection */
  126. } IxParityENAccMcuConfig ;
  127. /**
  128. * @ingroup IxParityENAcc
  129. *
  130. * @struct IxParityENAccEbcConfig
  131. *
  132. * @brief Expansion Bus Controller parity detection is to be enabled or disabled
  133. *
  134. * Note: All the Chip Select(s) and External Masters will have the same parity
  135. */
  136. typedef struct /**< IxParityENAccEbcConfig */
  137. {
  138. IxParityENAccConfigOption ebcCs0Enabled; /**< Expansion Bus Controller - Chip Select 0 */
  139. IxParityENAccConfigOption ebcCs1Enabled; /**< Expansion Bus Controller - Chip Select 1 */
  140. IxParityENAccConfigOption ebcCs2Enabled; /**< Expansion Bus Controller - Chip Select 2 */
  141. IxParityENAccConfigOption ebcCs3Enabled; /**< Expansion Bus Controller - Chip Select 3 */
  142. IxParityENAccConfigOption ebcCs4Enabled; /**< Expansion Bus Controller - Chip Select 4 */
  143. IxParityENAccConfigOption ebcCs5Enabled; /**< Expansion Bus Controller - Chip Select 5 */
  144. IxParityENAccConfigOption ebcCs6Enabled; /**< Expansion Bus Controller - Chip Select 6 */
  145. IxParityENAccConfigOption ebcCs7Enabled; /**< Expansion Bus Controller - Chip Select 7 */
  146. IxParityENAccConfigOption ebcExtMstEnabled; /**< External Master on Expansion bus */
  147. IxParityENAccParityType parityOddEven; /**< Parity - Odd or Even */
  148. } IxParityENAccEbcConfig ;
  149. /**
  150. * @ingroup IxParityENAcc
  151. *
  152. * @struct IxParityENAccHWParityConfig
  153. *
  154. * @brief Parity error configuration of the Hardware Blocks
  155. */
  156. typedef struct /**< IxParityENAccHWParityConfig */
  157. {
  158. IxParityENAccNpeConfig npeAConfig; /**< NPE A parity detection is to be enabled/disabled */
  159. IxParityENAccNpeConfig npeBConfig; /**< NPE B parity detection is to be enabled/disabled */
  160. IxParityENAccNpeConfig npeCConfig; /**< NPE C parity detection is to be enabled/disabled */
  161. IxParityENAccMcuConfig mcuConfig; /**< MCU pairty detection is to be enabled/disabled */
  162. IxParityENAccConfigOption swcpEnabled; /**< SWCP parity detection is to be enabled */
  163. IxParityENAccConfigOption aqmEnabled; /**< AQM parity detection is to be enabled */
  164. IxParityENAccEbcConfig ebcConfig; /**< Expansion Bus Controller parity detection is to be enabled/disabled */
  165. } IxParityENAccHWParityConfig;
  166. /**
  167. * @ingroup IxParityENAcc
  168. *
  169. * @struct IxParityENAccNpeParityErrorStats
  170. *
  171. * @brief NPE parity error statistics
  172. */
  173. typedef struct /* IxParityENAccNpeParityErrorStats */
  174. {
  175. UINT32 parityErrorsIMem; /**< Parity errors in Instruction Memory */
  176. UINT32 parityErrorsDMem; /**< Parity errors in Data Memory */
  177. UINT32 parityErrorsExternal; /**< Parity errors in NPE External Entities */
  178. } IxParityENAccNpeParityErrorStats;
  179. /**
  180. * @ingroup IxParityENAcc
  181. *
  182. * @struct IxParityENAccMcuParityErrorStats
  183. *
  184. * @brief DDR Memory Control Unit parity error statistics
  185. *
  186. * Note: There could be two outstanding parity errors at any given time whose address
  187. * details captured. If there is no room for the new interrupt then it would be treated
  188. * as overflow parity condition.
  189. */
  190. typedef struct /* IxParityENAccMcuParityErrorStats */
  191. {
  192. UINT32 parityErrorsSingleBit; /**< Parity errors of the type Single-Bit */
  193. UINT32 parityErrorsMultiBit; /**< Parity errors of the type Multi-Bit */
  194. UINT32 parityErrorsOverflow; /**< Parity errors when more than two parity errors occured */
  195. } IxParityENAccMcuParityErrorStats;
  196. /**
  197. * @ingroup IxParityENAcc
  198. *
  199. * @struct IxParityENAccEbcParityErrorStats
  200. *
  201. * @brief Expansion Bus Controller parity error statistics
  202. */
  203. typedef struct /* IxParityENAccEbcParityErrorStats */
  204. {
  205. UINT32 parityErrorsInbound; /**< Odd bit parity errors on inbound transfers */
  206. UINT32 parityErrorsOutbound; /**< Odd bit parity errors on outbound transfers */
  207. } IxParityENAccEbcParityErrorStats;
  208. /**
  209. * @ingroup IxParityENAcc
  210. *
  211. * @struct IxParityENAccParityErrorStats
  212. *
  213. * @brief Parity Error Statistics for the all the hardware blocks
  214. */
  215. typedef struct /**< IxParityENAccParityErrorStats */
  216. {
  217. IxParityENAccNpeParityErrorStats npeStats; /**< NPE parity error statistics */
  218. IxParityENAccMcuParityErrorStats mcuStats; /**< MCU parity error statistics */
  219. IxParityENAccEbcParityErrorStats ebcStats; /**< EBC parity error statistics */
  220. UINT32 swcpStats; /**< SWCP parity error statistics */
  221. UINT32 aqmStats; /**< AQM parity error statistics */
  222. } IxParityENAccParityErrorStats;
  223. /**
  224. * @ingroup IxParityENAcc
  225. *
  226. * @enum IxParityENAccParityErrorSource
  227. *
  228. * @brief The source of the parity error notification
  229. */
  230. typedef enum /**< IxParityENAccParityErrorSource */
  231. {
  232. IX_PARITYENACC_NPE_A_IMEM, /**< NPE A - Instruction memory */
  233. IX_PARITYENACC_NPE_A_DMEM, /**< NPE A - Data memory */
  234. IX_PARITYENACC_NPE_A_EXT, /**< NPE A - External Entity*/
  235. IX_PARITYENACC_NPE_B_IMEM, /**< NPE B - Instruction memory */
  236. IX_PARITYENACC_NPE_B_DMEM, /**< NPE B - Data memory */
  237. IX_PARITYENACC_NPE_B_EXT, /**< NPE B - External Entity*/
  238. IX_PARITYENACC_NPE_C_IMEM, /**< NPE C - Instruction memory */
  239. IX_PARITYENACC_NPE_C_DMEM, /**< NPE C - Data memory */
  240. IX_PARITYENACC_NPE_C_EXT, /**< NPE C - External Entity*/
  241. IX_PARITYENACC_SWCP, /**< SWCP */
  242. IX_PARITYENACC_AQM, /**< AQM */
  243. IX_PARITYENACC_MCU_SBIT, /**< DDR Memory Controller Unit - Single bit parity */
  244. IX_PARITYENACC_MCU_MBIT, /**< DDR Memory Controller Unit - Multi bit parity */
  245. IX_PARITYENACC_MCU_OVERFLOW, /**< DDR Memory Controller Unit - Parity errors in excess of two */
  246. IX_PARITYENACC_EBC_CS, /**< Expansion Bus Controller - Chip Select */
  247. IX_PARITYENACC_EBC_EXTMST /**< Expansion Bus Controller - External Master */
  248. } IxParityENAccParityErrorSource;
  249. /**
  250. * @ingroup IxParityENAcc
  251. *
  252. * @enum IxParityENAccParityErrorAccess
  253. *
  254. * @brief The type of access resulting in parity error
  255. */
  256. typedef enum /**< IxParityENAccParityErrorAccess */
  257. {
  258. IX_PARITYENACC_READ, /**< Read Access */
  259. IX_PARITYENACC_WRITE /**< Write Access */
  260. } IxParityENAccParityErrorAccess;
  261. /**
  262. * @ingroup IxParityENAcc
  263. *
  264. * @typedef IxParityENAccParityErrorAddress
  265. *
  266. * @brief The memory location which has parity error
  267. */
  268. typedef UINT32 IxParityENAccParityErrorAddress;
  269. /**
  270. * @ingroup IxParityENAcc
  271. *
  272. * @typedef IxParityENAccParityErrorData
  273. *
  274. * @brief The data read from the memory location which has parity error
  275. */
  276. typedef UINT32 IxParityENAccParityErrorData;
  277. /**
  278. * @ingroup IxParityENAcc
  279. *
  280. * @enum IxParityENAccParityErrorRequester
  281. *
  282. * @brief The requester interface through which the SDRAM memory access
  283. * resulted in the parity error.
  284. */
  285. typedef enum /**< IxParityENAccParityErrorRequester */
  286. {
  287. IX_PARITYENACC_MPI, /**< Direct Memory Port Interface */
  288. IX_PARITYENACC_AHB_BUS /**< South or North AHB Bus */
  289. } IxParityENAccParityErrorRequester;
  290. /**
  291. * @ingroup IxParityENAcc
  292. *
  293. * @enum IxParityENAccAHBErrorMaster
  294. *
  295. * @brief The Master on the AHB bus interface whose transaction might have
  296. * resulted in the parity error notification to XScale.
  297. */
  298. typedef enum /**< IxParityENAccAHBErrorMaster */
  299. {
  300. IX_PARITYENACC_AHBN_MST_NPE_A, /**< NPE - A */
  301. IX_PARITYENACC_AHBN_MST_NPE_B, /**< NPE - B */
  302. IX_PARITYENACC_AHBN_MST_NPE_C, /**< NPE - C */
  303. IX_PARITYENACC_AHBS_MST_XSCALE, /**< XScale Bus Interface Unit */
  304. IX_PARITYENACC_AHBS_MST_PBC, /**< PCI Bus Controller */
  305. IX_PARITYENACC_AHBS_MST_EBC, /**< Expansion Bus Controller */
  306. IX_PARITYENACC_AHBS_MST_AHB_BRIDGE, /**< AHB Bridge */
  307. IX_PARITYENACC_AHBS_MST_USBH /**< USB Host Controller */
  308. } IxParityENAccAHBErrorMaster;
  309. /**
  310. * @ingroup IxParityENAcc
  311. *
  312. * @enum IxParityENAccAHBErrorSlave
  313. *
  314. * @brief The Slave on the AHB bus interface whose transaction might have
  315. * resulted in the parity error notification to XScale.
  316. */
  317. typedef enum /**< IxParityENAccAHBErrorSlave */
  318. {
  319. IX_PARITYENACC_AHBN_SLV_MCU, /**< Memory Control Unit */
  320. IX_PARITYENACC_AHBN_SLV_AHB_BRIDGE, /**< AHB Bridge */
  321. IX_PARITYENACC_AHBS_SLV_MCU, /**< XScale Bus Interface Unit */
  322. IX_PARITYENACC_AHBS_SLV_APB_BRIDGE, /**< APB Bridge */
  323. IX_PARITYENACC_AHBS_SLV_AQM, /**< AQM */
  324. IX_PARITYENACC_AHBS_SLV_RSA, /**< RSA (Crypto Bus) */
  325. IX_PARITYENACC_AHBS_SLV_PBC, /**< PCI Bus Controller */
  326. IX_PARITYENACC_AHBS_SLV_EBC, /**< Expansion Bus Controller */
  327. IX_PARITYENACC_AHBS_SLV_USBH /**< USB Host Controller */
  328. } IxParityENAccAHBErrorSlave;
  329. /**
  330. * @ingroup IxParityENAcc
  331. *
  332. * @struct IxParityENAccAHBErrorTransaction
  333. *
  334. * @brief The Master and Slave on the AHB bus interface whose transaction might
  335. * have resulted in the parity error notification to XScale.
  336. *
  337. * NOTE: This information may be used in the data abort exception handler
  338. * to differentiate between the XScale and non-XScale access to the SDRAM
  339. * memory.
  340. */
  341. typedef struct /**< IxParityENAccAHBErrorTransaction */
  342. {
  343. IxParityENAccAHBErrorMaster ahbErrorMaster; /**< Master on AHB bus */
  344. IxParityENAccAHBErrorSlave ahbErrorSlave; /**< Slave on AHB bus */
  345. } IxParityENAccAHBErrorTransaction;
  346. /**
  347. * @ingroup IxParityENAcc
  348. *
  349. * @struct IxParityENAccParityErrorContextMessage
  350. *
  351. * @brief Parity Error Context Message
  352. */
  353. typedef struct /**< IxParityENAccParityErrorContextMessage */
  354. {
  355. IxParityENAccParityErrorSource pecParitySource; /**< Source info of parity error */
  356. IxParityENAccParityErrorAccess pecAccessType; /**< Read or Write Access
  357. Read - NPE, SWCP, AQM, DDR MCU,
  358. Exp Bus Ctrlr (Outbound)
  359. Write - DDR MCU,
  360. Exp Bus Ctrlr (Inbound
  361. i.e., External Master) */
  362. IxParityENAccParityErrorAddress pecAddress; /**< Address faulty location
  363. Valid only for AQM, DDR MCU,
  364. Exp Bus Ctrlr */
  365. IxParityENAccParityErrorData pecData; /**< Data read from the faulty location
  366. Valid only for AQM and DDR MCU
  367. For DDR MCU it is the bit location
  368. of the Single-bit parity */
  369. IxParityENAccParityErrorRequester pecRequester; /**< Requester of SDRAM memory access
  370. Valid only for the DDR MCU */
  371. IxParityENAccAHBErrorTransaction ahbErrorTran; /**< Master and Slave information on the
  372. last AHB Error Transaction */
  373. } IxParityENAccParityErrorContextMessage;
  374. /**
  375. * @ingroup IxParityENAcc
  376. *
  377. * @typedef IxParityENAccCallback
  378. *
  379. * @brief This prototype shows the format of a callback function.
  380. *
  381. * The callback will be used to notify the parity error to the client application.
  382. * The callback will be registered by @ref ixParityENAccCallbackRegister.
  383. *
  384. * It will be called from an ISR when a parity error is detected and thus
  385. * needs to follow the interrupt callable function conventions.
  386. *
  387. */
  388. typedef void (*IxParityENAccCallback) (void);
  389. /*
  390. * Prototypes for interface functions.
  391. */
  392. /**
  393. * @ingroup IxParityENAcc
  394. *
  395. * @fn IxParityENAccStatus ixParityENAccInit(void)
  396. *
  397. * @brief This function will initialise the IxParityENAcc component.
  398. *
  399. * This function will initialise the IxParityENAcc component. It should only be
  400. * called once, prior to using the IxParityENAcc component.
  401. *
  402. * <OL><LI>It initialises the internal data structures, registers the ISR that
  403. * will be triggered when a parity error occurs in IXP4xx silicon.</LI></OL>
  404. *
  405. * @li Re-entrant : No
  406. * @li ISR Callable : No
  407. *
  408. * @return @li IX_PARITYENACC_SUCCESS - Initialization is successful
  409. * @li IX_PARITYENACC_ALREADY_INITIALISED - The access layer has already
  410. * been initialized
  411. * @li IX_PARITYENACC_OPERATION_FAILED - The request failed because the
  412. * operation didn't succeed on the hardware. Refer to error trace/log
  413. * for details.
  414. */
  415. PUBLIC IxParityENAccStatus ixParityENAccInit(void);
  416. /**
  417. * @ingroup IxParityENAcc
  418. *
  419. * @fn IxParityENAccStatus ixParityENAccCallbackRegister (
  420. IxParityENAccCallback parityErrNfyCallBack)
  421. *
  422. * @brief This function will register a new callback with IxParityENAcc component.
  423. * It can also reregister a new callback replacing the old callback.
  424. *
  425. * @param parityErrNfyCallBack [in] - This parameter will specify the call-back
  426. * function supplied by the client application.
  427. *
  428. * This interface registers the user application supplied call-back handler with
  429. * the parity error handling access component after the init.
  430. *
  431. * The callback function will be called from an ISR that will be triggered by the
  432. * parity error in the IXP400 silicon.
  433. *
  434. * The following actions will be performed by this function:
  435. * <OL><LI>Check for the prior initialisation of the module before registering or
  436. * re-registering of the callback.
  437. * Check for parity error detection disabled before re-registration of the callback.
  438. * </LI></OL>
  439. *
  440. * @li Re-entrant : No
  441. * @li ISR Callable : No
  442. *
  443. * @return @li IX_PARITYENACC_SUCCESS - The parameters check passed and the
  444. * registration is successful.
  445. * @li IX_PARITYENACC_INVALID_PARAMETERS - Request failed due to NULL
  446. * parameter passed.
  447. * @li IX_PARITYENACC_OPERATION_FAILED - The request failed because the
  448. * parity error detection not yet disabled.
  449. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior to
  450. * the initialisation of the access layer.
  451. */
  452. PUBLIC IxParityENAccStatus ixParityENAccCallbackRegister (
  453. IxParityENAccCallback parityErrNfyCallBack);
  454. /**
  455. * @ingroup IxParityENAcc
  456. *
  457. * @fn IxParityENAccStatus ixParityENAccParityDetectionConfigure (
  458. const IxParityENAccHWParityConfig *hwParityConfig)
  459. *
  460. * @brief This interface allows the client application to enable the parity
  461. * error detection on the underlying hardware block.
  462. *
  463. * @param hwParityConfig [in] - Hardware blocks for which the parity error
  464. * detection is to be enabled or disabled.
  465. *
  466. * The client application allocates and provides the reference to the buffer.
  467. *
  468. * It will also verify whether the specific hardware block is functional or not.
  469. *
  470. * NOTE: Failure in enabling or disabling of one or more components result in
  471. * trace message but still returns IX_PARITYENACC_SUCCESS. Refer to the function
  472. * @ref ixParityENAccParityDetectionQuery on how to verify the failures while
  473. * enabling/disabling paritys error detection.
  474. *
  475. * It shall be invoked after the Init and CallbackRegister functions but before
  476. * any other function of the IxParityENAcc layer.
  477. *
  478. * @li Re-entrant : No
  479. * @li ISR Callable : No
  480. *
  481. * @return @li IX_PARITYENACC_SUCCESS - The parameters check passed and the
  482. * request to enable/disable is successful.
  483. * @li IX_PARITYENACC_INVALID_PARAMETERS-The request failed due to
  484. * NULL parameter supplied.
  485. * @li IX_PARITYENACC_OPERATION_FAILED - The request failed because the
  486. * operation didn't succeed on the hardware.
  487. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior to
  488. * the initialisation of the access layer.
  489. */
  490. PUBLIC IxParityENAccStatus ixParityENAccParityDetectionConfigure (
  491. const IxParityENAccHWParityConfig *hwParityConfig);
  492. /**
  493. * @ingroup IxParityENAcc
  494. *
  495. * @fn IxParityENAccStatus ixParityENAccParityDetectionQuery (
  496. IxParityENAccHWParityConfig * const hwParityConfig)
  497. *
  498. * @brief This interface allows the client application to determine the
  499. * status of the parity error detection on the specified hardware blocks
  500. *
  501. * @param hwParityConfig [out] - Hardware blocks whose parity error detection
  502. * has been enabled or disabled.
  503. *
  504. * The client application allocates and provides the reference to the buffer.
  505. *
  506. * This interface can be used immediately after the interface @ref
  507. * ixParityENAccParityDetectionConfigure to see on which of the hardware blocks
  508. * the parity error detection has either been enabled or disabled based on the
  509. * client application request.
  510. *
  511. * @li Re-entrant : No
  512. * @li ISR Callable : No
  513. *
  514. * @return @li IX_PARITYENACC_SUCCESS - The parameters check passed and the
  515. * request to query on whether the hardware parity error detection
  516. * is enabled or disabled is successful.
  517. * @li IX_PARITYENACC_INVALID_PARAMETERS-The request failed due to
  518. * NULL parameter or invalid values supplied.
  519. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior
  520. * to the initialisation of the access layer.
  521. */
  522. PUBLIC IxParityENAccStatus ixParityENAccParityDetectionQuery(
  523. IxParityENAccHWParityConfig * const hwParityConfig);
  524. /**
  525. * @ingroup IxParityENAcc
  526. *
  527. * @fn IxParityENAccStatus ixParityENAccParityErrorContextGet(
  528. IxParityENAccParityErrorContextMessage * const pecMessage)
  529. *
  530. * @brief This interface allows the client application to determine the
  531. * status of the parity error context on hardware block for which the
  532. * current parity error interrupt triggered.
  533. *
  534. * @param pecMessage [out] - The parity error context information of the
  535. * parity interrupt currently being process.
  536. *
  537. * The client application allocates and provides the reference to the buffer.
  538. *
  539. * Refer to the data structure @ref IxParityENAccParityErrorContextMessage
  540. * for details.
  541. *
  542. * The routine will will fetch the parity error context in the following
  543. * priority, if multiple parity errors observed.
  544. *
  545. * <pre>
  546. * 0 - MCU (Multi-bit and single-bit in that order)
  547. * 1 - NPE-A
  548. * 2 - NPE-B
  549. * 3 - NPE-C
  550. * 4 - SWCP
  551. * 5 - QM
  552. * 6 - EXP
  553. *
  554. * NOTE: The information provided in the @ref IxParityENAccAHBErrorTransaction
  555. * may be of help for the client application to decide on the course of action
  556. * to take. This info is taken from the Performance Monitoring Unit register
  557. * which records most recent error observed on the AHB bus. This information
  558. * might have been overwritten by some other error by the time it is retrieved.
  559. * </pre>
  560. *
  561. * @li Re-entrant : No
  562. * @li ISR Callable : Yes
  563. *
  564. * @return @li IX_PARITYENACC_SUCCESS-The parameters check passed and the
  565. * request to get the parity error context information is successful.
  566. * @li IX_PARITYENACC_INVALID_PARAMETERS-The request failed due to
  567. * NULL parameter is passed
  568. * @li IX_PARITYENACC_OPERATION_FAILED - The request failed because
  569. * the operation didn't succeed on the hardware.
  570. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior
  571. * to the initialisation of the access layer.
  572. * @li IX_PARITYENACC_NO_PARITY - No parity condition exits or has
  573. * already been cleared
  574. */
  575. PUBLIC IxParityENAccStatus ixParityENAccParityErrorContextGet(
  576. IxParityENAccParityErrorContextMessage * const pecMessage);
  577. /**
  578. * @ingroup IxParityENAcc
  579. *
  580. * @fn IxParityENAccStatus ixParityENAccParityErrorInterruptClear (
  581. const IxParityENAccParityErrorContextMessage *pecMessage)
  582. *
  583. * @brief This interface helps the client application to clear off the
  584. * interrupt condition on the hardware block identified in the parity
  585. * error context message. Please refer to the table below as the operation
  586. * varies depending on the interrupt source.
  587. *
  588. * @param pecMessage [in] - The parity error context information of the
  589. * hardware block whose parity error interrupt condition is to disabled.
  590. *
  591. * The client application allocates and provides the reference to the buffer.
  592. *
  593. * <pre>
  594. * ****************************************************************************
  595. * Following actions will be taken during the interrupt clear for respective
  596. * hardware blocks.
  597. *
  598. * Parity Source Actions taken during Interrupt clear
  599. * ------------- -------------------------------------------------------
  600. * NPE-A Interrupt will be masked off at the interrupt controller
  601. * so that it will not trigger continuously.
  602. * Client application has to take appropriate action and
  603. * re-configure the parity error detection subsequently.
  604. * The client application will not be notified of further
  605. * interrupts, until the re-configuration is done using
  606. * @ref ixParityENAccParityDetectionConfigure.
  607. *
  608. * NPE-B Interrupt will be masked off at the interrupt controller
  609. * so that it will not trigger continuously.
  610. * Client application has to take appropriate action and
  611. * re-configure the parity error detection subsequently.
  612. * The client application will not be notified of further
  613. * interrupts, until the re-configuration is done using
  614. * @ref ixParityENAccParityDetectionConfigure.
  615. *
  616. * NPE-C Interrupt will be masked off at the interrupt controller
  617. * Client application has to take appropriate action and
  618. * re-configure the parity error detection subsequently.
  619. * The client application will not be notified of further
  620. * interrupts, until the re-configuration is done using
  621. * @ref ixParityENAccParityDetectionConfigure.
  622. *
  623. * SWCP Interrupt will be masked off at the interrupt controller.
  624. * Client application has to take appropriate action and
  625. * re-configure the parity error detection subsequently.
  626. * The client application will not be notified of further
  627. * interrupts, until the re-configuration is done using
  628. * @ref ixParityENAccParityDetectionConfigure.
  629. *
  630. * AQM Interrupt will be masked off at the interrupt controller.
  631. * Client application has to take appropriate action and
  632. * re-configure the parity error detection subsequently.
  633. * The client application will not be notified of further
  634. * interrupts, until the re-configuration is done using
  635. * @ref ixParityENAccParityDetectionConfigure.
  636. *
  637. * MCU Parity interrupt condition is cleared at the SDRAM MCU for
  638. * the following:
  639. * 1. Single-bit
  640. * 2. Multi-bit
  641. * 3. Overflow condition i.e., more than two parity conditions
  642. * occurred
  643. * Note that single-parity errors do not result in data abort
  644. * and not all data aborts caused by multi-bit parity error.
  645. *
  646. * EXP Parity interrupt condition is cleared at the expansion bus
  647. * controller for the following:
  648. * 1. External master initiated Inbound write
  649. * 2. Internal master (IXP400) initiated Outbound read
  650. * ****************************************************************************
  651. * </pre>
  652. * @li Re-entrant : No
  653. * @li ISR Callable : No
  654. *
  655. * @return @li IX_PARITYENACC_SUCCESS-The parameters check passed and the request
  656. * to clear the parity error interrupt condition is successful.
  657. * @li IX_PARITYENACC_INVALID_PARAMETERS-The request failed due to
  658. * NULL parameters have been passed or contents have been
  659. * supplied with invalid values.
  660. * @li IX_PARITYENACC_OPERATION_FAILED - The request failed because
  661. * the operation didn't succeed on the hardware.
  662. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior
  663. * to the initialisation of the access layer.
  664. */
  665. PUBLIC IxParityENAccStatus ixParityENAccParityErrorInterruptClear (
  666. const IxParityENAccParityErrorContextMessage *pecMessage);
  667. /**
  668. * @ingroup IxParityENAcc
  669. *
  670. * @fn IxParityENAccStatus ixParityENAccStatsGet (
  671. IxParityENAccParityErrorStats * const ixParityErrorStats)
  672. *
  673. * @brief This interface allows the client application to retrieve parity
  674. * error statistics for all the hardware blocks
  675. *
  676. * @param ixParityErrorStats - [out] The statistics for all the hardware blocks.
  677. *
  678. * The client application allocates and provides the reference to the buffer.
  679. *
  680. * @li Re-entrant : No
  681. * @li ISR Callable : Yes
  682. *
  683. * @return @li IX_PARITYENACC_SUCCESS-The parameters check passed and the
  684. * request to retrieve parity error statistics for the hardware
  685. * block is successful.
  686. * @li IX_PARITYENACC_INVALID_PARAMETERS-The request failed due to a
  687. * NULL parameter passed.
  688. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested prior
  689. * to the initialisation of the access layer.
  690. */
  691. PUBLIC IxParityENAccStatus ixParityENAccStatsGet (
  692. IxParityENAccParityErrorStats * const ixParityErrorStats);
  693. /**
  694. * @ingroup IxParityENAcc
  695. *
  696. * @fn IxParityENAccStatus ixParityENAccStatsShow (void)
  697. *
  698. * @brief This interface allows the client application to print all the
  699. * parity error statistics.
  700. *
  701. * @li Re-entrant : No
  702. * @li ISR Callable : No
  703. *
  704. * @return @li IX_PARITYENACC_SUCCESS - The request to show the pairty
  705. * error statistics is successful.
  706. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested
  707. * prior to the initialisation of the access layer.
  708. */
  709. PUBLIC IxParityENAccStatus ixParityENAccStatsShow (void);
  710. /**
  711. * @ingroup IxParityENAcc
  712. *
  713. * @fn IxParityENAccStatus ixParityENAccStatsReset (void)
  714. *
  715. * @brief This interface allows the client application to reset all the
  716. * parity error statistics.
  717. *
  718. * @li Re-entrant : No
  719. * @li ISR Callable : No
  720. *
  721. * @return @li IX_PARITYENACC_SUCCESS - The request to reset the parity
  722. * error statistics is successful.
  723. * @li IX_PARITYENACC_NOT_INITIALISED - The operation requested
  724. * prior to the initialisation of the access layer.
  725. */
  726. PUBLIC IxParityENAccStatus ixParityENAccStatsReset (void);
  727. #endif /* IXPARITYENACC_H */
  728. #endif /* __ixp46X */
  729. /**
  730. * @} defgroup IxParityENAcc
  731. */