system.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /*
  2. * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration
  3. *
  4. * NOTE: The location and contents of this file are highly subject to change.
  5. *
  6. * Source for configuration-independent binaries (which link in a
  7. * configuration-specific HAL library) must NEVER include this file.
  8. * The HAL itself has historically included this file in some instances,
  9. * but this is not appropriate either, because the HAL is meant to be
  10. * core-specific but system independent.
  11. */
  12. /* Customer ID=11657; Build=0x5fe96; Copyright (c) 2000-2010 Tensilica Inc.
  13. Permission is hereby granted, free of charge, to any person obtaining
  14. a copy of this software and associated documentation files (the
  15. "Software"), to deal in the Software without restriction, including
  16. without limitation the rights to use, copy, modify, merge, publish,
  17. distribute, sublicense, and/or sell copies of the Software, and to
  18. permit persons to whom the Software is furnished to do so, subject to
  19. the following conditions:
  20. The above copyright notice and this permission notice shall be included
  21. in all copies or substantial portions of the Software.
  22. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  25. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  26. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  27. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  28. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. #ifndef XTENSA_CONFIG_SYSTEM_H
  30. #define XTENSA_CONFIG_SYSTEM_H
  31. /*#include <xtensa/hal.h>*/
  32. /*----------------------------------------------------------------------
  33. CONFIGURED SOFTWARE OPTIONS
  34. ----------------------------------------------------------------------*/
  35. #define XSHAL_USE_ABSOLUTE_LITERALS 0 /* (sw-only option, whether software uses absolute literals) */
  36. #define XSHAL_HAVE_TEXT_SECTION_LITERALS 1 /* Set if there is some memory that allows both code and literals. */
  37. #define XSHAL_ABI XTHAL_ABI_WINDOWED /* (sw-only option, selected ABI) */
  38. /* The above maps to one of the following constants: */
  39. #define XTHAL_ABI_WINDOWED 0
  40. #define XTHAL_ABI_CALL0 1
  41. /* Alternatives: */
  42. /*#define XSHAL_WINDOWED_ABI 1*/ /* set if windowed ABI selected */
  43. /*#define XSHAL_CALL0_ABI 0*/ /* set if call0 ABI selected */
  44. #define XSHAL_CLIB XTHAL_CLIB_NEWLIB /* (sw-only option, selected C library) */
  45. /* The above maps to one of the following constants: */
  46. #define XTHAL_CLIB_NEWLIB 0
  47. #define XTHAL_CLIB_UCLIBC 1
  48. #define XTHAL_CLIB_XCLIB 2
  49. /* Alternatives: */
  50. /*#define XSHAL_NEWLIB 1*/ /* set if newlib C library selected */
  51. /*#define XSHAL_UCLIBC 0*/ /* set if uCLibC C library selected */
  52. /*#define XSHAL_XCLIB 0*/ /* set if Xtensa C library selected */
  53. #define XSHAL_USE_FLOATING_POINT 1
  54. #define XSHAL_FLOATING_POINT_ABI 0
  55. /* SW workarounds enabled for HW errata: */
  56. /*----------------------------------------------------------------------
  57. DEVICE ADDRESSES
  58. ----------------------------------------------------------------------*/
  59. /*
  60. * Strange place to find these, but the configuration GUI
  61. * allows moving these around to account for various core
  62. * configurations. Specific boards (and their BSP software)
  63. * will have specific meanings for these components.
  64. */
  65. /* I/O Block areas: */
  66. #define XSHAL_IOBLOCK_CACHED_VADDR 0x70000000
  67. #define XSHAL_IOBLOCK_CACHED_PADDR 0x70000000
  68. #define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000
  69. #define XSHAL_IOBLOCK_BYPASS_VADDR 0x90000000
  70. #define XSHAL_IOBLOCK_BYPASS_PADDR 0x90000000
  71. #define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000
  72. /* System ROM: */
  73. #define XSHAL_ROM_VADDR 0x50000000
  74. #define XSHAL_ROM_PADDR 0x50000000
  75. #define XSHAL_ROM_SIZE 0x01000000
  76. /* Largest available area (free of vectors): */
  77. #define XSHAL_ROM_AVAIL_VADDR 0x50000000
  78. #define XSHAL_ROM_AVAIL_VSIZE 0x01000000
  79. /* System RAM: */
  80. #define XSHAL_RAM_VADDR 0x60000000
  81. #define XSHAL_RAM_PADDR 0x60000000
  82. #define XSHAL_RAM_VSIZE 0x20000000
  83. #define XSHAL_RAM_PSIZE 0x20000000
  84. #define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE
  85. /* Largest available area (free of vectors): */
  86. #define XSHAL_RAM_AVAIL_VADDR 0x60000000
  87. #define XSHAL_RAM_AVAIL_VSIZE 0x20000000
  88. /*
  89. * Shadow system RAM (same device as system RAM, at different address).
  90. * (Emulation boards need this for the SONIC Ethernet driver
  91. * when data caches are configured for writeback mode.)
  92. * NOTE: on full MMU configs, this points to the BYPASS virtual address
  93. * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual
  94. * addresses are viewed through the BYPASS static map rather than
  95. * the CACHED static map.
  96. */
  97. #define XSHAL_RAM_BYPASS_VADDR 0xA0000000
  98. #define XSHAL_RAM_BYPASS_PADDR 0xA0000000
  99. #define XSHAL_RAM_BYPASS_PSIZE 0x20000000
  100. /* Alternate system RAM (different device than system RAM): */
  101. /*#define XSHAL_ALTRAM_[VP]ADDR ...not configured...*/
  102. /*#define XSHAL_ALTRAM_SIZE ...not configured...*/
  103. /* Some available location in which to place devices in a simulation (eg. XTMP): */
  104. #define XSHAL_SIMIO_CACHED_VADDR 0xC0000000
  105. #define XSHAL_SIMIO_BYPASS_VADDR 0xC0000000
  106. #define XSHAL_SIMIO_PADDR 0xC0000000
  107. #define XSHAL_SIMIO_SIZE 0x20000000
  108. /*----------------------------------------------------------------------
  109. * For use by reference testbench exit and diagnostic routines.
  110. */
  111. #define XSHAL_MAGIC_EXIT 0x0
  112. /*----------------------------------------------------------------------
  113. * DEVICE-ADDRESS DEPENDENT...
  114. *
  115. * Values written to CACHEATTR special register (or its equivalent)
  116. * to enable and disable caches in various modes.
  117. *----------------------------------------------------------------------*/
  118. /*----------------------------------------------------------------------
  119. BACKWARD COMPATIBILITY ...
  120. ----------------------------------------------------------------------*/
  121. /*
  122. * NOTE: the following two macros are DEPRECATED. Use the latter
  123. * board-specific macros instead, which are specially tuned for the
  124. * particular target environments' memory maps.
  125. */
  126. #define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */
  127. #define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */
  128. /*----------------------------------------------------------------------
  129. GENERIC
  130. ----------------------------------------------------------------------*/
  131. /* For the following, a 512MB region is used if it contains a system (PIF) RAM,
  132. * system (PIF) ROM, local memory, or XLMI. */
  133. /* These set any unused 512MB region to cache-BYPASS attribute: */
  134. #define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x22221112 /* enable caches in write-back mode */
  135. #define XSHAL_ALLVALID_CACHEATTR_WRITEALLOC 0x22221112 /* enable caches in write-allocate mode */
  136. #define XSHAL_ALLVALID_CACHEATTR_WRITETHRU 0x22221112 /* enable caches in write-through mode */
  137. #define XSHAL_ALLVALID_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */
  138. #define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting to enable caches */
  139. /* These set any unused 512MB region to ILLEGAL attribute: */
  140. #define XSHAL_STRICT_CACHEATTR_WRITEBACK 0xFFFF111F /* enable caches in write-back mode */
  141. #define XSHAL_STRICT_CACHEATTR_WRITEALLOC 0xFFFF111F /* enable caches in write-allocate mode */
  142. #define XSHAL_STRICT_CACHEATTR_WRITETHRU 0xFFFF111F /* enable caches in write-through mode */
  143. #define XSHAL_STRICT_CACHEATTR_BYPASS 0xFFFF222F /* disable caches in bypass mode */
  144. #define XSHAL_STRICT_CACHEATTR_DEFAULT XSHAL_STRICT_CACHEATTR_WRITEBACK /* default setting to enable caches */
  145. /* These set the first 512MB, if unused, to ILLEGAL attribute to help catch
  146. * NULL-pointer dereference bugs; all other unused 512MB regions are set
  147. * to cache-BYPASS attribute: */
  148. #define XSHAL_TRAPNULL_CACHEATTR_WRITEBACK 0x2222111F /* enable caches in write-back mode */
  149. #define XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC 0x2222111F /* enable caches in write-allocate mode */
  150. #define XSHAL_TRAPNULL_CACHEATTR_WRITETHRU 0x2222111F /* enable caches in write-through mode */
  151. #define XSHAL_TRAPNULL_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */
  152. #define XSHAL_TRAPNULL_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK /* default setting to enable caches */
  153. /*----------------------------------------------------------------------
  154. ISS (Instruction Set Simulator) SPECIFIC ...
  155. ----------------------------------------------------------------------*/
  156. /* For now, ISS defaults to the TRAPNULL settings: */
  157. #define XSHAL_ISS_CACHEATTR_WRITEBACK XSHAL_TRAPNULL_CACHEATTR_WRITEBACK
  158. #define XSHAL_ISS_CACHEATTR_WRITEALLOC XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC
  159. #define XSHAL_ISS_CACHEATTR_WRITETHRU XSHAL_TRAPNULL_CACHEATTR_WRITETHRU
  160. #define XSHAL_ISS_CACHEATTR_BYPASS XSHAL_TRAPNULL_CACHEATTR_BYPASS
  161. #define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK
  162. #define XSHAL_ISS_PIPE_REGIONS 0
  163. #define XSHAL_ISS_SDRAM_REGIONS 0
  164. /*----------------------------------------------------------------------
  165. XT2000 BOARD SPECIFIC ...
  166. ----------------------------------------------------------------------*/
  167. /* For the following, a 512MB region is used if it contains any system RAM,
  168. * system ROM, local memory, XLMI, or other XT2000 board device or memory.
  169. * Regions containing devices are forced to cache-BYPASS mode regardless
  170. * of whether the macro is _WRITEBACK vs. _BYPASS etc. */
  171. /* These set any 512MB region unused on the XT2000 to ILLEGAL attribute: */
  172. #define XSHAL_XT2000_CACHEATTR_WRITEBACK 0xFF22111F /* enable caches in write-back mode */
  173. #define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0xFF22111F /* enable caches in write-allocate mode */
  174. #define XSHAL_XT2000_CACHEATTR_WRITETHRU 0xFF22111F /* enable caches in write-through mode */
  175. #define XSHAL_XT2000_CACHEATTR_BYPASS 0xFF22222F /* disable caches in bypass mode */
  176. #define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */
  177. #define XSHAL_XT2000_PIPE_REGIONS 0x00000000 /* BusInt pipeline regions */
  178. #define XSHAL_XT2000_SDRAM_REGIONS 0x00000440 /* BusInt SDRAM regions */
  179. /*----------------------------------------------------------------------
  180. VECTOR INFO AND SIZES
  181. ----------------------------------------------------------------------*/
  182. #define XSHAL_VECTORS_PACKED 0
  183. #define XSHAL_STATIC_VECTOR_SELECT 1
  184. #define XSHAL_RESET_VECTOR_VADDR 0x40000400
  185. #define XSHAL_RESET_VECTOR_PADDR 0x40000400
  186. /*
  187. * Sizes allocated to vectors by the system (memory map) configuration.
  188. * These sizes are constrained by core configuration (eg. one vector's
  189. * code cannot overflow into another vector) but are dependent on the
  190. * system or board (or LSP) memory map configuration.
  191. *
  192. * Whether or not each vector happens to be in a system ROM is also
  193. * a system configuration matter, sometimes useful, included here also:
  194. */
  195. #define XSHAL_RESET_VECTOR_SIZE 0x00000300
  196. #define XSHAL_RESET_VECTOR_ISROM 0
  197. #define XSHAL_USER_VECTOR_SIZE 0x00000038
  198. #define XSHAL_USER_VECTOR_ISROM 0
  199. #define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
  200. #define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
  201. #define XSHAL_KERNEL_VECTOR_SIZE 0x00000038
  202. #define XSHAL_KERNEL_VECTOR_ISROM 0
  203. #define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
  204. #define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
  205. #define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x00000040
  206. #define XSHAL_DOUBLEEXC_VECTOR_ISROM 0
  207. #define XSHAL_WINDOW_VECTORS_SIZE 0x00000178
  208. #define XSHAL_WINDOW_VECTORS_ISROM 0
  209. #define XSHAL_INTLEVEL2_VECTOR_SIZE 0x00000038
  210. #define XSHAL_INTLEVEL2_VECTOR_ISROM 0
  211. #define XSHAL_INTLEVEL3_VECTOR_SIZE 0x00000038
  212. #define XSHAL_INTLEVEL3_VECTOR_ISROM 0
  213. #define XSHAL_INTLEVEL4_VECTOR_SIZE 0x00000038
  214. #define XSHAL_INTLEVEL4_VECTOR_ISROM 0
  215. #define XSHAL_INTLEVEL5_VECTOR_SIZE 0x00000038
  216. #define XSHAL_INTLEVEL5_VECTOR_ISROM 0
  217. #define XSHAL_INTLEVEL6_VECTOR_SIZE 0x00000038
  218. #define XSHAL_INTLEVEL6_VECTOR_ISROM 0
  219. #define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL6_VECTOR_SIZE
  220. #define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL6_VECTOR_ISROM
  221. #define XSHAL_NMI_VECTOR_SIZE 0x00000038
  222. #define XSHAL_NMI_VECTOR_ISROM 0
  223. #define XSHAL_INTLEVEL7_VECTOR_SIZE XSHAL_NMI_VECTOR_SIZE
  224. #endif /*XTENSA_CONFIG_SYSTEM_H*/