1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/stddef.h>
25#include <linux/kernel.h>
26#include <linux/pci.h>
27#include <linux/kdev_t.h>
28#include <linux/delay.h>
29#include <linux/seq_file.h>
30#include <linux/of_platform.h>
31
32#include <asm/time.h>
33#include <asm/machdep.h>
34#include <asm/pci-bridge.h>
35#include <asm/mpic.h>
36#include <asm/prom.h>
37#include <mm/mmu_decl.h>
38#include <asm/udbg.h>
39
40#include <sysdev/fsl_soc.h>
41#include <sysdev/fsl_pci.h>
42
43#include "mpc85xx.h"
44#include "socrates_fpga_pic.h"
45
46static void __init socrates_pic_init(void)
47{
48 struct device_node *np;
49
50 struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
51 0, 256, " OpenPIC ");
52 BUG_ON(mpic == NULL);
53 mpic_init(mpic);
54
55 np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
56 if (!np) {
57 printk(KERN_ERR "Could not find socrates-fpga-pic node\n");
58 return;
59 }
60 socrates_fpga_pic_init(np);
61 of_node_put(np);
62}
63
64
65
66
67static void __init socrates_setup_arch(void)
68{
69 if (ppc_md.progress)
70 ppc_md.progress("socrates_setup_arch()", 0);
71
72 fsl_pci_assign_primary();
73}
74
75machine_arch_initcall(socrates, mpc85xx_common_publish_devices);
76
77
78
79
80static int __init socrates_probe(void)
81{
82 unsigned long root = of_get_flat_dt_root();
83
84 if (of_flat_dt_is_compatible(root, "abb,socrates"))
85 return 1;
86
87 return 0;
88}
89
90define_machine(socrates) {
91 .name = "Socrates",
92 .probe = socrates_probe,
93 .setup_arch = socrates_setup_arch,
94 .init_IRQ = socrates_pic_init,
95 .get_irq = mpic_get_irq,
96 .restart = fsl_rstcr_restart,
97 .calibrate_decr = generic_calibrate_decr,
98 .progress = udbg_progress,
99};
100