mpc85xx_cds_common.c 17 KB

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