blob: 6a2c4dc413a83fa5f8e932b7ef55f690546f2d8e [file] [log] [blame]
Saeed Bisharaedabd382009-08-06 15:12:43 +03001/*
2 * arch/arm/mach-dove/common.c
3 *
4 * Core functions for Marvell Dove 88AP510 System On Chip
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/pci.h>
Andrew Lunn2f129bf2011-12-15 08:15:07 +010016#include <linux/clk-provider.h>
Sebastian Hesselbarth5b03df92012-11-17 15:22:27 +010017#include <linux/clk/mvebu.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030018#include <linux/ata_platform.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030019#include <linux/gpio.h>
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +020020#include <linux/of.h>
21#include <linux/of_platform.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030022#include <asm/page.h>
23#include <asm/setup.h>
24#include <asm/timex.h>
Lennert Buytenhek573a6522009-11-24 19:33:52 +020025#include <asm/hardware/cache-tauros2.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030026#include <asm/mach/map.h>
27#include <asm/mach/time.h>
28#include <asm/mach/pci.h>
29#include <mach/dove.h>
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020030#include <mach/pm.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030031#include <mach/bridge-regs.h>
32#include <asm/mach/arch.h>
33#include <linux/irq.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030034#include <plat/time.h>
Arnd Bergmannc02cecb2012-08-24 15:21:54 +020035#include <linux/platform_data/usb-ehci-orion.h>
Sebastian Hesselbarthfd57c652012-09-25 02:02:14 +020036#include <plat/irq.h>
Andrew Lunn28a2b452011-05-15 13:32:41 +020037#include <plat/common.h>
Andrew Lunn45173d52011-12-07 21:48:06 +010038#include <plat/addr-map.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030039#include "common.h"
40
41/*****************************************************************************
42 * I/O Address Mapping
43 ****************************************************************************/
44static struct map_desc dove_io_desc[] __initdata = {
45 {
Thomas Petazzonic3c5a282012-09-11 14:27:18 +020046 .virtual = (unsigned long) DOVE_SB_REGS_VIRT_BASE,
Saeed Bisharaedabd382009-08-06 15:12:43 +030047 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
48 .length = DOVE_SB_REGS_SIZE,
49 .type = MT_DEVICE,
50 }, {
Thomas Petazzonic3c5a282012-09-11 14:27:18 +020051 .virtual = (unsigned long) DOVE_NB_REGS_VIRT_BASE,
Saeed Bisharaedabd382009-08-06 15:12:43 +030052 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
53 .length = DOVE_NB_REGS_SIZE,
54 .type = MT_DEVICE,
Saeed Bisharaedabd382009-08-06 15:12:43 +030055 },
56};
57
58void __init dove_map_io(void)
59{
60 iotable_init(dove_io_desc, ARRAY_SIZE(dove_io_desc));
61}
62
63/*****************************************************************************
Andrew Lunn2f129bf2011-12-15 08:15:07 +010064 * CLK tree
65 ****************************************************************************/
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +020066static int dove_tclk;
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020067
68static DEFINE_SPINLOCK(gating_lock);
Andrew Lunn2f129bf2011-12-15 08:15:07 +010069static struct clk *tclk;
70
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020071static struct clk __init *dove_register_gate(const char *name,
72 const char *parent, u8 bit_idx)
Andrew Lunn2f129bf2011-12-15 08:15:07 +010073{
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020074 return clk_register_gate(NULL, name, parent, 0,
75 (void __iomem *)CLOCK_GATING_CONTROL,
76 bit_idx, 0, &gating_lock);
77}
Andrew Lunn4574b882012-04-06 17:17:26 +020078
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +020079static void __init dove_clk_init(void)
Andrew Lunn2f129bf2011-12-15 08:15:07 +010080{
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020081 struct clk *usb0, *usb1, *sata, *pex0, *pex1, *sdio0, *sdio1;
82 struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
83 struct clk *xor0, *xor1, *ge, *gephy;
84
Andrew Lunn2f129bf2011-12-15 08:15:07 +010085 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +020086 dove_tclk);
Andrew Lunn4574b882012-04-06 17:17:26 +020087
Sebastian Hesselbarth52167472012-08-15 19:07:31 +020088 usb0 = dove_register_gate("usb0", "tclk", CLOCK_GATING_BIT_USB0);
89 usb1 = dove_register_gate("usb1", "tclk", CLOCK_GATING_BIT_USB1);
90 sata = dove_register_gate("sata", "tclk", CLOCK_GATING_BIT_SATA);
91 pex0 = dove_register_gate("pex0", "tclk", CLOCK_GATING_BIT_PCIE0);
92 pex1 = dove_register_gate("pex1", "tclk", CLOCK_GATING_BIT_PCIE1);
93 sdio0 = dove_register_gate("sdio0", "tclk", CLOCK_GATING_BIT_SDIO0);
94 sdio1 = dove_register_gate("sdio1", "tclk", CLOCK_GATING_BIT_SDIO1);
95 nand = dove_register_gate("nand", "tclk", CLOCK_GATING_BIT_NAND);
96 camera = dove_register_gate("camera", "tclk", CLOCK_GATING_BIT_CAMERA);
97 i2s0 = dove_register_gate("i2s0", "tclk", CLOCK_GATING_BIT_I2S0);
98 i2s1 = dove_register_gate("i2s1", "tclk", CLOCK_GATING_BIT_I2S1);
99 crypto = dove_register_gate("crypto", "tclk", CLOCK_GATING_BIT_CRYPTO);
100 ac97 = dove_register_gate("ac97", "tclk", CLOCK_GATING_BIT_AC97);
101 pdma = dove_register_gate("pdma", "tclk", CLOCK_GATING_BIT_PDMA);
102 xor0 = dove_register_gate("xor0", "tclk", CLOCK_GATING_BIT_XOR0);
103 xor1 = dove_register_gate("xor1", "tclk", CLOCK_GATING_BIT_XOR1);
104 gephy = dove_register_gate("gephy", "tclk", CLOCK_GATING_BIT_GIGA_PHY);
105 ge = dove_register_gate("ge", "gephy", CLOCK_GATING_BIT_GBE);
106
107 orion_clkdev_add(NULL, "orion_spi.0", tclk);
108 orion_clkdev_add(NULL, "orion_spi.1", tclk);
109 orion_clkdev_add(NULL, "orion_wdt", tclk);
110 orion_clkdev_add(NULL, "mv64xxx_i2c.0", tclk);
111
112 orion_clkdev_add(NULL, "orion-ehci.0", usb0);
113 orion_clkdev_add(NULL, "orion-ehci.1", usb1);
Sebastian Hesselbarth3fbcd3d2012-09-25 02:02:15 +0200114 orion_clkdev_add(NULL, "mv643xx_eth_port.0", ge);
115 orion_clkdev_add(NULL, "sata_mv.0", sata);
Sebastian Hesselbarth52167472012-08-15 19:07:31 +0200116 orion_clkdev_add("0", "pcie", pex0);
117 orion_clkdev_add("1", "pcie", pex1);
118 orion_clkdev_add(NULL, "sdhci-dove.0", sdio0);
119 orion_clkdev_add(NULL, "sdhci-dove.1", sdio1);
120 orion_clkdev_add(NULL, "orion_nand", nand);
121 orion_clkdev_add(NULL, "cafe1000-ccic.0", camera);
122 orion_clkdev_add(NULL, "kirkwood-i2s.0", i2s0);
123 orion_clkdev_add(NULL, "kirkwood-i2s.1", i2s1);
124 orion_clkdev_add(NULL, "mv_crypto", crypto);
125 orion_clkdev_add(NULL, "dove-ac97", ac97);
126 orion_clkdev_add(NULL, "dove-pdma", pdma);
127 orion_clkdev_add(NULL, "mv_xor_shared.0", xor0);
128 orion_clkdev_add(NULL, "mv_xor_shared.1", xor1);
Andrew Lunn2f129bf2011-12-15 08:15:07 +0100129}
130
131/*****************************************************************************
Saeed Bisharaedabd382009-08-06 15:12:43 +0300132 * EHCI0
133 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300134void __init dove_ehci0_init(void)
135{
Andrew Lunn72053352012-02-08 15:52:47 +0100136 orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0, EHCI_PHY_NA);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300137}
138
139/*****************************************************************************
140 * EHCI1
141 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300142void __init dove_ehci1_init(void)
143{
Andrew Lunndb33f4d2011-12-07 21:48:08 +0100144 orion_ehci_1_init(DOVE_USB1_PHYS_BASE, IRQ_DOVE_USB1);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300145}
146
147/*****************************************************************************
148 * GE00
149 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300150void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data)
151{
Hannes Reinecke30e0f582012-06-12 15:59:45 +0200152 orion_ge00_init(eth_data, DOVE_GE00_PHYS_BASE,
Arnaud Patard (Rtp)58569ae2012-07-26 12:15:46 +0200153 IRQ_DOVE_GE00_SUM, IRQ_DOVE_GE00_ERR,
154 1600);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300155}
156
157/*****************************************************************************
158 * SoC RTC
159 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300160void __init dove_rtc_init(void)
161{
Andrew Lunnf6eaccb2011-05-15 13:32:42 +0200162 orion_rtc_init(DOVE_RTC_PHYS_BASE, IRQ_DOVE_RTC);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300163}
164
165/*****************************************************************************
166 * SATA
167 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300168void __init dove_sata_init(struct mv_sata_platform_data *sata_data)
169{
Andrew Lunndb33f4d2011-12-07 21:48:08 +0100170 orion_sata_init(sata_data, DOVE_SATA_PHYS_BASE, IRQ_DOVE_SATA);
Andrew Lunn9e613f82011-05-15 13:32:50 +0200171
Saeed Bisharaedabd382009-08-06 15:12:43 +0300172}
173
174/*****************************************************************************
175 * UART0
176 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300177void __init dove_uart0_init(void)
178{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200179 orion_uart0_init(DOVE_UART0_VIRT_BASE, DOVE_UART0_PHYS_BASE,
Andrew Lunn74c33572011-12-24 03:06:34 +0100180 IRQ_DOVE_UART_0, tclk);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300181}
182
183/*****************************************************************************
184 * UART1
185 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300186void __init dove_uart1_init(void)
187{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200188 orion_uart1_init(DOVE_UART1_VIRT_BASE, DOVE_UART1_PHYS_BASE,
Andrew Lunn74c33572011-12-24 03:06:34 +0100189 IRQ_DOVE_UART_1, tclk);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300190}
191
192/*****************************************************************************
193 * UART2
194 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300195void __init dove_uart2_init(void)
196{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200197 orion_uart2_init(DOVE_UART2_VIRT_BASE, DOVE_UART2_PHYS_BASE,
Andrew Lunn74c33572011-12-24 03:06:34 +0100198 IRQ_DOVE_UART_2, tclk);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300199}
200
201/*****************************************************************************
202 * UART3
203 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300204void __init dove_uart3_init(void)
205{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200206 orion_uart3_init(DOVE_UART3_VIRT_BASE, DOVE_UART3_PHYS_BASE,
Andrew Lunn74c33572011-12-24 03:06:34 +0100207 IRQ_DOVE_UART_3, tclk);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300208}
209
210/*****************************************************************************
Andrew Lunn980f9f62011-05-15 13:32:46 +0200211 * SPI
Saeed Bisharaedabd382009-08-06 15:12:43 +0300212 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300213void __init dove_spi0_init(void)
214{
Andrew Lunn4574b882012-04-06 17:17:26 +0200215 orion_spi_init(DOVE_SPI0_PHYS_BASE);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300216}
217
Saeed Bisharaedabd382009-08-06 15:12:43 +0300218void __init dove_spi1_init(void)
219{
Andrew Lunn4574b882012-04-06 17:17:26 +0200220 orion_spi_1_init(DOVE_SPI1_PHYS_BASE);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300221}
222
223/*****************************************************************************
224 * I2C
225 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300226void __init dove_i2c_init(void)
227{
Andrew Lunnaac7ffa2011-05-15 13:32:45 +0200228 orion_i2c_init(DOVE_I2C_PHYS_BASE, IRQ_DOVE_I2C, 10);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300229}
230
231/*****************************************************************************
232 * Time handling
233 ****************************************************************************/
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200234void __init dove_init_early(void)
235{
236 orion_time_set_base(TIMER_VIRT_BASE);
237}
238
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +0200239static int __init dove_find_tclk(void)
Saeed Bisharaedabd382009-08-06 15:12:43 +0300240{
Saeed Bisharaedabd382009-08-06 15:12:43 +0300241 return 166666667;
242}
243
Andrew Lunnca2ac5c2012-05-14 11:28:43 +0200244static void __init dove_timer_init(void)
Saeed Bisharaedabd382009-08-06 15:12:43 +0300245{
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +0200246 dove_tclk = dove_find_tclk();
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200247 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +0200248 IRQ_DOVE_BRIDGE, dove_tclk);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300249}
250
251struct sys_timer dove_timer = {
252 .init = dove_timer_init,
253};
254
255/*****************************************************************************
Sebastian Hesselbarth624d0b52012-08-15 19:07:32 +0200256 * Cryptographic Engines and Security Accelerator (CESA)
257 ****************************************************************************/
258void __init dove_crypto_init(void)
259{
260 orion_crypto_init(DOVE_CRYPT_PHYS_BASE, DOVE_CESA_PHYS_BASE,
261 DOVE_CESA_SIZE, IRQ_DOVE_CRYPTO);
262}
263
264/*****************************************************************************
Saeed Bisharaedabd382009-08-06 15:12:43 +0300265 * XOR 0
266 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300267void __init dove_xor0_init(void)
268{
Andrew Lunndb33f4d2011-12-07 21:48:08 +0100269 orion_xor0_init(DOVE_XOR0_PHYS_BASE, DOVE_XOR0_HIGH_PHYS_BASE,
Andrew Lunnee962722011-05-15 13:32:48 +0200270 IRQ_DOVE_XOR_00, IRQ_DOVE_XOR_01);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300271}
272
273/*****************************************************************************
274 * XOR 1
275 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300276void __init dove_xor1_init(void)
277{
Andrew Lunnee962722011-05-15 13:32:48 +0200278 orion_xor1_init(DOVE_XOR1_PHYS_BASE, DOVE_XOR1_HIGH_PHYS_BASE,
279 IRQ_DOVE_XOR_10, IRQ_DOVE_XOR_11);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300280}
281
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300282/*****************************************************************************
283 * SDIO
284 ****************************************************************************/
285static u64 sdio_dmamask = DMA_BIT_MASK(32);
286
287static struct resource dove_sdio0_resources[] = {
288 {
289 .start = DOVE_SDIO0_PHYS_BASE,
290 .end = DOVE_SDIO0_PHYS_BASE + 0xff,
291 .flags = IORESOURCE_MEM,
292 }, {
293 .start = IRQ_DOVE_SDIO0,
294 .end = IRQ_DOVE_SDIO0,
295 .flags = IORESOURCE_IRQ,
296 },
297};
298
299static struct platform_device dove_sdio0 = {
Mike Rapoport930e2fe2010-10-28 21:23:53 +0200300 .name = "sdhci-dove",
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300301 .id = 0,
302 .dev = {
303 .dma_mask = &sdio_dmamask,
304 .coherent_dma_mask = DMA_BIT_MASK(32),
305 },
306 .resource = dove_sdio0_resources,
307 .num_resources = ARRAY_SIZE(dove_sdio0_resources),
308};
309
310void __init dove_sdio0_init(void)
311{
312 platform_device_register(&dove_sdio0);
313}
314
315static struct resource dove_sdio1_resources[] = {
316 {
317 .start = DOVE_SDIO1_PHYS_BASE,
318 .end = DOVE_SDIO1_PHYS_BASE + 0xff,
319 .flags = IORESOURCE_MEM,
320 }, {
321 .start = IRQ_DOVE_SDIO1,
322 .end = IRQ_DOVE_SDIO1,
323 .flags = IORESOURCE_IRQ,
324 },
325};
326
327static struct platform_device dove_sdio1 = {
Mike Rapoport930e2fe2010-10-28 21:23:53 +0200328 .name = "sdhci-dove",
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300329 .id = 1,
330 .dev = {
331 .dma_mask = &sdio_dmamask,
332 .coherent_dma_mask = DMA_BIT_MASK(32),
333 },
334 .resource = dove_sdio1_resources,
335 .num_resources = ARRAY_SIZE(dove_sdio1_resources),
336};
337
338void __init dove_sdio1_init(void)
339{
340 platform_device_register(&dove_sdio1);
341}
342
Saeed Bisharaedabd382009-08-06 15:12:43 +0300343void __init dove_init(void)
344{
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +0200345 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
346 (dove_tclk + 499999) / 1000000);
Saeed Bisharaedabd382009-08-06 15:12:43 +0300347
Lennert Buytenhek573a6522009-11-24 19:33:52 +0200348#ifdef CONFIG_CACHE_TAUROS2
Chao Xie5cc58152012-07-31 14:13:13 +0800349 tauros2_init(0);
Lennert Buytenhek573a6522009-11-24 19:33:52 +0200350#endif
Saeed Bisharaedabd382009-08-06 15:12:43 +0300351 dove_setup_cpu_mbus();
352
Andrew Lunn2f129bf2011-12-15 08:15:07 +0100353 /* Setup root of clk tree */
Sebastian Hesselbarth5817d102012-08-15 19:07:30 +0200354 dove_clk_init();
Andrew Lunn2f129bf2011-12-15 08:15:07 +0100355
Saeed Bisharaedabd382009-08-06 15:12:43 +0300356 /* internal devices that every board has */
357 dove_rtc_init();
358 dove_xor0_init();
359 dove_xor1_init();
360}
Russell King6ca6ff92011-11-05 09:48:52 +0000361
362void dove_restart(char mode, const char *cmd)
363{
364 /*
365 * Enable soft reset to assert RSTOUTn.
366 */
367 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
368
369 /*
370 * Assert soft reset.
371 */
372 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
373
374 while (1)
375 ;
376}
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200377
378#if defined(CONFIG_MACH_DOVE_DT)
379/*
Sebastian Hesselbarth5b03df92012-11-17 15:22:27 +0100380 * There are still devices that doesn't even know about DT,
381 * get clock gates here and add a clock lookup.
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200382 */
Sebastian Hesselbarth5b03df92012-11-17 15:22:27 +0100383static void __init dove_legacy_clk_init(void)
384{
385 struct device_node *np = of_find_compatible_node(NULL, NULL,
386 "marvell,dove-gating-clock");
387 struct of_phandle_args clkspec;
388
389 clkspec.np = np;
390 clkspec.args_count = 1;
391
392 clkspec.args[0] = CLOCK_GATING_BIT_USB0;
393 orion_clkdev_add(NULL, "orion-ehci.0",
394 of_clk_get_from_provider(&clkspec));
395
396 clkspec.args[0] = CLOCK_GATING_BIT_USB1;
397 orion_clkdev_add(NULL, "orion-ehci.1",
398 of_clk_get_from_provider(&clkspec));
399
400 clkspec.args[0] = CLOCK_GATING_BIT_GBE;
401 orion_clkdev_add(NULL, "mv643xx_eth_port.0",
402 of_clk_get_from_provider(&clkspec));
403
404 clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
405 orion_clkdev_add("0", "pcie",
406 of_clk_get_from_provider(&clkspec));
407
408 clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
409 orion_clkdev_add("1", "pcie",
410 of_clk_get_from_provider(&clkspec));
411
412 clkspec.args[0] = CLOCK_GATING_BIT_XOR0;
413 orion_clkdev_add(NULL, "mv_xor_shared.0",
414 of_clk_get_from_provider(&clkspec));
415
416 clkspec.args[0] = CLOCK_GATING_BIT_XOR1;
417 orion_clkdev_add(NULL, "mv_xor_shared.1",
418 of_clk_get_from_provider(&clkspec));
419}
420
421static void __init dove_of_clk_init(void)
422{
423 mvebu_clocks_init();
424 dove_legacy_clk_init();
425}
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200426
427static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
428 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
429};
430
431static void __init dove_dt_init(void)
432{
433 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
434 (dove_tclk + 499999) / 1000000);
435
436#ifdef CONFIG_CACHE_TAUROS2
Sebastian Hesselbarthfd57c652012-09-25 02:02:14 +0200437 tauros2_init(0);
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200438#endif
439 dove_setup_cpu_mbus();
440
441 /* Setup root of clk tree */
Sebastian Hesselbarth5b03df92012-11-17 15:22:27 +0100442 dove_of_clk_init();
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200443
444 /* Internal devices not ported to DT yet */
445 dove_rtc_init();
446 dove_xor0_init();
447 dove_xor1_init();
448
449 dove_ge00_init(&dove_dt_ge00_data);
450 dove_ehci0_init();
451 dove_ehci1_init();
452 dove_pcie_init(1, 1);
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200453
Sebastian Hesselbarth5b03df92012-11-17 15:22:27 +0100454 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
Sebastian Hesselbarth81d2ef72012-08-15 19:07:33 +0200455}
456
457static const char * const dove_dt_board_compat[] = {
458 "marvell,dove",
459 NULL
460};
461
462DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
463 .map_io = dove_map_io,
464 .init_early = dove_init_early,
465 .init_irq = orion_dt_init_irq,
466 .timer = &dove_timer,
467 .init_machine = dove_dt_init,
468 .restart = dove_restart,
469 .dt_compat = dove_dt_board_compat,
470MACHINE_END
471#endif