config.c 20 KB

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