config.c 29 KB

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