config.c 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  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. #include <linux/platform_device.h>
  24. #include <linux/adb.h>
  25. #include <linux/cuda.h>
  26. #include <asm/setup.h>
  27. #include <asm/bootinfo.h>
  28. #include <asm/bootinfo-mac.h>
  29. #include <asm/byteorder.h>
  30. #include <asm/io.h>
  31. #include <asm/irq.h>
  32. #include <asm/pgtable.h>
  33. #include <asm/rtc.h>
  34. #include <asm/machdep.h>
  35. #include <asm/macintosh.h>
  36. #include <asm/macints.h>
  37. #include <asm/machw.h>
  38. #include <asm/mac_iop.h>
  39. #include <asm/mac_via.h>
  40. #include <asm/mac_oss.h>
  41. #include <asm/mac_psc.h>
  42. /* Mac bootinfo struct */
  43. struct mac_booter_data mac_bi_data;
  44. /* The phys. video addr. - might be bogus on some machines */
  45. static unsigned long mac_orig_videoaddr;
  46. /* Mac specific timer functions */
  47. extern u32 mac_gettimeoffset(void);
  48. extern int mac_hwclk(int, struct rtc_time *);
  49. extern int mac_set_clock_mmss(unsigned long);
  50. extern void iop_preinit(void);
  51. extern void iop_init(void);
  52. extern void via_init(void);
  53. extern void via_init_clock(irq_handler_t func);
  54. extern void via_flush_cache(void);
  55. extern void oss_init(void);
  56. extern void psc_init(void);
  57. extern void baboon_init(void);
  58. extern void mac_mksound(unsigned int, unsigned int);
  59. static void mac_get_model(char *str);
  60. static void mac_identify(void);
  61. static void mac_report_hardware(void);
  62. static void __init mac_sched_init(irq_handler_t vector)
  63. {
  64. via_init_clock(vector);
  65. }
  66. /*
  67. * Parse a Macintosh-specific record in the bootinfo
  68. */
  69. int __init mac_parse_bootinfo(const struct bi_record *record)
  70. {
  71. int unknown = 0;
  72. const void *data = record->data;
  73. switch (be16_to_cpu(record->tag)) {
  74. case BI_MAC_MODEL:
  75. mac_bi_data.id = be32_to_cpup(data);
  76. break;
  77. case BI_MAC_VADDR:
  78. mac_bi_data.videoaddr = be32_to_cpup(data);
  79. break;
  80. case BI_MAC_VDEPTH:
  81. mac_bi_data.videodepth = be32_to_cpup(data);
  82. break;
  83. case BI_MAC_VROW:
  84. mac_bi_data.videorow = be32_to_cpup(data);
  85. break;
  86. case BI_MAC_VDIM:
  87. mac_bi_data.dimensions = be32_to_cpup(data);
  88. break;
  89. case BI_MAC_VLOGICAL:
  90. mac_orig_videoaddr = be32_to_cpup(data);
  91. mac_bi_data.videological =
  92. VIDEOMEMBASE + (mac_orig_videoaddr & ~VIDEOMEMMASK);
  93. break;
  94. case BI_MAC_SCCBASE:
  95. mac_bi_data.sccbase = be32_to_cpup(data);
  96. break;
  97. case BI_MAC_BTIME:
  98. mac_bi_data.boottime = be32_to_cpup(data);
  99. break;
  100. case BI_MAC_GMTBIAS:
  101. mac_bi_data.gmtbias = be32_to_cpup(data);
  102. break;
  103. case BI_MAC_MEMSIZE:
  104. mac_bi_data.memsize = be32_to_cpup(data);
  105. break;
  106. case BI_MAC_CPUID:
  107. mac_bi_data.cpuid = be32_to_cpup(data);
  108. break;
  109. case BI_MAC_ROMBASE:
  110. mac_bi_data.rombase = be32_to_cpup(data);
  111. break;
  112. default:
  113. unknown = 1;
  114. break;
  115. }
  116. return unknown;
  117. }
  118. /*
  119. * Flip into 24bit mode for an instant - flushes the L2 cache card. We
  120. * have to disable interrupts for this. Our IRQ handlers will crap
  121. * themselves if they take an IRQ in 24bit mode!
  122. */
  123. static void mac_cache_card_flush(int writeback)
  124. {
  125. unsigned long flags;
  126. local_irq_save(flags);
  127. via_flush_cache();
  128. local_irq_restore(flags);
  129. }
  130. void __init config_mac(void)
  131. {
  132. if (!MACH_IS_MAC)
  133. printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
  134. mach_sched_init = mac_sched_init;
  135. mach_init_IRQ = mac_init_IRQ;
  136. mach_get_model = mac_get_model;
  137. arch_gettimeoffset = mac_gettimeoffset;
  138. mach_hwclk = mac_hwclk;
  139. mach_set_clock_mmss = mac_set_clock_mmss;
  140. mach_reset = mac_reset;
  141. mach_halt = mac_poweroff;
  142. mach_power_off = mac_poweroff;
  143. mach_max_dma_address = 0xffffffff;
  144. #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
  145. mach_beep = mac_mksound;
  146. #endif
  147. /*
  148. * Determine hardware present
  149. */
  150. mac_identify();
  151. mac_report_hardware();
  152. /*
  153. * AFAIK only the IIci takes a cache card. The IIfx has onboard
  154. * cache ... someone needs to figure out how to tell if it's on or
  155. * not.
  156. */
  157. if (macintosh_config->ident == MAC_MODEL_IICI
  158. || macintosh_config->ident == MAC_MODEL_IIFX)
  159. mach_l2_flush = mac_cache_card_flush;
  160. }
  161. /*
  162. * Macintosh Table: hardcoded model configuration data.
  163. *
  164. * Much of this was defined by Alan, based on who knows what docs.
  165. * I've added a lot more, and some of that was pure guesswork based
  166. * on hardware pages present on the Mac web site. Possibly wildly
  167. * inaccurate, so look here if a new Mac model won't run. Example: if
  168. * a Mac crashes immediately after the VIA1 registers have been dumped
  169. * to the screen, it probably died attempting to read DirB on a RBV.
  170. * Meaning it should have MAC_VIA_IICI here :-)
  171. */
  172. struct mac_model *macintosh_config;
  173. EXPORT_SYMBOL(macintosh_config);
  174. static struct mac_model mac_data_table[] = {
  175. /*
  176. * We'll pretend to be a Macintosh II, that's pretty safe.
  177. */
  178. {
  179. .ident = MAC_MODEL_II,
  180. .name = "Unknown",
  181. .adb_type = MAC_ADB_II,
  182. .via_type = MAC_VIA_II,
  183. .scsi_type = MAC_SCSI_OLD,
  184. .scc_type = MAC_SCC_II,
  185. .nubus_type = MAC_NUBUS,
  186. .floppy_type = MAC_FLOPPY_IWM,
  187. },
  188. /*
  189. * Original Mac II hardware
  190. */
  191. {
  192. .ident = MAC_MODEL_II,
  193. .name = "II",
  194. .adb_type = MAC_ADB_II,
  195. .via_type = MAC_VIA_II,
  196. .scsi_type = MAC_SCSI_OLD,
  197. .scc_type = MAC_SCC_II,
  198. .nubus_type = MAC_NUBUS,
  199. .floppy_type = MAC_FLOPPY_IWM,
  200. }, {
  201. .ident = MAC_MODEL_IIX,
  202. .name = "IIx",
  203. .adb_type = MAC_ADB_II,
  204. .via_type = MAC_VIA_II,
  205. .scsi_type = MAC_SCSI_OLD,
  206. .scc_type = MAC_SCC_II,
  207. .nubus_type = MAC_NUBUS,
  208. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  209. }, {
  210. .ident = MAC_MODEL_IICX,
  211. .name = "IIcx",
  212. .adb_type = MAC_ADB_II,
  213. .via_type = MAC_VIA_II,
  214. .scsi_type = MAC_SCSI_OLD,
  215. .scc_type = MAC_SCC_II,
  216. .nubus_type = MAC_NUBUS,
  217. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  218. }, {
  219. .ident = MAC_MODEL_SE30,
  220. .name = "SE/30",
  221. .adb_type = MAC_ADB_II,
  222. .via_type = MAC_VIA_II,
  223. .scsi_type = MAC_SCSI_OLD,
  224. .scc_type = MAC_SCC_II,
  225. .nubus_type = MAC_NUBUS,
  226. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  227. },
  228. /*
  229. * Weirdified Mac II hardware - all subtly different. Gee thanks
  230. * Apple. All these boxes seem to have VIA2 in a different place to
  231. * the Mac II (+1A000 rather than +4000)
  232. * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
  233. */
  234. {
  235. .ident = MAC_MODEL_IICI,
  236. .name = "IIci",
  237. .adb_type = MAC_ADB_II,
  238. .via_type = MAC_VIA_IICI,
  239. .scsi_type = MAC_SCSI_OLD,
  240. .scc_type = MAC_SCC_II,
  241. .nubus_type = MAC_NUBUS,
  242. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  243. }, {
  244. .ident = MAC_MODEL_IIFX,
  245. .name = "IIfx",
  246. .adb_type = MAC_ADB_IOP,
  247. .via_type = MAC_VIA_IICI,
  248. .scsi_type = MAC_SCSI_IIFX,
  249. .scc_type = MAC_SCC_IOP,
  250. .nubus_type = MAC_NUBUS,
  251. .floppy_type = MAC_FLOPPY_SWIM_IOP,
  252. }, {
  253. .ident = MAC_MODEL_IISI,
  254. .name = "IIsi",
  255. .adb_type = MAC_ADB_IISI,
  256. .via_type = MAC_VIA_IICI,
  257. .scsi_type = MAC_SCSI_OLD,
  258. .scc_type = MAC_SCC_II,
  259. .nubus_type = MAC_NUBUS,
  260. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  261. }, {
  262. .ident = MAC_MODEL_IIVI,
  263. .name = "IIvi",
  264. .adb_type = MAC_ADB_IISI,
  265. .via_type = MAC_VIA_IICI,
  266. .scsi_type = MAC_SCSI_LC,
  267. .scc_type = MAC_SCC_II,
  268. .nubus_type = MAC_NUBUS,
  269. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  270. }, {
  271. .ident = MAC_MODEL_IIVX,
  272. .name = "IIvx",
  273. .adb_type = MAC_ADB_IISI,
  274. .via_type = MAC_VIA_IICI,
  275. .scsi_type = MAC_SCSI_LC,
  276. .scc_type = MAC_SCC_II,
  277. .nubus_type = MAC_NUBUS,
  278. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  279. },
  280. /*
  281. * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
  282. */
  283. {
  284. .ident = MAC_MODEL_CLII,
  285. .name = "Classic II",
  286. .adb_type = MAC_ADB_IISI,
  287. .via_type = MAC_VIA_IICI,
  288. .scsi_type = MAC_SCSI_LC,
  289. .scc_type = MAC_SCC_II,
  290. .nubus_type = MAC_NUBUS,
  291. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  292. }, {
  293. .ident = MAC_MODEL_CCL,
  294. .name = "Color Classic",
  295. .adb_type = MAC_ADB_CUDA,
  296. .via_type = MAC_VIA_IICI,
  297. .scsi_type = MAC_SCSI_LC,
  298. .scc_type = MAC_SCC_II,
  299. .nubus_type = MAC_NUBUS,
  300. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  301. }, {
  302. .ident = MAC_MODEL_CCLII,
  303. .name = "Color Classic II",
  304. .adb_type = MAC_ADB_CUDA,
  305. .via_type = MAC_VIA_IICI,
  306. .scsi_type = MAC_SCSI_LC,
  307. .scc_type = MAC_SCC_II,
  308. .nubus_type = MAC_NUBUS,
  309. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  310. },
  311. /*
  312. * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
  313. */
  314. {
  315. .ident = MAC_MODEL_LC,
  316. .name = "LC",
  317. .adb_type = MAC_ADB_IISI,
  318. .via_type = MAC_VIA_IICI,
  319. .scsi_type = MAC_SCSI_LC,
  320. .scc_type = MAC_SCC_II,
  321. .nubus_type = MAC_NUBUS,
  322. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  323. }, {
  324. .ident = MAC_MODEL_LCII,
  325. .name = "LC II",
  326. .adb_type = MAC_ADB_IISI,
  327. .via_type = MAC_VIA_IICI,
  328. .scsi_type = MAC_SCSI_LC,
  329. .scc_type = MAC_SCC_II,
  330. .nubus_type = MAC_NUBUS,
  331. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  332. }, {
  333. .ident = MAC_MODEL_LCIII,
  334. .name = "LC III",
  335. .adb_type = MAC_ADB_IISI,
  336. .via_type = MAC_VIA_IICI,
  337. .scsi_type = MAC_SCSI_LC,
  338. .scc_type = MAC_SCC_II,
  339. .nubus_type = MAC_NUBUS,
  340. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  341. },
  342. /*
  343. * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
  344. * differently as some of the stuff connected to VIA2 seems different.
  345. * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
  346. * the 660AV and 840AV which use an AMD 79C940 (MACE).
  347. * The 700, 900 and 950 have some I/O chips in the wrong place to
  348. * confuse us. The 840AV has a SCSI location of its own (same as
  349. * the 660AV).
  350. */
  351. {
  352. .ident = MAC_MODEL_Q605,
  353. .name = "Quadra 605",
  354. .adb_type = MAC_ADB_CUDA,
  355. .via_type = MAC_VIA_QUADRA,
  356. .scsi_type = MAC_SCSI_QUADRA,
  357. .scc_type = MAC_SCC_QUADRA,
  358. .nubus_type = MAC_NUBUS,
  359. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  360. }, {
  361. .ident = MAC_MODEL_Q605_ACC,
  362. .name = "Quadra 605",
  363. .adb_type = MAC_ADB_CUDA,
  364. .via_type = MAC_VIA_QUADRA,
  365. .scsi_type = MAC_SCSI_QUADRA,
  366. .scc_type = MAC_SCC_QUADRA,
  367. .nubus_type = MAC_NUBUS,
  368. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  369. }, {
  370. .ident = MAC_MODEL_Q610,
  371. .name = "Quadra 610",
  372. .adb_type = MAC_ADB_II,
  373. .via_type = MAC_VIA_QUADRA,
  374. .scsi_type = MAC_SCSI_QUADRA,
  375. .scc_type = MAC_SCC_QUADRA,
  376. .ether_type = MAC_ETHER_SONIC,
  377. .nubus_type = MAC_NUBUS,
  378. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  379. }, {
  380. .ident = MAC_MODEL_Q630,
  381. .name = "Quadra 630",
  382. .adb_type = MAC_ADB_CUDA,
  383. .via_type = MAC_VIA_QUADRA,
  384. .scsi_type = MAC_SCSI_QUADRA,
  385. .ide_type = MAC_IDE_QUADRA,
  386. .scc_type = MAC_SCC_QUADRA,
  387. .ether_type = MAC_ETHER_SONIC,
  388. .nubus_type = MAC_NUBUS,
  389. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  390. }, {
  391. .ident = MAC_MODEL_Q650,
  392. .name = "Quadra 650",
  393. .adb_type = MAC_ADB_II,
  394. .via_type = MAC_VIA_QUADRA,
  395. .scsi_type = MAC_SCSI_QUADRA,
  396. .scc_type = MAC_SCC_QUADRA,
  397. .ether_type = MAC_ETHER_SONIC,
  398. .nubus_type = MAC_NUBUS,
  399. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  400. },
  401. /* The Q700 does have a NS Sonic */
  402. {
  403. .ident = MAC_MODEL_Q700,
  404. .name = "Quadra 700",
  405. .adb_type = MAC_ADB_II,
  406. .via_type = MAC_VIA_QUADRA,
  407. .scsi_type = MAC_SCSI_QUADRA2,
  408. .scc_type = MAC_SCC_QUADRA,
  409. .ether_type = MAC_ETHER_SONIC,
  410. .nubus_type = MAC_NUBUS,
  411. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  412. }, {
  413. .ident = MAC_MODEL_Q800,
  414. .name = "Quadra 800",
  415. .adb_type = MAC_ADB_II,
  416. .via_type = MAC_VIA_QUADRA,
  417. .scsi_type = MAC_SCSI_QUADRA,
  418. .scc_type = MAC_SCC_QUADRA,
  419. .ether_type = MAC_ETHER_SONIC,
  420. .nubus_type = MAC_NUBUS,
  421. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  422. }, {
  423. .ident = MAC_MODEL_Q840,
  424. .name = "Quadra 840AV",
  425. .adb_type = MAC_ADB_CUDA,
  426. .via_type = MAC_VIA_QUADRA,
  427. .scsi_type = MAC_SCSI_QUADRA3,
  428. .scc_type = MAC_SCC_PSC,
  429. .ether_type = MAC_ETHER_MACE,
  430. .nubus_type = MAC_NUBUS,
  431. .floppy_type = MAC_FLOPPY_AV,
  432. }, {
  433. .ident = MAC_MODEL_Q900,
  434. .name = "Quadra 900",
  435. .adb_type = MAC_ADB_IOP,
  436. .via_type = MAC_VIA_QUADRA,
  437. .scsi_type = MAC_SCSI_QUADRA2,
  438. .scc_type = MAC_SCC_IOP,
  439. .ether_type = MAC_ETHER_SONIC,
  440. .nubus_type = MAC_NUBUS,
  441. .floppy_type = MAC_FLOPPY_SWIM_IOP,
  442. }, {
  443. .ident = MAC_MODEL_Q950,
  444. .name = "Quadra 950",
  445. .adb_type = MAC_ADB_IOP,
  446. .via_type = MAC_VIA_QUADRA,
  447. .scsi_type = MAC_SCSI_QUADRA2,
  448. .scc_type = MAC_SCC_IOP,
  449. .ether_type = MAC_ETHER_SONIC,
  450. .nubus_type = MAC_NUBUS,
  451. .floppy_type = MAC_FLOPPY_SWIM_IOP,
  452. },
  453. /*
  454. * Performa - more LC type machines
  455. */
  456. {
  457. .ident = MAC_MODEL_P460,
  458. .name = "Performa 460",
  459. .adb_type = MAC_ADB_IISI,
  460. .via_type = MAC_VIA_IICI,
  461. .scsi_type = MAC_SCSI_LC,
  462. .scc_type = MAC_SCC_II,
  463. .nubus_type = MAC_NUBUS,
  464. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  465. }, {
  466. .ident = MAC_MODEL_P475,
  467. .name = "Performa 475",
  468. .adb_type = MAC_ADB_CUDA,
  469. .via_type = MAC_VIA_QUADRA,
  470. .scsi_type = MAC_SCSI_QUADRA,
  471. .scc_type = MAC_SCC_II,
  472. .nubus_type = MAC_NUBUS,
  473. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  474. }, {
  475. .ident = MAC_MODEL_P475F,
  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. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  483. }, {
  484. .ident = MAC_MODEL_P520,
  485. .name = "Performa 520",
  486. .adb_type = MAC_ADB_CUDA,
  487. .via_type = MAC_VIA_IICI,
  488. .scsi_type = MAC_SCSI_LC,
  489. .scc_type = MAC_SCC_II,
  490. .nubus_type = MAC_NUBUS,
  491. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  492. }, {
  493. .ident = MAC_MODEL_P550,
  494. .name = "Performa 550",
  495. .adb_type = MAC_ADB_CUDA,
  496. .via_type = MAC_VIA_IICI,
  497. .scsi_type = MAC_SCSI_LC,
  498. .scc_type = MAC_SCC_II,
  499. .nubus_type = MAC_NUBUS,
  500. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  501. },
  502. /* These have the comm slot, and therefore possibly SONIC ethernet */
  503. {
  504. .ident = MAC_MODEL_P575,
  505. .name = "Performa 575",
  506. .adb_type = MAC_ADB_CUDA,
  507. .via_type = MAC_VIA_QUADRA,
  508. .scsi_type = MAC_SCSI_QUADRA,
  509. .scc_type = MAC_SCC_II,
  510. .ether_type = MAC_ETHER_SONIC,
  511. .nubus_type = MAC_NUBUS,
  512. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  513. }, {
  514. .ident = MAC_MODEL_P588,
  515. .name = "Performa 588",
  516. .adb_type = MAC_ADB_CUDA,
  517. .via_type = MAC_VIA_QUADRA,
  518. .scsi_type = MAC_SCSI_QUADRA,
  519. .ide_type = MAC_IDE_QUADRA,
  520. .scc_type = MAC_SCC_II,
  521. .ether_type = MAC_ETHER_SONIC,
  522. .nubus_type = MAC_NUBUS,
  523. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  524. }, {
  525. .ident = MAC_MODEL_TV,
  526. .name = "TV",
  527. .adb_type = MAC_ADB_CUDA,
  528. .via_type = MAC_VIA_IICI,
  529. .scsi_type = MAC_SCSI_LC,
  530. .scc_type = MAC_SCC_II,
  531. .nubus_type = MAC_NUBUS,
  532. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  533. }, {
  534. .ident = MAC_MODEL_P600,
  535. .name = "Performa 600",
  536. .adb_type = MAC_ADB_IISI,
  537. .via_type = MAC_VIA_IICI,
  538. .scsi_type = MAC_SCSI_LC,
  539. .scc_type = MAC_SCC_II,
  540. .nubus_type = MAC_NUBUS,
  541. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  542. },
  543. /*
  544. * Centris - just guessing again; maybe like Quadra.
  545. * The C610 may or may not have SONIC. We probe to make sure.
  546. */
  547. {
  548. .ident = MAC_MODEL_C610,
  549. .name = "Centris 610",
  550. .adb_type = MAC_ADB_II,
  551. .via_type = MAC_VIA_QUADRA,
  552. .scsi_type = MAC_SCSI_QUADRA,
  553. .scc_type = MAC_SCC_QUADRA,
  554. .ether_type = MAC_ETHER_SONIC,
  555. .nubus_type = MAC_NUBUS,
  556. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  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. .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
  567. }, {
  568. .ident = MAC_MODEL_C660,
  569. .name = "Centris 660AV",
  570. .adb_type = MAC_ADB_CUDA,
  571. .via_type = MAC_VIA_QUADRA,
  572. .scsi_type = MAC_SCSI_QUADRA3,
  573. .scc_type = MAC_SCC_PSC,
  574. .ether_type = MAC_ETHER_MACE,
  575. .nubus_type = MAC_NUBUS,
  576. .floppy_type = MAC_FLOPPY_AV,
  577. },
  578. /*
  579. * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
  580. * and a PMU (in two variations?) for ADB. Most of them use the
  581. * Quadra-style VIAs. A few models also have IDE from hell.
  582. */
  583. {
  584. .ident = MAC_MODEL_PB140,
  585. .name = "PowerBook 140",
  586. .adb_type = MAC_ADB_PB1,
  587. .via_type = MAC_VIA_QUADRA,
  588. .scsi_type = MAC_SCSI_OLD,
  589. .scc_type = MAC_SCC_QUADRA,
  590. .nubus_type = MAC_NUBUS,
  591. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  592. }, {
  593. .ident = MAC_MODEL_PB145,
  594. .name = "PowerBook 145",
  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. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  601. }, {
  602. .ident = MAC_MODEL_PB150,
  603. .name = "PowerBook 150",
  604. .adb_type = MAC_ADB_PB2,
  605. .via_type = MAC_VIA_IICI,
  606. .scsi_type = MAC_SCSI_OLD,
  607. .ide_type = MAC_IDE_PB,
  608. .scc_type = MAC_SCC_QUADRA,
  609. .nubus_type = MAC_NUBUS,
  610. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  611. }, {
  612. .ident = MAC_MODEL_PB160,
  613. .name = "PowerBook 160",
  614. .adb_type = MAC_ADB_PB1,
  615. .via_type = MAC_VIA_QUADRA,
  616. .scsi_type = MAC_SCSI_OLD,
  617. .scc_type = MAC_SCC_QUADRA,
  618. .nubus_type = MAC_NUBUS,
  619. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  620. }, {
  621. .ident = MAC_MODEL_PB165,
  622. .name = "PowerBook 165",
  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. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  629. }, {
  630. .ident = MAC_MODEL_PB165C,
  631. .name = "PowerBook 165c",
  632. .adb_type = MAC_ADB_PB1,
  633. .via_type = MAC_VIA_QUADRA,
  634. .scsi_type = MAC_SCSI_OLD,
  635. .scc_type = MAC_SCC_QUADRA,
  636. .nubus_type = MAC_NUBUS,
  637. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  638. }, {
  639. .ident = MAC_MODEL_PB170,
  640. .name = "PowerBook 170",
  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. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  647. }, {
  648. .ident = MAC_MODEL_PB180,
  649. .name = "PowerBook 180",
  650. .adb_type = MAC_ADB_PB1,
  651. .via_type = MAC_VIA_QUADRA,
  652. .scsi_type = MAC_SCSI_OLD,
  653. .scc_type = MAC_SCC_QUADRA,
  654. .nubus_type = MAC_NUBUS,
  655. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  656. }, {
  657. .ident = MAC_MODEL_PB180C,
  658. .name = "PowerBook 180c",
  659. .adb_type = MAC_ADB_PB1,
  660. .via_type = MAC_VIA_QUADRA,
  661. .scsi_type = MAC_SCSI_OLD,
  662. .scc_type = MAC_SCC_QUADRA,
  663. .nubus_type = MAC_NUBUS,
  664. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  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_LATE,
  671. .ide_type = MAC_IDE_BABOON,
  672. .scc_type = MAC_SCC_QUADRA,
  673. .nubus_type = MAC_NUBUS,
  674. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  675. }, {
  676. .ident = MAC_MODEL_PB520,
  677. .name = "PowerBook 520",
  678. .adb_type = MAC_ADB_PB2,
  679. .via_type = MAC_VIA_QUADRA,
  680. .scsi_type = MAC_SCSI_LATE,
  681. .scc_type = MAC_SCC_QUADRA,
  682. .ether_type = MAC_ETHER_SONIC,
  683. .nubus_type = MAC_NUBUS,
  684. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  685. },
  686. /*
  687. * PowerBook Duos are pretty much like normal PowerBooks
  688. * All of these probably have onboard SONIC in the Dock which
  689. * means we'll have to probe for it eventually.
  690. */
  691. {
  692. .ident = MAC_MODEL_PB210,
  693. .name = "PowerBook Duo 210",
  694. .adb_type = MAC_ADB_PB2,
  695. .via_type = MAC_VIA_IICI,
  696. .scsi_type = MAC_SCSI_DUO,
  697. .scc_type = MAC_SCC_QUADRA,
  698. .nubus_type = MAC_NUBUS,
  699. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  700. }, {
  701. .ident = MAC_MODEL_PB230,
  702. .name = "PowerBook Duo 230",
  703. .adb_type = MAC_ADB_PB2,
  704. .via_type = MAC_VIA_IICI,
  705. .scsi_type = MAC_SCSI_DUO,
  706. .scc_type = MAC_SCC_QUADRA,
  707. .nubus_type = MAC_NUBUS,
  708. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  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_DUO,
  715. .scc_type = MAC_SCC_QUADRA,
  716. .nubus_type = MAC_NUBUS,
  717. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  718. }, {
  719. .ident = MAC_MODEL_PB270C,
  720. .name = "PowerBook Duo 270c",
  721. .adb_type = MAC_ADB_PB2,
  722. .via_type = MAC_VIA_IICI,
  723. .scsi_type = MAC_SCSI_DUO,
  724. .scc_type = MAC_SCC_QUADRA,
  725. .nubus_type = MAC_NUBUS,
  726. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  727. }, {
  728. .ident = MAC_MODEL_PB280,
  729. .name = "PowerBook Duo 280",
  730. .adb_type = MAC_ADB_PB2,
  731. .via_type = MAC_VIA_IICI,
  732. .scsi_type = MAC_SCSI_DUO,
  733. .scc_type = MAC_SCC_QUADRA,
  734. .nubus_type = MAC_NUBUS,
  735. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  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_DUO,
  742. .scc_type = MAC_SCC_QUADRA,
  743. .nubus_type = MAC_NUBUS,
  744. .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
  745. },
  746. /*
  747. * Other stuff?
  748. */
  749. {
  750. .ident = -1
  751. }
  752. };
  753. static struct resource scc_a_rsrcs[] = {
  754. { .flags = IORESOURCE_MEM },
  755. { .flags = IORESOURCE_IRQ },
  756. };
  757. static struct resource scc_b_rsrcs[] = {
  758. { .flags = IORESOURCE_MEM },
  759. { .flags = IORESOURCE_IRQ },
  760. };
  761. struct platform_device scc_a_pdev = {
  762. .name = "scc",
  763. .id = 0,
  764. .num_resources = ARRAY_SIZE(scc_a_rsrcs),
  765. .resource = scc_a_rsrcs,
  766. };
  767. EXPORT_SYMBOL(scc_a_pdev);
  768. struct platform_device scc_b_pdev = {
  769. .name = "scc",
  770. .id = 1,
  771. .num_resources = ARRAY_SIZE(scc_b_rsrcs),
  772. .resource = scc_b_rsrcs,
  773. };
  774. EXPORT_SYMBOL(scc_b_pdev);
  775. static void __init mac_identify(void)
  776. {
  777. struct mac_model *m;
  778. /* Penguin data useful? */
  779. int model = mac_bi_data.id;
  780. if (!model) {
  781. /* no bootinfo model id -> NetBSD booter was used! */
  782. /* XXX FIXME: breaks for model > 31 */
  783. model = (mac_bi_data.cpuid >> 2) & 63;
  784. printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
  785. "(obsolete bootloader?)\n");
  786. }
  787. macintosh_config = mac_data_table;
  788. for (m = macintosh_config; m->ident != -1; m++) {
  789. if (m->ident == model) {
  790. macintosh_config = m;
  791. break;
  792. }
  793. }
  794. /* Set up serial port resources for the console initcall. */
  795. scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
  796. scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
  797. scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
  798. scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
  799. switch (macintosh_config->scc_type) {
  800. case MAC_SCC_PSC:
  801. scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
  802. scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
  803. break;
  804. default:
  805. /* On non-PSC machines, the serial ports share an IRQ. */
  806. if (macintosh_config->ident == MAC_MODEL_IIFX) {
  807. scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
  808. scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
  809. } else {
  810. scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
  811. scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
  812. }
  813. break;
  814. }
  815. /*
  816. * We need to pre-init the IOPs, if any. Otherwise
  817. * the serial console won't work if the user had
  818. * the serial ports set to "Faster" mode in MacOS.
  819. */
  820. iop_preinit();
  821. printk(KERN_INFO "Detected Macintosh model: %d\n", model);
  822. /*
  823. * Report booter data:
  824. */
  825. printk(KERN_DEBUG " Penguin bootinfo data:\n");
  826. printk(KERN_DEBUG " Video: addr 0x%lx "
  827. "row 0x%lx depth %lx dimensions %ld x %ld\n",
  828. mac_bi_data.videoaddr, mac_bi_data.videorow,
  829. mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
  830. mac_bi_data.dimensions >> 16);
  831. printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
  832. mac_bi_data.videological, mac_orig_videoaddr,
  833. mac_bi_data.sccbase);
  834. printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
  835. mac_bi_data.boottime, mac_bi_data.gmtbias);
  836. printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
  837. mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
  838. iop_init();
  839. via_init();
  840. oss_init();
  841. psc_init();
  842. baboon_init();
  843. #ifdef CONFIG_ADB_CUDA
  844. find_via_cuda();
  845. #endif
  846. }
  847. static void __init mac_report_hardware(void)
  848. {
  849. printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
  850. }
  851. static void mac_get_model(char *str)
  852. {
  853. strcpy(str, "Macintosh ");
  854. strcat(str, macintosh_config->name);
  855. }
  856. static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
  857. static struct platform_device swim_pdev = {
  858. .name = "swim",
  859. .id = -1,
  860. .num_resources = 1,
  861. .resource = &swim_rsrc,
  862. };
  863. static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
  864. {
  865. .flags = IORESOURCE_IRQ,
  866. .start = IRQ_MAC_SCSI,
  867. .end = IRQ_MAC_SCSI,
  868. }, {
  869. .flags = IORESOURCE_MEM,
  870. .start = 0x50008000,
  871. .end = 0x50009FFF,
  872. },
  873. };
  874. static const struct resource mac_scsi_duo_rsrc[] __initconst = {
  875. {
  876. .flags = IORESOURCE_MEM,
  877. .start = 0xFEE02000,
  878. .end = 0xFEE03FFF,
  879. },
  880. };
  881. static const struct resource mac_scsi_old_rsrc[] __initconst = {
  882. {
  883. .flags = IORESOURCE_IRQ,
  884. .start = IRQ_MAC_SCSI,
  885. .end = IRQ_MAC_SCSI,
  886. }, {
  887. .flags = IORESOURCE_MEM,
  888. .start = 0x50010000,
  889. .end = 0x50011FFF,
  890. }, {
  891. .flags = IORESOURCE_MEM,
  892. .start = 0x50006000,
  893. .end = 0x50007FFF,
  894. },
  895. };
  896. static const struct resource mac_scsi_late_rsrc[] __initconst = {
  897. {
  898. .flags = IORESOURCE_IRQ,
  899. .start = IRQ_MAC_SCSI,
  900. .end = IRQ_MAC_SCSI,
  901. }, {
  902. .flags = IORESOURCE_MEM,
  903. .start = 0x50010000,
  904. .end = 0x50011FFF,
  905. },
  906. };
  907. static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
  908. {
  909. .flags = IORESOURCE_IRQ,
  910. .start = IRQ_MAC_SCSI,
  911. .end = IRQ_MAC_SCSI,
  912. }, {
  913. .flags = IORESOURCE_MEM,
  914. .start = 0x50F10000,
  915. .end = 0x50F11FFF,
  916. }, {
  917. .flags = IORESOURCE_MEM,
  918. .start = 0x50F06000,
  919. .end = 0x50F07FFF,
  920. },
  921. };
  922. static struct platform_device esp_0_pdev = {
  923. .name = "mac_esp",
  924. .id = 0,
  925. };
  926. static struct platform_device esp_1_pdev = {
  927. .name = "mac_esp",
  928. .id = 1,
  929. };
  930. static struct platform_device sonic_pdev = {
  931. .name = "macsonic",
  932. .id = -1,
  933. };
  934. static struct platform_device mace_pdev = {
  935. .name = "macmace",
  936. .id = -1,
  937. };
  938. int __init mac_platform_init(void)
  939. {
  940. u8 *swim_base;
  941. if (!MACH_IS_MAC)
  942. return -ENODEV;
  943. /*
  944. * Serial devices
  945. */
  946. platform_device_register(&scc_a_pdev);
  947. platform_device_register(&scc_b_pdev);
  948. /*
  949. * Floppy device
  950. */
  951. switch (macintosh_config->floppy_type) {
  952. case MAC_FLOPPY_SWIM_ADDR1:
  953. swim_base = (u8 *)(VIA1_BASE + 0x1E000);
  954. break;
  955. case MAC_FLOPPY_SWIM_ADDR2:
  956. swim_base = (u8 *)(VIA1_BASE + 0x16000);
  957. break;
  958. default:
  959. swim_base = NULL;
  960. break;
  961. }
  962. if (swim_base) {
  963. swim_rsrc.start = (resource_size_t) swim_base,
  964. swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
  965. platform_device_register(&swim_pdev);
  966. }
  967. /*
  968. * SCSI device(s)
  969. */
  970. switch (macintosh_config->scsi_type) {
  971. case MAC_SCSI_QUADRA:
  972. case MAC_SCSI_QUADRA3:
  973. platform_device_register(&esp_0_pdev);
  974. break;
  975. case MAC_SCSI_QUADRA2:
  976. platform_device_register(&esp_0_pdev);
  977. if ((macintosh_config->ident == MAC_MODEL_Q900) ||
  978. (macintosh_config->ident == MAC_MODEL_Q950))
  979. platform_device_register(&esp_1_pdev);
  980. break;
  981. case MAC_SCSI_IIFX:
  982. /* Addresses from The Guide to Mac Family Hardware.
  983. * $5000 8000 - $5000 9FFF: SCSI DMA
  984. * $5000 C000 - $5000 DFFF: Alternate SCSI (DMA)
  985. * $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk)
  986. * The SCSI DMA custom IC embeds the 53C80 core. mac_scsi does
  987. * not make use of its DMA or hardware handshaking logic.
  988. */
  989. platform_device_register_simple("mac_scsi", 0,
  990. mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc));
  991. break;
  992. case MAC_SCSI_DUO:
  993. /* Addresses from the Duo Dock II Developer Note.
  994. * $FEE0 2000 - $FEE0 3FFF: normal mode
  995. * $FEE0 4000 - $FEE0 5FFF: pseudo DMA without /DRQ
  996. * $FEE0 6000 - $FEE0 7FFF: pseudo DMA with /DRQ
  997. * The NetBSD code indicates that both 5380 chips share
  998. * an IRQ (?) which would need careful handling (see mac_esp).
  999. */
  1000. platform_device_register_simple("mac_scsi", 1,
  1001. mac_scsi_duo_rsrc, ARRAY_SIZE(mac_scsi_duo_rsrc));
  1002. /* fall through */
  1003. case MAC_SCSI_OLD:
  1004. /* Addresses from Developer Notes for Duo System,
  1005. * PowerBook 180 & 160, 140 & 170, Macintosh IIsi
  1006. * and also from The Guide to Mac Family Hardware for
  1007. * SE/30, II, IIx, IIcx, IIci.
  1008. * $5000 6000 - $5000 7FFF: pseudo-DMA with /DRQ
  1009. * $5001 0000 - $5001 1FFF: normal mode
  1010. * $5001 2000 - $5001 3FFF: pseudo-DMA without /DRQ
  1011. * GMFH says that $5000 0000 - $50FF FFFF "wraps
  1012. * $5000 0000 - $5001 FFFF eight times" (!)
  1013. * mess.org says IIci and Color Classic do not alias
  1014. * I/O address space.
  1015. */
  1016. platform_device_register_simple("mac_scsi", 0,
  1017. mac_scsi_old_rsrc, ARRAY_SIZE(mac_scsi_old_rsrc));
  1018. break;
  1019. case MAC_SCSI_LATE:
  1020. /* PDMA logic in 68040 PowerBooks is somehow different to
  1021. * '030 models. It's probably more like Quadras (see mac_esp).
  1022. */
  1023. platform_device_register_simple("mac_scsi", 0,
  1024. mac_scsi_late_rsrc, ARRAY_SIZE(mac_scsi_late_rsrc));
  1025. break;
  1026. case MAC_SCSI_LC:
  1027. /* Addresses from Mac LC data in Designing Cards & Drivers 3ed.
  1028. * Also from the Developer Notes for Classic II, LC III,
  1029. * Color Classic and IIvx.
  1030. * $50F0 6000 - $50F0 7FFF: SCSI handshake
  1031. * $50F1 0000 - $50F1 1FFF: SCSI
  1032. * $50F1 2000 - $50F1 3FFF: SCSI DMA
  1033. */
  1034. platform_device_register_simple("mac_scsi", 0,
  1035. mac_scsi_ccl_rsrc, ARRAY_SIZE(mac_scsi_ccl_rsrc));
  1036. break;
  1037. }
  1038. /*
  1039. * Ethernet device
  1040. */
  1041. switch (macintosh_config->ether_type) {
  1042. case MAC_ETHER_SONIC:
  1043. platform_device_register(&sonic_pdev);
  1044. break;
  1045. case MAC_ETHER_MACE:
  1046. platform_device_register(&mace_pdev);
  1047. break;
  1048. }
  1049. return 0;
  1050. }
  1051. arch_initcall(mac_platform_init);