setup.h 11 KB

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