setup.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. /*
  2. ** asm/setup.h -- Definition of the Linux/m68k setup information
  3. **
  4. ** Copyright 1992 by Greg Harp
  5. **
  6. ** This file is subject to the terms and conditions of the GNU General Public
  7. ** License. See the file COPYING in the main directory of this archive
  8. ** for more details.
  9. **
  10. ** Created 09/29/92 by Greg Harp
  11. **
  12. ** 5/2/94 Roman Hodek:
  13. ** Added bi_atari part of the machine dependent union bi_un; for now it
  14. ** contains just a model field to distinguish between TT and Falcon.
  15. ** 26/7/96 Roman Zippel:
  16. ** Renamed to setup.h; added some useful macros to allow gcc some
  17. ** optimizations if possible.
  18. ** 5/10/96 Geert Uytterhoeven:
  19. ** Redesign of the boot information structure; moved boot information
  20. ** structure to bootinfo.h
  21. */
  22. #ifndef _M68K_SETUP_H
  23. #define _M68K_SETUP_H
  24. #include <uapi/asm/bootinfo.h>
  25. #include <uapi/asm/setup.h>
  26. #define CL_SIZE COMMAND_LINE_SIZE
  27. #ifndef __ASSEMBLY__
  28. extern unsigned long m68k_machtype;
  29. #endif /* !__ASSEMBLY__ */
  30. #if !defined(CONFIG_AMIGA)
  31. # define MACH_IS_AMIGA (0)
  32. #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
  33. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  34. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  35. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  36. # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
  37. #else
  38. # define MACH_AMIGA_ONLY
  39. # define MACH_IS_AMIGA (1)
  40. # define MACH_TYPE (MACH_AMIGA)
  41. #endif
  42. #if !defined(CONFIG_ATARI)
  43. # define MACH_IS_ATARI (0)
  44. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
  45. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  46. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  47. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  48. # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
  49. #else
  50. # define MACH_ATARI_ONLY
  51. # define MACH_IS_ATARI (1)
  52. # define MACH_TYPE (MACH_ATARI)
  53. #endif
  54. #if !defined(CONFIG_MAC)
  55. # define MACH_IS_MAC (0)
  56. #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
  57. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  58. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  59. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  60. # define MACH_IS_MAC (m68k_machtype == MACH_MAC)
  61. #else
  62. # define MACH_MAC_ONLY
  63. # define MACH_IS_MAC (1)
  64. # define MACH_TYPE (MACH_MAC)
  65. #endif
  66. #if defined(CONFIG_SUN3)
  67. #define MACH_IS_SUN3 (1)
  68. #define MACH_SUN3_ONLY (1)
  69. #define MACH_TYPE (MACH_SUN3)
  70. #else
  71. #define MACH_IS_SUN3 (0)
  72. #endif
  73. #if !defined (CONFIG_APOLLO)
  74. # define MACH_IS_APOLLO (0)
  75. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  76. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  77. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  78. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  79. # define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
  80. #else
  81. # define MACH_APOLLO_ONLY
  82. # define MACH_IS_APOLLO (1)
  83. # define MACH_TYPE (MACH_APOLLO)
  84. #endif
  85. #if !defined (CONFIG_MVME147)
  86. # define MACH_IS_MVME147 (0)
  87. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  88. || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
  89. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  90. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
  91. # define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
  92. #else
  93. # define MACH_MVME147_ONLY
  94. # define MACH_IS_MVME147 (1)
  95. # define MACH_TYPE (MACH_MVME147)
  96. #endif
  97. #if !defined (CONFIG_MVME16x)
  98. # define MACH_IS_MVME16x (0)
  99. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  100. || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
  101. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  102. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  103. # define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
  104. #else
  105. # define MACH_MVME16x_ONLY
  106. # define MACH_IS_MVME16x (1)
  107. # define MACH_TYPE (MACH_MVME16x)
  108. #endif
  109. #if !defined (CONFIG_BVME6000)
  110. # define MACH_IS_BVME6000 (0)
  111. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  112. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  113. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  114. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  115. # define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
  116. #else
  117. # define MACH_BVME6000_ONLY
  118. # define MACH_IS_BVME6000 (1)
  119. # define MACH_TYPE (MACH_BVME6000)
  120. #endif
  121. #if !defined (CONFIG_HP300)
  122. # define MACH_IS_HP300 (0)
  123. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  124. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  125. || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
  126. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  127. # define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
  128. #else
  129. # define MACH_HP300_ONLY
  130. # define MACH_IS_HP300 (1)
  131. # define MACH_TYPE (MACH_HP300)
  132. #endif
  133. #if !defined (CONFIG_Q40)
  134. # define MACH_IS_Q40 (0)
  135. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  136. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  137. || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
  138. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  139. # define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
  140. #else
  141. # define MACH_Q40_ONLY
  142. # define MACH_IS_Q40 (1)
  143. # define MACH_TYPE (MACH_Q40)
  144. #endif
  145. #if !defined (CONFIG_SUN3X)
  146. # define MACH_IS_SUN3X (0)
  147. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  148. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  149. || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
  150. || defined(CONFIG_Q40) || defined(CONFIG_MVME147)
  151. # define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
  152. #else
  153. # define CONFIG_SUN3X_ONLY
  154. # define MACH_IS_SUN3X (1)
  155. # define MACH_TYPE (MACH_SUN3X)
  156. #endif
  157. #ifndef MACH_TYPE
  158. # define MACH_TYPE (m68k_machtype)
  159. #endif
  160. #ifndef __ASSEMBLY__
  161. extern unsigned long m68k_cputype;
  162. extern unsigned long m68k_fputype;
  163. extern unsigned long m68k_mmutype;
  164. #ifdef CONFIG_VME
  165. extern unsigned long vme_brdtype;
  166. #endif
  167. /*
  168. * m68k_is040or060 is != 0 for a '040 or higher;
  169. * used numbers are 4 for 68040 and 6 for 68060.
  170. */
  171. extern int m68k_is040or060;
  172. #endif /* !__ASSEMBLY__ */
  173. #if !defined(CONFIG_M68020)
  174. # define CPU_IS_020 (0)
  175. # define MMU_IS_851 (0)
  176. # define MMU_IS_SUN3 (0)
  177. #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  178. # define CPU_IS_020 (m68k_cputype & CPU_68020)
  179. # define MMU_IS_851 (m68k_mmutype & MMU_68851)
  180. # define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */
  181. #else
  182. # define CPU_M68020_ONLY
  183. # define CPU_IS_020 (1)
  184. #ifdef MACH_SUN3_ONLY
  185. # define MMU_IS_SUN3 (1)
  186. # define MMU_IS_851 (0)
  187. #else
  188. # define MMU_IS_SUN3 (0)
  189. # define MMU_IS_851 (1)
  190. #endif
  191. #endif
  192. #if !defined(CONFIG_M68030)
  193. # define CPU_IS_030 (0)
  194. # define MMU_IS_030 (0)
  195. #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  196. # define CPU_IS_030 (m68k_cputype & CPU_68030)
  197. # define MMU_IS_030 (m68k_mmutype & MMU_68030)
  198. #else
  199. # define CPU_M68030_ONLY
  200. # define CPU_IS_030 (1)
  201. # define MMU_IS_030 (1)
  202. #endif
  203. #if !defined(CONFIG_M68040)
  204. # define CPU_IS_040 (0)
  205. # define MMU_IS_040 (0)
  206. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
  207. # define CPU_IS_040 (m68k_cputype & CPU_68040)
  208. # define MMU_IS_040 (m68k_mmutype & MMU_68040)
  209. #else
  210. # define CPU_M68040_ONLY
  211. # define CPU_IS_040 (1)
  212. # define MMU_IS_040 (1)
  213. #endif
  214. #if !defined(CONFIG_M68060)
  215. # define CPU_IS_060 (0)
  216. # define MMU_IS_060 (0)
  217. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
  218. # define CPU_IS_060 (m68k_cputype & CPU_68060)
  219. # define MMU_IS_060 (m68k_mmutype & MMU_68060)
  220. #else
  221. # define CPU_M68060_ONLY
  222. # define CPU_IS_060 (1)
  223. # define MMU_IS_060 (1)
  224. #endif
  225. #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
  226. # define CPU_IS_020_OR_030 (0)
  227. #else
  228. # define CPU_M68020_OR_M68030
  229. # if defined(CONFIG_M68040) || defined(CONFIG_M68060)
  230. # define CPU_IS_020_OR_030 (!m68k_is040or060)
  231. # else
  232. # define CPU_M68020_OR_M68030_ONLY
  233. # define CPU_IS_020_OR_030 (1)
  234. # endif
  235. #endif
  236. #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
  237. # define CPU_IS_040_OR_060 (0)
  238. #else
  239. # define CPU_M68040_OR_M68060
  240. # if defined(CONFIG_M68020) || defined(CONFIG_M68030)
  241. # define CPU_IS_040_OR_060 (m68k_is040or060)
  242. # else
  243. # define CPU_M68040_OR_M68060_ONLY
  244. # define CPU_IS_040_OR_060 (1)
  245. # endif
  246. #endif
  247. #if !defined(CONFIG_COLDFIRE)
  248. # define CPU_IS_COLDFIRE (0)
  249. #else
  250. # define CPU_IS_COLDFIRE (1)
  251. # define MMU_IS_COLDFIRE (1)
  252. #endif
  253. #define CPU_TYPE (m68k_cputype)
  254. #ifdef CONFIG_M68KFPU_EMU
  255. # ifdef CONFIG_M68KFPU_EMU_ONLY
  256. # define FPU_IS_EMU (1)
  257. # else
  258. # define FPU_IS_EMU (!m68k_fputype)
  259. # endif
  260. #else
  261. # define FPU_IS_EMU (0)
  262. #endif
  263. /*
  264. * Miscellaneous
  265. */
  266. #define NUM_MEMINFO 4
  267. #ifndef __ASSEMBLY__
  268. struct m68k_mem_info {
  269. unsigned long addr; /* physical address of memory chunk */
  270. unsigned long size; /* length of memory chunk (in bytes) */
  271. };
  272. extern int m68k_num_memory; /* # of memory blocks found (and used) */
  273. extern int m68k_realnum_memory; /* real # of memory blocks found */
  274. extern struct m68k_mem_info m68k_memory[NUM_MEMINFO];/* memory description */
  275. #endif
  276. #endif /* _M68K_SETUP_H */