hw_dspintc.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /**
  2. * \file hw_dspintc.h
  3. *
  4. * \brief Hardware registers and fields for DSP interrupt controller
  5. */
  6. /*
  7. * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  8. */
  9. /*
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. *
  14. * Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. *
  17. * Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the
  20. * distribution.
  21. *
  22. * Neither the name of Texas Instruments Incorporated nor the names of
  23. * its contributors may be used to endorse or promote products derived
  24. * from this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  29. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  30. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  31. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  32. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  33. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  34. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  35. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. */
  39. #ifndef HW_DSPINTC_H_
  40. #define HW_DSPINTC_H_
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. /******************************************************************************
  45. ** DSP INTC REGISTER OFFSETS
  46. ******************************************************************************/
  47. /**
  48. * \brief Macros used in conjunction with DSP interrupt controller
  49. * base address for register addressing
  50. *
  51. * \param n - Register instance
  52. *
  53. * \note Minimum unit = 1 byte; Registers are 4 bytes
  54. */
  55. #define DSPINTC_EVTFLAG(n) (0x00000 + ((n)*4))
  56. #define DSPINTC_EVTSET(n) (0x00020 + ((n)*4))
  57. #define DSPINTC_EVTCLR(n) (0x00040 + ((n)*4))
  58. #define DSPINTC_EVTMASK(n) (0x00080 + ((n)*4))
  59. #define DSPINTC_MEVTFLAG(n) (0x000A0 + ((n)*4))
  60. #define DSPINTC_EXPMASK(n) (0x000C0 + ((n)*4))
  61. #define DSPINTC_MEXPFLAG(n) (0x000E0 + ((n)*4))
  62. #define DSPINTC_INTMUX(n) (0x00100 + ((n)*4))
  63. #define DSPINTC_INTXSTAT (0x00180)
  64. #define DSPINTC_INTXCLR (0x00184)
  65. #define DSPINTC_INTDMASK (0x00188)
  66. #define DSPINTC_AEGMUX(n) (0x10140 + ((n)*4))
  67. /******************************************************************************
  68. ** FIELD DEFINITION MACROS
  69. ******************************************************************************/
  70. /**
  71. * \registers EVENT REGISTERS
  72. *
  73. * \brief These registers manage the system events that are received by
  74. * the controller. These include flag, set, and clear registers
  75. * covering all system events.
  76. *
  77. * \param n - Any system event
  78. *
  79. * \note Shifting by (n & 31) ensures 0x1 does not shift by more than
  80. * 31 bits for system event IDs larger than 31. The proper event
  81. * register must first be identified.
  82. */
  83. /* Event Flag */
  84. #define DSPINTC_EVTFLAG_EF(n) (0x1 << ((n) & 31))
  85. /* Event Set */
  86. #define DSPINTC_EVTSET_ES(n) (0x1 << ((n) & 31))
  87. /* Event Clear */
  88. #define DSPINTC_EVTCLR_EC(n) (0x1 << ((n) & 31))
  89. /**
  90. * \registers EVENT COMBINER REGISTERS
  91. *
  92. * \brief These registers allow up to 32 events to be combined into a
  93. * single combined event which can then be used by the interrupt
  94. * selector.
  95. *
  96. * \param n - Any system event
  97. *
  98. * \note Shifting by (n & 31) ensures 0x1 does not shift by more than
  99. * 31 bits for system event IDs larger than 31. The proper event
  100. * combiner register must first be identified.
  101. */
  102. /* Event Mask */
  103. #define DSPINTC_EVTMASK_EM(n) (0x1 << ((n) & 31))
  104. /* Masked Event Flag */
  105. #define DSPINTC_MEVTFLAG_MEF(n) (0x1 << ((n) & 31))
  106. /**
  107. * \registers CPU INTERRUPT SELECTOR REGISTERS
  108. *
  109. * \brief These registers manage which system events trigger the
  110. * available CPU interrupts and also provide interrupt exception
  111. * information.
  112. *
  113. * \param n - Any CPU maskable interrupt
  114. */
  115. /* Interrupt Mux */
  116. #define DSPINTC_INTMUX_INTSEL_SHIFT(n) (((n) & 0x3) * 8)
  117. #define DSPINTC_INTMUX_INTSEL(n) (0x7F << DSPINTC_INTMUX_INTSEL_SHIFT(n))
  118. /* Interrupt Exception Status */
  119. #define DSPINTC_INTXSTAT_SYSINT (0xFF000000u)
  120. #define DSPINTC_INTXSTAT_SYSINT_SHIFT (0x00000018u)
  121. #define DSPINTC_INTXSTAT_CPUINT (0x00FF0000u)
  122. #define DSPINTC_INTXSTAT_CPUINT_SHIFT (0x00000010u)
  123. #define DSPINTC_INTXSTAT_DROP (0x00000001u)
  124. #define DSPINTC_INTXSTAT_DROP_SHIFT (0x00000000u)
  125. /* Interrupt Exception Clear */
  126. #define DSPINTC_INTXCLR_CLEAR (0x00000001u)
  127. #define DSPINTC_INTXCLR_CLEAR_SHIFT (0x00000000u)
  128. /* Dropped Interrupt Mask */
  129. #define DSPINTC_INTDMASK_IDM(n) (0x1 << (n))
  130. /**
  131. * \registers CPU EXCEPTION REGISTERS
  132. *
  133. * \brief
  134. *
  135. * \param
  136. *
  137. * \note Not yet defined...
  138. */
  139. /**
  140. * \registers ADVANCED EVENT GENERATOR MUX REGISTERS
  141. *
  142. * \brief
  143. *
  144. * \param
  145. *
  146. * \note Not yet defined...
  147. */
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif /* HW_DSPINTC_H_ */