2 * MPC85xx RDB Board Setup
4 * Copyright 2009 Freescale Semiconductor Inc.
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.
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>
21 #include <asm/system.h>
23 #include <asm/machdep.h>
24 #include <asm/pci-bridge.h>
25 #include <mm/mmu_decl.h>
30 #include <sysdev/fsl_soc.h>
31 #include <sysdev/fsl_pci.h>
39 #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
41 #define DBG(fmt, args...)
45 void __init mpc85xx_rdb_pic_init(void)
48 unsigned long root = of_get_flat_dt_root();
50 if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
51 mpic = mpic_alloc(NULL, 0, MPIC_NO_RESET |
56 mpic = mpic_alloc(NULL, 0,
67 * Setup the architecture
69 static void __init mpc85xx_rdb_setup_arch(void)
72 struct device_node *np;
76 ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
79 for_each_node_by_type(np, "pci") {
80 if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
81 fsl_add_bridge(np, 0);
87 printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
90 machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
91 machine_device_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
92 machine_device_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
93 machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
94 machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
95 machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices);
98 * Called very early, device-tree isn't unflattened
100 static int __init p2020_rdb_probe(void)
102 unsigned long root = of_get_flat_dt_root();
104 if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
109 static int __init p1020_rdb_probe(void)
111 unsigned long root = of_get_flat_dt_root();
113 if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
118 static int __init p1021_rdb_pc_probe(void)
120 unsigned long root = of_get_flat_dt_root();
122 if (of_flat_dt_is_compatible(root, "fsl,P1021RDB-PC"))
127 static int __init p2020_rdb_pc_probe(void)
129 unsigned long root = of_get_flat_dt_root();
131 if (of_flat_dt_is_compatible(root, "fsl,P2020RDB-PC"))
136 static int __init p1025_rdb_probe(void)
138 unsigned long root = of_get_flat_dt_root();
140 return of_flat_dt_is_compatible(root, "fsl,P1025RDB");
143 static int __init p1020_mbg_pc_probe(void)
145 unsigned long root = of_get_flat_dt_root();
147 return of_flat_dt_is_compatible(root, "fsl,P1020MBG-PC");
150 define_machine(p2020_rdb) {
152 .probe = p2020_rdb_probe,
153 .setup_arch = mpc85xx_rdb_setup_arch,
154 .init_IRQ = mpc85xx_rdb_pic_init,
156 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
158 .get_irq = mpic_get_irq,
159 .restart = fsl_rstcr_restart,
160 .calibrate_decr = generic_calibrate_decr,
161 .progress = udbg_progress,
164 define_machine(p1020_rdb) {
166 .probe = p1020_rdb_probe,
167 .setup_arch = mpc85xx_rdb_setup_arch,
168 .init_IRQ = mpc85xx_rdb_pic_init,
170 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
172 .get_irq = mpic_get_irq,
173 .restart = fsl_rstcr_restart,
174 .calibrate_decr = generic_calibrate_decr,
175 .progress = udbg_progress,
178 define_machine(p1021_rdb_pc) {
179 .name = "P1021 RDB-PC",
180 .probe = p1021_rdb_pc_probe,
181 .setup_arch = mpc85xx_rdb_setup_arch,
182 .init_IRQ = mpc85xx_rdb_pic_init,
184 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
186 .get_irq = mpic_get_irq,
187 .restart = fsl_rstcr_restart,
188 .calibrate_decr = generic_calibrate_decr,
189 .progress = udbg_progress,
192 define_machine(p2020_rdb_pc) {
193 .name = "P2020RDB-PC",
194 .probe = p2020_rdb_pc_probe,
195 .setup_arch = mpc85xx_rdb_setup_arch,
196 .init_IRQ = mpc85xx_rdb_pic_init,
198 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
200 .get_irq = mpic_get_irq,
201 .restart = fsl_rstcr_restart,
202 .calibrate_decr = generic_calibrate_decr,
203 .progress = udbg_progress,
206 define_machine(p1025_rdb) {
208 .probe = p1025_rdb_probe,
209 .setup_arch = mpc85xx_rdb_setup_arch,
210 .init_IRQ = mpc85xx_rdb_pic_init,
212 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
214 .get_irq = mpic_get_irq,
215 .restart = fsl_rstcr_restart,
216 .calibrate_decr = generic_calibrate_decr,
217 .progress = udbg_progress,
220 define_machine(p1020_mbg_pc) {
221 .name = "P1020 MBG-PC",
222 .probe = p1020_mbg_pc_probe,
223 .setup_arch = mpc85xx_rdb_setup_arch,
224 .init_IRQ = mpc85xx_rdb_pic_init,
226 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
228 .get_irq = mpic_get_irq,
229 .restart = fsl_rstcr_restart,
230 .calibrate_decr = generic_calibrate_decr,
231 .progress = udbg_progress,