config.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  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. #warning move to adb/via init
  141. #if 0
  142. mach_hwclk = mac_hwclk;
  143. #endif
  144. mach_set_clock_mmss = mac_set_clock_mmss;
  145. mach_reset = mac_reset;
  146. mach_halt = mac_poweroff;
  147. mach_power_off = mac_poweroff;
  148. mach_max_dma_address = 0xffffffff;
  149. #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
  150. mach_beep = mac_mksound;
  151. #endif
  152. #ifdef CONFIG_HEARTBEAT
  153. #if 0
  154. mach_heartbeat = mac_heartbeat;
  155. mach_heartbeat_irq = IRQ_MAC_TIMER;
  156. #endif
  157. #endif
  158. /*
  159. * Determine hardware present
  160. */
  161. mac_identify();
  162. mac_report_hardware();
  163. /*
  164. * AFAIK only the IIci takes a cache card. The IIfx has onboard
  165. * cache ... someone needs to figure out how to tell if it's on or
  166. * not.
  167. */
  168. if (macintosh_config->ident == MAC_MODEL_IICI
  169. || macintosh_config->ident == MAC_MODEL_IIFX)
  170. mach_l2_flush = mac_cache_card_flush;
  171. /*
  172. * Check for machine specific fixups.
  173. */
  174. #ifdef OLD_NUBUS_CODE
  175. nubus_sweep_video();
  176. #endif
  177. }
  178. /*
  179. * Macintosh Table: hardcoded model configuration data.
  180. *
  181. * Much of this was defined by Alan, based on who knows what docs.
  182. * I've added a lot more, and some of that was pure guesswork based
  183. * on hardware pages present on the Mac web site. Possibly wildly
  184. * inaccurate, so look here if a new Mac model won't run. Example: if
  185. * a Mac crashes immediately after the VIA1 registers have been dumped
  186. * to the screen, it probably died attempting to read DirB on a RBV.
  187. * Meaning it should have MAC_VIA_IIci here :-)
  188. */
  189. struct mac_model *macintosh_config;
  190. EXPORT_SYMBOL(macintosh_config);
  191. static struct mac_model mac_data_table[] = {
  192. /*
  193. * We'll pretend to be a Macintosh II, that's pretty safe.
  194. */
  195. {
  196. .ident = MAC_MODEL_II,
  197. .name = "Unknown",
  198. .adb_type = MAC_ADB_II,
  199. .via_type = MAC_VIA_II,
  200. .scsi_type = MAC_SCSI_OLD,
  201. .scc_type = MAC_SCC_II,
  202. .nubus_type = MAC_NUBUS
  203. },
  204. /*
  205. * Original MacII hardware
  206. *
  207. */
  208. {
  209. .ident = MAC_MODEL_II,
  210. .name = "II",
  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_IIX,
  218. .name = "IIx",
  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_IICX,
  226. .name = "IIcx",
  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. .ident = MAC_MODEL_SE30,
  234. .name = "SE/30",
  235. .adb_type = MAC_ADB_II,
  236. .via_type = MAC_VIA_II,
  237. .scsi_type = MAC_SCSI_OLD,
  238. .scc_type = MAC_SCC_II,
  239. .nubus_type = MAC_NUBUS
  240. },
  241. /*
  242. * Weirdified MacII hardware - all subtly different. Gee thanks
  243. * Apple. All these boxes seem to have VIA2 in a different place to
  244. * the MacII (+1A000 rather than +4000)
  245. * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
  246. */
  247. {
  248. .ident = MAC_MODEL_IICI,
  249. .name = "IIci",
  250. .adb_type = MAC_ADB_II,
  251. .via_type = MAC_VIA_IIci,
  252. .scsi_type = MAC_SCSI_OLD,
  253. .scc_type = MAC_SCC_II,
  254. .nubus_type = MAC_NUBUS
  255. }, {
  256. .ident = MAC_MODEL_IIFX,
  257. .name = "IIfx",
  258. .adb_type = MAC_ADB_IOP,
  259. .via_type = MAC_VIA_IIci,
  260. .scsi_type = MAC_SCSI_OLD,
  261. .scc_type = MAC_SCC_IOP,
  262. .nubus_type = MAC_NUBUS
  263. }, {
  264. .ident = MAC_MODEL_IISI,
  265. .name = "IIsi",
  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_IIVI,
  273. .name = "IIvi",
  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. .ident = MAC_MODEL_IIVX,
  281. .name = "IIvx",
  282. .adb_type = MAC_ADB_IISI,
  283. .via_type = MAC_VIA_IIci,
  284. .scsi_type = MAC_SCSI_OLD,
  285. .scc_type = MAC_SCC_II,
  286. .nubus_type = MAC_NUBUS
  287. },
  288. /*
  289. * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
  290. */
  291. {
  292. .ident = MAC_MODEL_CLII,
  293. .name = "Classic II",
  294. .adb_type = MAC_ADB_IISI,
  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. .ident = MAC_MODEL_CCL,
  301. .name = "Color Classic",
  302. .adb_type = MAC_ADB_CUDA,
  303. .via_type = MAC_VIA_IIci,
  304. .scsi_type = MAC_SCSI_OLD,
  305. .scc_type = MAC_SCC_II,
  306. .nubus_type = MAC_NUBUS},
  307. /*
  308. * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
  309. */
  310. {
  311. .ident = MAC_MODEL_LC,
  312. .name = "LC",
  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_LCII,
  320. .name = "LC II",
  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. .ident = MAC_MODEL_LCIII,
  328. .name = "LC III",
  329. .adb_type = MAC_ADB_IISI,
  330. .via_type = MAC_VIA_IIci,
  331. .scsi_type = MAC_SCSI_OLD,
  332. .scc_type = MAC_SCC_II,
  333. .nubus_type = MAC_NUBUS
  334. },
  335. /*
  336. * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
  337. * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
  338. * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
  339. * AMD 79C940 (MACE).
  340. * The 700, 900 and 950 have some I/O chips in the wrong place to
  341. * confuse us. The 840AV has a SCSI location of its own (same as
  342. * the 660AV).
  343. */
  344. {
  345. .ident = MAC_MODEL_Q605,
  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_Q605_ACC,
  354. .name = "Quadra 605",
  355. .adb_type = MAC_ADB_CUDA,
  356. .via_type = MAC_VIA_QUADRA,
  357. .scsi_type = MAC_SCSI_QUADRA,
  358. .scc_type = MAC_SCC_QUADRA,
  359. .nubus_type = MAC_NUBUS
  360. }, {
  361. .ident = MAC_MODEL_Q610,
  362. .name = "Quadra 610",
  363. .adb_type = MAC_ADB_II,
  364. .via_type = MAC_VIA_QUADRA,
  365. .scsi_type = MAC_SCSI_QUADRA,
  366. .scc_type = MAC_SCC_QUADRA,
  367. .ether_type = MAC_ETHER_SONIC,
  368. .nubus_type = MAC_NUBUS
  369. }, {
  370. .ident = MAC_MODEL_Q630,
  371. .name = "Quadra 630",
  372. .adb_type = MAC_ADB_CUDA,
  373. .via_type = MAC_VIA_QUADRA,
  374. .scsi_type = MAC_SCSI_QUADRA,
  375. .ide_type = MAC_IDE_QUADRA,
  376. .scc_type = MAC_SCC_QUADRA,
  377. .ether_type = MAC_ETHER_SONIC,
  378. .nubus_type = MAC_NUBUS
  379. }, {
  380. .ident = MAC_MODEL_Q650,
  381. .name = "Quadra 650",
  382. .adb_type = MAC_ADB_II,
  383. .via_type = MAC_VIA_QUADRA,
  384. .scsi_type = MAC_SCSI_QUADRA,
  385. .scc_type = MAC_SCC_QUADRA,
  386. .ether_type = MAC_ETHER_SONIC,
  387. .nubus_type = MAC_NUBUS
  388. },
  389. /* The Q700 does have a NS Sonic */
  390. {
  391. .ident = MAC_MODEL_Q700,
  392. .name = "Quadra 700",
  393. .adb_type = MAC_ADB_II,
  394. .via_type = MAC_VIA_QUADRA,
  395. .scsi_type = MAC_SCSI_QUADRA2,
  396. .scc_type = MAC_SCC_QUADRA,
  397. .ether_type = MAC_ETHER_SONIC,
  398. .nubus_type = MAC_NUBUS
  399. }, {
  400. .ident = MAC_MODEL_Q800,
  401. .name = "Quadra 800",
  402. .adb_type = MAC_ADB_II,
  403. .via_type = MAC_VIA_QUADRA,
  404. .scsi_type = MAC_SCSI_QUADRA,
  405. .scc_type = MAC_SCC_QUADRA,
  406. .ether_type = MAC_ETHER_SONIC,
  407. .nubus_type = MAC_NUBUS
  408. }, {
  409. .ident = MAC_MODEL_Q840,
  410. .name = "Quadra 840AV",
  411. .adb_type = MAC_ADB_CUDA,
  412. .via_type = MAC_VIA_QUADRA,
  413. .scsi_type = MAC_SCSI_QUADRA3,
  414. .scc_type = MAC_SCC_PSC,
  415. .ether_type = MAC_ETHER_MACE,
  416. .nubus_type = MAC_NUBUS
  417. }, {
  418. .ident = MAC_MODEL_Q900,
  419. .name = "Quadra 900",
  420. .adb_type = MAC_ADB_IOP,
  421. .via_type = MAC_VIA_QUADRA,
  422. .scsi_type = MAC_SCSI_QUADRA2,
  423. .scc_type = MAC_SCC_IOP,
  424. .ether_type = MAC_ETHER_SONIC,
  425. .nubus_type = MAC_NUBUS
  426. }, {
  427. .ident = MAC_MODEL_Q950,
  428. .name = "Quadra 950",
  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. /*
  437. * Performa - more LC type machines
  438. */
  439. {
  440. .ident = MAC_MODEL_P460,
  441. .name = "Performa 460",
  442. .adb_type = MAC_ADB_IISI,
  443. .via_type = MAC_VIA_IIci,
  444. .scsi_type = MAC_SCSI_OLD,
  445. .scc_type = MAC_SCC_II,
  446. .nubus_type = MAC_NUBUS
  447. }, {
  448. .ident = MAC_MODEL_P475,
  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_P475F,
  457. .name = "Performa 475",
  458. .adb_type = MAC_ADB_CUDA,
  459. .via_type = MAC_VIA_QUADRA,
  460. .scsi_type = MAC_SCSI_QUADRA,
  461. .scc_type = MAC_SCC_II,
  462. .nubus_type = MAC_NUBUS
  463. }, {
  464. .ident = MAC_MODEL_P520,
  465. .name = "Performa 520",
  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. .ident = MAC_MODEL_P550,
  473. .name = "Performa 550",
  474. .adb_type = MAC_ADB_CUDA,
  475. .via_type = MAC_VIA_IIci,
  476. .scsi_type = MAC_SCSI_OLD,
  477. .scc_type = MAC_SCC_II,
  478. .nubus_type = MAC_NUBUS
  479. },
  480. /* These have the comm slot, and therefore the possibility of SONIC ethernet */
  481. {
  482. .ident = MAC_MODEL_P575,
  483. .name = "Performa 575",
  484. .adb_type = MAC_ADB_CUDA,
  485. .via_type = MAC_VIA_QUADRA,
  486. .scsi_type = MAC_SCSI_QUADRA,
  487. .scc_type = MAC_SCC_II,
  488. .ether_type = MAC_ETHER_SONIC,
  489. .nubus_type = MAC_NUBUS
  490. }, {
  491. .ident = MAC_MODEL_P588,
  492. .name = "Performa 588",
  493. .adb_type = MAC_ADB_CUDA,
  494. .via_type = MAC_VIA_QUADRA,
  495. .scsi_type = MAC_SCSI_QUADRA,
  496. .ide_type = MAC_IDE_QUADRA,
  497. .scc_type = MAC_SCC_II,
  498. .ether_type = MAC_ETHER_SONIC,
  499. .nubus_type = MAC_NUBUS
  500. }, {
  501. .ident = MAC_MODEL_TV,
  502. .name = "TV",
  503. .adb_type = MAC_ADB_CUDA,
  504. .via_type = MAC_VIA_QUADRA,
  505. .scsi_type = MAC_SCSI_OLD,
  506. .scc_type = MAC_SCC_II,
  507. .nubus_type = MAC_NUBUS
  508. }, {
  509. .ident = MAC_MODEL_P600,
  510. .name = "Performa 600",
  511. .adb_type = MAC_ADB_IISI,
  512. .via_type = MAC_VIA_IIci,
  513. .scsi_type = MAC_SCSI_OLD,
  514. .scc_type = MAC_SCC_II,
  515. .nubus_type = MAC_NUBUS
  516. },
  517. /*
  518. * Centris - just guessing again; maybe like Quadra
  519. */
  520. /* The C610 may or may not have SONIC. We probe to make sure */
  521. {
  522. .ident = MAC_MODEL_C610,
  523. .name = "Centris 610",
  524. .adb_type = MAC_ADB_II,
  525. .via_type = MAC_VIA_QUADRA,
  526. .scsi_type = MAC_SCSI_QUADRA,
  527. .scc_type = MAC_SCC_QUADRA,
  528. .ether_type = MAC_ETHER_SONIC,
  529. .nubus_type = MAC_NUBUS
  530. }, {
  531. .ident = MAC_MODEL_C650,
  532. .name = "Centris 650",
  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_C660,
  541. .name = "Centris 660AV",
  542. .adb_type = MAC_ADB_CUDA,
  543. .via_type = MAC_VIA_QUADRA,
  544. .scsi_type = MAC_SCSI_QUADRA3,
  545. .scc_type = MAC_SCC_PSC,
  546. .ether_type = MAC_ETHER_MACE,
  547. .nubus_type = MAC_NUBUS
  548. },
  549. /*
  550. * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
  551. * and a PMU (in two variations?) for ADB. Most of them use the
  552. * Quadra-style VIAs. A few models also have IDE from hell.
  553. */
  554. {
  555. .ident = MAC_MODEL_PB140,
  556. .name = "PowerBook 140",
  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_PB145,
  564. .name = "PowerBook 145",
  565. .adb_type = MAC_ADB_PB1,
  566. .via_type = MAC_VIA_QUADRA,
  567. .scsi_type = MAC_SCSI_OLD,
  568. .scc_type = MAC_SCC_QUADRA,
  569. .nubus_type = MAC_NUBUS
  570. }, {
  571. .ident = MAC_MODEL_PB150,
  572. .name = "PowerBook 150",
  573. .adb_type = MAC_ADB_PB1,
  574. .via_type = MAC_VIA_IIci,
  575. .scsi_type = MAC_SCSI_OLD,
  576. .ide_type = MAC_IDE_PB,
  577. .scc_type = MAC_SCC_QUADRA,
  578. .nubus_type = MAC_NUBUS
  579. }, {
  580. .ident = MAC_MODEL_PB160,
  581. .name = "PowerBook 160",
  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_PB165,
  589. .name = "PowerBook 165",
  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_PB165C,
  597. .name = "PowerBook 165c",
  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_PB170,
  605. .name = "PowerBook 170",
  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_PB180,
  613. .name = "PowerBook 180",
  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_PB180C,
  621. .name = "PowerBook 180c",
  622. .adb_type = MAC_ADB_PB1,
  623. .via_type = MAC_VIA_QUADRA,
  624. .scsi_type = MAC_SCSI_OLD,
  625. .scc_type = MAC_SCC_QUADRA,
  626. .nubus_type = MAC_NUBUS
  627. }, {
  628. .ident = MAC_MODEL_PB190,
  629. .name = "PowerBook 190",
  630. .adb_type = MAC_ADB_PB2,
  631. .via_type = MAC_VIA_QUADRA,
  632. .scsi_type = MAC_SCSI_OLD,
  633. .ide_type = MAC_IDE_BABOON,
  634. .scc_type = MAC_SCC_QUADRA,
  635. .nubus_type = MAC_NUBUS
  636. }, {
  637. .ident = MAC_MODEL_PB520,
  638. .name = "PowerBook 520",
  639. .adb_type = MAC_ADB_PB2,
  640. .via_type = MAC_VIA_QUADRA,
  641. .scsi_type = MAC_SCSI_OLD,
  642. .scc_type = MAC_SCC_QUADRA,
  643. .ether_type = MAC_ETHER_SONIC,
  644. .nubus_type = MAC_NUBUS
  645. },
  646. /*
  647. * PowerBook Duos are pretty much like normal PowerBooks
  648. * All of these probably have onboard SONIC in the Dock which
  649. * means we'll have to probe for it eventually.
  650. *
  651. * Are these really MAC_VIA_IIci? The developer notes for the
  652. * Duos show pretty much the same custom parts as in most of
  653. * the other PowerBooks which would imply MAC_VIA_QUADRA.
  654. */
  655. {
  656. .ident = MAC_MODEL_PB210,
  657. .name = "PowerBook Duo 210",
  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_PB230,
  665. .name = "PowerBook Duo 230",
  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_PB250,
  673. .name = "PowerBook Duo 250",
  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_PB270C,
  681. .name = "PowerBook Duo 270c",
  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_PB280,
  689. .name = "PowerBook Duo 280",
  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. .ident = MAC_MODEL_PB280C,
  697. .name = "PowerBook Duo 280c",
  698. .adb_type = MAC_ADB_PB2,
  699. .via_type = MAC_VIA_IIci,
  700. .scsi_type = MAC_SCSI_OLD,
  701. .scc_type = MAC_SCC_QUADRA,
  702. .nubus_type = MAC_NUBUS
  703. },
  704. /*
  705. * Other stuff ??
  706. */
  707. {
  708. .ident = -1
  709. }
  710. };
  711. static void __init mac_identify(void)
  712. {
  713. struct mac_model *m;
  714. /* Penguin data useful? */
  715. int model = mac_bi_data.id;
  716. if (!model) {
  717. /* no bootinfo model id -> NetBSD booter was used! */
  718. /* XXX FIXME: breaks for model > 31 */
  719. model = (mac_bi_data.cpuid >> 2) & 63;
  720. printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
  721. }
  722. macintosh_config = mac_data_table;
  723. for (m = macintosh_config; m->ident != -1; m++) {
  724. if (m->ident == model) {
  725. macintosh_config = m;
  726. break;
  727. }
  728. }
  729. /* We need to pre-init the IOPs, if any. Otherwise */
  730. /* the serial console won't work if the user had */
  731. /* the serial ports set to "Faster" mode in MacOS. */
  732. iop_preinit();
  733. printk(KERN_INFO "Detected Macintosh model: %d \n", model);
  734. /*
  735. * Report booter data:
  736. */
  737. printk(KERN_DEBUG " Penguin bootinfo data:\n");
  738. printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
  739. mac_bi_data.videoaddr, mac_bi_data.videorow,
  740. mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
  741. mac_bi_data.dimensions >> 16);
  742. printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
  743. mac_bi_data.videological, mac_orig_videoaddr,
  744. mac_bi_data.sccbase);
  745. printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
  746. mac_bi_data.boottime, mac_bi_data.gmtbias);
  747. printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
  748. mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
  749. #if 0
  750. printk("Ramdisk: addr 0x%lx size 0x%lx\n",
  751. m68k_ramdisk.addr, m68k_ramdisk.size);
  752. #endif
  753. iop_init();
  754. via_init();
  755. oss_init();
  756. psc_init();
  757. baboon_init();
  758. }
  759. static void __init mac_report_hardware(void)
  760. {
  761. printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
  762. }
  763. static void mac_get_model(char *str)
  764. {
  765. strcpy(str, "Macintosh ");
  766. strcat(str, macintosh_config->name);
  767. }