setup.h 10 KB

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