powerpc: Delete __cpuinit usage from all users
[linux/fpc-iii.git] / arch / arm / mach-kirkwood / board-dt.c
blobe9647b80cb590d9d0131b9542a5e476da9cad459
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");
44 struct of_phandle_args clkspec;
45 struct clk *clk;
47 clkspec.np = np;
48 clkspec.args_count = 1;
50 clkspec.args[0] = CGC_BIT_PEX0;
51 orion_clkdev_add("0", "pcie",
52 of_clk_get_from_provider(&clkspec));
54 clkspec.args[0] = CGC_BIT_PEX1;
55 orion_clkdev_add("1", "pcie",
56 of_clk_get_from_provider(&clkspec));
58 clkspec.args[0] = CGC_BIT_SDIO;
59 orion_clkdev_add(NULL, "mvsdio",
60 of_clk_get_from_provider(&clkspec));
63 * The ethernet interfaces forget the MAC address assigned by
64 * u-boot if the clocks are turned off. Until proper DT support
65 * is available we always enable them for now.
67 clkspec.args[0] = CGC_BIT_GE0;
68 clk = of_clk_get_from_provider(&clkspec);
69 orion_clkdev_add(NULL, "mv643xx_eth_port.0", clk);
70 clk_prepare_enable(clk);
72 clkspec.args[0] = CGC_BIT_GE1;
73 clk = of_clk_get_from_provider(&clkspec);
74 orion_clkdev_add(NULL, "mv643xx_eth_port.1", clk);
75 clk_prepare_enable(clk);
78 static void __init kirkwood_of_clk_init(void)
80 mvebu_clocks_init();
81 kirkwood_legacy_clk_init();
84 static void __init kirkwood_dt_init(void)
86 pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
89 * Disable propagation of mbus errors to the CPU local bus,
90 * as this causes mbus errors (which can occur for example
91 * for PCI aborts) to throw CPU aborts, which we're not set
92 * up to deal with.
94 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
96 kirkwood_setup_wins();
98 kirkwood_l2_init();
100 /* Setup root of clk tree */
101 kirkwood_of_clk_init();
103 kirkwood_cpuidle_init();
105 #ifdef CONFIG_KEXEC
106 kexec_reinit = kirkwood_enable_pcie;
107 #endif
109 if (of_machine_is_compatible("globalscale,dreamplug"))
110 dreamplug_init();
112 if (of_machine_is_compatible("globalscale,guruplug"))
113 guruplug_dt_init();
115 if (of_machine_is_compatible("dlink,dns-kirkwood"))
116 dnskw_init();
118 if (of_machine_is_compatible("iom,iconnect"))
119 iconnect_init();
121 if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
122 ib62x0_init();
124 if (of_machine_is_compatible("qnap,ts219"))
125 qnap_dt_ts219_init();
127 if (of_machine_is_compatible("seagate,dockstar"))
128 dockstar_dt_init();
130 if (of_machine_is_compatible("seagate,goflexnet"))
131 goflexnet_init();
133 if (of_machine_is_compatible("buffalo,lsxl"))
134 lsxl_init();
136 if (of_machine_is_compatible("iom,ix2-200"))
137 iomega_ix2_200_init();
139 if (of_machine_is_compatible("keymile,km_kirkwood"))
140 km_kirkwood_init();
142 if (of_machine_is_compatible("lacie,cloudbox") ||
143 of_machine_is_compatible("lacie,inetspace_v2") ||
144 of_machine_is_compatible("lacie,netspace_lite_v2") ||
145 of_machine_is_compatible("lacie,netspace_max_v2") ||
146 of_machine_is_compatible("lacie,netspace_mini_v2") ||
147 of_machine_is_compatible("lacie,netspace_v2"))
148 ns2_init();
150 if (of_machine_is_compatible("mpl,cec4"))
151 mplcec4_init();
153 if (of_machine_is_compatible("netgear,readynas-duo-v2"))
154 netgear_readynas_init();
156 if (of_machine_is_compatible("plathome,openblocks-a6"))
157 openblocks_a6_init();
159 if (of_machine_is_compatible("usi,topkick"))
160 usi_topkick_init();
162 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
165 static const char * const kirkwood_dt_board_compat[] = {
166 "globalscale,dreamplug",
167 "globalscale,guruplug",
168 "dlink,dns-320",
169 "dlink,dns-325",
170 "iom,iconnect",
171 "raidsonic,ib-nas62x0",
172 "qnap,ts219",
173 "seagate,dockstar",
174 "seagate,goflexnet",
175 "buffalo,lsxl",
176 "iom,ix2-200",
177 "keymile,km_kirkwood",
178 "lacie,cloudbox",
179 "lacie,inetspace_v2",
180 "lacie,netspace_lite_v2",
181 "lacie,netspace_max_v2",
182 "lacie,netspace_mini_v2",
183 "lacie,netspace_v2",
184 "mpl,cec4",
185 "netgear,readynas-duo-v2",
186 "plathome,openblocks-a6",
187 "usi,topkick",
188 "zyxel,nsa310",
189 NULL
192 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
193 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
194 .map_io = kirkwood_map_io,
195 .init_early = kirkwood_init_early,
196 .init_irq = orion_dt_init_irq,
197 .init_time = kirkwood_timer_init,
198 .init_machine = kirkwood_dt_init,
199 .restart = kirkwood_restart,
200 .dt_compat = kirkwood_dt_board_compat,
201 MACHINE_END