config.c 21 KB

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