2 * MPC8536 DS Board Setup
4 * Copyright 2008 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>
33 void __init mpc8536_ds_pic_init(void)
37 struct device_node *np;
39 np = of_find_node_by_type(NULL, "open-pic");
41 printk(KERN_ERR "Could not find open-pic node\n");
45 if (of_address_to_resource(np, 0, &r)) {
46 printk(KERN_ERR "Failed to map mpic register space\n");
51 mpic = mpic_alloc(np, r.start,
52 MPIC_PRIMARY | MPIC_WANTS_RESET |
53 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
62 * Setup the architecture
64 static void __init mpc8536_ds_setup_arch(void)
67 struct device_node *np;
71 ppc_md.progress("mpc8536_ds_setup_arch()", 0);
74 for_each_node_by_type(np, "pci") {
75 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
76 of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
78 of_address_to_resource(np, 0, &rsrc);
79 if ((rsrc.start & 0xfffff) == 0x8000)
80 fsl_add_bridge(np, 1);
82 fsl_add_bridge(np, 0);
88 printk("MPC8536 DS board from Freescale Semiconductor\n");
91 static struct of_device_id __initdata mpc8536_ds_ids[] = {
93 { .compatible = "soc", },
94 { .compatible = "simple-bus", },
95 { .compatible = "gianfar", },
99 static int __init mpc8536_ds_publish_devices(void)
101 return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL);
103 machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices);
106 * Called very early, device-tree isn't unflattened
108 static int __init mpc8536_ds_probe(void)
110 unsigned long root = of_get_flat_dt_root();
112 return of_flat_dt_is_compatible(root, "fsl,mpc8536ds");
115 define_machine(mpc8536_ds) {
116 .name = "MPC8536 DS",
117 .probe = mpc8536_ds_probe,
118 .setup_arch = mpc8536_ds_setup_arch,
119 .init_IRQ = mpc8536_ds_pic_init,
121 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
123 .get_irq = mpic_get_irq,
124 .restart = fsl_rstcr_restart,
125 .calibrate_decr = generic_calibrate_decr,
126 .progress = udbg_progress,