config.c 21 KB

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