csl_xmc.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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_xmc.h
  35. *
  36. * @brief
  37. * XMC CSL Implementation on DSP side
  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_XMC_API XMC
  48. *
  49. * @section Introduction
  50. *
  51. * @subsection xxx Overview
  52. *
  53. * The XMC takes on the following roles:
  54. * a) UMC to VBusM conversion
  55. * b) Shared memory access path
  56. * c) Prefetch support
  57. * d) Address extension/translation
  58. * e) Memory protection for addresses outside CGEM eg. MSMC RAM or EMIF
  59. *
  60. * @subsection References
  61. * -# XMC User's Guide
  62. *
  63. * @subsection Assumptions
  64. * The abbreviations XMC, xmc and Xmc have been used throughout this
  65. * document to refer to CGEM eXtended Memory Controller
  66. */
  67. #ifndef CSL_XMC_H
  68. #define CSL_XMC_H
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72. #include <ti/csl/soc.h>
  73. #include <ti/csl/csl.h>
  74. #include <ti/csl/cslr_xmc.h>
  75. /**
  76. @defgroup CSL_XMC_SYMBOL XMC Symbols Defined
  77. @ingroup CSL_XMC_API
  78. */
  79. /**
  80. @defgroup CSL_XMC_DATASTRUCT XMC Data Structures
  81. @ingroup CSL_XMC_API
  82. */
  83. /**
  84. @defgroup CSL_XMC_FUNCTION XMC Functions
  85. @ingroup CSL_XMC_API
  86. */
  87. /** @addtogroup CSL_XMC_DATASTRUCT
  88. @{ */
  89. /** @brief This is the definition of CSL_XMC_XMPAXH */
  90. typedef struct CSL_XMC_XMPAXH_s
  91. {
  92. /** Base Address */
  93. Uint32 bAddr;
  94. /** Encoded Segment Size */
  95. Uint8 segSize;
  96. }CSL_XMC_XMPAXH;
  97. /** @brief This is the definition of CSL_XMC_XMPAXL */
  98. typedef struct CSL_XMC_XMPAXL_s
  99. {
  100. /** Replacement Address */
  101. Uint32 rAddr;
  102. /** When set, supervisor may read from segment */
  103. Uint32 sr;
  104. /** When set, supervisor may write to segment */
  105. Uint32 sw;
  106. /** When set, supervisor may execute from segment */
  107. Uint32 sx;
  108. /** When set, user may read from segment */
  109. Uint32 ur;
  110. /** When set, user may write to segment */
  111. Uint32 uw;
  112. /** When set, user may execute from segment */
  113. Uint32 ux;
  114. }CSL_XMC_XMPAXL;
  115. /** @brief This is the definition of CSL_XMC_MPFSR */
  116. typedef struct CSL_XMC_MPFSR_s
  117. {
  118. /** Local Access ? */
  119. Uint32 local;
  120. /** When set, indicates a Supervisor Read Request */
  121. Uint32 sr;
  122. /** When set, indicates a Supervisor Write Request */
  123. Uint32 sw;
  124. /** When set, indicates a Supervisor program fetch Request */
  125. Uint32 sx;
  126. /** When set, indicates a User Read Request */
  127. Uint32 ur;
  128. /** When set, indicates a User Write Request */
  129. Uint32 uw;
  130. /** When set, indicates a User program fetch Request */
  131. Uint32 ux;
  132. }CSL_XMC_MPFSR;
  133. /** @brief This is the definition of CSL_XMC_XPFADDR */
  134. typedef struct CSL_XMC_XPFADDR_s
  135. {
  136. /** Stream address (128-bit aligned) */
  137. Uint32 addr;
  138. /** Sign bit of stream direction (0=fwd, 1=rev) */
  139. Uint32 dir;
  140. /** Data pending for upper ("high") half */
  141. Uint32 dph;
  142. /** Data valid for upper half */
  143. Uint32 dvh;
  144. /** Address valid for upper half */
  145. Uint32 avh;
  146. /** Data pending for lower half */
  147. Uint32 dpl;
  148. /** Data valid for lower half */
  149. Uint32 dvl;
  150. /** Address valid for lower half */
  151. Uint32 avl;
  152. }CSL_XMC_XPFADDR;
  153. /** @brief This is the definition of CSL_XMC_ACEN_MODE */
  154. typedef enum {
  155. /** Disable analysis counters. */
  156. CSL_XMC_ACEN_MODE_COUNT_DISABLE = 0,
  157. /** Count Program events only. */
  158. CSL_XMC_ACEN_MODE_COUNT_PROGEVENTS = 1,
  159. /** Count Data events only. */
  160. CSL_XMC_ACEN_MODE_COUNT_DATAEVENTS = 2,
  161. /** Count both program and data events. */
  162. CSL_XMC_ACEN_MODE_COUNT_ALL = 3
  163. }CSL_XMC_ACEN_MODE;
  164. /**
  165. * Handle to access XMC registers accessible through config bus.
  166. */
  167. #ifndef CSL_XMC_CFG_REGS
  168. #if defined(SOC_C6678)||defined(SOC_C6657)
  169. #define CSL_XMC_CFG_REGS (CSL_XMC_CONFIG_REGS)
  170. #else
  171. #define CSL_XMC_CFG_REGS (CSL_DSP_DSP_XMC_CTRL_REGS)
  172. #endif
  173. #endif
  174. #define hXmc ((CSL_XmcRegs*)CSL_XMC_CFG_REGS)
  175. /**
  176. @}
  177. */
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181. #endif /* CSL_XMC_H */