mpc85xx_cds_common.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. /*
  2. * arch/ppc/platform/85xx/mpc85xx_cds_common.c
  3. *
  4. * MPC85xx CDS board specific routines
  5. *
  6. * Maintainer: Kumar Gala <kumar.gala@freescale.com>
  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 void 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. }
  121. static struct irqaction cpm2_irqaction = {
  122. .handler = cpm2_cascade,
  123. .flags = SA_INTERRUPT,
  124. .mask = CPU_MASK_NONE,
  125. .name = "cpm2_cascade",
  126. };
  127. #endif /* CONFIG_CPM2 */
  128. void __init
  129. mpc85xx_cds_init_IRQ(void)
  130. {
  131. bd_t *binfo = (bd_t *) __res;
  132. int i;
  133. /* Determine the Physical Address of the OpenPIC regs */
  134. phys_addr_t OpenPIC_PAddr = binfo->bi_immr_base + MPC85xx_OPENPIC_OFFSET;
  135. OpenPIC_Addr = ioremap(OpenPIC_PAddr, MPC85xx_OPENPIC_SIZE);
  136. OpenPIC_InitSenses = mpc85xx_cds_openpic_initsenses;
  137. OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses);
  138. /* Skip reserved space and internal sources */
  139. #ifdef CONFIG_MPC8548
  140. openpic_set_sources(0, 48, OpenPIC_Addr + 0x10200);
  141. #else
  142. openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
  143. #endif
  144. /* Map PIC IRQs 0-11 */
  145. openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
  146. /* we let openpic interrupts starting from an offset, to
  147. * leave space for cascading interrupts underneath.
  148. */
  149. openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET);
  150. #ifdef CONFIG_PCI
  151. openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
  152. for (i = 0; i < NUM_8259_INTERRUPTS; i++)
  153. irq_desc[i].handler = &i8259_pic;
  154. i8259_init(0);
  155. #endif
  156. #ifdef CONFIG_CPM2
  157. /* Setup CPM2 PIC */
  158. cpm2_init_IRQ();
  159. setup_irq(MPC85xx_IRQ_CPM, &cpm2_irqaction);
  160. #endif
  161. return;
  162. }
  163. #ifdef CONFIG_PCI
  164. /*
  165. * interrupt routing
  166. */
  167. int
  168. mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  169. {
  170. struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
  171. if (!hose->index)
  172. {
  173. /* Handle PCI1 interrupts */
  174. char pci_irq_table[][4] =
  175. /*
  176. * PCI IDSEL/INTPIN->INTLINE
  177. * A B C D
  178. */
  179. /* Note IRQ assignment for slots is based on which slot the elysium is
  180. * in -- in this setup elysium is in slot #2 (this PIRQA as first
  181. * interrupt on slot */
  182. {
  183. { 0, 1, 2, 3 }, /* 16 - PMC */
  184. { 0, 1, 2, 3 }, /* 17 P2P (Tsi320) */
  185. { 0, 1, 2, 3 }, /* 18 - Slot 1 */
  186. { 1, 2, 3, 0 }, /* 19 - Slot 2 */
  187. { 2, 3, 0, 1 }, /* 20 - Slot 3 */
  188. { 3, 0, 1, 2 }, /* 21 - Slot 4 */
  189. };
  190. const long min_idsel = 16, max_idsel = 21, irqs_per_slot = 4;
  191. int i, j;
  192. for (i = 0; i < 6; i++)
  193. for (j = 0; j < 4; j++)
  194. pci_irq_table[i][j] =
  195. ((pci_irq_table[i][j] + 5 -
  196. cds_pci_slot) & 0x3) + PIRQ0A;
  197. return PCI_IRQ_TABLE_LOOKUP;
  198. } else {
  199. /* Handle PCI2 interrupts (if we have one) */
  200. char pci_irq_table[][4] =
  201. {
  202. /*
  203. * We only have one slot and one interrupt
  204. * going to PIRQA - PIRQD */
  205. { PIRQ1A, PIRQ1A, PIRQ1A, PIRQ1A }, /* 21 - slot 0 */
  206. };
  207. const long min_idsel = 21, max_idsel = 21, irqs_per_slot = 4;
  208. return PCI_IRQ_TABLE_LOOKUP;
  209. }
  210. }
  211. #define ARCADIA_HOST_BRIDGE_IDSEL 17
  212. #define ARCADIA_2ND_BRIDGE_IDSEL 3
  213. extern int mpc85xx_pci1_last_busno;
  214. int
  215. mpc85xx_exclude_device(u_char bus, u_char devfn)
  216. {
  217. if (bus == 0 && PCI_SLOT(devfn) == 0)
  218. return PCIBIOS_DEVICE_NOT_FOUND;
  219. #ifdef CONFIG_85xx_PCI2
  220. if (mpc85xx_pci1_last_busno)
  221. if (bus == (mpc85xx_pci1_last_busno + 1) && PCI_SLOT(devfn) == 0)
  222. return PCIBIOS_DEVICE_NOT_FOUND;
  223. #endif
  224. /* We explicitly do not go past the Tundra 320 Bridge */
  225. if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
  226. return PCIBIOS_DEVICE_NOT_FOUND;
  227. if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
  228. return PCIBIOS_DEVICE_NOT_FOUND;
  229. else
  230. return PCIBIOS_SUCCESSFUL;
  231. }
  232. void __init
  233. mpc85xx_cds_enable_via(struct pci_controller *hose)
  234. {
  235. u32 pci_class;
  236. u16 vid, did;
  237. early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
  238. if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
  239. return;
  240. /* Configure P2P so that we can reach bus 1 */
  241. early_write_config_byte(hose, 0, 0x88, PCI_PRIMARY_BUS, 0);
  242. early_write_config_byte(hose, 0, 0x88, PCI_SECONDARY_BUS, 1);
  243. early_write_config_byte(hose, 0, 0x88, PCI_SUBORDINATE_BUS, 0xff);
  244. early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
  245. early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
  246. if ((vid != PCI_VENDOR_ID_VIA) ||
  247. (did != PCI_DEVICE_ID_VIA_82C686))
  248. return;
  249. /* Enable USB and IDE functions */
  250. early_write_config_byte(hose, 1, 0x10, 0x48, 0x08);
  251. }
  252. void __init
  253. mpc85xx_cds_fixup_via(struct pci_controller *hose)
  254. {
  255. u32 pci_class;
  256. u16 vid, did;
  257. early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
  258. if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
  259. return;
  260. /*
  261. * Force the backplane P2P bridge to have a window
  262. * open from 0x00000000-0x00001fff in PCI I/O space.
  263. * This allows legacy I/O (i8259, etc) on the VIA
  264. * southbridge to be accessed.
  265. */
  266. early_write_config_byte(hose, 0, 0x88, PCI_IO_BASE, 0x00);
  267. early_write_config_word(hose, 0, 0x88, PCI_IO_BASE_UPPER16, 0x0000);
  268. early_write_config_byte(hose, 0, 0x88, PCI_IO_LIMIT, 0x10);
  269. early_write_config_word(hose, 0, 0x88, PCI_IO_LIMIT_UPPER16, 0x0000);
  270. early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
  271. early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
  272. if ((vid != PCI_VENDOR_ID_VIA) ||
  273. (did != PCI_DEVICE_ID_VIA_82C686))
  274. return;
  275. /*
  276. * Since the P2P window was forced to cover the fixed
  277. * legacy I/O addresses, it is necessary to manually
  278. * place the base addresses for the IDE and USB functions
  279. * within this window.
  280. */
  281. /* Function 1, IDE */
  282. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_0, 0x1ff8);
  283. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_1, 0x1ff4);
  284. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_2, 0x1fe8);
  285. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_3, 0x1fe4);
  286. early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_4, 0x1fd0);
  287. /* Function 2, USB ports 0-1 */
  288. early_write_config_dword(hose, 1, 0x12, PCI_BASE_ADDRESS_4, 0x1fa0);
  289. /* Function 3, USB ports 2-3 */
  290. early_write_config_dword(hose, 1, 0x13, PCI_BASE_ADDRESS_4, 0x1f80);
  291. /* Function 5, Power Management */
  292. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_0, 0x1e00);
  293. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_1, 0x1dfc);
  294. early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_2, 0x1df8);
  295. /* Function 6, AC97 Interface */
  296. early_write_config_dword(hose, 1, 0x16, PCI_BASE_ADDRESS_0, 0x1c00);
  297. }
  298. void __init
  299. mpc85xx_cds_pcibios_fixup(void)
  300. {
  301. struct pci_dev *dev = NULL;
  302. u_char c;
  303. if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
  304. PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
  305. /*
  306. * U-Boot does not set the enable bits
  307. * for the IDE device. Force them on here.
  308. */
  309. pci_read_config_byte(dev, 0x40, &c);
  310. c |= 0x03; /* IDE: Chip Enable Bits */
  311. pci_write_config_byte(dev, 0x40, c);
  312. /*
  313. * Since only primary interface works, force the
  314. * IDE function to standard primary IDE interrupt
  315. * w/ 8259 offset
  316. */
  317. dev->irq = 14;
  318. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
  319. }
  320. /*
  321. * Force legacy USB interrupt routing
  322. */
  323. if ((dev = pci_find_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. }
  328. if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
  329. PCI_DEVICE_ID_VIA_82C586_2, dev))) {
  330. dev->irq = 11;
  331. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
  332. }
  333. }
  334. #endif /* CONFIG_PCI */
  335. TODC_ALLOC();
  336. /* ************************************************************************
  337. *
  338. * Setup the architecture
  339. *
  340. */
  341. static void __init
  342. mpc85xx_cds_setup_arch(void)
  343. {
  344. bd_t *binfo = (bd_t *) __res;
  345. unsigned int freq;
  346. struct gianfar_platform_data *pdata;
  347. /* get the core frequency */
  348. freq = binfo->bi_intfreq;
  349. printk("mpc85xx_cds_setup_arch\n");
  350. #ifdef CONFIG_CPM2
  351. cpm2_reset();
  352. #endif
  353. cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE);
  354. cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1;
  355. printk("CDS Version = %x in PCI slot %d\n", cadmus[CM_VER], cds_pci_slot);
  356. /* Setup TODC access */
  357. TODC_INIT(TODC_TYPE_DS1743,
  358. 0,
  359. 0,
  360. ioremap(CDS_RTC_ADDR, CDS_RTC_SIZE),
  361. 8);
  362. /* Set loops_per_jiffy to a half-way reasonable value,
  363. for use until calibrate_delay gets called. */
  364. loops_per_jiffy = freq / HZ;
  365. #ifdef CONFIG_PCI
  366. /* VIA IDE configuration */
  367. ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
  368. /* setup PCI host bridges */
  369. mpc85xx_setup_hose();
  370. #endif
  371. #ifdef CONFIG_SERIAL_8250
  372. mpc85xx_early_serial_map();
  373. #endif
  374. #ifdef CONFIG_SERIAL_TEXT_DEBUG
  375. /* Invalidate the entry we stole earlier the serial ports
  376. * should be properly mapped */
  377. invalidate_tlbcam_entry(num_tlbcam_entries - 1);
  378. #endif
  379. /* setup the board related information for the enet controllers */
  380. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
  381. if (pdata) {
  382. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  383. pdata->interruptPHY = MPC85xx_IRQ_EXT5;
  384. pdata->phyid = 0;
  385. /* fixup phy address */
  386. pdata->phy_reg_addr += binfo->bi_immr_base;
  387. memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
  388. }
  389. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
  390. if (pdata) {
  391. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  392. pdata->interruptPHY = MPC85xx_IRQ_EXT5;
  393. pdata->phyid = 1;
  394. /* fixup phy address */
  395. pdata->phy_reg_addr += binfo->bi_immr_base;
  396. memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
  397. }
  398. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
  399. if (pdata) {
  400. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  401. pdata->interruptPHY = MPC85xx_IRQ_EXT5;
  402. pdata->phyid = 0;
  403. /* fixup phy address */
  404. pdata->phy_reg_addr += binfo->bi_immr_base;
  405. memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
  406. }
  407. pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
  408. if (pdata) {
  409. pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
  410. pdata->interruptPHY = MPC85xx_IRQ_EXT5;
  411. pdata->phyid = 1;
  412. /* fixup phy address */
  413. pdata->phy_reg_addr += binfo->bi_immr_base;
  414. memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
  415. }
  416. ppc_sys_device_remove(MPC85xx_eTSEC3);
  417. ppc_sys_device_remove(MPC85xx_eTSEC4);
  418. #ifdef CONFIG_BLK_DEV_INITRD
  419. if (initrd_start)
  420. ROOT_DEV = Root_RAM0;
  421. else
  422. #endif
  423. #ifdef CONFIG_ROOT_NFS
  424. ROOT_DEV = Root_NFS;
  425. #else
  426. ROOT_DEV = Root_HDA1;
  427. #endif
  428. }
  429. /* ************************************************************************ */
  430. void __init
  431. platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  432. unsigned long r6, unsigned long r7)
  433. {
  434. /* parse_bootinfo must always be called first */
  435. parse_bootinfo(find_bootinfo());
  436. /*
  437. * If we were passed in a board information, copy it into the
  438. * residual data area.
  439. */
  440. if (r3) {
  441. memcpy((void *) __res, (void *) (r3 + KERNELBASE),
  442. sizeof (bd_t));
  443. }
  444. #ifdef CONFIG_SERIAL_TEXT_DEBUG
  445. {
  446. bd_t *binfo = (bd_t *) __res;
  447. struct uart_port p;
  448. /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
  449. settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
  450. binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
  451. memset(&p, 0, sizeof (p));
  452. p.iotype = SERIAL_IO_MEM;
  453. p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART0_OFFSET;
  454. p.uartclk = binfo->bi_busfreq;
  455. gen550_init(0, &p);
  456. memset(&p, 0, sizeof (p));
  457. p.iotype = SERIAL_IO_MEM;
  458. p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART1_OFFSET;
  459. p.uartclk = binfo->bi_busfreq;
  460. gen550_init(1, &p);
  461. }
  462. #endif
  463. #if defined(CONFIG_BLK_DEV_INITRD)
  464. /*
  465. * If the init RAM disk has been configured in, and there's a valid
  466. * starting address for it, set it up.
  467. */
  468. if (r4) {
  469. initrd_start = r4 + KERNELBASE;
  470. initrd_end = r5 + KERNELBASE;
  471. }
  472. #endif /* CONFIG_BLK_DEV_INITRD */
  473. /* Copy the kernel command line arguments to a safe place. */
  474. if (r6) {
  475. *(char *) (r7 + KERNELBASE) = 0;
  476. strcpy(cmd_line, (char *) (r6 + KERNELBASE));
  477. }
  478. identify_ppc_sys_by_id(mfspr(SPRN_SVR));
  479. /* setup the PowerPC module struct */
  480. ppc_md.setup_arch = mpc85xx_cds_setup_arch;
  481. ppc_md.show_cpuinfo = mpc85xx_cds_show_cpuinfo;
  482. ppc_md.init_IRQ = mpc85xx_cds_init_IRQ;
  483. ppc_md.get_irq = openpic_get_irq;
  484. ppc_md.restart = mpc85xx_restart;
  485. ppc_md.power_off = mpc85xx_power_off;
  486. ppc_md.halt = mpc85xx_halt;
  487. ppc_md.find_end_of_memory = mpc85xx_find_end_of_memory;
  488. ppc_md.calibrate_decr = mpc85xx_calibrate_decr;
  489. ppc_md.time_init = todc_time_init;
  490. ppc_md.set_rtc_time = todc_set_rtc_time;
  491. ppc_md.get_rtc_time = todc_get_rtc_time;
  492. ppc_md.nvram_read_val = todc_direct_read_val;
  493. ppc_md.nvram_write_val = todc_direct_write_val;
  494. #if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
  495. ppc_md.progress = gen550_progress;
  496. #endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
  497. #if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
  498. ppc_md.early_serial_map = mpc85xx_early_serial_map;
  499. #endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
  500. if (ppc_md.progress)
  501. ppc_md.progress("mpc85xx_cds_init(): exit", 0);
  502. return;
  503. }