mac80211: enable vif.cab_queue for mesh
[linux-2.6/btrfs-unstable.git] / arch / arm / mach-kirkwood / board-dt.c
blobff4150a2ad05259383d147626fbae49648e1a256
1 /*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
4 * arch/arm/mach-kirkwood/board-dt.c
6 * Flattened Device Tree board initialization
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.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/of.h>
16 #include <linux/of_platform.h>
17 #include <linux/clk-provider.h>
18 #include <linux/clk/mvebu.h>
19 #include <linux/kexec.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22 #include <mach/bridge-regs.h>
23 #include <linux/platform_data/usb-ehci-orion.h>
24 #include <plat/irq.h>
25 #include <plat/common.h>
26 #include "common.h"
28 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
29 { .compatible = "simple-bus", },
30 { }
34 * There are still devices that doesn't know about DT yet. Get clock
35 * gates here and add a clock lookup alias, so that old platform
36 * devices still work.
39 static void __init kirkwood_legacy_clk_init(void)
42 struct device_node *np = of_find_compatible_node(
43 NULL, NULL, "marvell,kirkwood-gating-clock");
45 struct of_phandle_args clkspec;
47 clkspec.np = np;
48 clkspec.args_count = 1;
50 clkspec.args[0] = CGC_BIT_GE0;
51 orion_clkdev_add(NULL, "mv643xx_eth_port.0",
52 of_clk_get_from_provider(&clkspec));
54 clkspec.args[0] = CGC_BIT_PEX0;
55 orion_clkdev_add("0", "pcie",
56 of_clk_get_from_provider(&clkspec));
58 clkspec.args[0] = CGC_BIT_USB0;
59 orion_clkdev_add(NULL, "orion-ehci.0",
60 of_clk_get_from_provider(&clkspec));
62 clkspec.args[0] = CGC_BIT_PEX1;
63 orion_clkdev_add("1", "pcie",
64 of_clk_get_from_provider(&clkspec));
66 clkspec.args[0] = CGC_BIT_GE1;
67 orion_clkdev_add(NULL, "mv643xx_eth_port.1",
68 of_clk_get_from_provider(&clkspec));
72 static void __init kirkwood_of_clk_init(void)
74 mvebu_clocks_init();
75 kirkwood_legacy_clk_init();
78 static void __init kirkwood_dt_init(void)
80 pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
83 * Disable propagation of mbus errors to the CPU local bus,
84 * as this causes mbus errors (which can occur for example
85 * for PCI aborts) to throw CPU aborts, which we're not set
86 * up to deal with.
88 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
90 kirkwood_setup_cpu_mbus();
92 kirkwood_l2_init();
94 /* Setup root of clk tree */
95 kirkwood_of_clk_init();
97 #ifdef CONFIG_KEXEC
98 kexec_reinit = kirkwood_enable_pcie;
99 #endif
101 if (of_machine_is_compatible("globalscale,dreamplug"))
102 dreamplug_init();
104 if (of_machine_is_compatible("dlink,dns-kirkwood"))
105 dnskw_init();
107 if (of_machine_is_compatible("iom,iconnect"))
108 iconnect_init();
110 if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
111 ib62x0_init();
113 if (of_machine_is_compatible("qnap,ts219"))
114 qnap_dt_ts219_init();
116 if (of_machine_is_compatible("seagate,dockstar"))
117 dockstar_dt_init();
119 if (of_machine_is_compatible("seagate,goflexnet"))
120 goflexnet_init();
122 if (of_machine_is_compatible("buffalo,lsxl"))
123 lsxl_init();
125 if (of_machine_is_compatible("iom,ix2-200"))
126 iomega_ix2_200_init();
128 if (of_machine_is_compatible("keymile,km_kirkwood"))
129 km_kirkwood_init();
131 if (of_machine_is_compatible("lacie,inetspace_v2") ||
132 of_machine_is_compatible("lacie,netspace_v2") ||
133 of_machine_is_compatible("lacie,netspace_max_v2") ||
134 of_machine_is_compatible("lacie,netspace_lite_v2") ||
135 of_machine_is_compatible("lacie,netspace_mini_v2"))
136 ns2_init();
138 if (of_machine_is_compatible("mpl,cec4"))
139 mplcec4_init();
141 if (of_machine_is_compatible("plathome,openblocks-a6"))
142 openblocks_a6_init();
144 if (of_machine_is_compatible("usi,topkick"))
145 usi_topkick_init();
147 if (of_machine_is_compatible("zyxel,nsa310"))
148 nsa310_init();
150 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
153 static const char * const kirkwood_dt_board_compat[] = {
154 "globalscale,dreamplug",
155 "dlink,dns-320",
156 "dlink,dns-325",
157 "iom,iconnect",
158 "raidsonic,ib-nas62x0",
159 "qnap,ts219",
160 "seagate,dockstar",
161 "seagate,goflexnet",
162 "buffalo,lsxl",
163 "iom,ix2-200",
164 "keymile,km_kirkwood",
165 "lacie,inetspace_v2",
166 "lacie,netspace_max_v2",
167 "lacie,netspace_v2",
168 "lacie,netspace_lite_v2",
169 "lacie,netspace_mini_v2",
170 "mpl,cec4",
171 "plathome,openblocks-a6",
172 "usi,topkick",
173 "zyxel,nsa310",
174 NULL
177 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
178 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
179 .map_io = kirkwood_map_io,
180 .init_early = kirkwood_init_early,
181 .init_irq = orion_dt_init_irq,
182 .timer = &kirkwood_timer,
183 .init_machine = kirkwood_dt_init,
184 .restart = kirkwood_restart,
185 .dt_compat = kirkwood_dt_board_compat,
186 MACHINE_END