config.c 28 KB

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