setup.h 11 KB

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