config.c 21 KB

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