]> Pileus Git - ~andy/linux/blob - arch/arm/mach-kirkwood/board-dt.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[~andy/linux] / 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 <asm/mach/arch.h>
18 #include <asm/mach/map.h>
19 #include <mach/bridge-regs.h>
20 #include "common.h"
21
22 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
23         { .compatible = "simple-bus", },
24         { }
25 };
26
27 static void __init kirkwood_dt_init(void)
28 {
29         pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
30
31         /*
32          * Disable propagation of mbus errors to the CPU local bus,
33          * as this causes mbus errors (which can occur for example
34          * for PCI aborts) to throw CPU aborts, which we're not set
35          * up to deal with.
36          */
37         writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
38
39         kirkwood_setup_cpu_mbus();
40
41 #ifdef CONFIG_CACHE_FEROCEON_L2
42         kirkwood_l2_init();
43 #endif
44
45         /* internal devices that every board has */
46         kirkwood_wdt_init();
47         kirkwood_xor0_init();
48         kirkwood_xor1_init();
49         kirkwood_crypto_init();
50
51 #ifdef CONFIG_KEXEC
52         kexec_reinit = kirkwood_enable_pcie;
53 #endif
54
55         if (of_machine_is_compatible("globalscale,dreamplug"))
56                 dreamplug_init();
57
58         of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
59 }
60
61 static const char *kirkwood_dt_board_compat[] = {
62         "globalscale,dreamplug",
63         NULL
64 };
65
66 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
67         /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
68         .map_io         = kirkwood_map_io,
69         .init_early     = kirkwood_init_early,
70         .init_irq       = kirkwood_init_irq,
71         .timer          = &kirkwood_timer,
72         .init_machine   = kirkwood_dt_init,
73         .restart        = kirkwood_restart,
74         .dt_compat      = kirkwood_dt_board_compat,
75 MACHINE_END