csl_chip.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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_chip.h
  35. *
  36. * @brief
  37. * API header file for CHIP module CSL
  38. *
  39. * \par
  40. * ============================================================================
  41. * @n (C) Copyright 2008, 2009, Texas Instruments, Inc.
  42. * @n Use of this software is controlled by the terms and conditions found
  43. * @n in the license agreement under which this software has been supplied.
  44. * ===========================================================================
  45. * \par
  46. */
  47. /** @defgroup CSL_CHIP_API CHIP
  48. *
  49. * @section Introduction
  50. *
  51. * @subsection xxx Overview
  52. * This module deals with all System On Chip (SOC) configurations. It consists
  53. * of Configuration Registers specific for the chip. Following are the Registers
  54. * associated with the CHIP module: \n
  55. *
  56. * (1) Addressing Mode Register - This register specifies the addressing
  57. * mode for the registers which can perform linear or circular addressing,
  58. * also contain sizes for circular addressing \n
  59. *
  60. * (2) Control Status Register - This register contains the control and status
  61. * bits. This register is used to control the mode of cache. This is also
  62. * used to enable or disable all the interrupts except reset and
  63. * non maskable interrupt. \n
  64. *
  65. * (3) Interrupt Flag Register - This register contains the status of
  66. * INT4-INT15 and NMI interrupt. Each corresponding bit in the IFR is set
  67. * to 1 when that interrupt occurs; otherwise, the bits are cleared to 0. \n
  68. *
  69. * (4) Interrupt Set Register - This register allows user to manually set the
  70. * maskable interrupts (INT4-INT15) in the interrupt flag register (IFR).
  71. * Writing a 1 to any of the bits in ISR causes the corresponding interrupt
  72. * flag to be set in IFR. \n
  73. *
  74. * (5) Interrupt Clear Register - This register allows user to manually clear
  75. * the maskable interrupts (INT15-INT4) in the interrupt flag register
  76. * (IFR). Writing a 1 to any of the bits in ICR causes the corresponding
  77. * interrupt flag to be cleared in IFR. \n
  78. *
  79. * (6) Interrupt Enable Register - This register enables and disables individual
  80. * interrupts and this not accessible in User mode. \n
  81. *
  82. * (7) Interrupt Service Table Pointer Register - This register is used to
  83. * locate the interrupt service routine (ISR). \n
  84. *
  85. * (8) Interrupt Return Pointer Register - This register contains the return
  86. * pointer that directs the CPU to the proper location to continue program
  87. * execution after processing a maskable interrupt. \n
  88. *
  89. * (9) Nonmaskable Interrupt (NMI) Return Pointer Register - This register
  90. * contains the return pointer that directs the CPU to the proper location
  91. * to continue program execution after processing of a non-maskable
  92. * interrupt (NMI). \n
  93. *
  94. * (10)Exception Return Pointer Register - This register contains the return
  95. * pointer that directs the CPU to the proper location to continue program
  96. * execution after processing of a exception. \n
  97. *
  98. * (11)Time Stamp Counter Registers - The CPU contains a free running 64-bit
  99. * counter that advances each CPU clock after counting is enabled. The counter
  100. * is accessed using two 32-bit read-only control registers, Time Stamp Counter
  101. * Registers - Low (TSCL) and Time Stamp Counter Registers - High (TSCH). The
  102. * counter is enabled by writing to TSCL. The value written is ignored. Once
  103. * enabled, counting cannot be disabled under program control. Counting is
  104. * disabled in the following cases:
  105. * a. After exiting the reset state.
  106. * b. When the CPU is fully powered down. \n
  107. *
  108. * (12)Analysis Return Pointer \n
  109. *
  110. * (13)SPLOOP Inner Loop Count Register - The SPLOOP or SPLOOPD instructions
  111. * use the SPLOOP inner loop count register (ILC), as the count of the number
  112. * of iterations left to perform. The ILC content is decremented at each stage
  113. * boundary until the ILC content reaches 0. \n
  114. *
  115. * (14)SPLOOP Reload Inner Loop Count Register - Predicated SPLOOP or
  116. * SPLOOPD instructions used in conjunction with a SPMASKR or SPKERNELR
  117. * instruction use the SPLOOP reload inner loop count register (RILC), as
  118. * the iteration count value to be written to the SPLOOP inner loop count
  119. * register (ILC) in the cycle before the reload operation begins. \n
  120. *
  121. * (15)Restricted Entry Point Address Register - This register is used by the
  122. * SWENR instruction as the target of the change of control when an SWENR
  123. * instruction is issued. The contents of REP should be preinitialized by the
  124. * processor in Supervisor mode before any SWENR instruction is issued. \n
  125. *
  126. * (16)E1 Phase Program Counter - This register contains the 32-bit address of the
  127. * fetch packet in the E1 pipeline phase. \n
  128. *
  129. * (17)DSP Core Number Register - This register provides an identifier to shared
  130. * resources in the system which identifies which CPU is accessing those
  131. * resources. The contents of this register are set to a specific value at reset. \n
  132. *
  133. * (18)Saturation Status Register - This register provides saturation flags for
  134. * each functional unit, making it possible for the program to distinguish
  135. * between saturations caused by different instructions in the same execute
  136. * packet. \n
  137. *
  138. * (19)GMPY Polynomial.A Side Register - The GMPY instruction uses the 32-bit
  139. * polynomial in the GMPY polynomial-A side register (GPLYA), when the
  140. * instruction is executed on the M1 unit. \n
  141. *
  142. * (20)GMPY Polynomial.B Side Register - The GMPY instruction uses the 32-bit
  143. * polynomial in the GMPY polynomial-B side register (GPLYB), when the
  144. * instruction is executed on the M2 unit. \n
  145. *
  146. * (21)Galois Field Polynomial Generator Function Register - This register
  147. * controls the field size and the Galois field polynomial generator of the
  148. * Galois field multiply hardware. \n
  149. *
  150. * (22)Debug Interrupt Enable Register - This register is used to designate
  151. * which interrupts and exceptions are treated as high priority interrupts
  152. * when operating in real-time emulation mode. \n
  153. *
  154. * (23)Task State Register - This register contains all of the status bits that
  155. * determine or indicate the current execution environment. TSR is saved in the
  156. * event of an interrupt or exception to the ITSR or NTSR, respectively. \n
  157. *
  158. * (24)Interrupt Task State Register - This register is used to store the
  159. * contents of the task state register (TSR) in the event of an interrupt. \n
  160. *
  161. * (25)NMI/Exception Task State Register - This register is used to store
  162. * the contents of the task state register (TSR) and the conditions under
  163. * which an exception occurred in the event of a nonmaskable interrupt (NMI) or
  164. * an exception. \n
  165. *
  166. * (26)Exception Flag Register - This register contains bits that indicate
  167. * which exceptions have been detected. Clearing the EFR bits is done by
  168. * writing a 1 to the corresponding bit position in the exception clear
  169. * register (ECR). \n
  170. *
  171. * (27)Exception Clear Register - This register is used to clear individual
  172. * bits in the exception flag register (EFR). Writing a 1 to any bit in ECR
  173. * clears the corresponding bit in EFR. \n
  174. *
  175. * (28)Internal Exception Report Register - This register contains flags that
  176. * indicate the cause of the internal exception. \n
  177. */
  178. #ifndef CSL_CHIP_H
  179. #define CSL_CHIP_H
  180. #ifdef __cplusplus
  181. extern "C" {
  182. #endif
  183. #include <ti/csl/csl.h>
  184. #include <ti/csl/cslr_chip.h>
  185. #if defined(_TMS320C6X)
  186. #include <c6x.h>
  187. #endif
  188. #include <ti/csl/soc.h>
  189. /**
  190. @defgroup CSL_CHIP_ENUM CHIP Enumerated Data Types
  191. @ingroup CSL_CHIP_API
  192. */
  193. /**
  194. @defgroup CSL_CHIP_FUNCTION CHIP Functions
  195. @ingroup CSL_CHIP_API
  196. */
  197. /* CHIP global macro declarations */
  198. /* CHIP global typedef declarations */
  199. /** @addtogroup CSL_CHIP_ENUM
  200. @{ */
  201. /** Enum for the CHIP registers */
  202. typedef enum {
  203. /** Addressing Mode Register */
  204. CSL_CHIP_AMR = 0,
  205. /** Control Status Register */
  206. CSL_CHIP_CSR = 1,
  207. /** Interrupt Flag Register */
  208. CSL_CHIP_IFR = 2,
  209. /** Interrupt Set Register */
  210. CSL_CHIP_ISR = 2,
  211. /** Interrupt Clear Register */
  212. CSL_CHIP_ICR = 3,
  213. /** Interrupt Enable Register */
  214. CSL_CHIP_IER = 4,
  215. /** Interrupt Service Table Pointer Register */
  216. CSL_CHIP_ISTP= 5,
  217. /** Interrupt Return Pointer Register */
  218. CSL_CHIP_IRP= 6,
  219. /** Nonmaskable Interrupt (NMI) Return Pointer Register */
  220. CSL_CHIP_NRP= 7,
  221. /** Exception Return Pointer Register */
  222. CSL_CHIP_ERP= 7,
  223. /** Time Stamp Counter Register - Low */
  224. CSL_CHIP_TSCL= 10,
  225. /** Time Stamp Counter Registers - High */
  226. CSL_CHIP_TSCH= 11,
  227. /** Analysis Return Pointer */
  228. CSL_CHIP_ARP= 12,
  229. /** SPLOOP Inner Loop Count Register */
  230. CSL_CHIP_ILC= 13,
  231. /** SPLOOP Reload Inner Loop Count Register */
  232. CSL_CHIP_RILC= 14,
  233. /** Restricted Entry Point Address Register */
  234. CSL_CHIP_REP= 15,
  235. /** E1 Phase Program Counter */
  236. CSL_CHIP_PCE1= 16,
  237. /** DSP Core Number Register */
  238. CSL_CHIP_DNUM= 17,
  239. /** Saturation Status Register */
  240. CSL_CHIP_SSR= 21,
  241. /** GMPY Polynomial.A Side Register */
  242. CSL_CHIP_GPLYA= 22,
  243. /** GMPY Polynomial.B Side Register */
  244. CSL_CHIP_GPLYB= 23,
  245. /** Galois Field Polynomial Generator Function Register */
  246. CSL_CHIP_GFPGFR= 24,
  247. /** Debug interrupt enable register */
  248. CSL_CHIP_DIER=25,
  249. /** Task State Register */
  250. CSL_CHIP_TSR= 26,
  251. /** Interrupt Task State Register */
  252. CSL_CHIP_ITSR= 27,
  253. /** NMI/Exception Task State Register */
  254. CSL_CHIP_NTSR= 28,
  255. /** Exception Flag Register */
  256. CSL_CHIP_EFR= 29,
  257. /** Exception Clear Register */
  258. CSL_CHIP_ECR= 29,
  259. /** Internal Exception Report Register */
  260. CSL_CHIP_IERR= 31
  261. } CSL_ChipReg;
  262. /**
  263. @}
  264. */
  265. /* CHIP global function declarations */
  266. extern Uint32 CSL_chipWriteReg (
  267. CSL_ChipReg reg,
  268. CSL_Reg32 val
  269. );
  270. extern Uint32 CSL_chipReadReg(
  271. CSL_ChipReg reg
  272. );
  273. #ifdef __cplusplus
  274. }
  275. #endif
  276. #endif