config.c 28 KB

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