tie.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /*
  2. * xtensa/config/tie.h -- HAL definitions that are dependent on CORE and TIE configuration
  3. *
  4. * This header file is sometimes referred to as the "compile-time HAL" or CHAL.
  5. * It was generated for a specific Xtensa processor configuration,
  6. * and furthermore for a specific set of TIE source files that extend
  7. * basic core functionality.
  8. *
  9. * Source for configuration-independent binaries (which link in a
  10. * configuration-specific HAL library) must NEVER include this file.
  11. * It is perfectly normal, however, for the HAL source itself to include this file.
  12. */
  13. /*
  14. * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of version 2.1 of the GNU Lesser General Public
  18. * License as published by the Free Software Foundation.
  19. *
  20. * This program is distributed in the hope that it would be useful, but
  21. * WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  23. *
  24. * Further, this software is distributed without any warranty that it is
  25. * free of the rightful claim of any third person regarding infringement
  26. * or the like. Any license provided herein, whether implied or
  27. * otherwise, applies only to this software file. Patent licenses, if
  28. * any, provided herein do not apply to combinations of this program with
  29. * other software, or any other product whatsoever.
  30. *
  31. * You should have received a copy of the GNU Lesser General Public
  32. * License along with this program; if not, write the Free Software
  33. * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
  34. * USA.
  35. */
  36. #ifndef XTENSA_CONFIG_TIE_H
  37. #define XTENSA_CONFIG_TIE_H
  38. #include <xtensa/hal.h>
  39. /*----------------------------------------------------------------------
  40. GENERAL
  41. ----------------------------------------------------------------------*/
  42. /*
  43. * Separators for macros that expand into arrays.
  44. * These can be predefined by files that #include this one,
  45. * when different separators are required.
  46. */
  47. /* Element separator for macros that expand into 1-dimensional arrays: */
  48. #ifndef XCHAL_SEP
  49. #define XCHAL_SEP ,
  50. #endif
  51. /* Array separator for macros that expand into 2-dimensional arrays: */
  52. #ifndef XCHAL_SEP2
  53. #define XCHAL_SEP2 },{
  54. #endif
  55. /*----------------------------------------------------------------------
  56. COPROCESSORS and EXTRA STATE
  57. ----------------------------------------------------------------------*/
  58. #define XCHAL_CP_NUM 0 /* number of coprocessors */
  59. #define XCHAL_CP_MAX 0 /* max coprocessor id plus one (0 if none) */
  60. #define XCHAL_CP_MASK 0x00 /* bitmask of coprocessors by id */
  61. /* Space for coprocessors' state save areas: */
  62. #define XCHAL_CP0_SA_SIZE 0
  63. #define XCHAL_CP1_SA_SIZE 0
  64. #define XCHAL_CP2_SA_SIZE 0
  65. #define XCHAL_CP3_SA_SIZE 0
  66. #define XCHAL_CP4_SA_SIZE 0
  67. #define XCHAL_CP5_SA_SIZE 0
  68. #define XCHAL_CP6_SA_SIZE 0
  69. #define XCHAL_CP7_SA_SIZE 0
  70. /* Minimum required alignments of CP state save areas: */
  71. #define XCHAL_CP0_SA_ALIGN 1
  72. #define XCHAL_CP1_SA_ALIGN 1
  73. #define XCHAL_CP2_SA_ALIGN 1
  74. #define XCHAL_CP3_SA_ALIGN 1
  75. #define XCHAL_CP4_SA_ALIGN 1
  76. #define XCHAL_CP5_SA_ALIGN 1
  77. #define XCHAL_CP6_SA_ALIGN 1
  78. #define XCHAL_CP7_SA_ALIGN 1
  79. /* Indexing macros: */
  80. #define _XCHAL_CP_SA_SIZE(n) XCHAL_CP ## n ## _SA_SIZE
  81. #define XCHAL_CP_SA_SIZE(n) _XCHAL_CP_SA_SIZE(n) /* n = 0 .. 7 */
  82. #define _XCHAL_CP_SA_ALIGN(n) XCHAL_CP ## n ## _SA_ALIGN
  83. #define XCHAL_CP_SA_ALIGN(n) _XCHAL_CP_SA_ALIGN(n) /* n = 0 .. 7 */
  84. /* Space for "extra" state (user special registers and non-cp TIE) save area: */
  85. #define XCHAL_EXTRA_SA_SIZE 0
  86. #define XCHAL_EXTRA_SA_ALIGN 1
  87. /* Total save area size (extra + all coprocessors) */
  88. /* (not useful until xthal_{save,restore}_all_extra() is implemented, */
  89. /* but included for Tor2 beta; doesn't account for alignment!): */
  90. #define XCHAL_CPEXTRA_SA_SIZE_TOR2 0 /* Tor2Beta temporary definition -- do not use */
  91. /* Combined required alignment for all CP and EXTRA state save areas */
  92. /* (does not include required alignment for any base config registers): */
  93. #define XCHAL_CPEXTRA_SA_ALIGN 1
  94. /* ... */
  95. #ifdef _ASMLANGUAGE
  96. /*
  97. * Assembly-language specific definitions (assembly macros, etc.).
  98. */
  99. #include <xtensa/config/specreg.h>
  100. /********************
  101. * Macros to save and restore the non-coprocessor TIE portion of EXTRA state.
  102. */
  103. /* (none) */
  104. /********************
  105. * Macros to create functions that save and restore all EXTRA (non-coprocessor) state
  106. * (does not include zero-overhead loop registers and non-optional registers).
  107. */
  108. /*
  109. * Macro that expands to the body of a function that
  110. * stores the extra (non-coprocessor) optional/custom state.
  111. * Entry: a2 = ptr to save area in which to save extra state
  112. * Exit: any register a2-a15 (?) may have been clobbered.
  113. */
  114. .macro xchal_extra_store_funcbody
  115. .endm
  116. /*
  117. * Macro that expands to the body of a function that
  118. * loads the extra (non-coprocessor) optional/custom state.
  119. * Entry: a2 = ptr to save area from which to restore extra state
  120. * Exit: any register a2-a15 (?) may have been clobbered.
  121. */
  122. .macro xchal_extra_load_funcbody
  123. .endm
  124. /********************
  125. * Macros to save and restore the state of each TIE coprocessor.
  126. */
  127. /********************
  128. * Macros to create functions that save and restore the state of *any* TIE coprocessor.
  129. */
  130. /*
  131. * Macro that expands to the body of a function
  132. * that stores the selected coprocessor's state (registers etc).
  133. * Entry: a2 = ptr to save area in which to save cp state
  134. * a3 = coprocessor number
  135. * Exit: any register a2-a15 (?) may have been clobbered.
  136. */
  137. .macro xchal_cpi_store_funcbody
  138. .endm
  139. /*
  140. * Macro that expands to the body of a function
  141. * that loads the selected coprocessor's state (registers etc).
  142. * Entry: a2 = ptr to save area from which to restore cp state
  143. * a3 = coprocessor number
  144. * Exit: any register a2-a15 (?) may have been clobbered.
  145. */
  146. .macro xchal_cpi_load_funcbody
  147. .endm
  148. #endif /*_ASMLANGUAGE*/
  149. /*
  150. * Contents of save areas in terms of libdb register numbers.
  151. * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
  152. * it is up to the user of this header file to define these macros
  153. * usefully before each expansion of the CONTENTS_LIBDB macros.
  154. * (Fields rsv[123] are reserved for future additions; they are currently
  155. * set to zero but may be set to some useful values in the future.)
  156. *
  157. * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
  158. * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
  159. * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
  160. */
  161. #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0
  162. #define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */
  163. #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0
  164. #define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */
  165. #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
  166. #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
  167. #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0
  168. #define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */
  169. #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
  170. #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
  171. #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
  172. #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
  173. #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0
  174. #define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */
  175. #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0
  176. #define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */
  177. #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
  178. #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
  179. /*----------------------------------------------------------------------
  180. MISC
  181. ----------------------------------------------------------------------*/
  182. #if 0 /* is there something equivalent for user TIE? */
  183. #define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier
  184. (CoreID) set in the Xtensa Processor Generator */
  185. #define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */
  186. /* These definitions describe the hardware targeted by this software: */
  187. #define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */
  188. #define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */
  189. #define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
  190. #define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
  191. #define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
  192. #define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
  193. #define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
  194. #define XTHAL_HW_REL_T1050 1
  195. #define XTHAL_HW_REL_T1050_1 1
  196. #define XCHAL_HW_CONFIGID_RELIABLE 1
  197. #endif /*0*/
  198. /*----------------------------------------------------------------------
  199. ISA
  200. ----------------------------------------------------------------------*/
  201. #if 0 /* these probably don't belong here, but are related to or implemented using TIE */
  202. #define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */
  203. /* Misc instructions: */
  204. #define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */
  205. #define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */
  206. #define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */
  207. #endif /*0*/
  208. #endif /*XTENSA_CONFIG_TIE_H*/