setup.h 9.2 KB

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