blob: dbaf44354f0d33a549a9ac4ed1eb0d96b24c9008 [file] [log] [blame]
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +00001/*
2 * P1010RDB Board Setup
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
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.
10 */
11
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>
18
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000019#include <asm/time.h>
20#include <asm/machdep.h>
21#include <asm/pci-bridge.h>
22#include <mm/mmu_decl.h>
23#include <asm/prom.h>
24#include <asm/udbg.h>
25#include <asm/mpic.h>
26
27#include <sysdev/fsl_soc.h>
28#include <sysdev/fsl_pci.h>
29
Kumar Gala199bfbe2011-11-24 01:00:10 -060030#include "mpc85xx.h"
31
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000032void __init p1010_rdb_pic_init(void)
33{
Kyle Moffette55d7f72011-12-22 10:19:14 +000034 struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
Kyle Moffett50196092011-12-22 10:19:12 +000035 MPIC_SINGLE_DEST_CPU,
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000036 0, 256, " OpenPIC ");
37
38 BUG_ON(mpic == NULL);
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000039
40 mpic_init(mpic);
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000041}
42
43
44/*
45 * Setup the architecture
46 */
47static void __init p1010_rdb_setup_arch(void)
48{
49#ifdef CONFIG_PCI
50 struct device_node *np;
51#endif
52
53 if (ppc_md.progress)
54 ppc_md.progress("p1010_rdb_setup_arch()", 0);
55
56#ifdef CONFIG_PCI
57 for_each_node_by_type(np, "pci") {
58 if (of_device_is_compatible(np, "fsl,p1010-pcie"))
59 fsl_add_bridge(np, 0);
60 }
61
62#endif
63
64 printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
65}
66
Kumar Gala199bfbe2011-11-24 01:00:10 -060067machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
Prabhakar Kushwaha2d05c392011-06-02 20:28:08 +000068machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
69
70/*
71 * Called very early, device-tree isn't unflattened
72 */
73static int __init p1010_rdb_probe(void)
74{
75 unsigned long root = of_get_flat_dt_root();
76
77 if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
78 return 1;
79 return 0;
80}
81
82define_machine(p1010_rdb) {
83 .name = "P1010 RDB",
84 .probe = p1010_rdb_probe,
85 .setup_arch = p1010_rdb_setup_arch,
86 .init_IRQ = p1010_rdb_pic_init,
87#ifdef CONFIG_PCI
88 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
89#endif
90 .get_irq = mpic_get_irq,
91 .restart = fsl_rstcr_restart,
92 .calibrate_decr = generic_calibrate_decr,
93 .progress = udbg_progress,
94};