config.c 20 KB

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