powerpc/fsl-pci: Unify pci/pcie initialization code
[deliverable/linux.git] / arch / powerpc / platforms / 85xx / mpc8536_ds.c
CommitLineData
2f3804ed
KG
1/*
2 * MPC8536 DS Board Setup
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/kdev_t.h>
16#include <linux/delay.h>
17#include <linux/seq_file.h>
18#include <linux/interrupt.h>
19#include <linux/of_platform.h>
20
2f3804ed
KG
21#include <asm/time.h>
22#include <asm/machdep.h>
23#include <asm/pci-bridge.h>
24#include <mm/mmu_decl.h>
25#include <asm/prom.h>
26#include <asm/udbg.h>
27#include <asm/mpic.h>
152d0182 28#include <asm/swiotlb.h>
2f3804ed
KG
29
30#include <sysdev/fsl_soc.h>
31#include <sysdev/fsl_pci.h>
32
543a07b1
DES
33#include "mpc85xx.h"
34
2f3804ed
KG
35void __init mpc8536_ds_pic_init(void)
36{
e55d7f73 37 struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
2f3804ed
KG
38 0, 256, " OpenPIC ");
39 BUG_ON(mpic == NULL);
2f3804ed
KG
40 mpic_init(mpic);
41}
42
43/*
44 * Setup the architecture
45 */
46static void __init mpc8536_ds_setup_arch(void)
47{
2f3804ed
KG
48 if (ppc_md.progress)
49 ppc_md.progress("mpc8536_ds_setup_arch()", 0);
50
905e75c4 51 fsl_pci_assign_primary();
2f3804ed 52
905e75c4 53 swiotlb_detect_4g();
152d0182 54
2f3804ed
KG
55 printk("MPC8536 DS board from Freescale Semiconductor\n");
56}
57
905e75c4 58machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
2f3804ed 59
152d0182
KG
60machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
61
2f3804ed
KG
62/*
63 * Called very early, device-tree isn't unflattened
64 */
65static int __init mpc8536_ds_probe(void)
66{
67 unsigned long root = of_get_flat_dt_root();
68
69 return of_flat_dt_is_compatible(root, "fsl,mpc8536ds");
70}
71
72define_machine(mpc8536_ds) {
73 .name = "MPC8536 DS",
74 .probe = mpc8536_ds_probe,
75 .setup_arch = mpc8536_ds_setup_arch,
76 .init_IRQ = mpc8536_ds_pic_init,
77#ifdef CONFIG_PCI
78 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
79#endif
80 .get_irq = mpic_get_irq,
81 .restart = fsl_rstcr_restart,
82 .calibrate_decr = generic_calibrate_decr,
83 .progress = udbg_progress,
84};
This page took 0.316473 seconds and 5 git commands to generate.