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>
36 #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
38 #define DBG(fmt, args...)
42 void __init mpc85xx_rdb_pic_init(void)
46 struct device_node *np;
47 unsigned long root = of_get_flat_dt_root();
49 np = of_find_node_by_type(NULL, "open-pic");
51 printk(KERN_ERR "Could not find open-pic node\n");
55 if (of_address_to_resource(np, 0, &r)) {
56 printk(KERN_ERR "Failed to map mpic register space\n");
61 if (of_flat_dt_is_compatible(root, "fsl,85XXRDB-CAMP")) {
62 mpic = mpic_alloc(np, r.start,
64 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
67 mpic = mpic_alloc(np, r.start,
68 MPIC_PRIMARY | MPIC_WANTS_RESET |
69 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
82 * Setup the architecture
85 extern void __init mpc85xx_smp_init(void);
87 static void __init mpc85xx_rdb_setup_arch(void)
90 struct device_node *np;
94 ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
97 for_each_node_by_type(np, "pci") {
98 if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
99 fsl_add_bridge(np, 0);
108 printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
111 static struct of_device_id __initdata mpc85xxrdb_ids[] = {
113 { .compatible = "soc", },
114 { .compatible = "simple-bus", },
115 { .compatible = "gianfar", },
119 static int __init mpc85xxrdb_publish_devices(void)
121 return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
123 machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
124 machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
127 * Called very early, device-tree isn't unflattened
129 static int __init p2020_rdb_probe(void)
131 unsigned long root = of_get_flat_dt_root();
133 if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
138 static int __init p1020_rdb_probe(void)
140 unsigned long root = of_get_flat_dt_root();
142 if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
147 define_machine(p2020_rdb) {
149 .probe = p2020_rdb_probe,
150 .setup_arch = mpc85xx_rdb_setup_arch,
151 .init_IRQ = mpc85xx_rdb_pic_init,
153 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
155 .get_irq = mpic_get_irq,
156 .restart = fsl_rstcr_restart,
157 .calibrate_decr = generic_calibrate_decr,
158 .progress = udbg_progress,
161 define_machine(p1020_rdb) {
163 .probe = p1020_rdb_probe,
164 .setup_arch = mpc85xx_rdb_setup_arch,
165 .init_IRQ = mpc85xx_rdb_pic_init,
167 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
169 .get_irq = mpic_get_irq,
170 .restart = fsl_rstcr_restart,
171 .calibrate_decr = generic_calibrate_decr,
172 .progress = udbg_progress,