staging:iio:Documentation gyro -> anglvel updates in attribute names
[zen-stable.git] / arch / powerpc / platforms / 85xx / p1010rdb.c
blobd7387fa7f5345bd33c6c7db37039f6d81af29729
1 /*
2 * P1010RDB Board Setup
4 * Copyright 2011 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/delay.h>
16 #include <linux/interrupt.h>
17 #include <linux/of_platform.h>
19 #include <asm/system.h>
20 #include <asm/time.h>
21 #include <asm/machdep.h>
22 #include <asm/pci-bridge.h>
23 #include <mm/mmu_decl.h>
24 #include <asm/prom.h>
25 #include <asm/udbg.h>
26 #include <asm/mpic.h>
28 #include <sysdev/fsl_soc.h>
29 #include <sysdev/fsl_pci.h>
31 void __init p1010_rdb_pic_init(void)
33 struct mpic *mpic;
34 struct resource r;
35 struct device_node *np;
37 np = of_find_node_by_type(NULL, "open-pic");
38 if (np == NULL) {
39 printk(KERN_ERR "Could not find open-pic node\n");
40 return;
43 if (of_address_to_resource(np, 0, &r)) {
44 printk(KERN_ERR "Failed to map mpic register space\n");
45 of_node_put(np);
46 return;
49 mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET |
50 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
51 0, 256, " OpenPIC ");
53 BUG_ON(mpic == NULL);
54 of_node_put(np);
56 mpic_init(mpic);
62 * Setup the architecture
64 static void __init p1010_rdb_setup_arch(void)
66 #ifdef CONFIG_PCI
67 struct device_node *np;
68 #endif
70 if (ppc_md.progress)
71 ppc_md.progress("p1010_rdb_setup_arch()", 0);
73 #ifdef CONFIG_PCI
74 for_each_node_by_type(np, "pci") {
75 if (of_device_is_compatible(np, "fsl,p1010-pcie"))
76 fsl_add_bridge(np, 0);
79 #endif
81 printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
84 static struct of_device_id __initdata p1010rdb_ids[] = {
85 { .type = "soc", },
86 { .compatible = "soc", },
87 { .compatible = "simple-bus", },
88 {},
91 static int __init p1010rdb_publish_devices(void)
93 return of_platform_bus_probe(NULL, p1010rdb_ids, NULL);
95 machine_device_initcall(p1010_rdb, p1010rdb_publish_devices);
96 machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
99 * Called very early, device-tree isn't unflattened
101 static int __init p1010_rdb_probe(void)
103 unsigned long root = of_get_flat_dt_root();
105 if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
106 return 1;
107 return 0;
110 define_machine(p1010_rdb) {
111 .name = "P1010 RDB",
112 .probe = p1010_rdb_probe,
113 .setup_arch = p1010_rdb_setup_arch,
114 .init_IRQ = p1010_rdb_pic_init,
115 #ifdef CONFIG_PCI
116 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
117 #endif
118 .get_irq = mpic_get_irq,
119 .restart = fsl_rstcr_restart,
120 .calibrate_decr = generic_calibrate_decr,
121 .progress = udbg_progress,