blob: b0090aac9642283ba4c62a00789edd92baab8ce7 [file] [log] [blame]
Anton Vorontsovb13e9302008-05-23 20:39:01 +04001/*
2 * MPC8360E-RDK board file.
3 *
4 * Copyright (c) 2006 Freescale Semicondutor, Inc.
5 * Copyright (c) 2007-2008 MontaVista Software, Inc.
6 *
7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/kernel.h>
16#include <linux/pci.h>
17#include <linux/of_platform.h>
18#include <linux/io.h>
19#include <asm/prom.h>
20#include <asm/time.h>
21#include <asm/ipic.h>
22#include <asm/udbg.h>
23#include <asm/qe.h>
24#include <asm/qe_ic.h>
25#include <sysdev/fsl_soc.h>
John Rigby76fe1ff2008-06-26 11:07:57 -060026#include <sysdev/fsl_pci.h>
Anton Vorontsovb13e9302008-05-23 20:39:01 +040027
28#include "mpc83xx.h"
29
30static struct of_device_id __initdata mpc836x_rdk_ids[] = {
31 { .compatible = "simple-bus", },
32 {},
33};
34
35static int __init mpc836x_rdk_declare_of_platform_devices(void)
36{
37 return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
38}
39machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
40
41static void __init mpc836x_rdk_setup_arch(void)
42{
43#ifdef CONFIG_PCI
44 struct device_node *np;
45#endif
46
47 if (ppc_md.progress)
48 ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
49
50#ifdef CONFIG_PCI
51 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
52 mpc83xx_add_bridge(np);
53#endif
Anton Vorontsov20cfb412008-12-05 19:55:04 +030054#ifdef CONFIG_QUICC_ENGINE
Anton Vorontsovb13e9302008-05-23 20:39:01 +040055 qe_reset();
Anton Vorontsov20cfb412008-12-05 19:55:04 +030056#endif
Anton Vorontsovb13e9302008-05-23 20:39:01 +040057}
58
59static void __init mpc836x_rdk_init_IRQ(void)
60{
61 struct device_node *np;
62
63 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
64 if (!np)
65 return;
66
67 ipic_init(np, 0);
68
69 /*
70 * Initialize the default interrupt mapping priorities,
71 * in case the boot rom changed something on us.
72 */
73 ipic_set_default_priority();
74 of_node_put(np);
Anton Vorontsov20cfb412008-12-05 19:55:04 +030075#ifdef CONFIG_QUICC_ENGINE
Anton Vorontsovb13e9302008-05-23 20:39:01 +040076 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
77 if (!np)
78 return;
79
80 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
81 of_node_put(np);
Anton Vorontsov20cfb412008-12-05 19:55:04 +030082#endif
Anton Vorontsovb13e9302008-05-23 20:39:01 +040083}
84
85/*
86 * Called very early, MMU is off, device-tree isn't unflattened.
87 */
88static int __init mpc836x_rdk_probe(void)
89{
90 unsigned long root = of_get_flat_dt_root();
91
92 return of_flat_dt_is_compatible(root, "fsl,mpc8360rdk");
93}
94
95define_machine(mpc836x_rdk) {
96 .name = "MPC836x RDK",
97 .probe = mpc836x_rdk_probe,
98 .setup_arch = mpc836x_rdk_setup_arch,
99 .init_IRQ = mpc836x_rdk_init_IRQ,
100 .get_irq = ipic_get_irq,
101 .restart = mpc83xx_restart,
102 .time_init = mpc83xx_time_init,
103 .calibrate_decr = generic_calibrate_decr,
104 .progress = udbg_progress,
105};