config.c 22 KB

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