config.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. /*
  2. * linux/arch/m68k/mac/config.c
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file COPYING in the main directory of this archive
  6. * for more details.
  7. */
  8. /*
  9. * Miscellaneous linux stuff
  10. */
  11. #include <linux/config.h>
  12. #include <linux/module.h>
  13. #include <linux/types.h>
  14. #include <linux/mm.h>
  15. #include <linux/tty.h>
  16. #include <linux/console.h>
  17. #include <linux/interrupt.h>
  18. /* keyb */
  19. #include <linux/random.h>
  20. #include <linux/delay.h>
  21. /* keyb */
  22. #include <linux/init.h>
  23. #include <linux/vt_kern.h>
  24. #define BOOTINFO_COMPAT_1_0
  25. #include <asm/setup.h>
  26. #include <asm/bootinfo.h>
  27. #include <asm/system.h>
  28. #include <asm/io.h>
  29. #include <asm/irq.h>
  30. #include <asm/pgtable.h>
  31. #include <asm/rtc.h>
  32. #include <asm/machdep.h>
  33. #include <asm/macintosh.h>
  34. #include <asm/macints.h>
  35. #include <asm/machw.h>
  36. #include <asm/mac_iop.h>
  37. #include <asm/mac_via.h>
  38. #include <asm/mac_oss.h>
  39. #include <asm/mac_psc.h>
  40. /* Mac bootinfo struct */
  41. struct mac_booter_data mac_bi_data;
  42. int mac_bisize = sizeof mac_bi_data;
  43. struct mac_hw_present mac_hw_present;
  44. /* New m68k bootinfo stuff and videobase */
  45. extern int m68k_num_memory;
  46. extern struct mem_info m68k_memory[NUM_MEMINFO];
  47. extern struct mem_info m68k_ramdisk;
  48. extern char m68k_command_line[CL_SIZE];
  49. void *mac_env; /* Loaded by the boot asm */
  50. /* The phys. video addr. - might be bogus on some machines */
  51. unsigned long mac_orig_videoaddr;
  52. /* Mac specific timer functions */
  53. extern unsigned long mac_gettimeoffset (void);
  54. extern int mac_hwclk (int, struct rtc_time *);
  55. extern int mac_set_clock_mmss (unsigned long);
  56. extern int show_mac_interrupts(struct seq_file *, void *);
  57. extern void iop_preinit(void);
  58. extern void iop_init(void);
  59. extern void via_init(void);
  60. extern void via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *));
  61. extern void via_flush_cache(void);
  62. extern void oss_init(void);
  63. extern void psc_init(void);
  64. extern void baboon_init(void);
  65. extern void mac_mksound(unsigned int, unsigned int);
  66. extern void nubus_sweep_video(void);
  67. /* Mac specific debug functions (in debug.c) */
  68. extern void mac_debug_init(void);
  69. extern void mac_debugging_long(int, long);
  70. static void mac_get_model(char *str);
  71. static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
  72. {
  73. via_init_clock(vector);
  74. }
  75. /*
  76. * Parse a Macintosh-specific record in the bootinfo
  77. */
  78. int __init mac_parse_bootinfo(const struct bi_record *record)
  79. {
  80. int unknown = 0;
  81. const u_long *data = record->data;
  82. switch (record->tag) {
  83. case BI_MAC_MODEL:
  84. mac_bi_data.id = *data;
  85. break;
  86. case BI_MAC_VADDR:
  87. mac_bi_data.videoaddr = *data;
  88. break;
  89. case BI_MAC_VDEPTH:
  90. mac_bi_data.videodepth = *data;
  91. break;
  92. case BI_MAC_VROW:
  93. mac_bi_data.videorow = *data;
  94. break;
  95. case BI_MAC_VDIM:
  96. mac_bi_data.dimensions = *data;
  97. break;
  98. case BI_MAC_VLOGICAL:
  99. mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
  100. mac_orig_videoaddr = *data;
  101. break;
  102. case BI_MAC_SCCBASE:
  103. mac_bi_data.sccbase = *data;
  104. break;
  105. case BI_MAC_BTIME:
  106. mac_bi_data.boottime = *data;
  107. break;
  108. case BI_MAC_GMTBIAS:
  109. mac_bi_data.gmtbias = *data;
  110. break;
  111. case BI_MAC_MEMSIZE:
  112. mac_bi_data.memsize = *data;
  113. break;
  114. case BI_MAC_CPUID:
  115. mac_bi_data.cpuid = *data;
  116. break;
  117. case BI_MAC_ROMBASE:
  118. mac_bi_data.rombase = *data;
  119. break;
  120. default:
  121. unknown = 1;
  122. }
  123. return(unknown);
  124. }
  125. /*
  126. * Flip into 24bit mode for an instant - flushes the L2 cache card. We
  127. * have to disable interrupts for this. Our IRQ handlers will crap
  128. * themselves if they take an IRQ in 24bit mode!
  129. */
  130. static void mac_cache_card_flush(int writeback)
  131. {
  132. unsigned long flags;
  133. local_irq_save(flags);
  134. via_flush_cache();
  135. local_irq_restore(flags);
  136. }
  137. void __init config_mac(void)
  138. {
  139. if (!MACH_IS_MAC) {
  140. printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
  141. }
  142. mach_sched_init = mac_sched_init;
  143. mach_init_IRQ = mac_init_IRQ;
  144. mach_get_model = mac_get_model;
  145. mach_gettimeoffset = mac_gettimeoffset;
  146. #warning move to adb/via init
  147. #if 0
  148. mach_hwclk = mac_hwclk;
  149. #endif
  150. mach_set_clock_mmss = mac_set_clock_mmss;
  151. mach_reset = mac_reset;
  152. mach_halt = mac_poweroff;
  153. mach_power_off = mac_poweroff;
  154. mach_max_dma_address = 0xffffffff;
  155. #if 0
  156. mach_debug_init = mac_debug_init;
  157. #endif
  158. #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
  159. mach_beep = mac_mksound;
  160. #endif
  161. #ifdef CONFIG_HEARTBEAT
  162. #if 0
  163. mach_heartbeat = mac_heartbeat;
  164. mach_heartbeat_irq = IRQ_MAC_TIMER;
  165. #endif
  166. #endif
  167. /*
  168. * Determine hardware present
  169. */
  170. mac_identify();
  171. mac_report_hardware();
  172. /* AFAIK only the IIci takes a cache card. The IIfx has onboard
  173. cache ... someone needs to figure out how to tell if it's on or
  174. not. */
  175. if (macintosh_config->ident == MAC_MODEL_IICI
  176. || macintosh_config->ident == MAC_MODEL_IIFX) {
  177. mach_l2_flush = mac_cache_card_flush;
  178. }
  179. /*
  180. * Check for machine specific fixups.
  181. */
  182. #ifdef OLD_NUBUS_CODE
  183. nubus_sweep_video();
  184. #endif
  185. }
  186. /*
  187. * Macintosh Table: hardcoded model configuration data.
  188. *
  189. * Much of this was defined by Alan, based on who knows what docs.
  190. * I've added a lot more, and some of that was pure guesswork based
  191. * on hardware pages present on the Mac web site. Possibly wildly
  192. * inaccurate, so look here if a new Mac model won't run. Example: if
  193. * a Mac crashes immediately after the VIA1 registers have been dumped
  194. * to the screen, it probably died attempting to read DirB on a RBV.
  195. * Meaning it should have MAC_VIA_IIci here :-)
  196. */
  197. struct mac_model *macintosh_config;
  198. EXPORT_SYMBOL(macintosh_config);
  199. static struct mac_model mac_data_table[]=
  200. {
  201. /*
  202. * We'll pretend to be a Macintosh II, that's pretty safe.
  203. */
  204. {
  205. .ident = MAC_MODEL_II,
  206. .name = "Unknown",
  207. .adb_type = MAC_ADB_II,
  208. .via_type = MAC_VIA_II,
  209. .scsi_type = MAC_SCSI_OLD,
  210. .scc_type = MAC_SCC_II,
  211. .nubus_type = MAC_NUBUS
  212. },
  213. /*
  214. * Original MacII hardware
  215. *
  216. */
  217. {
  218. .ident = MAC_MODEL_II,
  219. .name = "II",
  220. .adb_type = MAC_ADB_II,
  221. .via_type = MAC_VIA_II,
  222. .scsi_type = MAC_SCSI_OLD,
  223. .scc_type = MAC_SCC_II,
  224. .nubus_type = MAC_NUBUS
  225. }, {
  226. .ident = MAC_MODEL_IIX,
  227. .name = "IIx",
  228. .adb_type = MAC_ADB_II,
  229. .via_type = MAC_VIA_II,
  230. .scsi_type = MAC_SCSI_OLD,
  231. .scc_type = MAC_SCC_II,
  232. .nubus_type = MAC_NUBUS
  233. }, {
  234. .ident = MAC_MODEL_IICX,
  235. .name = "IIcx",
  236. .adb_type = MAC_ADB_II,
  237. .via_type = MAC_VIA_II,
  238. .scsi_type = MAC_SCSI_OLD,
  239. .scc_type = MAC_SCC_II,
  240. .nubus_type = MAC_NUBUS
  241. }, {
  242. .ident = MAC_MODEL_SE30,
  243. .name = "SE/30",
  244. .adb_type = MAC_ADB_II,
  245. .via_type = MAC_VIA_II,
  246. .scsi_type = MAC_SCSI_OLD,
  247. .scc_type = MAC_SCC_II,
  248. .nubus_type = MAC_NUBUS
  249. },
  250. /*
  251. * Weirdified MacII hardware - all subtley different. Gee thanks
  252. * Apple. All these boxes seem to have VIA2 in a different place to
  253. * the MacII (+1A000 rather than +4000)
  254. * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
  255. */
  256. {
  257. .ident = MAC_MODEL_IICI,
  258. .name = "IIci",
  259. .adb_type = MAC_ADB_II,
  260. .via_type = MAC_VIA_IIci,
  261. .scsi_type = MAC_SCSI_OLD,
  262. .scc_type = MAC_SCC_II,
  263. .nubus_type = MAC_NUBUS
  264. }, {
  265. .ident = MAC_MODEL_IIFX,
  266. .name = "IIfx",
  267. .adb_type = MAC_ADB_IOP,
  268. .via_type = MAC_VIA_IIci,
  269. .scsi_type = MAC_SCSI_OLD,
  270. .scc_type = MAC_SCC_IOP,
  271. .nubus_type = MAC_NUBUS
  272. }, {
  273. .ident = MAC_MODEL_IISI,
  274. .name = "IIsi",
  275. .adb_type = MAC_ADB_IISI,
  276. .via_type = MAC_VIA_IIci,
  277. .scsi_type = MAC_SCSI_OLD,
  278. .scc_type = MAC_SCC_II,
  279. .nubus_type = MAC_NUBUS
  280. }, {
  281. .ident = MAC_MODEL_IIVI,
  282. .name = "IIvi",
  283. .adb_type = MAC_ADB_IISI,
  284. .via_type = MAC_VIA_IIci,
  285. .scsi_type = MAC_SCSI_OLD,
  286. .scc_type = MAC_SCC_II,
  287. .nubus_type = MAC_NUBUS
  288. }, {
  289. .ident = MAC_MODEL_IIVX,
  290. .name = "IIvx",
  291. .adb_type = MAC_ADB_IISI,
  292. .via_type = MAC_VIA_IIci,
  293. .scsi_type = MAC_SCSI_OLD,
  294. .scc_type = MAC_SCC_II,
  295. .nubus_type = MAC_NUBUS
  296. },
  297. /*
  298. * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
  299. */
  300. {
  301. .ident = MAC_MODEL_CLII,
  302. .name = "Classic II",
  303. .adb_type = MAC_ADB_IISI,
  304. .via_type = MAC_VIA_IIci,
  305. .scsi_type = MAC_SCSI_OLD,
  306. .scc_type = MAC_SCC_II,
  307. .nubus_type = MAC_NUBUS
  308. }, {
  309. .ident = MAC_MODEL_CCL,
  310. .name = "Color Classic",
  311. .adb_type = MAC_ADB_CUDA,
  312. .via_type = MAC_VIA_IIci,
  313. .scsi_type = MAC_SCSI_OLD,
  314. .scc_type = MAC_SCC_II,
  315. .nubus_type = MAC_NUBUS},
  316. /*
  317. * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
  318. */
  319. {
  320. .ident = MAC_MODEL_LC,
  321. .name = "LC",
  322. .adb_type = MAC_ADB_IISI,
  323. .via_type = MAC_VIA_IIci,
  324. .scsi_type = MAC_SCSI_OLD,
  325. .scc_type = MAC_SCC_II,
  326. .nubus_type = MAC_NUBUS
  327. }, {
  328. .ident = MAC_MODEL_LCII,
  329. .name = "LC II",
  330. .adb_type = MAC_ADB_IISI,
  331. .via_type = MAC_VIA_IIci,
  332. .scsi_type = MAC_SCSI_OLD,
  333. .scc_type = MAC_SCC_II,
  334. .nubus_type = MAC_NUBUS
  335. }, {
  336. .ident = MAC_MODEL_LCIII,
  337. .name = "LC III",
  338. .adb_type = MAC_ADB_IISI,
  339. .via_type = MAC_VIA_IIci,
  340. .scsi_type = MAC_SCSI_OLD,
  341. .scc_type = MAC_SCC_II,
  342. .nubus_type = MAC_NUBUS
  343. },
  344. /*
  345. * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
  346. * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
  347. * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
  348. * AMD 79C940 (MACE).
  349. * The 700, 900 and 950 have some I/O chips in the wrong place to
  350. * confuse us. The 840AV has a SCSI location of its own (same as
  351. * the 660AV).
  352. */
  353. {
  354. .ident = MAC_MODEL_Q605,
  355. .name = "Quadra 605",
  356. .adb_type = MAC_ADB_CUDA,
  357. .via_type = MAC_VIA_QUADRA,
  358. .scsi_type = MAC_SCSI_QUADRA,
  359. .scc_type = MAC_SCC_QUADRA,
  360. .nubus_type = MAC_NUBUS
  361. }, {
  362. .ident = MAC_MODEL_Q605_ACC,
  363. .name = "Quadra 605",
  364. .adb_type = MAC_ADB_CUDA,
  365. .via_type = MAC_VIA_QUADRA,
  366. .scsi_type = MAC_SCSI_QUADRA,
  367. .scc_type = MAC_SCC_QUADRA,
  368. .nubus_type = MAC_NUBUS
  369. }, {
  370. .ident = MAC_MODEL_Q610,
  371. .name = "Quadra 610",
  372. .adb_type = MAC_ADB_II,
  373. .via_type = MAC_VIA_QUADRA,
  374. .scsi_type = MAC_SCSI_QUADRA,
  375. .scc_type = MAC_SCC_QUADRA,
  376. .ether_type = MAC_ETHER_SONIC,
  377. .nubus_type = MAC_NUBUS
  378. }, {
  379. .ident = MAC_MODEL_Q630,
  380. .name = "Quadra 630",
  381. .adb_type = MAC_ADB_CUDA,
  382. .via_type = MAC_VIA_QUADRA,
  383. .scsi_type = MAC_SCSI_QUADRA,
  384. .ide_type = MAC_IDE_QUADRA,
  385. .scc_type = MAC_SCC_QUADRA,
  386. .ether_type = MAC_ETHER_SONIC,
  387. .nubus_type = MAC_NUBUS
  388. }, {
  389. .ident = MAC_MODEL_Q650,
  390. .name = "Quadra 650",
  391. .adb_type = MAC_ADB_II,
  392. .via_type = MAC_VIA_QUADRA,
  393. .scsi_type = MAC_SCSI_QUADRA,
  394. .scc_type = MAC_SCC_QUADRA,
  395. .ether_type = MAC_ETHER_SONIC,
  396. .nubus_type = MAC_NUBUS
  397. },
  398. /* The Q700 does have a NS Sonic */
  399. {
  400. .ident = MAC_MODEL_Q700,
  401. .name = "Quadra 700",
  402. .adb_type = MAC_ADB_II,
  403. .via_type = MAC_VIA_QUADRA,
  404. .scsi_type = MAC_SCSI_QUADRA2,
  405. .scc_type = MAC_SCC_QUADRA,
  406. .ether_type = MAC_ETHER_SONIC,
  407. .nubus_type = MAC_NUBUS
  408. }, {
  409. .ident = MAC_MODEL_Q800,
  410. .name = "Quadra 800",
  411. .adb_type = MAC_ADB_II,
  412. .via_type = MAC_VIA_QUADRA,
  413. .scsi_type = MAC_SCSI_QUADRA,
  414. .scc_type = MAC_SCC_QUADRA,
  415. .ether_type = MAC_ETHER_SONIC,
  416. .nubus_type = MAC_NUBUS
  417. }, {
  418. .ident = MAC_MODEL_Q840,
  419. .name = "Quadra 840AV",
  420. .adb_type = MAC_ADB_CUDA,
  421. .via_type = MAC_VIA_QUADRA,
  422. .scsi_type = MAC_SCSI_QUADRA3,
  423. .scc_type = MAC_SCC_PSC,
  424. .ether_type = MAC_ETHER_MACE,
  425. .nubus_type = MAC_NUBUS
  426. }, {
  427. .ident = MAC_MODEL_Q900,
  428. .name = "Quadra 900",
  429. .adb_type = MAC_ADB_IOP,
  430. .via_type = MAC_VIA_QUADRA,
  431. .scsi_type = MAC_SCSI_QUADRA2,
  432. .scc_type = MAC_SCC_IOP,
  433. .ether_type = MAC_ETHER_SONIC,
  434. .nubus_type = MAC_NUBUS
  435. }, {
  436. .ident = MAC_MODEL_Q950,
  437. .name = "Quadra 950",
  438. .adb_type = MAC_ADB_IOP,
  439. .via_type = MAC_VIA_QUADRA,
  440. .scsi_type = MAC_SCSI_QUADRA2,
  441. .scc_type = MAC_SCC_IOP,
  442. .ether_type = MAC_ETHER_SONIC,
  443. .nubus_type = MAC_NUBUS
  444. },
  445. /*
  446. * Performa - more LC type machines
  447. */
  448. {
  449. .ident = MAC_MODEL_P460,
  450. .name = "Performa 460",
  451. .adb_type = MAC_ADB_IISI,
  452. .via_type = MAC_VIA_IIci,
  453. .scsi_type = MAC_SCSI_OLD,
  454. .scc_type = MAC_SCC_II,
  455. .nubus_type = MAC_NUBUS
  456. }, {
  457. .ident = MAC_MODEL_P475,
  458. .name = "Performa 475",
  459. .adb_type = MAC_ADB_CUDA,
  460. .via_type = MAC_VIA_QUADRA,
  461. .scsi_type = MAC_SCSI_QUADRA,
  462. .scc_type = MAC_SCC_II,
  463. .nubus_type = MAC_NUBUS
  464. }, {
  465. .ident = MAC_MODEL_P475F,
  466. .name = "Performa 475",
  467. .adb_type = MAC_ADB_CUDA,
  468. .via_type = MAC_VIA_QUADRA,
  469. .scsi_type = MAC_SCSI_QUADRA,
  470. .scc_type = MAC_SCC_II,
  471. .nubus_type = MAC_NUBUS
  472. }, {
  473. .ident = MAC_MODEL_P520,
  474. .name = "Performa 520",
  475. .adb_type = MAC_ADB_CUDA,
  476. .via_type = MAC_VIA_IIci,
  477. .scsi_type = MAC_SCSI_OLD,
  478. .scc_type = MAC_SCC_II,
  479. .nubus_type = MAC_NUBUS
  480. }, {
  481. .ident = MAC_MODEL_P550,
  482. .name = "Performa 550",
  483. .adb_type = MAC_ADB_CUDA,
  484. .via_type = MAC_VIA_IIci,
  485. .scsi_type = MAC_SCSI_OLD,
  486. .scc_type = MAC_SCC_II,
  487. .nubus_type = MAC_NUBUS
  488. },
  489. /* These have the comm slot, and therefore the possibility of SONIC ethernet */
  490. {
  491. .ident = MAC_MODEL_P575,
  492. .name = "Performa 575",
  493. .adb_type = MAC_ADB_CUDA,
  494. .via_type = MAC_VIA_QUADRA,
  495. .scsi_type = MAC_SCSI_QUADRA,
  496. .scc_type = MAC_SCC_II,
  497. .ether_type = MAC_ETHER_SONIC,
  498. .nubus_type = MAC_NUBUS
  499. }, {
  500. .ident = MAC_MODEL_P588,
  501. .name = "Performa 588",
  502. .adb_type = MAC_ADB_CUDA,
  503. .via_type = MAC_VIA_QUADRA,
  504. .scsi_type = MAC_SCSI_QUADRA,
  505. .ide_type = MAC_IDE_QUADRA,
  506. .scc_type = MAC_SCC_II,
  507. .ether_type = MAC_ETHER_SONIC,
  508. .nubus_type = MAC_NUBUS
  509. }, {
  510. .ident = MAC_MODEL_TV,
  511. .name = "TV",
  512. .adb_type = MAC_ADB_CUDA,
  513. .via_type = MAC_VIA_QUADRA,
  514. .scsi_type = MAC_SCSI_OLD,
  515. .scc_type = MAC_SCC_II,
  516. .nubus_type = MAC_NUBUS
  517. }, {
  518. .ident = MAC_MODEL_P600,
  519. .name = "Performa 600",
  520. .adb_type = MAC_ADB_IISI,
  521. .via_type = MAC_VIA_IIci,
  522. .scsi_type = MAC_SCSI_OLD,
  523. .scc_type = MAC_SCC_II,
  524. .nubus_type = MAC_NUBUS
  525. },
  526. /*
  527. * Centris - just guessing again; maybe like Quadra
  528. */
  529. /* The C610 may or may not have SONIC. We probe to make sure */
  530. {
  531. .ident = MAC_MODEL_C610,
  532. .name = "Centris 610",
  533. .adb_type = MAC_ADB_II,
  534. .via_type = MAC_VIA_QUADRA,
  535. .scsi_type = MAC_SCSI_QUADRA,
  536. .scc_type = MAC_SCC_QUADRA,
  537. .ether_type = MAC_ETHER_SONIC,
  538. .nubus_type = MAC_NUBUS
  539. }, {
  540. .ident = MAC_MODEL_C650,
  541. .name = "Centris 650",
  542. .adb_type = MAC_ADB_II,
  543. .via_type = MAC_VIA_QUADRA,
  544. .scsi_type = MAC_SCSI_QUADRA,
  545. .scc_type = MAC_SCC_QUADRA,
  546. .ether_type = MAC_ETHER_SONIC,
  547. .nubus_type = MAC_NUBUS
  548. }, {
  549. .ident = MAC_MODEL_C660,
  550. .name = "Centris 660AV",
  551. .adb_type = MAC_ADB_CUDA,
  552. .via_type = MAC_VIA_QUADRA,
  553. .scsi_type = MAC_SCSI_QUADRA3,
  554. .scc_type = MAC_SCC_PSC,
  555. .ether_type = MAC_ETHER_MACE,
  556. .nubus_type = MAC_NUBUS
  557. },
  558. /*
  559. * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
  560. * and a PMU (in two variations?) for ADB. Most of them use the
  561. * Quadra-style VIAs. A few models also have IDE from hell.
  562. */
  563. {
  564. .ident = MAC_MODEL_PB140,
  565. .name = "PowerBook 140",
  566. .adb_type = MAC_ADB_PB1,
  567. .via_type = MAC_VIA_QUADRA,
  568. .scsi_type = MAC_SCSI_OLD,
  569. .scc_type = MAC_SCC_QUADRA,
  570. .nubus_type = MAC_NUBUS
  571. }, {
  572. .ident = MAC_MODEL_PB145,
  573. .name = "PowerBook 145",
  574. .adb_type = MAC_ADB_PB1,
  575. .via_type = MAC_VIA_QUADRA,
  576. .scsi_type = MAC_SCSI_OLD,
  577. .scc_type = MAC_SCC_QUADRA,
  578. .nubus_type = MAC_NUBUS
  579. }, {
  580. .ident = MAC_MODEL_PB150,
  581. .name = "PowerBook 150",
  582. .adb_type = MAC_ADB_PB1,
  583. .via_type = MAC_VIA_IIci,
  584. .scsi_type = MAC_SCSI_OLD,
  585. .ide_type = MAC_IDE_PB,
  586. .scc_type = MAC_SCC_QUADRA,
  587. .nubus_type = MAC_NUBUS
  588. }, {
  589. .ident = MAC_MODEL_PB160,
  590. .name = "PowerBook 160",
  591. .adb_type = MAC_ADB_PB1,
  592. .via_type = MAC_VIA_QUADRA,
  593. .scsi_type = MAC_SCSI_OLD,
  594. .scc_type = MAC_SCC_QUADRA,
  595. .nubus_type = MAC_NUBUS
  596. }, {
  597. .ident = MAC_MODEL_PB165,
  598. .name = "PowerBook 165",
  599. .adb_type = MAC_ADB_PB1,
  600. .via_type = MAC_VIA_QUADRA,
  601. .scsi_type = MAC_SCSI_OLD,
  602. .scc_type = MAC_SCC_QUADRA,
  603. .nubus_type = MAC_NUBUS
  604. }, {
  605. .ident = MAC_MODEL_PB165C,
  606. .name = "PowerBook 165c",
  607. .adb_type = MAC_ADB_PB1,
  608. .via_type = MAC_VIA_QUADRA,
  609. .scsi_type = MAC_SCSI_OLD,
  610. .scc_type = MAC_SCC_QUADRA,
  611. .nubus_type = MAC_NUBUS
  612. }, {
  613. .ident = MAC_MODEL_PB170,
  614. .name = "PowerBook 170",
  615. .adb_type = MAC_ADB_PB1,
  616. .via_type = MAC_VIA_QUADRA,
  617. .scsi_type = MAC_SCSI_OLD,
  618. .scc_type = MAC_SCC_QUADRA,
  619. .nubus_type = MAC_NUBUS
  620. }, {
  621. .ident = MAC_MODEL_PB180,
  622. .name = "PowerBook 180",
  623. .adb_type = MAC_ADB_PB1,
  624. .via_type = MAC_VIA_QUADRA,
  625. .scsi_type = MAC_SCSI_OLD,
  626. .scc_type = MAC_SCC_QUADRA,
  627. .nubus_type = MAC_NUBUS
  628. }, {
  629. .ident = MAC_MODEL_PB180C,
  630. .name = "PowerBook 180c",
  631. .adb_type = MAC_ADB_PB1,
  632. .via_type = MAC_VIA_QUADRA,
  633. .scsi_type = MAC_SCSI_OLD,
  634. .scc_type = MAC_SCC_QUADRA,
  635. .nubus_type = MAC_NUBUS
  636. }, {
  637. .ident = MAC_MODEL_PB190,
  638. .name = "PowerBook 190",
  639. .adb_type = MAC_ADB_PB2,
  640. .via_type = MAC_VIA_QUADRA,
  641. .scsi_type = MAC_SCSI_OLD,
  642. .ide_type = MAC_IDE_BABOON,
  643. .scc_type = MAC_SCC_QUADRA,
  644. .nubus_type = MAC_NUBUS
  645. }, {
  646. .ident = MAC_MODEL_PB520,
  647. .name = "PowerBook 520",
  648. .adb_type = MAC_ADB_PB2,
  649. .via_type = MAC_VIA_QUADRA,
  650. .scsi_type = MAC_SCSI_OLD,
  651. .scc_type = MAC_SCC_QUADRA,
  652. .ether_type = MAC_ETHER_SONIC,
  653. .nubus_type = MAC_NUBUS
  654. },
  655. /*
  656. * PowerBook Duos are pretty much like normal PowerBooks
  657. * All of these probably have onboard SONIC in the Dock which
  658. * means we'll have to probe for it eventually.
  659. *
  660. * Are these reallly MAC_VIA_IIci? The developer notes for the
  661. * Duos show pretty much the same custom parts as in most of
  662. * the other PowerBooks which would imply MAC_VIA_QUADRA.
  663. */
  664. {
  665. .ident = MAC_MODEL_PB210,
  666. .name = "PowerBook Duo 210",
  667. .adb_type = MAC_ADB_PB2,
  668. .via_type = MAC_VIA_IIci,
  669. .scsi_type = MAC_SCSI_OLD,
  670. .scc_type = MAC_SCC_QUADRA,
  671. .nubus_type = MAC_NUBUS
  672. }, {
  673. .ident = MAC_MODEL_PB230,
  674. .name = "PowerBook Duo 230",
  675. .adb_type = MAC_ADB_PB2,
  676. .via_type = MAC_VIA_IIci,
  677. .scsi_type = MAC_SCSI_OLD,
  678. .scc_type = MAC_SCC_QUADRA,
  679. .nubus_type = MAC_NUBUS
  680. }, {
  681. .ident = MAC_MODEL_PB250,
  682. .name = "PowerBook Duo 250",
  683. .adb_type = MAC_ADB_PB2,
  684. .via_type = MAC_VIA_IIci,
  685. .scsi_type = MAC_SCSI_OLD,
  686. .scc_type = MAC_SCC_QUADRA,
  687. .nubus_type = MAC_NUBUS
  688. }, {
  689. .ident = MAC_MODEL_PB270C,
  690. .name = "PowerBook Duo 270c",
  691. .adb_type = MAC_ADB_PB2,
  692. .via_type = MAC_VIA_IIci,
  693. .scsi_type = MAC_SCSI_OLD,
  694. .scc_type = MAC_SCC_QUADRA,
  695. .nubus_type = MAC_NUBUS
  696. }, {
  697. .ident = MAC_MODEL_PB280,
  698. .name = "PowerBook Duo 280",
  699. .adb_type = MAC_ADB_PB2,
  700. .via_type = MAC_VIA_IIci,
  701. .scsi_type = MAC_SCSI_OLD,
  702. .scc_type = MAC_SCC_QUADRA,
  703. .nubus_type = MAC_NUBUS
  704. }, {
  705. .ident = MAC_MODEL_PB280C,
  706. .name = "PowerBook Duo 280c",
  707. .adb_type = MAC_ADB_PB2,
  708. .via_type = MAC_VIA_IIci,
  709. .scsi_type = MAC_SCSI_OLD,
  710. .scc_type = MAC_SCC_QUADRA,
  711. .nubus_type = MAC_NUBUS
  712. },
  713. /*
  714. * Other stuff ??
  715. */
  716. {
  717. .ident = -1
  718. }
  719. };
  720. void mac_identify(void)
  721. {
  722. struct mac_model *m;
  723. /* Penguin data useful? */
  724. int model = mac_bi_data.id;
  725. if (!model) {
  726. /* no bootinfo model id -> NetBSD booter was used! */
  727. /* XXX FIXME: breaks for model > 31 */
  728. model=(mac_bi_data.cpuid>>2)&63;
  729. printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
  730. }
  731. macintosh_config = mac_data_table;
  732. for (m = macintosh_config ; m->ident != -1 ; m++) {
  733. if (m->ident == model) {
  734. macintosh_config = m;
  735. break;
  736. }
  737. }
  738. /* We need to pre-init the IOPs, if any. Otherwise */
  739. /* the serial console won't work if the user had */
  740. /* the serial ports set to "Faster" mode in MacOS. */
  741. iop_preinit();
  742. mac_debug_init();
  743. printk (KERN_INFO "Detected Macintosh model: %d \n", model);
  744. /*
  745. * Report booter data:
  746. */
  747. printk (KERN_DEBUG " Penguin bootinfo data:\n");
  748. printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
  749. mac_bi_data.videoaddr, mac_bi_data.videorow,
  750. mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
  751. mac_bi_data.dimensions >> 16);
  752. printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
  753. mac_bi_data.videological, mac_orig_videoaddr,
  754. mac_bi_data.sccbase);
  755. printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
  756. mac_bi_data.boottime, mac_bi_data.gmtbias);
  757. printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
  758. mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
  759. #if 0
  760. printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
  761. m68k_ramdisk.addr, m68k_ramdisk.size);
  762. #endif
  763. /*
  764. * TODO: set the various fields in macintosh_config->hw_present here!
  765. */
  766. switch (macintosh_config->scsi_type) {
  767. case MAC_SCSI_OLD:
  768. MACHW_SET(MAC_SCSI_80);
  769. break;
  770. case MAC_SCSI_QUADRA:
  771. case MAC_SCSI_QUADRA2:
  772. case MAC_SCSI_QUADRA3:
  773. MACHW_SET(MAC_SCSI_96);
  774. if ((macintosh_config->ident == MAC_MODEL_Q900) ||
  775. (macintosh_config->ident == MAC_MODEL_Q950))
  776. MACHW_SET(MAC_SCSI_96_2);
  777. break;
  778. default:
  779. printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
  780. MACHW_SET(MAC_SCSI_80);
  781. break;
  782. }
  783. iop_init();
  784. via_init();
  785. oss_init();
  786. psc_init();
  787. baboon_init();
  788. }
  789. void mac_report_hardware(void)
  790. {
  791. printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
  792. }
  793. static void mac_get_model(char *str)
  794. {
  795. strcpy(str,"Macintosh ");
  796. strcat(str, macintosh_config->name);
  797. }