config.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  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. #ifdef CONFIG_DUMMY_CONSOLE
  184. conswitchp = &dummy_con;
  185. #endif
  186. mach_max_dma_address = 0xffffffff;
  187. #if 0
  188. mach_debug_init = mac_debug_init;
  189. #endif
  190. #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
  191. mach_beep = mac_mksound;
  192. #endif
  193. #ifdef CONFIG_HEARTBEAT
  194. #if 0
  195. mach_heartbeat = mac_heartbeat;
  196. mach_heartbeat_irq = IRQ_MAC_TIMER;
  197. #endif
  198. #endif
  199. /*
  200. * Determine hardware present
  201. */
  202. mac_identify();
  203. mac_report_hardware();
  204. /* AFAIK only the IIci takes a cache card. The IIfx has onboard
  205. cache ... someone needs to figure out how to tell if it's on or
  206. not. */
  207. if (macintosh_config->ident == MAC_MODEL_IICI
  208. || macintosh_config->ident == MAC_MODEL_IIFX) {
  209. mach_l2_flush = mac_cache_card_flush;
  210. }
  211. /*
  212. * Check for machine specific fixups.
  213. */
  214. #ifdef OLD_NUBUS_CODE
  215. nubus_sweep_video();
  216. #endif
  217. }
  218. /*
  219. * Macintosh Table: hardcoded model configuration data.
  220. *
  221. * Much of this was defined by Alan, based on who knows what docs.
  222. * I've added a lot more, and some of that was pure guesswork based
  223. * on hardware pages present on the Mac web site. Possibly wildly
  224. * inaccurate, so look here if a new Mac model won't run. Example: if
  225. * a Mac crashes immediately after the VIA1 registers have been dumped
  226. * to the screen, it probably died attempting to read DirB on a RBV.
  227. * Meaning it should have MAC_VIA_IIci here :-)
  228. */
  229. struct mac_model *macintosh_config;
  230. EXPORT_SYMBOL(macintosh_config);
  231. static struct mac_model mac_data_table[]=
  232. {
  233. /*
  234. * We'll pretend to be a Macintosh II, that's pretty safe.
  235. */
  236. {
  237. .ident = MAC_MODEL_II,
  238. .name = "Unknown",
  239. .adb_type = MAC_ADB_II,
  240. .via_type = MAC_VIA_II,
  241. .scsi_type = MAC_SCSI_OLD,
  242. .scc_type = MAC_SCC_II,
  243. .nubus_type = MAC_NUBUS
  244. },
  245. /*
  246. * Original MacII hardware
  247. *
  248. */
  249. {
  250. .ident = MAC_MODEL_II,
  251. .name = "II",
  252. .adb_type = MAC_ADB_II,
  253. .via_type = MAC_VIA_II,
  254. .scsi_type = MAC_SCSI_OLD,
  255. .scc_type = MAC_SCC_II,
  256. .nubus_type = MAC_NUBUS
  257. }, {
  258. .ident = MAC_MODEL_IIX,
  259. .name = "IIx",
  260. .adb_type = MAC_ADB_II,
  261. .via_type = MAC_VIA_II,
  262. .scsi_type = MAC_SCSI_OLD,
  263. .scc_type = MAC_SCC_II,
  264. .nubus_type = MAC_NUBUS
  265. }, {
  266. .ident = MAC_MODEL_IICX,
  267. .name = "IIcx",
  268. .adb_type = MAC_ADB_II,
  269. .via_type = MAC_VIA_II,
  270. .scsi_type = MAC_SCSI_OLD,
  271. .scc_type = MAC_SCC_II,
  272. .nubus_type = MAC_NUBUS
  273. }, {
  274. .ident = MAC_MODEL_SE30,
  275. .name = "SE/30",
  276. .adb_type = MAC_ADB_II,
  277. .via_type = MAC_VIA_II,
  278. .scsi_type = MAC_SCSI_OLD,
  279. .scc_type = MAC_SCC_II,
  280. .nubus_type = MAC_NUBUS
  281. },
  282. /*
  283. * Weirdified MacII hardware - all subtley different. Gee thanks
  284. * Apple. All these boxes seem to have VIA2 in a different place to
  285. * the MacII (+1A000 rather than +4000)
  286. * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
  287. */
  288. {
  289. .ident = MAC_MODEL_IICI,
  290. .name = "IIci",
  291. .adb_type = MAC_ADB_II,
  292. .via_type = MAC_VIA_IIci,
  293. .scsi_type = MAC_SCSI_OLD,
  294. .scc_type = MAC_SCC_II,
  295. .nubus_type = MAC_NUBUS
  296. }, {
  297. .ident = MAC_MODEL_IIFX,
  298. .name = "IIfx",
  299. .adb_type = MAC_ADB_IOP,
  300. .via_type = MAC_VIA_IIci,
  301. .scsi_type = MAC_SCSI_OLD,
  302. .scc_type = MAC_SCC_IOP,
  303. .nubus_type = MAC_NUBUS
  304. }, {
  305. .ident = MAC_MODEL_IISI,
  306. .name = "IIsi",
  307. .adb_type = MAC_ADB_IISI,
  308. .via_type = MAC_VIA_IIci,
  309. .scsi_type = MAC_SCSI_OLD,
  310. .scc_type = MAC_SCC_II,
  311. .nubus_type = MAC_NUBUS
  312. }, {
  313. .ident = MAC_MODEL_IIVI,
  314. .name = "IIvi",
  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_IIVX,
  322. .name = "IIvx",
  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. /*
  330. * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
  331. */
  332. {
  333. .ident = MAC_MODEL_CLII,
  334. .name = "Classic II",
  335. .adb_type = MAC_ADB_IISI,
  336. .via_type = MAC_VIA_IIci,
  337. .scsi_type = MAC_SCSI_OLD,
  338. .scc_type = MAC_SCC_II,
  339. .nubus_type = MAC_NUBUS
  340. }, {
  341. .ident = MAC_MODEL_CCL,
  342. .name = "Color Classic",
  343. .adb_type = MAC_ADB_CUDA,
  344. .via_type = MAC_VIA_IIci,
  345. .scsi_type = MAC_SCSI_OLD,
  346. .scc_type = MAC_SCC_II,
  347. .nubus_type = MAC_NUBUS},
  348. /*
  349. * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
  350. */
  351. {
  352. .ident = MAC_MODEL_LC,
  353. .name = "LC",
  354. .adb_type = MAC_ADB_IISI,
  355. .via_type = MAC_VIA_IIci,
  356. .scsi_type = MAC_SCSI_OLD,
  357. .scc_type = MAC_SCC_II,
  358. .nubus_type = MAC_NUBUS
  359. }, {
  360. .ident = MAC_MODEL_LCII,
  361. .name = "LC II",
  362. .adb_type = MAC_ADB_IISI,
  363. .via_type = MAC_VIA_IIci,
  364. .scsi_type = MAC_SCSI_OLD,
  365. .scc_type = MAC_SCC_II,
  366. .nubus_type = MAC_NUBUS
  367. }, {
  368. .ident = MAC_MODEL_LCIII,
  369. .name = "LC III",
  370. .adb_type = MAC_ADB_IISI,
  371. .via_type = MAC_VIA_IIci,
  372. .scsi_type = MAC_SCSI_OLD,
  373. .scc_type = MAC_SCC_II,
  374. .nubus_type = MAC_NUBUS
  375. },
  376. /*
  377. * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
  378. * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
  379. * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
  380. * AMD 79C940 (MACE).
  381. * The 700, 900 and 950 have some I/O chips in the wrong place to
  382. * confuse us. The 840AV has a SCSI location of its own (same as
  383. * the 660AV).
  384. */
  385. {
  386. .ident = MAC_MODEL_Q605,
  387. .name = "Quadra 605",
  388. .adb_type = MAC_ADB_CUDA,
  389. .via_type = MAC_VIA_QUADRA,
  390. .scsi_type = MAC_SCSI_QUADRA,
  391. .scc_type = MAC_SCC_QUADRA,
  392. .nubus_type = MAC_NUBUS
  393. }, {
  394. .ident = MAC_MODEL_Q605_ACC,
  395. .name = "Quadra 605",
  396. .adb_type = MAC_ADB_CUDA,
  397. .via_type = MAC_VIA_QUADRA,
  398. .scsi_type = MAC_SCSI_QUADRA,
  399. .scc_type = MAC_SCC_QUADRA,
  400. .nubus_type = MAC_NUBUS
  401. }, {
  402. .ident = MAC_MODEL_Q610,
  403. .name = "Quadra 610",
  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_Q630,
  412. .name = "Quadra 630",
  413. .adb_type = MAC_ADB_CUDA,
  414. .via_type = MAC_VIA_QUADRA,
  415. .scsi_type = MAC_SCSI_QUADRA,
  416. .ide_type = MAC_IDE_QUADRA,
  417. .scc_type = MAC_SCC_QUADRA,
  418. .ether_type = MAC_ETHER_SONIC,
  419. .nubus_type = MAC_NUBUS
  420. }, {
  421. .ident = MAC_MODEL_Q650,
  422. .name = "Quadra 650",
  423. .adb_type = MAC_ADB_II,
  424. .via_type = MAC_VIA_QUADRA,
  425. .scsi_type = MAC_SCSI_QUADRA,
  426. .scc_type = MAC_SCC_QUADRA,
  427. .ether_type = MAC_ETHER_SONIC,
  428. .nubus_type = MAC_NUBUS
  429. },
  430. /* The Q700 does have a NS Sonic */
  431. {
  432. .ident = MAC_MODEL_Q700,
  433. .name = "Quadra 700",
  434. .adb_type = MAC_ADB_II,
  435. .via_type = MAC_VIA_QUADRA,
  436. .scsi_type = MAC_SCSI_QUADRA2,
  437. .scc_type = MAC_SCC_QUADRA,
  438. .ether_type = MAC_ETHER_SONIC,
  439. .nubus_type = MAC_NUBUS
  440. }, {
  441. .ident = MAC_MODEL_Q800,
  442. .name = "Quadra 800",
  443. .adb_type = MAC_ADB_II,
  444. .via_type = MAC_VIA_QUADRA,
  445. .scsi_type = MAC_SCSI_QUADRA,
  446. .scc_type = MAC_SCC_QUADRA,
  447. .ether_type = MAC_ETHER_SONIC,
  448. .nubus_type = MAC_NUBUS
  449. }, {
  450. .ident = MAC_MODEL_Q840,
  451. .name = "Quadra 840AV",
  452. .adb_type = MAC_ADB_CUDA,
  453. .via_type = MAC_VIA_QUADRA,
  454. .scsi_type = MAC_SCSI_QUADRA3,
  455. .scc_type = MAC_SCC_PSC,
  456. .ether_type = MAC_ETHER_MACE,
  457. .nubus_type = MAC_NUBUS
  458. }, {
  459. .ident = MAC_MODEL_Q900,
  460. .name = "Quadra 900",
  461. .adb_type = MAC_ADB_IOP,
  462. .via_type = MAC_VIA_QUADRA,
  463. .scsi_type = MAC_SCSI_QUADRA2,
  464. .scc_type = MAC_SCC_IOP,
  465. .ether_type = MAC_ETHER_SONIC,
  466. .nubus_type = MAC_NUBUS
  467. }, {
  468. .ident = MAC_MODEL_Q950,
  469. .name = "Quadra 950",
  470. .adb_type = MAC_ADB_IOP,
  471. .via_type = MAC_VIA_QUADRA,
  472. .scsi_type = MAC_SCSI_QUADRA2,
  473. .scc_type = MAC_SCC_IOP,
  474. .ether_type = MAC_ETHER_SONIC,
  475. .nubus_type = MAC_NUBUS
  476. },
  477. /*
  478. * Performa - more LC type machines
  479. */
  480. {
  481. .ident = MAC_MODEL_P460,
  482. .name = "Performa 460",
  483. .adb_type = MAC_ADB_IISI,
  484. .via_type = MAC_VIA_IIci,
  485. .scsi_type = MAC_SCSI_OLD,
  486. .scc_type = MAC_SCC_II,
  487. .nubus_type = MAC_NUBUS
  488. }, {
  489. .ident = MAC_MODEL_P475,
  490. .name = "Performa 475",
  491. .adb_type = MAC_ADB_CUDA,
  492. .via_type = MAC_VIA_QUADRA,
  493. .scsi_type = MAC_SCSI_QUADRA,
  494. .scc_type = MAC_SCC_II,
  495. .nubus_type = MAC_NUBUS
  496. }, {
  497. .ident = MAC_MODEL_P475F,
  498. .name = "Performa 475",
  499. .adb_type = MAC_ADB_CUDA,
  500. .via_type = MAC_VIA_QUADRA,
  501. .scsi_type = MAC_SCSI_QUADRA,
  502. .scc_type = MAC_SCC_II,
  503. .nubus_type = MAC_NUBUS
  504. }, {
  505. .ident = MAC_MODEL_P520,
  506. .name = "Performa 520",
  507. .adb_type = MAC_ADB_CUDA,
  508. .via_type = MAC_VIA_IIci,
  509. .scsi_type = MAC_SCSI_OLD,
  510. .scc_type = MAC_SCC_II,
  511. .nubus_type = MAC_NUBUS
  512. }, {
  513. .ident = MAC_MODEL_P550,
  514. .name = "Performa 550",
  515. .adb_type = MAC_ADB_CUDA,
  516. .via_type = MAC_VIA_IIci,
  517. .scsi_type = MAC_SCSI_OLD,
  518. .scc_type = MAC_SCC_II,
  519. .nubus_type = MAC_NUBUS
  520. },
  521. /* These have the comm slot, and therefore the possibility of SONIC ethernet */
  522. {
  523. .ident = MAC_MODEL_P575,
  524. .name = "Performa 575",
  525. .adb_type = MAC_ADB_CUDA,
  526. .via_type = MAC_VIA_QUADRA,
  527. .scsi_type = MAC_SCSI_QUADRA,
  528. .scc_type = MAC_SCC_II,
  529. .ether_type = MAC_ETHER_SONIC,
  530. .nubus_type = MAC_NUBUS
  531. }, {
  532. .ident = MAC_MODEL_P588,
  533. .name = "Performa 588",
  534. .adb_type = MAC_ADB_CUDA,
  535. .via_type = MAC_VIA_QUADRA,
  536. .scsi_type = MAC_SCSI_QUADRA,
  537. .ide_type = MAC_IDE_QUADRA,
  538. .scc_type = MAC_SCC_II,
  539. .ether_type = MAC_ETHER_SONIC,
  540. .nubus_type = MAC_NUBUS
  541. }, {
  542. .ident = MAC_MODEL_TV,
  543. .name = "TV",
  544. .adb_type = MAC_ADB_CUDA,
  545. .via_type = MAC_VIA_QUADRA,
  546. .scsi_type = MAC_SCSI_OLD,
  547. .scc_type = MAC_SCC_II,
  548. .nubus_type = MAC_NUBUS
  549. }, {
  550. .ident = MAC_MODEL_P600,
  551. .name = "Performa 600",
  552. .adb_type = MAC_ADB_IISI,
  553. .via_type = MAC_VIA_IIci,
  554. .scsi_type = MAC_SCSI_OLD,
  555. .scc_type = MAC_SCC_II,
  556. .nubus_type = MAC_NUBUS
  557. },
  558. /*
  559. * Centris - just guessing again; maybe like Quadra
  560. */
  561. /* The C610 may or may not have SONIC. We probe to make sure */
  562. {
  563. .ident = MAC_MODEL_C610,
  564. .name = "Centris 610",
  565. .adb_type = MAC_ADB_II,
  566. .via_type = MAC_VIA_QUADRA,
  567. .scsi_type = MAC_SCSI_QUADRA,
  568. .scc_type = MAC_SCC_QUADRA,
  569. .ether_type = MAC_ETHER_SONIC,
  570. .nubus_type = MAC_NUBUS
  571. }, {
  572. .ident = MAC_MODEL_C650,
  573. .name = "Centris 650",
  574. .adb_type = MAC_ADB_II,
  575. .via_type = MAC_VIA_QUADRA,
  576. .scsi_type = MAC_SCSI_QUADRA,
  577. .scc_type = MAC_SCC_QUADRA,
  578. .ether_type = MAC_ETHER_SONIC,
  579. .nubus_type = MAC_NUBUS
  580. }, {
  581. .ident = MAC_MODEL_C660,
  582. .name = "Centris 660AV",
  583. .adb_type = MAC_ADB_CUDA,
  584. .via_type = MAC_VIA_QUADRA,
  585. .scsi_type = MAC_SCSI_QUADRA3,
  586. .scc_type = MAC_SCC_PSC,
  587. .ether_type = MAC_ETHER_MACE,
  588. .nubus_type = MAC_NUBUS
  589. },
  590. /*
  591. * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
  592. * and a PMU (in two variations?) for ADB. Most of them use the
  593. * Quadra-style VIAs. A few models also have IDE from hell.
  594. */
  595. {
  596. .ident = MAC_MODEL_PB140,
  597. .name = "PowerBook 140",
  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_PB145,
  605. .name = "PowerBook 145",
  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_PB150,
  613. .name = "PowerBook 150",
  614. .adb_type = MAC_ADB_PB1,
  615. .via_type = MAC_VIA_IIci,
  616. .scsi_type = MAC_SCSI_OLD,
  617. .ide_type = MAC_IDE_PB,
  618. .scc_type = MAC_SCC_QUADRA,
  619. .nubus_type = MAC_NUBUS
  620. }, {
  621. .ident = MAC_MODEL_PB160,
  622. .name = "PowerBook 160",
  623. .adb_type = MAC_ADB_PB1,
  624. .via_type = MAC_VIA_QUADRA,
  625. .scsi_type = MAC_SCSI_OLD,
  626. .scc_type = MAC_SCC_QUADRA,
  627. .nubus_type = MAC_NUBUS
  628. }, {
  629. .ident = MAC_MODEL_PB165,
  630. .name = "PowerBook 165",
  631. .adb_type = MAC_ADB_PB1,
  632. .via_type = MAC_VIA_QUADRA,
  633. .scsi_type = MAC_SCSI_OLD,
  634. .scc_type = MAC_SCC_QUADRA,
  635. .nubus_type = MAC_NUBUS
  636. }, {
  637. .ident = MAC_MODEL_PB165C,
  638. .name = "PowerBook 165c",
  639. .adb_type = MAC_ADB_PB1,
  640. .via_type = MAC_VIA_QUADRA,
  641. .scsi_type = MAC_SCSI_OLD,
  642. .scc_type = MAC_SCC_QUADRA,
  643. .nubus_type = MAC_NUBUS
  644. }, {
  645. .ident = MAC_MODEL_PB170,
  646. .name = "PowerBook 170",
  647. .adb_type = MAC_ADB_PB1,
  648. .via_type = MAC_VIA_QUADRA,
  649. .scsi_type = MAC_SCSI_OLD,
  650. .scc_type = MAC_SCC_QUADRA,
  651. .nubus_type = MAC_NUBUS
  652. }, {
  653. .ident = MAC_MODEL_PB180,
  654. .name = "PowerBook 180",
  655. .adb_type = MAC_ADB_PB1,
  656. .via_type = MAC_VIA_QUADRA,
  657. .scsi_type = MAC_SCSI_OLD,
  658. .scc_type = MAC_SCC_QUADRA,
  659. .nubus_type = MAC_NUBUS
  660. }, {
  661. .ident = MAC_MODEL_PB180C,
  662. .name = "PowerBook 180c",
  663. .adb_type = MAC_ADB_PB1,
  664. .via_type = MAC_VIA_QUADRA,
  665. .scsi_type = MAC_SCSI_OLD,
  666. .scc_type = MAC_SCC_QUADRA,
  667. .nubus_type = MAC_NUBUS
  668. }, {
  669. .ident = MAC_MODEL_PB190,
  670. .name = "PowerBook 190",
  671. .adb_type = MAC_ADB_PB2,
  672. .via_type = MAC_VIA_QUADRA,
  673. .scsi_type = MAC_SCSI_OLD,
  674. .ide_type = MAC_IDE_BABOON,
  675. .scc_type = MAC_SCC_QUADRA,
  676. .nubus_type = MAC_NUBUS
  677. }, {
  678. .ident = MAC_MODEL_PB520,
  679. .name = "PowerBook 520",
  680. .adb_type = MAC_ADB_PB2,
  681. .via_type = MAC_VIA_QUADRA,
  682. .scsi_type = MAC_SCSI_OLD,
  683. .scc_type = MAC_SCC_QUADRA,
  684. .ether_type = MAC_ETHER_SONIC,
  685. .nubus_type = MAC_NUBUS
  686. },
  687. /*
  688. * PowerBook Duos are pretty much like normal PowerBooks
  689. * All of these probably have onboard SONIC in the Dock which
  690. * means we'll have to probe for it eventually.
  691. *
  692. * Are these reallly MAC_VIA_IIci? The developer notes for the
  693. * Duos show pretty much the same custom parts as in most of
  694. * the other PowerBooks which would imply MAC_VIA_QUADRA.
  695. */
  696. {
  697. .ident = MAC_MODEL_PB210,
  698. .name = "PowerBook Duo 210",
  699. .adb_type = MAC_ADB_PB2,
  700. .via_type = MAC_VIA_IIci,
  701. .scsi_type = MAC_SCSI_OLD,
  702. .scc_type = MAC_SCC_QUADRA,
  703. .nubus_type = MAC_NUBUS
  704. }, {
  705. .ident = MAC_MODEL_PB230,
  706. .name = "PowerBook Duo 230",
  707. .adb_type = MAC_ADB_PB2,
  708. .via_type = MAC_VIA_IIci,
  709. .scsi_type = MAC_SCSI_OLD,
  710. .scc_type = MAC_SCC_QUADRA,
  711. .nubus_type = MAC_NUBUS
  712. }, {
  713. .ident = MAC_MODEL_PB250,
  714. .name = "PowerBook Duo 250",
  715. .adb_type = MAC_ADB_PB2,
  716. .via_type = MAC_VIA_IIci,
  717. .scsi_type = MAC_SCSI_OLD,
  718. .scc_type = MAC_SCC_QUADRA,
  719. .nubus_type = MAC_NUBUS
  720. }, {
  721. .ident = MAC_MODEL_PB270C,
  722. .name = "PowerBook Duo 270c",
  723. .adb_type = MAC_ADB_PB2,
  724. .via_type = MAC_VIA_IIci,
  725. .scsi_type = MAC_SCSI_OLD,
  726. .scc_type = MAC_SCC_QUADRA,
  727. .nubus_type = MAC_NUBUS
  728. }, {
  729. .ident = MAC_MODEL_PB280,
  730. .name = "PowerBook Duo 280",
  731. .adb_type = MAC_ADB_PB2,
  732. .via_type = MAC_VIA_IIci,
  733. .scsi_type = MAC_SCSI_OLD,
  734. .scc_type = MAC_SCC_QUADRA,
  735. .nubus_type = MAC_NUBUS
  736. }, {
  737. .ident = MAC_MODEL_PB280C,
  738. .name = "PowerBook Duo 280c",
  739. .adb_type = MAC_ADB_PB2,
  740. .via_type = MAC_VIA_IIci,
  741. .scsi_type = MAC_SCSI_OLD,
  742. .scc_type = MAC_SCC_QUADRA,
  743. .nubus_type = MAC_NUBUS
  744. },
  745. /*
  746. * Other stuff ??
  747. */
  748. {
  749. .ident = -1
  750. }
  751. };
  752. void mac_identify(void)
  753. {
  754. struct mac_model *m;
  755. /* Penguin data useful? */
  756. int model = mac_bi_data.id;
  757. if (!model) {
  758. /* no bootinfo model id -> NetBSD booter was used! */
  759. /* XXX FIXME: breaks for model > 31 */
  760. model=(mac_bi_data.cpuid>>2)&63;
  761. printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
  762. }
  763. macintosh_config = mac_data_table;
  764. for (m = macintosh_config ; m->ident != -1 ; m++) {
  765. if (m->ident == model) {
  766. macintosh_config = m;
  767. break;
  768. }
  769. }
  770. /* We need to pre-init the IOPs, if any. Otherwise */
  771. /* the serial console won't work if the user had */
  772. /* the serial ports set to "Faster" mode in MacOS. */
  773. iop_preinit();
  774. mac_debug_init();
  775. printk (KERN_INFO "Detected Macintosh model: %d \n", model);
  776. /*
  777. * Report booter data:
  778. */
  779. printk (KERN_DEBUG " Penguin bootinfo data:\n");
  780. printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
  781. mac_bi_data.videoaddr, mac_bi_data.videorow,
  782. mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
  783. mac_bi_data.dimensions >> 16);
  784. printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
  785. mac_bi_data.videological, mac_orig_videoaddr,
  786. mac_bi_data.sccbase);
  787. printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
  788. mac_bi_data.boottime, mac_bi_data.gmtbias);
  789. printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
  790. mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
  791. #if 0
  792. printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
  793. m68k_ramdisk.addr, m68k_ramdisk.size);
  794. #endif
  795. /*
  796. * TODO: set the various fields in macintosh_config->hw_present here!
  797. */
  798. switch (macintosh_config->scsi_type) {
  799. case MAC_SCSI_OLD:
  800. MACHW_SET(MAC_SCSI_80);
  801. break;
  802. case MAC_SCSI_QUADRA:
  803. case MAC_SCSI_QUADRA2:
  804. case MAC_SCSI_QUADRA3:
  805. MACHW_SET(MAC_SCSI_96);
  806. if ((macintosh_config->ident == MAC_MODEL_Q900) ||
  807. (macintosh_config->ident == MAC_MODEL_Q950))
  808. MACHW_SET(MAC_SCSI_96_2);
  809. break;
  810. default:
  811. printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
  812. MACHW_SET(MAC_SCSI_80);
  813. break;
  814. }
  815. iop_init();
  816. via_init();
  817. oss_init();
  818. psc_init();
  819. baboon_init();
  820. }
  821. void mac_report_hardware(void)
  822. {
  823. printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
  824. }
  825. static void mac_get_model(char *str)
  826. {
  827. strcpy(str,"Macintosh ");
  828. strcat(str, macintosh_config->name);
  829. }