system.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. /*
  13. * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of version 2.1 of the GNU Lesser General Public
  17. * License as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it would be useful, but
  20. * WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  22. *
  23. * Further, this software is distributed without any warranty that it is
  24. * free of the rightful claim of any third person regarding infringement
  25. * or the like. Any license provided herein, whether implied or
  26. * otherwise, applies only to this software file. Patent licenses, if
  27. * any, provided herein do not apply to combinations of this program with
  28. * other software, or any other product whatsoever.
  29. *
  30. * You should have received a copy of the GNU Lesser General Public
  31. * License along with this program; if not, write the Free Software
  32. * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
  33. * USA.
  34. */
  35. #ifndef XTENSA_CONFIG_SYSTEM_H
  36. #define XTENSA_CONFIG_SYSTEM_H
  37. /*#include <xtensa/hal.h>*/
  38. /*----------------------------------------------------------------------
  39. DEVICE ADDRESSES
  40. ----------------------------------------------------------------------*/
  41. /*
  42. * Strange place to find these, but the configuration GUI
  43. * allows moving these around to account for various core
  44. * configurations. Specific boards (and their BSP software)
  45. * will have specific meanings for these components.
  46. */
  47. /* I/O Block areas: */
  48. #define XSHAL_IOBLOCK_CACHED_VADDR 0xE0000000
  49. #define XSHAL_IOBLOCK_CACHED_PADDR 0xF0000000
  50. #define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000
  51. #define XSHAL_IOBLOCK_BYPASS_VADDR 0xF0000000
  52. #define XSHAL_IOBLOCK_BYPASS_PADDR 0xF0000000
  53. #define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000
  54. /* System ROM: */
  55. #define XSHAL_ROM_VADDR 0xEE000000
  56. #define XSHAL_ROM_PADDR 0xFE000000
  57. #define XSHAL_ROM_SIZE 0x00400000
  58. /* Largest available area (free of vectors): */
  59. #define XSHAL_ROM_AVAIL_VADDR 0xEE00052C
  60. #define XSHAL_ROM_AVAIL_VSIZE 0x003FFAD4
  61. /* System RAM: */
  62. #define XSHAL_RAM_VADDR 0xD0000000
  63. #define XSHAL_RAM_PADDR 0x00000000
  64. #define XSHAL_RAM_VSIZE 0x08000000
  65. #define XSHAL_RAM_PSIZE 0x10000000
  66. #define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE
  67. /* Largest available area (free of vectors): */
  68. #define XSHAL_RAM_AVAIL_VADDR 0xD0000370
  69. #define XSHAL_RAM_AVAIL_VSIZE 0x07FFFC90
  70. /*
  71. * Shadow system RAM (same device as system RAM, at different address).
  72. * (Emulation boards need this for the SONIC Ethernet driver
  73. * when data caches are configured for writeback mode.)
  74. * NOTE: on full MMU configs, this points to the BYPASS virtual address
  75. * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual
  76. * addresses are viewed through the BYPASS static map rather than
  77. * the CACHED static map.
  78. */
  79. #define XSHAL_RAM_BYPASS_VADDR 0xD8000000
  80. #define XSHAL_RAM_BYPASS_PADDR 0x00000000
  81. #define XSHAL_RAM_BYPASS_PSIZE 0x08000000
  82. /* Alternate system RAM (different device than system RAM): */
  83. #define XSHAL_ALTRAM_VADDR 0xCEE00000
  84. #define XSHAL_ALTRAM_PADDR 0xC0000000
  85. #define XSHAL_ALTRAM_SIZE 0x00200000
  86. /*----------------------------------------------------------------------
  87. * DEVICE-ADDRESS DEPENDENT...
  88. *
  89. * Values written to CACHEATTR special register (or its equivalent)
  90. * to enable and disable caches in various modes.
  91. *----------------------------------------------------------------------*/
  92. /*----------------------------------------------------------------------
  93. BACKWARD COMPATIBILITY ...
  94. ----------------------------------------------------------------------*/
  95. /*
  96. * NOTE: the following two macros are DEPRECATED. Use the latter
  97. * board-specific macros instead, which are specially tuned for the
  98. * particular target environments' memory maps.
  99. */
  100. #define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */
  101. #define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */
  102. /*----------------------------------------------------------------------
  103. ISS (Instruction Set Simulator) SPECIFIC ...
  104. ----------------------------------------------------------------------*/
  105. #define XSHAL_ISS_CACHEATTR_WRITEBACK 0x1122222F /* enable caches in write-back mode */
  106. #define XSHAL_ISS_CACHEATTR_WRITEALLOC 0x1122222F /* enable caches in write-allocate mode */
  107. #define XSHAL_ISS_CACHEATTR_WRITETHRU 0x1122222F /* enable caches in write-through mode */
  108. #define XSHAL_ISS_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */
  109. #define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_ISS_CACHEATTR_WRITEBACK /* default setting to enable caches */
  110. /* For Coware only: */
  111. #define XSHAL_COWARE_CACHEATTR_WRITEBACK 0x11222222 /* enable caches in write-back mode */
  112. #define XSHAL_COWARE_CACHEATTR_WRITEALLOC 0x11222222 /* enable caches in write-allocate mode */
  113. #define XSHAL_COWARE_CACHEATTR_WRITETHRU 0x11222222 /* enable caches in write-through mode */
  114. #define XSHAL_COWARE_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */
  115. #define XSHAL_COWARE_CACHEATTR_DEFAULT XSHAL_COWARE_CACHEATTR_WRITEBACK /* default setting to enable caches */
  116. /* For BFM and other purposes: */
  117. #define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x11222222 /* enable caches without any invalid regions */
  118. #define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting for caches without any invalid regions */
  119. #define XSHAL_ISS_PIPE_REGIONS 0
  120. #define XSHAL_ISS_SDRAM_REGIONS 0
  121. /*----------------------------------------------------------------------
  122. XT2000 BOARD SPECIFIC ...
  123. ----------------------------------------------------------------------*/
  124. #define XSHAL_XT2000_CACHEATTR_WRITEBACK 0x22FFFFFF /* enable caches in write-back mode */
  125. #define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0x22FFFFFF /* enable caches in write-allocate mode */
  126. #define XSHAL_XT2000_CACHEATTR_WRITETHRU 0x22FFFFFF /* enable caches in write-through mode */
  127. #define XSHAL_XT2000_CACHEATTR_BYPASS 0x22FFFFFF /* disable caches in bypass mode */
  128. #define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */
  129. #define XSHAL_XT2000_PIPE_REGIONS 0x00001000 /* BusInt pipeline regions */
  130. #define XSHAL_XT2000_SDRAM_REGIONS 0x00000005 /* BusInt SDRAM regions */
  131. /*----------------------------------------------------------------------
  132. VECTOR SIZES
  133. ----------------------------------------------------------------------*/
  134. /*
  135. * Sizes allocated to vectors by the system (memory map) configuration.
  136. * These sizes are constrained by core configuration (eg. one vector's
  137. * code cannot overflow into another vector) but are dependent on the
  138. * system or board (or LSP) memory map configuration.
  139. *
  140. * Whether or not each vector happens to be in a system ROM is also
  141. * a system configuration matter, sometimes useful, included here also:
  142. */
  143. #define XSHAL_RESET_VECTOR_SIZE 0x000004E0
  144. #define XSHAL_RESET_VECTOR_ISROM 1
  145. #define XSHAL_USER_VECTOR_SIZE 0x0000001C
  146. #define XSHAL_USER_VECTOR_ISROM 0
  147. #define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
  148. #define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
  149. #define XSHAL_KERNEL_VECTOR_SIZE 0x0000001C
  150. #define XSHAL_KERNEL_VECTOR_ISROM 0
  151. #define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
  152. #define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
  153. #define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x000000E0
  154. #define XSHAL_DOUBLEEXC_VECTOR_ISROM 0
  155. #define XSHAL_WINDOW_VECTORS_SIZE 0x00000180
  156. #define XSHAL_WINDOW_VECTORS_ISROM 0
  157. #define XSHAL_INTLEVEL2_VECTOR_SIZE 0x0000000C
  158. #define XSHAL_INTLEVEL2_VECTOR_ISROM 0
  159. #define XSHAL_INTLEVEL3_VECTOR_SIZE 0x0000000C
  160. #define XSHAL_INTLEVEL3_VECTOR_ISROM 0
  161. #define XSHAL_INTLEVEL4_VECTOR_SIZE 0x0000000C
  162. #define XSHAL_INTLEVEL4_VECTOR_ISROM 1
  163. #define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL4_VECTOR_SIZE
  164. #define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL4_VECTOR_ISROM
  165. #endif /*XTENSA_CONFIG_SYSTEM_H*/