config.c 20 KB

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