- Update to 3.4-rc7.
[linux-flexiantxendom0-3.2.10.git] / arch / arm / mach-kirkwood / board-dt.c
1 /*
2  * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3  *
4  * arch/arm/mach-kirkwood/board-dt.c
5  *
6  * Flattened Device Tree board initialization
7  *
8  * This file is licensed under the terms of the GNU General Public
9  * License version 2.  This program is licensed "as is" without any
10  * warranty of any kind, whether express or implied.
11  */
12
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/of.h>
16 #include <linux/of_platform.h>
17 #include <linux/kexec.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/map.h>
20 #include <mach/bridge-regs.h>
21 #include "common.h"
22
23 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
24         { .compatible = "simple-bus", },
25         { }
26 };
27
28 static void __init kirkwood_dt_init(void)
29 {
30         pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
31
32         /*
33          * Disable propagation of mbus errors to the CPU local bus,
34          * as this causes mbus errors (which can occur for example
35          * for PCI aborts) to throw CPU aborts, which we're not set
36          * up to deal with.
37          */
38         writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
39
40         kirkwood_setup_cpu_mbus();
41
42 #ifdef CONFIG_CACHE_FEROCEON_L2
43         kirkwood_l2_init();
44 #endif
45
46         /* internal devices that every board has */
47         kirkwood_wdt_init();
48         kirkwood_xor0_init();
49         kirkwood_xor1_init();
50         kirkwood_crypto_init();
51
52 #ifdef CONFIG_KEXEC
53         kexec_reinit = kirkwood_enable_pcie;
54 #endif
55
56         if (of_machine_is_compatible("globalscale,dreamplug"))
57                 dreamplug_init();
58
59         of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
60 }
61
62 static const char *kirkwood_dt_board_compat[] = {
63         "globalscale,dreamplug",
64         NULL
65 };
66
67 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
68         /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
69         .map_io         = kirkwood_map_io,
70         .init_early     = kirkwood_init_early,
71         .init_irq       = kirkwood_init_irq,
72         .timer          = &kirkwood_timer,
73         .init_machine   = kirkwood_dt_init,
74         .restart        = kirkwood_restart,
75         .dt_compat      = kirkwood_dt_board_compat,
76 MACHINE_END