setup.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 <linux/config.h>
  25. /*
  26. * Linux/m68k Architectures
  27. */
  28. #define MACH_AMIGA 1
  29. #define MACH_ATARI 2
  30. #define MACH_MAC 3
  31. #define MACH_APOLLO 4
  32. #define MACH_SUN3 5
  33. #define MACH_MVME147 6
  34. #define MACH_MVME16x 7
  35. #define MACH_BVME6000 8
  36. #define MACH_HP300 9
  37. #define MACH_Q40 10
  38. #define MACH_SUN3X 11
  39. #ifdef __KERNEL__
  40. #ifndef __ASSEMBLY__
  41. extern unsigned long m68k_machtype;
  42. #endif /* !__ASSEMBLY__ */
  43. #if !defined(CONFIG_AMIGA)
  44. # define MACH_IS_AMIGA (0)
  45. #elif defined(CONFIG_ATARI) || 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. # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
  50. #else
  51. # define MACH_AMIGA_ONLY
  52. # define MACH_IS_AMIGA (1)
  53. # define MACH_TYPE (MACH_AMIGA)
  54. #endif
  55. #if !defined(CONFIG_ATARI)
  56. # define MACH_IS_ATARI (0)
  57. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
  58. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  59. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  60. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  61. # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
  62. #else
  63. # define MACH_ATARI_ONLY
  64. # define MACH_IS_ATARI (1)
  65. # define MACH_TYPE (MACH_ATARI)
  66. #endif
  67. #if !defined(CONFIG_MAC)
  68. # define MACH_IS_MAC (0)
  69. #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
  70. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  71. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  72. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  73. # define MACH_IS_MAC (m68k_machtype == MACH_MAC)
  74. #else
  75. # define MACH_MAC_ONLY
  76. # define MACH_IS_MAC (1)
  77. # define MACH_TYPE (MACH_MAC)
  78. #endif
  79. #if defined(CONFIG_SUN3)
  80. #define MACH_IS_SUN3 (1)
  81. #define MACH_SUN3_ONLY (1)
  82. #define MACH_TYPE (MACH_SUN3)
  83. #else
  84. #define MACH_IS_SUN3 (0)
  85. #endif
  86. #if !defined (CONFIG_APOLLO)
  87. # define MACH_IS_APOLLO (0)
  88. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  89. || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
  90. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  91. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  92. # define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
  93. #else
  94. # define MACH_APOLLO_ONLY
  95. # define MACH_IS_APOLLO (1)
  96. # define MACH_TYPE (MACH_APOLLO)
  97. #endif
  98. #if !defined (CONFIG_MVME147)
  99. # define MACH_IS_MVME147 (0)
  100. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  101. || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
  102. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  103. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
  104. # define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
  105. #else
  106. # define MACH_MVME147_ONLY
  107. # define MACH_IS_MVME147 (1)
  108. # define MACH_TYPE (MACH_MVME147)
  109. #endif
  110. #if !defined (CONFIG_MVME16x)
  111. # define MACH_IS_MVME16x (0)
  112. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  113. || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
  114. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  115. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  116. # define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
  117. #else
  118. # define MACH_MVME16x_ONLY
  119. # define MACH_IS_MVME16x (1)
  120. # define MACH_TYPE (MACH_MVME16x)
  121. #endif
  122. #if !defined (CONFIG_BVME6000)
  123. # define MACH_IS_BVME6000 (0)
  124. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  125. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  126. || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
  127. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  128. # define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
  129. #else
  130. # define MACH_BVME6000_ONLY
  131. # define MACH_IS_BVME6000 (1)
  132. # define MACH_TYPE (MACH_BVME6000)
  133. #endif
  134. #if !defined (CONFIG_HP300)
  135. # define MACH_IS_HP300 (0)
  136. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  137. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  138. || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
  139. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  140. # define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
  141. #else
  142. # define MACH_HP300_ONLY
  143. # define MACH_IS_HP300 (1)
  144. # define MACH_TYPE (MACH_HP300)
  145. #endif
  146. #if !defined (CONFIG_Q40)
  147. # define MACH_IS_Q40 (0)
  148. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  149. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  150. || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
  151. || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
  152. # define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
  153. #else
  154. # define MACH_Q40_ONLY
  155. # define MACH_IS_Q40 (1)
  156. # define MACH_TYPE (MACH_Q40)
  157. #endif
  158. #if !defined (CONFIG_SUN3X)
  159. # define MACH_IS_SUN3X (0)
  160. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  161. || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
  162. || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
  163. || defined(CONFIG_Q40) || defined(CONFIG_MVME147)
  164. # define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
  165. #else
  166. # define CONFIG_SUN3X_ONLY
  167. # define MACH_IS_SUN3X (1)
  168. # define MACH_TYPE (MACH_SUN3X)
  169. #endif
  170. #ifndef MACH_TYPE
  171. # define MACH_TYPE (m68k_machtype)
  172. #endif
  173. #endif /* __KERNEL__ */
  174. /*
  175. * CPU, FPU and MMU types
  176. *
  177. * Note: we may rely on the following equalities:
  178. *
  179. * CPU_68020 == MMU_68851
  180. * CPU_68030 == MMU_68030
  181. * CPU_68040 == FPU_68040 == MMU_68040
  182. * CPU_68060 == FPU_68060 == MMU_68060
  183. */
  184. #define CPUB_68020 0
  185. #define CPUB_68030 1
  186. #define CPUB_68040 2
  187. #define CPUB_68060 3
  188. #define CPU_68020 (1<<CPUB_68020)
  189. #define CPU_68030 (1<<CPUB_68030)
  190. #define CPU_68040 (1<<CPUB_68040)
  191. #define CPU_68060 (1<<CPUB_68060)
  192. #define FPUB_68881 0
  193. #define FPUB_68882 1
  194. #define FPUB_68040 2 /* Internal FPU */
  195. #define FPUB_68060 3 /* Internal FPU */
  196. #define FPUB_SUNFPA 4 /* Sun-3 FPA */
  197. #define FPU_68881 (1<<FPUB_68881)
  198. #define FPU_68882 (1<<FPUB_68882)
  199. #define FPU_68040 (1<<FPUB_68040)
  200. #define FPU_68060 (1<<FPUB_68060)
  201. #define FPU_SUNFPA (1<<FPUB_SUNFPA)
  202. #define MMUB_68851 0
  203. #define MMUB_68030 1 /* Internal MMU */
  204. #define MMUB_68040 2 /* Internal MMU */
  205. #define MMUB_68060 3 /* Internal MMU */
  206. #define MMUB_APOLLO 4 /* Custom Apollo */
  207. #define MMUB_SUN3 5 /* Custom Sun-3 */
  208. #define MMU_68851 (1<<MMUB_68851)
  209. #define MMU_68030 (1<<MMUB_68030)
  210. #define MMU_68040 (1<<MMUB_68040)
  211. #define MMU_68060 (1<<MMUB_68060)
  212. #define MMU_SUN3 (1<<MMUB_SUN3)
  213. #define MMU_APOLLO (1<<MMUB_APOLLO)
  214. #ifdef __KERNEL__
  215. #ifndef __ASSEMBLY__
  216. extern unsigned long m68k_cputype;
  217. extern unsigned long m68k_fputype;
  218. extern unsigned long m68k_mmutype; /* Not really used yet */
  219. #ifdef CONFIG_VME
  220. extern unsigned long vme_brdtype;
  221. #endif
  222. /*
  223. * m68k_is040or060 is != 0 for a '040 or higher;
  224. * used numbers are 4 for 68040 and 6 for 68060.
  225. */
  226. extern int m68k_is040or060;
  227. #endif /* !__ASSEMBLY__ */
  228. #if !defined(CONFIG_M68020)
  229. # define CPU_IS_020 (0)
  230. # define MMU_IS_851 (0)
  231. # define MMU_IS_SUN3 (0)
  232. #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  233. # define CPU_IS_020 (m68k_cputype & CPU_68020)
  234. # define MMU_IS_851 (m68k_mmutype & MMU_68851)
  235. # define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */
  236. #else
  237. # define CPU_M68020_ONLY
  238. # define CPU_IS_020 (1)
  239. #ifdef MACH_SUN3_ONLY
  240. # define MMU_IS_SUN3 (1)
  241. # define MMU_IS_851 (0)
  242. #else
  243. # define MMU_IS_SUN3 (0)
  244. # define MMU_IS_851 (1)
  245. #endif
  246. #endif
  247. #if !defined(CONFIG_M68030)
  248. # define CPU_IS_030 (0)
  249. # define MMU_IS_030 (0)
  250. #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  251. # define CPU_IS_030 (m68k_cputype & CPU_68030)
  252. # define MMU_IS_030 (m68k_mmutype & MMU_68030)
  253. #else
  254. # define CPU_M68030_ONLY
  255. # define CPU_IS_030 (1)
  256. # define MMU_IS_030 (1)
  257. #endif
  258. #if !defined(CONFIG_M68040)
  259. # define CPU_IS_040 (0)
  260. # define MMU_IS_040 (0)
  261. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
  262. # define CPU_IS_040 (m68k_cputype & CPU_68040)
  263. # define MMU_IS_040 (m68k_mmutype & MMU_68040)
  264. #else
  265. # define CPU_M68040_ONLY
  266. # define CPU_IS_040 (1)
  267. # define MMU_IS_040 (1)
  268. #endif
  269. #if !defined(CONFIG_M68060)
  270. # define CPU_IS_060 (0)
  271. # define MMU_IS_060 (0)
  272. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
  273. # define CPU_IS_060 (m68k_cputype & CPU_68060)
  274. # define MMU_IS_060 (m68k_mmutype & MMU_68060)
  275. #else
  276. # define CPU_M68060_ONLY
  277. # define CPU_IS_060 (1)
  278. # define MMU_IS_060 (1)
  279. #endif
  280. #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
  281. # define CPU_IS_020_OR_030 (0)
  282. #else
  283. # define CPU_M68020_OR_M68030
  284. # if defined(CONFIG_M68040) || defined(CONFIG_M68060)
  285. # define CPU_IS_020_OR_030 (!m68k_is040or060)
  286. # else
  287. # define CPU_M68020_OR_M68030_ONLY
  288. # define CPU_IS_020_OR_030 (1)
  289. # endif
  290. #endif
  291. #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
  292. # define CPU_IS_040_OR_060 (0)
  293. #else
  294. # define CPU_M68040_OR_M68060
  295. # if defined(CONFIG_M68020) || defined(CONFIG_M68030)
  296. # define CPU_IS_040_OR_060 (m68k_is040or060)
  297. # else
  298. # define CPU_M68040_OR_M68060_ONLY
  299. # define CPU_IS_040_OR_060 (1)
  300. # endif
  301. #endif
  302. #define CPU_TYPE (m68k_cputype)
  303. #ifdef CONFIG_M68KFPU_EMU
  304. # ifdef CONFIG_M68KFPU_EMU_ONLY
  305. # define FPU_IS_EMU (1)
  306. # else
  307. # define FPU_IS_EMU (!m68k_fputype)
  308. # endif
  309. #else
  310. # define FPU_IS_EMU (0)
  311. #endif
  312. /*
  313. * Miscellaneous
  314. */
  315. #define NUM_MEMINFO 4
  316. #define CL_SIZE 256
  317. #define COMMAND_LINE_SIZE CL_SIZE
  318. #ifndef __ASSEMBLY__
  319. struct mem_info {
  320. unsigned long addr; /* physical address of memory chunk */
  321. unsigned long size; /* length of memory chunk (in bytes) */
  322. };
  323. extern int m68k_num_memory; /* # of memory blocks found (and used) */
  324. extern int m68k_realnum_memory; /* real # of memory blocks found */
  325. extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
  326. #endif
  327. #endif /* __KERNEL__ */
  328. #endif /* _M68K_SETUP_H */