setup.h 11 KB

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