csl_ipcAux.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. /* ============================================================================
  2. * Copyright (c) Texas Instruments Incorporated 2008, 2009
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the
  14. * distribution.
  15. *
  16. * Neither the name of Texas Instruments Incorporated nor the names of
  17. * its contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. */
  33. /**
  34. * @file csl_ipcAux.h
  35. *
  36. * @brief
  37. * API Auxilary header file for IPC CSL. It gives the definitions of the
  38. * query & control functions.
  39. *
  40. * \par
  41. * ============================================================================
  42. * @n (C) Copyright 2008, 2009, Texas Instruments, Inc.
  43. * @n Use of this software is controlled by the terms and conditions found
  44. * @n in the license agreement under which this software has been supplied.
  45. * ===========================================================================
  46. * \par
  47. */
  48. #ifndef CSL_IPCAUX_H_
  49. #define CSL_IPCAUX_H_
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53. #include <ti/csl/csl_ipc.h>
  54. /** @addtogroup CSL_IPC_FUNCTION
  55. @{ */
  56. /** ============================================================================
  57. * @n@b CSL_IPC_genNMIEvent
  58. *
  59. * @b Description
  60. * @n This function sets the NMIG bit of the NMI Generation Register (NMIGRx)
  61. * to create an NMI pulse to the GEM corresponding to the index
  62. * specified here.
  63. *
  64. * @b Arguments
  65. @verbatim
  66. index GEM number for which the NMI event is to be raised.
  67. @endverbatim
  68. *
  69. * <b> Return Value </b>
  70. * @n None
  71. *
  72. * <b> Pre Condition </b>
  73. * @n None.
  74. *
  75. * <b> Post Condition </b>
  76. * @n NMIG bit in the corresponding NMIGRx register configured.
  77. *
  78. * @b Writes
  79. * @n IPC_NMIGR_NMIG=1
  80. *
  81. * @b Example
  82. * @verbatim
  83. Example 1: Raise an NMI interrupt to Gem 2
  84. Uint32 index = 2;
  85. CSL_IPC_genNMIEvent (index);
  86. @endverbatim
  87. * =============================================================================
  88. */
  89. static inline void CSL_IPC_genNMIEvent (
  90. Uint32 index
  91. )
  92. {
  93. CSL_FINS (hIpc->NMIGR[index], IPC_NMIGR_NMIG, 1);
  94. return;
  95. }
  96. /** ============================================================================
  97. * @n@b CSL_IPC_genGEMInterrupt
  98. *
  99. * @b Description
  100. * @n This function sets the IPCG bit of the IPC Generation Register (IPCGRx)
  101. * to create an inter-DSP pulse to the GEM corresponding to the index
  102. * specified here. This API also configures the source ID for this
  103. * interrupt by setting the SRCSx bit of the IPCGRx register based on
  104. * the source ID specified.
  105. *
  106. * @b Arguments
  107. @verbatim
  108. index GEM number for which the interrupt is to be raised.
  109. srcId Indicates which of the 0-27 SRCSx bits needs to be set
  110. in the IPCGRx registers corresponding to the index specified.
  111. @endverbatim
  112. *
  113. * <b> Return Value </b>
  114. * @n None
  115. *
  116. * <b> Pre Condition </b>
  117. * @n None
  118. *
  119. * <b> Post Condition </b>
  120. * @n IPCG and SRCSx/SRCCx bits in the corresponding IPCGRx/IPCARx register
  121. * configured.
  122. *
  123. * @b Writes
  124. * @n IPC_IPCGR_IPCG=1,
  125. * IPC_IPCGR_SRCS0=1;
  126. * IPC_IPCGR_SRCS1=1;
  127. * IPC_IPCGR_SRCS2=1;
  128. * IPC_IPCGR_SRCS3=1;
  129. * IPC_IPCGR_SRCS4=1;
  130. * IPC_IPCGR_SRCS5=1;
  131. * IPC_IPCGR_SRCS6=1;
  132. * IPC_IPCGR_SRCS7=1;
  133. * IPC_IPCGR_SRCS8=1;
  134. * IPC_IPCGR_SRCS9=1;
  135. * IPC_IPCGR_SRCS10=1;
  136. * IPC_IPCGR_SRCS11=1;
  137. * IPC_IPCGR_SRCS12=1;
  138. * IPC_IPCGR_SRCS13=1;
  139. * IPC_IPCGR_SRCS14=1;
  140. * IPC_IPCGR_SRCS15=1;
  141. * IPC_IPCGR_SRCS16=1;
  142. * IPC_IPCGR_SRCS17=1;
  143. * IPC_IPCGR_SRCS18=1;
  144. * IPC_IPCGR_SRCS19=1;
  145. * IPC_IPCGR_SRCS20=1;
  146. * IPC_IPCGR_SRCS21=1;
  147. * IPC_IPCGR_SRCS22=1;
  148. * IPC_IPCGR_SRCS23=1;
  149. * IPC_IPCGR_SRCS24=1;
  150. * IPC_IPCGR_SRCS25=1;
  151. * IPC_IPCGR_SRCS26=1;
  152. * IPC_IPCGR_SRCS27=1;
  153. *
  154. * @b Affects
  155. * @n IPC_IPCAR_SRCC0=1;
  156. * IPC_IPCAR_SRCC1=1;
  157. * IPC_IPCAR_SRCC2=1;
  158. * IPC_IPCAR_SRCC3=1;
  159. * IPC_IPCAR_SRCC4=1;
  160. * IPC_IPCAR_SRCC5=1;
  161. * IPC_IPCAR_SRCC6=1;
  162. * IPC_IPCAR_SRCC7=1;
  163. * IPC_IPCAR_SRCC8=1;
  164. * IPC_IPCAR_SRCC9=1;
  165. * IPC_IPCAR_SRCC10=1;
  166. * IPC_IPCAR_SRCC11=1;
  167. * IPC_IPCAR_SRCC12=1;
  168. * IPC_IPCAR_SRCC13=1;
  169. * IPC_IPCAR_SRCC14=1;
  170. * IPC_IPCAR_SRCC15=1;
  171. * IPC_IPCAR_SRCC16=1;
  172. * IPC_IPCAR_SRCC17=1;
  173. * IPC_IPCAR_SRCC18=1;
  174. * IPC_IPCAR_SRCC19=1;
  175. * IPC_IPCAR_SRCC20=1;
  176. * IPC_IPCAR_SRCC21=1;
  177. * IPC_IPCAR_SRCC22=1;
  178. * IPC_IPCAR_SRCC23=1;
  179. * IPC_IPCAR_SRCC24=1;
  180. * IPC_IPCAR_SRCC25=1;
  181. * IPC_IPCAR_SRCC26=1;
  182. * IPC_IPCAR_SRCC27=1
  183. *
  184. * @b Example
  185. * @verbatim
  186. Example 1: An application running on GEM 2 is trying to raise
  187. an interrupt to Gem 1. The source Id for Gem 2 say is 2.
  188. Uint32 index = 1;
  189. Uint32 srcId = 2;
  190. CSL_IPC_genGEMInterrupt (index, srcId);
  191. @endverbatim
  192. * =============================================================================
  193. */
  194. static inline void CSL_IPC_genGEMInterrupt (
  195. Uint32 index,
  196. Uint32 srcId
  197. )
  198. {
  199. hIpc->IPCGR[index] = CSL_FMK (IPC_IPCGR_IPCG, 1) |
  200. CSL_FMKR (CSL_IPC_IPCGR_SRCS0_SHIFT + srcId, CSL_IPC_IPCGR_SRCS0_SHIFT + srcId, 1);
  201. return;
  202. }
  203. /** ============================================================================
  204. * @n@b CSL_IPC_isGEMInterruptSourceSet
  205. *
  206. * @b Description
  207. * @n This function checks if the SRCSx bit of the IPCGRx register is set.
  208. * It returns 1 if the SRCSx bit corresponding to the srcId is set in the
  209. * IPCGRx register corresponding to the index specified. Otherwise it returns
  210. * 0.
  211. *
  212. * @b Arguments
  213. @verbatim
  214. index GEM number for which the IPCGRx register needs to be checked.
  215. srcId Indicates which of the 0-27 SRCSx bits needs to be read
  216. in the IPCGRx registers corresponding to the index specified.
  217. @endverbatim
  218. *
  219. * <b> Return Value </b>
  220. * @n 1 - Indicates that the corresponding SRCSx bit is set and the
  221. * srcId specified is in fact the source for the IPC Gem interrupt. \n
  222. * 0 - Indicates that corresponding SRCSx bit not set and the
  223. * srcId specified is not the IPC source.
  224. *
  225. * <b> Pre Condition </b>
  226. * @n None
  227. *
  228. * <b> Post Condition </b>
  229. * @n None
  230. *
  231. * @b Reads
  232. * @n IPC_IPCGR_SRCS0;
  233. * IPC_IPCGR_SRCS1;
  234. * IPC_IPCGR_SRCS2;
  235. * IPC_IPCGR_SRCS3;
  236. * IPC_IPCGR_SRCS4;
  237. * IPC_IPCGR_SRCS5;
  238. * IPC_IPCGR_SRCS6;
  239. * IPC_IPCGR_SRCS7;
  240. * IPC_IPCGR_SRCS8;
  241. * IPC_IPCGR_SRCS9;
  242. * IPC_IPCGR_SRCS10;
  243. * IPC_IPCGR_SRCS11;
  244. * IPC_IPCGR_SRCS12;
  245. * IPC_IPCGR_SRCS13;
  246. * IPC_IPCGR_SRCS14;
  247. * IPC_IPCGR_SRCS15;
  248. * IPC_IPCGR_SRCS16;
  249. * IPC_IPCGR_SRCS17;
  250. * IPC_IPCGR_SRCS18;
  251. * IPC_IPCGR_SRCS19;
  252. * IPC_IPCGR_SRCS20;
  253. * IPC_IPCGR_SRCS21;
  254. * IPC_IPCGR_SRCS22;
  255. * IPC_IPCGR_SRCS23;
  256. * IPC_IPCGR_SRCS24;
  257. * IPC_IPCGR_SRCS25;
  258. * IPC_IPCGR_SRCS26;
  259. * IPC_IPCGR_SRCS27
  260. *
  261. * @b Example
  262. * @verbatim
  263. Example 1: An application running on Gem 1 received an interrupt and
  264. wants to check if the interrupt was from the core it was waiting on,
  265. i.e., the Gem 2.
  266. Uint32 index = 1;
  267. Uint32 srcId = 2;
  268. Uint32 retVal;
  269. retVal = CSL_IPC_isGEMInterruptSourceSet (index, srcId);
  270. if (retVal == 0)
  271. {
  272. ... // Maybe cotinue waiting for the IPC/message
  273. }
  274. else
  275. {
  276. ... // Do the needful processing.
  277. }
  278. @endverbatim
  279. * =============================================================================
  280. */
  281. static inline Uint32 CSL_IPC_isGEMInterruptSourceSet (
  282. Uint32 index,
  283. Uint32 srcId
  284. )
  285. {
  286. return CSL_FEXTR (hIpc->IPCGR[index], CSL_IPC_IPCGR_SRCS0_SHIFT + srcId, CSL_IPC_IPCGR_SRCS0_SHIFT + srcId);
  287. }
  288. /** ============================================================================
  289. * @n@b CSL_IPC_isGEMInterruptAckSet
  290. *
  291. * @b Description
  292. * @n This function checks if the SRCCx bit of the IPCARx register is set.
  293. * It returns 1 if the SRCCx bit corresponding to the srcId is set in the
  294. * IPCARx register corresponding to the index specified. Otherwise it returns
  295. * 0.
  296. *
  297. * @b Arguments
  298. @verbatim
  299. index GEM number for which the IPCARx register needs to be checked.
  300. srcId Indicates which of the 0-27 SRCCx bits needs to be read
  301. in the IPCARx registers corresponding to the index specified.
  302. @endverbatim
  303. *
  304. * <b> Return Value </b>
  305. * @n 1 - Indicates that the corresponding SRCCx bit is set and the
  306. * srcId specified is in fact the source for the IPC Gem interrupt. \n
  307. * 0 - Indicates that corresponding SRCCx bit not set and the
  308. * srcId specified is not the IPC source.
  309. *
  310. * <b> Pre Condition </b>
  311. * @n None
  312. *
  313. * <b> Post Condition </b>
  314. * @n None
  315. *
  316. * @b Reads
  317. * @n IPC_IPCAR_SRCC0;
  318. * IPC_IPCAR_SRCC1;
  319. * IPC_IPCAR_SRCC2;
  320. * IPC_IPCAR_SRCC3;
  321. * IPC_IPCAR_SRCC4;
  322. * IPC_IPCAR_SRCC5;
  323. * IPC_IPCAR_SRCC6;
  324. * IPC_IPCAR_SRCC7;
  325. * IPC_IPCAR_SRCC8;
  326. * IPC_IPCAR_SRCC9;
  327. * IPC_IPCAR_SRCC10;
  328. * IPC_IPCAR_SRCC11;
  329. * IPC_IPCAR_SRCC12;
  330. * IPC_IPCAR_SRCC13;
  331. * IPC_IPCAR_SRCC14;
  332. * IPC_IPCAR_SRCC15;
  333. * IPC_IPCAR_SRCC16;
  334. * IPC_IPCAR_SRCC17;
  335. * IPC_IPCAR_SRCC18;
  336. * IPC_IPCAR_SRCC19;
  337. * IPC_IPCAR_SRCC20;
  338. * IPC_IPCAR_SRCC21;
  339. * IPC_IPCAR_SRCC22;
  340. * IPC_IPCAR_SRCC23;
  341. * IPC_IPCAR_SRCC24;
  342. * IPC_IPCAR_SRCC25;
  343. * IPC_IPCAR_SRCC26;
  344. * IPC_IPCAR_SRCC27
  345. *
  346. * @b Example
  347. * @verbatim
  348. Uint32 index = 1;
  349. Uint32 srcId = 2;
  350. Uint32 retVal;
  351. retVal = CSL_IPC_isGEMInterruptAckSet (index, srcId);
  352. @endverbatim
  353. * =============================================================================
  354. */
  355. static inline Uint32 CSL_IPC_isGEMInterruptAckSet (
  356. Uint32 index,
  357. Uint32 srcId
  358. )
  359. {
  360. return CSL_FEXTR (hIpc->IPCAR[index], CSL_IPC_IPCAR_SRCC0_SHIFT + srcId, CSL_IPC_IPCAR_SRCC0_SHIFT + srcId);
  361. }
  362. /** ============================================================================
  363. * @n@b CSL_IPC_clearGEMInterruptSource
  364. *
  365. * @b Description
  366. * @n This function clears the interrupt source IDs by setting the SRCCx bit of
  367. * the IPC Acknowledgment Register (IPCARx) and SRCSx bit of IPC Generation
  368. * Register (IPCGRx) corresponding to the GEM index and Source ID specified.
  369. *
  370. * @b Arguments
  371. @verbatim
  372. index GEM number for which the interrupt surce is to be cleared.
  373. srcId Indicates which of the 0-27 SRCSx/SRCCx bits needs to be cleared
  374. in the IPCGRx/IPCARx registers corresponding to the index specified.
  375. @endverbatim
  376. *
  377. * <b> Return Value </b>
  378. * @n None
  379. *
  380. * <b> Pre Condition </b>
  381. * @n None
  382. *
  383. * <b> Post Condition </b>
  384. * @n SRCSx/SRCCx bits in the corresponding IPCGRx/IPCARx register are cleared.
  385. *
  386. * @b Writes
  387. * @n IPC_IPCAR_SRCC0=0;
  388. * IPC_IPCAR_SRCC1=0;
  389. * IPC_IPCAR_SRCC2=0;
  390. * IPC_IPCAR_SRCC3=0;
  391. * IPC_IPCAR_SRCC4=0;
  392. * IPC_IPCAR_SRCC5=0;
  393. * IPC_IPCAR_SRCC6=0;
  394. * IPC_IPCAR_SRCC7=0;
  395. * IPC_IPCAR_SRCC8=0;
  396. * IPC_IPCAR_SRCC9=0;
  397. * IPC_IPCAR_SRCC10=0;
  398. * IPC_IPCAR_SRCC11=0;
  399. * IPC_IPCAR_SRCC12=0;
  400. * IPC_IPCAR_SRCC13=0;
  401. * IPC_IPCAR_SRCC14=0;
  402. * IPC_IPCAR_SRCC15=0;
  403. * IPC_IPCAR_SRCC16=0;
  404. * IPC_IPCAR_SRCC17=0;
  405. * IPC_IPCAR_SRCC18=0;
  406. * IPC_IPCAR_SRCC19=0;
  407. * IPC_IPCAR_SRCC20=0;
  408. * IPC_IPCAR_SRCC21=0;
  409. * IPC_IPCAR_SRCC22=0;
  410. * IPC_IPCAR_SRCC23=0;
  411. * IPC_IPCAR_SRCC24=0;
  412. * IPC_IPCAR_SRCC25=0;
  413. * IPC_IPCAR_SRCC26=0;
  414. * IPC_IPCAR_SRCC27=0
  415. *
  416. * @b Affects
  417. * @n IPC_IPCGR_SRCS0=0,
  418. * IPC_IPCGR_SRCS1=0;
  419. * IPC_IPCGR_SRCS2=0;
  420. * IPC_IPCGR_SRCS3=0;
  421. * IPC_IPCGR_SRCS4=0;
  422. * IPC_IPCGR_SRCS5=0;
  423. * IPC_IPCGR_SRCS6=0;
  424. * IPC_IPCGR_SRCS7=0;
  425. * IPC_IPCGR_SRCS8=0;
  426. * IPC_IPCGR_SRCS9=0;
  427. * IPC_IPCGR_SRCS10=0;
  428. * IPC_IPCGR_SRCS11=0;
  429. * IPC_IPCGR_SRCS12=0;
  430. * IPC_IPCGR_SRCS13=0;
  431. * IPC_IPCGR_SRCS14=0;
  432. * IPC_IPCGR_SRCS15=0;
  433. * IPC_IPCGR_SRCS16=0;
  434. * IPC_IPCGR_SRCS17=0;
  435. * IPC_IPCGR_SRCS18=0;
  436. * IPC_IPCGR_SRCS19=0;
  437. * IPC_IPCGR_SRCS20=0;
  438. * IPC_IPCGR_SRCS21=0;
  439. * IPC_IPCGR_SRCS22=0;
  440. * IPC_IPCGR_SRCS23=0;
  441. * IPC_IPCGR_SRCS24=0;
  442. * IPC_IPCGR_SRCS25=0;
  443. * IPC_IPCGR_SRCS26=0;
  444. * IPC_IPCGR_SRCS27=0
  445. *
  446. * @b Example
  447. * @verbatim
  448. Example 1: Clear the interrupt for Gem 1 raised by Gem 2.
  449. Uint32 index = 1;
  450. Uint32 srcId = 2;
  451. CSL_IPC_clearGEMInterruptSource (index, srcId);
  452. @endverbatim
  453. * =============================================================================
  454. */
  455. static inline void CSL_IPC_clearGEMInterruptSource (
  456. Uint32 index,
  457. Uint32 srcId
  458. )
  459. {
  460. hIpc->IPCAR[index] = CSL_FMKR (CSL_IPC_IPCAR_SRCC0_SHIFT + srcId, CSL_IPC_IPCAR_SRCC0_SHIFT + srcId, 1);
  461. return;
  462. }
  463. /** ============================================================================
  464. * @n@b CSL_IPC_genHostInterrupt
  465. *
  466. * @b Description
  467. * @n This function sets the IPCG bit of the Host IPC Generation Register (IPCGRH)
  468. * to create an interrupt pulse on the device pin. This API also configures the
  469. * source ID for this interrupt by setting the SRCSx bit of the IPCGRHx
  470. * register based on the source ID specified.
  471. *
  472. * @b Arguments
  473. @verbatim
  474. srcId Indicates which of the 0-27 SRCSx bits needs to be set
  475. in the IPCGRH register.
  476. @endverbatim
  477. *
  478. * <b> Return Value </b>
  479. * @n None
  480. *
  481. * <b> Pre Condition </b>
  482. * @n None
  483. *
  484. * <b> Post Condition </b>
  485. * @n IPCG and SRCSx/SRCCx bits in the IPCGRH/IPCARH register configured.
  486. *
  487. * @b Writes
  488. * @n IPC_IPCGRH_IPCG=1,
  489. * IPC_IPCGRH_SRCS0=1;
  490. * IPC_IPCGRH_SRCS1=1;
  491. * IPC_IPCGRH_SRCS2=1;
  492. * IPC_IPCGRH_SRCS3=1;
  493. * IPC_IPCGRH_SRCS4=1;
  494. * IPC_IPCGRH_SRCS5=1;
  495. * IPC_IPCGRH_SRCS6=1;
  496. * IPC_IPCGRH_SRCS7=1;
  497. * IPC_IPCGRH_SRCS8=1;
  498. * IPC_IPCGRH_SRCS9=1;
  499. * IPC_IPCGRH_SRCS10=1;
  500. * IPC_IPCGRH_SRCS11=1;
  501. * IPC_IPCGRH_SRCS12=1;
  502. * IPC_IPCGRH_SRCS13=1;
  503. * IPC_IPCGRH_SRCS14=1;
  504. * IPC_IPCGRH_SRCS15=1;
  505. * IPC_IPCGRH_SRCS16=1;
  506. * IPC_IPCGRH_SRCS17=1;
  507. * IPC_IPCGRH_SRCS18=1;
  508. * IPC_IPCGRH_SRCS19=1;
  509. * IPC_IPCGRH_SRCS20=1;
  510. * IPC_IPCGRH_SRCS21=1;
  511. * IPC_IPCGRH_SRCS22=1;
  512. * IPC_IPCGRH_SRCS23=1;
  513. * IPC_IPCGRH_SRCS24=1;
  514. * IPC_IPCGRH_SRCS25=1;
  515. * IPC_IPCGRH_SRCS26=1;
  516. * IPC_IPCGRH_SRCS27=1
  517. *
  518. * @b Affects
  519. * IPC_IPCARH_SRCC0=1;
  520. * IPC_IPCARH_SRCC1=1;
  521. * IPC_IPCARH_SRCC2=1;
  522. * IPC_IPCARH_SRCC3=1;
  523. * IPC_IPCARH_SRCC4=1;
  524. * IPC_IPCARH_SRCC5=1;
  525. * IPC_IPCARH_SRCC6=1;
  526. * IPC_IPCARH_SRCC7=1;
  527. * IPC_IPCARH_SRCC8=1;
  528. * IPC_IPCARH_SRCC9=1;
  529. * IPC_IPCARH_SRCC10=1;
  530. * IPC_IPCARH_SRCC11=1;
  531. * IPC_IPCARH_SRCC12=1;
  532. * IPC_IPCARH_SRCC13=1;
  533. * IPC_IPCARH_SRCC14=1;
  534. * IPC_IPCARH_SRCC15=1;
  535. * IPC_IPCARH_SRCC16=1;
  536. * IPC_IPCARH_SRCC17=1;
  537. * IPC_IPCARH_SRCC18=1;
  538. * IPC_IPCARH_SRCC19=1;
  539. * IPC_IPCARH_SRCC20=1;
  540. * IPC_IPCARH_SRCC21=1;
  541. * IPC_IPCARH_SRCC22=1;
  542. * IPC_IPCARH_SRCC23=1;
  543. * IPC_IPCARH_SRCC24=1;
  544. * IPC_IPCARH_SRCC25=1;
  545. * IPC_IPCARH_SRCC26=1;
  546. * IPC_IPCARH_SRCC27=1
  547. *
  548. * @b Example
  549. * @verbatim
  550. Example 1: An application running on GEM 2 is trying to raise
  551. a host interrupt.
  552. Uint32 srcId = 2;
  553. CSL_IPC_genHostInterrupt (srcId);
  554. @endverbatim
  555. * =============================================================================
  556. */
  557. static inline void CSL_IPC_genHostInterrupt (
  558. Uint32 srcId
  559. )
  560. {
  561. hIpc->IPCGRH = CSL_FMK (IPC_IPCGRH_IPCG, 1) |
  562. CSL_FMKR (CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId, CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId, 1);
  563. return;
  564. }
  565. /** ============================================================================
  566. * @n@b CSL_IPC_isHostInterruptSourceSet
  567. *
  568. * @b Description
  569. * @n This function checks if the SRCSx bit of the IPCGRH register is set.
  570. * It returns 1 if the SRCSx bit corresponding to the srcId is set in the
  571. * IPCGRH register. Otherwise it returns 0.
  572. *
  573. * @b Arguments
  574. @verbatim
  575. srcId Indicates which of the 0-27 SRCSx bits needs to be read
  576. in the IPCGRH register.
  577. @endverbatim
  578. *
  579. * <b> Return Value </b>
  580. * @n 1 - Indicates that the corresponding SRCSx bit is set and the
  581. * srcId specified is in fact the source for the IPC Host interrupt. \n
  582. * 0 - Indicates that corresponding SRCSx bit not set and the
  583. * srcId specified is not the IPC source.
  584. *
  585. * <b> Pre Condition </b>
  586. * @n None
  587. *
  588. * <b> Post Condition </b>
  589. * @n None
  590. *
  591. * @b Reads
  592. * @n IPC_IPCGRH_SRCS0;
  593. * IPC_IPCGRH_SRCS1;
  594. * IPC_IPCGRH_SRCS2;
  595. * IPC_IPCGRH_SRCS3;
  596. * IPC_IPCGRH_SRCS4;
  597. * IPC_IPCGRH_SRCS5;
  598. * IPC_IPCGRH_SRCS6;
  599. * IPC_IPCGRH_SRCS7;
  600. * IPC_IPCGRH_SRCS8;
  601. * IPC_IPCGRH_SRCS9;
  602. * IPC_IPCGRH_SRCS10;
  603. * IPC_IPCGRH_SRCS11;
  604. * IPC_IPCGRH_SRCS12;
  605. * IPC_IPCGRH_SRCS13;
  606. * IPC_IPCGRH_SRCS14;
  607. * IPC_IPCGRH_SRCS15;
  608. * IPC_IPCGRH_SRCS16;
  609. * IPC_IPCGRH_SRCS17;
  610. * IPC_IPCGRH_SRCS18;
  611. * IPC_IPCGRH_SRCS19;
  612. * IPC_IPCGRH_SRCS20;
  613. * IPC_IPCGRH_SRCS21;
  614. * IPC_IPCGRH_SRCS22;
  615. * IPC_IPCGRH_SRCS23;
  616. * IPC_IPCGRH_SRCS24;
  617. * IPC_IPCGRH_SRCS25;
  618. * IPC_IPCGRH_SRCS26;
  619. * IPC_IPCGRH_SRCS27
  620. *
  621. * @b Example
  622. * @verbatim
  623. Example 1: Check if the host interrupt's source was set correctly
  624. to 2, i.e., the Gem 2 the source of the host interrupt.
  625. Uint32 srcId = 2;
  626. Uint32 retVal;
  627. retVal = CSL_IPC_isHostInterruptSourceSet (srcId);
  628. if (retVal == 0)
  629. {
  630. ... // Do something.
  631. }
  632. else
  633. {
  634. ... // Do the needful processing.
  635. }
  636. @endverbatim
  637. * =============================================================================
  638. */
  639. static inline Uint32 CSL_IPC_isHostInterruptSourceSet (
  640. Uint32 srcId
  641. )
  642. {
  643. return CSL_FEXTR (hIpc->IPCGRH, CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId, CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId);
  644. }
  645. /** ============================================================================
  646. * @n@b CSL_IPC_isHostInterruptAckSet
  647. *
  648. * @b Description
  649. * @n This function checks if the SRCCx bit of the IPCARH register is set.
  650. * It returns 1 if the SRCCx bit corresponding to the srcId is set in the
  651. * IPCARH register. Otherwise it returns 0.
  652. *
  653. * @b Arguments
  654. @verbatim
  655. srcId Indicates which of the 0-27 SRCCx bits needs to be read
  656. in the IPCARH register.
  657. @endverbatim
  658. *
  659. * <b> Return Value </b>
  660. * @n 1 - Indicates that the corresponding SRCCx bit is set and the
  661. * srcId specified is in fact the source for the IPC Host interrupt. \n
  662. * 0 - Indicates that corresponding SRCCx bit not set and the
  663. * srcId specified is not the IPC source.
  664. *
  665. * <b> Pre Condition </b>
  666. * @n None
  667. *
  668. * <b> Post Condition </b>
  669. * @n None
  670. *
  671. * @b Reads
  672. * @n IPC_IPCARH_SRCC0;
  673. * IPC_IPCARH_SRCC1;
  674. * IPC_IPCARH_SRCC2;
  675. * IPC_IPCARH_SRCC3;
  676. * IPC_IPCARH_SRCC4;
  677. * IPC_IPCARH_SRCC5;
  678. * IPC_IPCARH_SRCC6;
  679. * IPC_IPCARH_SRCC7;
  680. * IPC_IPCARH_SRCC8;
  681. * IPC_IPCARH_SRCC9;
  682. * IPC_IPCARH_SRCC10;
  683. * IPC_IPCARH_SRCC11;
  684. * IPC_IPCARH_SRCC12;
  685. * IPC_IPCARH_SRCC13;
  686. * IPC_IPCARH_SRCC14;
  687. * IPC_IPCARH_SRCC15;
  688. * IPC_IPCARH_SRCC16;
  689. * IPC_IPCARH_SRCC17;
  690. * IPC_IPCARH_SRCC18;
  691. * IPC_IPCARH_SRCC19;
  692. * IPC_IPCARH_SRCC20;
  693. * IPC_IPCARH_SRCC21;
  694. * IPC_IPCARH_SRCC22;
  695. * IPC_IPCARH_SRCC23;
  696. * IPC_IPCARH_SRCC24;
  697. * IPC_IPCARH_SRCC25;
  698. * IPC_IPCARH_SRCC26;
  699. * IPC_IPCARH_SRCC27
  700. *
  701. * @b Example
  702. * @verbatim
  703. Uint32 srcId = 2;
  704. Uint32 retVal;
  705. retVal = CSL_IPC_isHostInterruptAckSet (srcId);
  706. @endverbatim
  707. * =============================================================================
  708. */
  709. static inline Uint32 CSL_IPC_isHostInterruptAckSet (
  710. Uint32 srcId
  711. )
  712. {
  713. return CSL_FEXTR (hIpc->IPCARH, CSL_IPC_IPCARH_SRCC0_SHIFT + srcId, CSL_IPC_IPCARH_SRCC0_SHIFT + srcId);
  714. }
  715. /** ============================================================================
  716. * @n@b CSL_IPC_clearHostInterruptSource
  717. *
  718. * @b Description
  719. * @n This function clears the interrupt source IDs by setting the SRCCx bit
  720. * of the Host IPC Acknowledgment Register (IPCARH) and SRCSx bit of Host
  721. * IPC Generation Register (IPCGRH) corresponding to the Source ID specified.
  722. *
  723. * @b Arguments
  724. @verbatim
  725. srcId Indicates which of the 0-27 SRCSx/SRCCx bits needs to be cleared
  726. in the IPCGRH/IPCARH registers.
  727. @endverbatim
  728. *
  729. * <b> Return Value </b>
  730. * @n None
  731. *
  732. * <b> Pre Condition </b>
  733. * @n None
  734. *
  735. * <b> Post Condition </b>
  736. * @n SRCSx/SRCCx bits in the corresponding IPCGRH/IPCARH register are cleared.
  737. *
  738. * @b Writes
  739. * @n IPC_IPCARH_SRCC0=0;
  740. * IPC_IPCARH_SRCC1=0;
  741. * IPC_IPCARH_SRCC2=0;
  742. * IPC_IPCARH_SRCC3=0;
  743. * IPC_IPCARH_SRCC4=0;
  744. * IPC_IPCARH_SRCC5=0;
  745. * IPC_IPCARH_SRCC6=0;
  746. * IPC_IPCARH_SRCC7=0;
  747. * IPC_IPCARH_SRCC8=0;
  748. * IPC_IPCARH_SRCC9=0;
  749. * IPC_IPCARH_SRCC10=0;
  750. * IPC_IPCARH_SRCC11=0;
  751. * IPC_IPCARH_SRCC12=0;
  752. * IPC_IPCARH_SRCC13=0;
  753. * IPC_IPCARH_SRCC14=0;
  754. * IPC_IPCARH_SRCC15=0;
  755. * IPC_IPCARH_SRCC16=0;
  756. * IPC_IPCARH_SRCC17=0;
  757. * IPC_IPCARH_SRCC18=0;
  758. * IPC_IPCARH_SRCC19=0;
  759. * IPC_IPCARH_SRCC20=0;
  760. * IPC_IPCARH_SRCC21=0;
  761. * IPC_IPCARH_SRCC22=0;
  762. * IPC_IPCARH_SRCC23=0;
  763. * IPC_IPCARH_SRCC24=0;
  764. * IPC_IPCARH_SRCC25=0;
  765. * IPC_IPCARH_SRCC26=0;
  766. * IPC_IPCARH_SRCC27=0
  767. *
  768. * @b Affects
  769. * @n IPC_IPCGRH_SRCS0=0;
  770. * IPC_IPCGRH_SRCS1=0;
  771. * IPC_IPCGRH_SRCS2=0;
  772. * IPC_IPCGRH_SRCS3=0;
  773. * IPC_IPCGRH_SRCS4=0;
  774. * IPC_IPCGRH_SRCS5=0;
  775. * IPC_IPCGRH_SRCS6=0;
  776. * IPC_IPCGRH_SRCS7=0;
  777. * IPC_IPCGRH_SRCS8=0;
  778. * IPC_IPCGRH_SRCS9=0;
  779. * IPC_IPCGRH_SRCS10=0;
  780. * IPC_IPCGRH_SRCS11=0;
  781. * IPC_IPCGRH_SRCS12=0;
  782. * IPC_IPCGRH_SRCS13=0;
  783. * IPC_IPCGRH_SRCS14=0;
  784. * IPC_IPCGRH_SRCS15=0;
  785. * IPC_IPCGRH_SRCS16=0;
  786. * IPC_IPCGRH_SRCS17=0;
  787. * IPC_IPCGRH_SRCS18=0;
  788. * IPC_IPCGRH_SRCS19=0;
  789. * IPC_IPCGRH_SRCS20=0;
  790. * IPC_IPCGRH_SRCS21=0;
  791. * IPC_IPCGRH_SRCS22=0;
  792. * IPC_IPCGRH_SRCS23=0;
  793. * IPC_IPCGRH_SRCS24=0;
  794. * IPC_IPCGRH_SRCS25=0;
  795. * IPC_IPCGRH_SRCS26=0;
  796. * IPC_IPCGRH_SRCS27=0;
  797. *
  798. * @b Example
  799. * @verbatim
  800. Example 1: Clear the host interrupt raised by Gem 2.
  801. Uint32 srcId = 2;
  802. CSL_IPC_clearHostInterruptSource (srcId);
  803. @endverbatim
  804. * =============================================================================
  805. */
  806. static inline void CSL_IPC_clearHostInterruptSource (
  807. Uint32 srcId
  808. )
  809. {
  810. hIpc->IPCARH = CSL_FMKR (CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId, CSL_IPC_IPCGRH_SRCS0_SHIFT + srcId, 1);
  811. return;
  812. }
  813. #ifdef __cplusplus
  814. }
  815. #endif
  816. /* @} */
  817. #endif /*CSL_IPCAUX_H_*/