Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[sfrench/cifs-2.6.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 <plat/irq.h>
22 #include "common.h"
23
24 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
25         { .compatible = "simple-bus", },
26         { }
27 };
28
29 struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
30         OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
31         OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
32                        NULL),
33         OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
34         OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
35         OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
36         OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1030000, "mv_crypto", NULL),
37         {},
38 };
39
40 static void __init kirkwood_dt_init(void)
41 {
42         pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
43
44         /*
45          * Disable propagation of mbus errors to the CPU local bus,
46          * as this causes mbus errors (which can occur for example
47          * for PCI aborts) to throw CPU aborts, which we're not set
48          * up to deal with.
49          */
50         writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
51
52         kirkwood_setup_cpu_mbus();
53
54         kirkwood_l2_init();
55
56         /* Setup root of clk tree */
57         kirkwood_clk_init();
58
59         /* internal devices that every board has */
60         kirkwood_xor0_init();
61         kirkwood_xor1_init();
62
63 #ifdef CONFIG_KEXEC
64         kexec_reinit = kirkwood_enable_pcie;
65 #endif
66
67         if (of_machine_is_compatible("globalscale,dreamplug"))
68                 dreamplug_init();
69
70         if (of_machine_is_compatible("dlink,dns-kirkwood"))
71                 dnskw_init();
72
73         if (of_machine_is_compatible("iom,iconnect"))
74                 iconnect_init();
75
76         if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
77                 ib62x0_init();
78
79         if (of_machine_is_compatible("qnap,ts219"))
80                 qnap_dt_ts219_init();
81
82         if (of_machine_is_compatible("seagate,dockstar"))
83                 dockstar_dt_init();
84
85         if (of_machine_is_compatible("seagate,goflexnet"))
86                 goflexnet_init();
87
88         if (of_machine_is_compatible("buffalo,lsxl"))
89                 lsxl_init();
90
91         if (of_machine_is_compatible("iom,ix2-200"))
92                 iomega_ix2_200_init();
93
94         if (of_machine_is_compatible("keymile,km_kirkwood"))
95                 km_kirkwood_init();
96
97         of_platform_populate(NULL, kirkwood_dt_match_table,
98                              kirkwood_auxdata_lookup, NULL);
99 }
100
101 static const char *kirkwood_dt_board_compat[] = {
102         "globalscale,dreamplug",
103         "dlink,dns-320",
104         "dlink,dns-325",
105         "iom,iconnect",
106         "raidsonic,ib-nas62x0",
107         "qnap,ts219",
108         "seagate,dockstar",
109         "seagate,goflexnet",
110         "buffalo,lsxl",
111         "iom,ix2-200",
112         "keymile,km_kirkwood",
113         NULL
114 };
115
116 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
117         /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
118         .map_io         = kirkwood_map_io,
119         .init_early     = kirkwood_init_early,
120         .init_irq       = orion_dt_init_irq,
121         .timer          = &kirkwood_timer,
122         .init_machine   = kirkwood_dt_init,
123         .restart        = kirkwood_restart,
124         .dt_compat      = kirkwood_dt_board_compat,
125 MACHINE_END