mpc85xx_cds_common.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * arch/ppc/platform/85xx/mpc85xx_cds_common.c
  3. *
  4. * MPC85xx CDS board specific routines
  5. *
  6. * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  7. *
  8. * Copyright 2004 Freescale Semiconductor, Inc
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #include <linux/config.h>
  16. #include <linux/stddef.h>
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/errno.h>
  20. #include <linux/reboot.h>
  21. #include <linux/pci.h>
  22. #include <linux/kdev_t.h>
  23. #include <linux/major.h>
  24. #include <linux/console.h>
  25. #include <linux/delay.h>
  26. #include <linux/seq_file.h>
  27. #include <linux/serial.h>
  28. #include <linux/module.h>
  29. #include <linux/root_dev.h>
  30. #include <linux/initrd.h>
  31. #include <linux/tty.h>
  32. #include <linux/serial_core.h>
  33. #include <linux/fsl_devices.h>
  34. #include <asm/system.h>
  35. #include <asm/pgtable.h>
  36. #include <asm/page.h>
  37. #include <asm/atomic.h>
  38. #include <asm/time.h>
  39. #include <asm/todc.h>
  40. #include <asm/io.h>
  41. #include <asm/machdep.h>
  42. #include <asm/open_pic.h>
  43. #include <asm/i8259.h>
  44. #include <asm/bootinfo.h>
  45. #include <asm/pci-bridge.h>
  46. #include <asm/mpc85xx.h>
  47. #include <asm/irq.h>
  48. #include <asm/immap_85xx.h>
  49. #include <asm/cpm2.h>
  50. #include <asm/ppc_sys.h>
  51. #include <asm/kgdb.h>
  52. #include <mm/mmu_decl.h>
  53. #include <syslib/cpm2_pic.h>
  54. #include <syslib/ppc85xx_common.h>
  55. #include <syslib/ppc85xx_setup.h>
  56. #ifndef CONFIG_PCI
  57. unsigned long isa_io_base = 0;
  58. unsigned long isa_mem_base = 0;
  59. #endif
  60. extern unsigned long total_memory; /* in mm/init */
  61. unsigned char __res[sizeof (bd_t)];
  62. static int cds_pci_slot = 2;
  63. static volatile u8 * cadmus;
  64. /* Internal interrupts are all Level Sensitive, and Positive Polarity */
  65. static u_char mpc85xx_cds_openpic_initsenses[] __initdata = {
  66. MPC85XX_INTERNAL_IRQ_SENSES,
  67. #if defined(CONFIG_PCI)
  68. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 0: PCI1 slot */
  69. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI1 slot */
  70. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 2: PCI1 slot */
  71. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 3: PCI1 slot */
  72. #else
  73. 0x0, /* External 0: */
  74. 0x0, /* External 1: */
  75. 0x0, /* External 2: */
  76. 0x0, /* External 3: */
  77. #endif
  78. 0x0, /* External 4: */
  79. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */
  80. 0x0, /* External 6: */
  81. 0x0, /* External 7: */
  82. 0x0, /* External 8: */
  83. 0x0, /* External 9: */
  84. 0x0, /* External 10: */
  85. #if defined(CONFIG_85xx_PCI2) && defined(CONFIG_PCI)
  86. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 11: PCI2 slot 0 */
  87. #else
  88. 0x0, /* External 11: */
  89. #endif
  90. };
  91. /* ************************************************************************ */
  92. int
  93. mpc85xx_cds_show_cpuinfo(struct seq_file *m)
  94. {
  95. uint pvid, svid, phid1;
  96. uint memsize = total_memory;
  97. bd_t *binfo = (bd_t *) __res;
  98. unsigned int freq;
  99. /* get the core frequency */
  100. freq = binfo->bi_intfreq;
  101. pvid = mfspr(SPRN_PVR);
  102. svid = mfspr(SPRN_SVR);
  103. seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
  104. seq_printf(m, "Machine\t\t: CDS - MPC%s (%x)\n", cur_ppc_sys_spec->ppc_sys_name, cadmus[CM_VER]);
  105. seq_printf(m, "clock\t\t: %dMHz\n", freq / 1000000);
  106. seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
  107. seq_printf(m, "SVR\t\t: 0x%x\n", svid);
  108. /* Display cpu Pll setting */
  109. phid1 = mfspr(SPRN_HID1);
  110. seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
  111. /* Display the amount of memory */
  112. seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
  113. return 0;
  114. }
  115. #ifdef CONFIG_CPM2
  116. static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
  117. {
  118. while((irq = cpm2_get_irq(regs)) >= 0)
  119. __do_IRQ(irq, regs);
  120. return IRQ_HANDLED;
  121. }
  122. static struct irqaction cpm2_irqaction = {
  123. .handler = cpm2_cascade,
  124. .flags = SA_INTERRUPT,
  125. .mask = CPU_MASK_NONE,
  126. .name = "cpm2_cascade",
  127. };
  128. #endif /* CONFIG_CPM2 */
  129. void __init
  130. mpc85xx_cds_init_IRQ(void)
  131. {
  132. bd_t *binfo = (bd_t *) __res;
  133. int i;
  134. /* Determine the Physical Address of the OpenPIC regs */
  135. phys_addr_t OpenPIC_PAddr = binfo->bi_immr_base + MPC85xx_OPENPIC_OFFSET;
  136. OpenPIC_Addr = ioremap(OpenPIC_PAddr, MPC85xx_OPENPIC_SIZE);
  137. OpenPIC_InitSenses = mpc85xx_cds_openpic_initsenses;
  138. OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses);
  139. /* Skip reserved space and internal sources */
  140. #ifdef CONFIG_MPC8548
  141. openpic_set_sources(0, 48, OpenPIC_Addr + 0x10200);
  142. #else
  143. openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
  144. #endif
  145. /* Map PIC IRQs 0-11 */
  146. openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
  147. /* we let openpic interrupts starting from an offset, to
  148. * leave space for cascading interrupts underneath.
  149. */
  150. openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET);
  151. #ifdef CONFIG_PCI
  152. openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
  153. i8259_init(0, 0);
  154. #endif
  155. #ifdef CONFIG_CPM2
  156. /* Setup CPM2 PIC */
  157. cpm2_init_IRQ();
  158. setup_irq(MPC85xx_IRQ_CPM, &cpm2_irqaction);
  159. #endif
  160. return;
  161. }
  162. #ifdef CONFIG_PCI
  163. /*
  164. * interrupt routing
  165. */
  166. int
  167. mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  168. {
  169. struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
  170. if (!hose->index)
  171. {
  172. /* Handle PCI1 interrupts */
  173. char pci_irq_table[][4] =
  174. /*
  175. * PCI IDSEL/INTPIN->INTLINE
  176. * A B C D
  177. */
  178. /* Note IRQ assignment for slots is based on which slot the elysium is
  179. * in -- in this setup elysium is in slot #2 (this PIRQA as first
  180. * interrupt on slot */
  181. {
  182. { 0, 1, 2, 3 }, /* 16 - PMC */
  183. { 0, 1, 2, 3 }, /* 17 P2P (Tsi320) */
  184. { 0, 1, 2, 3 }, /* 18 - Slot 1 */
  185. { 1, 2, 3, 0 }, /* 19 - Slot 2 */
  186. { 2, 3, 0, 1 }, /* 20 - Slot 3 */
  187. { 3, 0, 1, 2 }, /* 21 - Slot 4 */
  188. };
  189. const long min_idsel = 16, max_idsel = 21, irqs_per_slot = 4;
  190. int i, j;
  191. for (i = 0; i < 6; i++)
  192. for (j = 0; j < 4; j++)
  193. pci_irq_table[i][j] =
  194. ((pci_irq_table[i][j] + 5 -
  195. cds_pci_slot) & 0x3) + PIRQ0A;
  196. return PCI_IRQ_TABLE_LOOKUP;
  197. } else {
  198. /* Handle PCI2 interrupts (if we have one) */
  199. char pci_irq_table[][4] =
  200. {
  201. /*
  202. * We only have one slot and one interrupt
  203. * going to PIRQA - PIRQD */
  204. { PIRQ1A, PIRQ1A, PIRQ1A, PIRQ1A }, /* 21 - slot 0 */
  205. };
  206. const long min_idsel = 21, max_idsel = 21, irqs_per_slot = 4;
  207. return PCI_IRQ_TABLE_LOOKUP;
  208. }
  209. }
  210. #define ARCADIA_HOST_BRIDGE_IDSEL 17
  211. #define ARCADIA_2ND_BRIDGE_IDSEL 3
  212. extern int mpc85xx_pci1_last_busno;
  213. int
  214. mpc85xx_exclude_device(u_char bus, u_char devfn)
  215. {
  216. if (bus == 0 && PCI_SLOT(devfn) == 0)
  217. return PCIBIOS_DEVICE_NOT_FOUND;
  218. #ifdef CONFIG_85xx_PCI2
  219. if (mpc85xx_pci1_last_busno)
  220. if (bus == (mpc85xx_pci1_last_busno + 1) && PCI_SLOT(devfn) == 0)
  221. return PCIBIOS_DEVICE_NOT_FOUND;
  222. #endif
  223. /* We explicitly do not go past the Tundra 320 Bridge */
  224. if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
  225. return PCIBIOS_DEVICE_NOT_FOUND;
  226. if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
  227. return PCIBIOS_DEVICE_NOT_FOUND;
  228. else
  229. return PCIBIOS_SUCCESSFUL;
  230. }
  231. void __init
  232. mpc85xx_cds_enable_via(struct pci_controller *hose)
  233. {
  234. u32 pci_class;
  235. u16 vid, did;
  236. early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
  237. if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
  238. return;
  239. /* Configure P2P so that we can reach bus 1 */
  240. early_write_config_byte(hose, 0, 0x88, PCI_PRIMARY_BUS, 0);
  241. early_write_config_byte(hose, 0, 0x88, PCI_SECONDARY_BUS, 1);
  242. early_write_config_byte(hose, 0, 0x88, PCI_SUBORDINATE_BUS, 0xff);
  243. early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
  244. early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
  245. if ((vid != PCI_VENDOR_ID_VIA) ||
  246. (did != PCI_DEVICE_ID_VIA_82C686))
  247. return;
  248. /* Enable USB and IDE functions */
  249. early_write_config_byte(hose, 1, 0x10, 0x48, 0x08);
  250. }
  251. void __init
  252. mpc85xx_cds_fixup_via(struct pci_controller *hose)
  253. {
  254. u32 pci_class;
  255. u16 vid, did;
  256. early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
  257. if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
  258. return;
  259. /*
  260. * Force the backplane P2P bridge to have a window
  261. * open from 0x00000000-0x00001fff in PCI I/O space.
  262. * This allows legacy I/O (i8259, etc) on the VIA
  263. * southbridge to be accessed.
  264. */
  265. early_write_config_byte(hose, 0, 0x88, PCI_IO_BASE, 0x00);
  266. early_write_config_word(hose, 0, 0x88, PCI_IO_BASE_UPPER16, 0x0000);
  267. early_write_config_byte(hose, 0, 0x88, PCI_IO_LIMIT, 0x10);
  268. early_write_config_word(hose, 0, 0x88, PCI_IO_LIMIT_UPPER16, 0x0000);
  269. early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
  270. early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
  271. if ((vid != PCI_VENDOR_ID_VIA) ||
  272. (did != PCI_DEVICE_ID_VIA_82C686))
  273. return;
  274. /*
  275. * Since the P2P window was forced to cover the fixed
  276. * legacy I/O addresses, it is necessary to manually
  277. * place the base addresses for the IDE and USB functions
  278. * within this window.
  279. */
  280. /* Function 1, IDE */
  281. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_0, 0x1ff8);
  282. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_1, 0x1ff4);
  283. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_2, 0x1fe8);
  284. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_3, 0x1fe4);
  285. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_4, 0x1fd0);
  286. /* Function 2, USB ports 0-1 */
  287. early_write_config_dword(hose, 1, 0x12, PCI_BASE_ADDRESS_4, 0x1fa0);
  288. /* Function 3, USB ports 2-3 */
  289. early_write_config_dword(hose, 1, 0x13, PCI_BASE_ADDRESS_4, 0x1f80);
  290. /* Function 5, Power Management */
  291. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_0, 0x1e00);
  292. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_1, 0x1dfc);
  293. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_2, 0x1df8);
  294. /* Function 6, AC97 Interface */
  295. early_write_config_dword(hose, 1, 0x16, PCI_BASE_ADDRESS_0, 0x1c00);
  296. }
  297. void __init
  298. mpc85xx_cds_pcibios_fixup(void)
  299. {
  300. struct pci_dev *dev;
  301. u_char c;
  302. if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
  303. PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
  304. /*
  305. * U-Boot does not set the enable bits
  306. * for the IDE device. Force them on here.
  307. */
  308. pci_read_config_byte(dev, 0x40, &c);
  309. c |= 0x03; /* IDE: Chip Enable Bits */
  310. pci_write_config_byte(dev, 0x40, c);
  311. /*
  312. * Since only primary interface works, force the
  313. * IDE function to standard primary IDE interrupt
  314. * w/ 8259 offset
  315. */
  316. dev->irq = 14;
  317. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
  318. pci_dev_put(dev);
  319. }
  320. /*
  321. * Force legacy USB interrupt routing
  322. */
  323. if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
  324. PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
  325. dev->irq = 10;
  326. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
  327. pci_dev_put(dev);
  328. }
  329. if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
  330. PCI_DEVICE_ID_VIA_82C586_2, dev))) {
  331. dev->irq = 11;
  332. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
  333. pci_dev_put(dev);
  334. }
  335. }
  336. #endif /* CONFIG_PCI */
  337. TODC_ALLOC();
  338. /* ************************************************************************
  339. *
  340. * Setup the architecture
  341. *
  342. */
  343. static void __init
  344. mpc85xx_cds_setup_arch(void)
  345. {
  346. bd_t *binfo = (bd_t *) __res;
  347. unsigned int freq;
  348. struct gianfar_platform_data *pdata;
  349. struct gianfar_mdio_data *mdata;
  350. /* get the core frequency */
  351. freq = binfo->bi_intfreq;
  352. printk("mpc85xx_cds_setup_arch\n");
  353. #ifdef CONFIG_CPM2
  354. cpm2_reset();
  355. #endif
  356. cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE);
  357. cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1;
  358. printk("CDS Version = %x in PCI slot %d\n", cadmus[CM_VER], cds_pci_slot);
  359. /* Setup TODC access */
  360. TODC_INIT(TODC_TYPE_DS1743,
  361. 0,
  362. 0,
  363. ioremap(CDS_RTC_ADDR, CDS_RTC_SIZE),
  364. 8);
  365. /* Set loops_per_jiffy to a half-way reasonable value,
  366. for use until calibrate_delay gets called. */
  367. loops_per_jiffy = freq / HZ;
  368. #ifdef CONFIG_PCI
  369. /* VIA IDE configuration */
  370. ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
  371. /* setup PCI host bridges */
  372. mpc85xx_setup_hose();
  373. #endif
  374. #ifdef CONFIG_SERIAL_8250
  375. mpc85xx_early_serial_map();
  376. #endif
  377. #ifdef CONFIG_SERIAL_TEXT_DEBUG
  378. /* Invalidate the entry we stole earlier the serial ports
  379. * should be properly mapped */
  380. invalidate_tlbcam_entry(num_tlbcam_entries - 1);
  381. #endif
  382. /* setup the board related info for the MDIO bus */
  383. mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
  384. mdata->irq[0] = MPC85xx_IRQ_EXT5;
  385. mdata->irq[1] = MPC85xx_IRQ_EXT5;
  386. mdata->irq[2] = -1;
  387. mdata->irq[3] = -1;
  388. mdata->irq[31] = -1;
  389. /* setup the board related information for the enet controllers */
  390. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
  391. if (pdata) {
  392. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  393. pdata->bus_id = 0;
  394. pdata->phy_id = 0;
  395. memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
  396. }
  397. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
  398. if (pdata) {
  399. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  400. pdata->bus_id = 0;
  401. pdata->phy_id = 1;
  402. memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
  403. }
  404. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
  405. if (pdata) {
  406. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  407. pdata->bus_id = 0;
  408. pdata->phy_id = 0;
  409. memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
  410. }
  411. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
  412. if (pdata) {
  413. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  414. pdata->bus_id = 0;
  415. pdata->phy_id = 1;
  416. memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
  417. }
  418. ppc_sys_device_remove(MPC85xx_eTSEC3);
  419. ppc_sys_device_remove(MPC85xx_eTSEC4);
  420. #ifdef CONFIG_BLK_DEV_INITRD
  421. if (initrd_start)
  422. ROOT_DEV = Root_RAM0;
  423. else
  424. #endif
  425. #ifdef CONFIG_ROOT_NFS
  426. ROOT_DEV = Root_NFS;
  427. #else
  428. ROOT_DEV = Root_HDA1;
  429. #endif
  430. }
  431. /* ************************************************************************ */
  432. void __init
  433. platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  434. unsigned long r6, unsigned long r7)
  435. {
  436. /* parse_bootinfo must always be called first */
  437. parse_bootinfo(find_bootinfo());
  438. /*
  439. * If we were passed in a board information, copy it into the
  440. * residual data area.
  441. */
  442. if (r3) {
  443. memcpy((void *) __res, (void *) (r3 + KERNELBASE),
  444. sizeof (bd_t));
  445. }
  446. #ifdef CONFIG_SERIAL_TEXT_DEBUG
  447. {
  448. bd_t *binfo = (bd_t *) __res;
  449. struct uart_port p;
  450. /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
  451. settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
  452. binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
  453. memset(&p, 0, sizeof (p));
  454. p.iotype = SERIAL_IO_MEM;
  455. p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART0_OFFSET;
  456. p.uartclk = binfo->bi_busfreq;
  457. gen550_init(0, &p);
  458. memset(&p, 0, sizeof (p));
  459. p.iotype = SERIAL_IO_MEM;
  460. p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART1_OFFSET;
  461. p.uartclk = binfo->bi_busfreq;
  462. gen550_init(1, &p);
  463. }
  464. #endif
  465. #if defined(CONFIG_BLK_DEV_INITRD)
  466. /*
  467. * If the init RAM disk has been configured in, and there's a valid
  468. * starting address for it, set it up.
  469. */
  470. if (r4) {
  471. initrd_start = r4 + KERNELBASE;
  472. initrd_end = r5 + KERNELBASE;
  473. }
  474. #endif /* CONFIG_BLK_DEV_INITRD */
  475. /* Copy the kernel command line arguments to a safe place. */
  476. if (r6) {
  477. *(char *) (r7 + KERNELBASE) = 0;
  478. strcpy(cmd_line, (char *) (r6 + KERNELBASE));
  479. }
  480. identify_ppc_sys_by_id(mfspr(SPRN_SVR));
  481. /* setup the PowerPC module struct */
  482. ppc_md.setup_arch = mpc85xx_cds_setup_arch;
  483. ppc_md.show_cpuinfo = mpc85xx_cds_show_cpuinfo;
  484. ppc_md.init_IRQ = mpc85xx_cds_init_IRQ;
  485. ppc_md.get_irq = openpic_get_irq;
  486. ppc_md.restart = mpc85xx_restart;
  487. ppc_md.power_off = mpc85xx_power_off;
  488. ppc_md.halt = mpc85xx_halt;
  489. ppc_md.find_end_of_memory = mpc85xx_find_end_of_memory;
  490. ppc_md.calibrate_decr = mpc85xx_calibrate_decr;
  491. ppc_md.time_init = todc_time_init;
  492. ppc_md.set_rtc_time = todc_set_rtc_time;
  493. ppc_md.get_rtc_time = todc_get_rtc_time;
  494. ppc_md.nvram_read_val = todc_direct_read_val;
  495. ppc_md.nvram_write_val = todc_direct_write_val;
  496. #if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
  497. ppc_md.progress = gen550_progress;
  498. #endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
  499. #if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
  500. ppc_md.early_serial_map = mpc85xx_early_serial_map;
  501. #endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
  502. if (ppc_md.progress)
  503. ppc_md.progress("mpc85xx_cds_init(): exit", 0);
  504. return;
  505. }