blob: fffa92e92d6cb29eb72eb5dd0718a95292357176 [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>
16#include <linux/serial_8250.h>
17#include <linux/clk.h>
18#include <linux/mbus.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/mv643xx_i2c.h>
21#include <linux/ata_platform.h>
Andrew Lunn5c602552011-05-15 13:32:40 +020022#include <linux/serial_8250.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030023#include <linux/spi/orion_spi.h>
24#include <linux/gpio.h>
25#include <asm/page.h>
26#include <asm/setup.h>
27#include <asm/timex.h>
Lennert Buytenhek573a6522009-11-24 19:33:52 +020028#include <asm/hardware/cache-tauros2.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030029#include <asm/mach/map.h>
30#include <asm/mach/time.h>
31#include <asm/mach/pci.h>
32#include <mach/dove.h>
33#include <mach/bridge-regs.h>
34#include <asm/mach/arch.h>
35#include <linux/irq.h>
36#include <plat/mv_xor.h>
37#include <plat/ehci-orion.h>
38#include <plat/time.h>
Andrew Lunn28a2b452011-05-15 13:32:41 +020039#include <plat/common.h>
Saeed Bisharaedabd382009-08-06 15:12:43 +030040#include "common.h"
41
Andrew Lunn28a2b452011-05-15 13:32:41 +020042static int get_tclk(void);
43
Saeed Bisharaedabd382009-08-06 15:12:43 +030044/*****************************************************************************
45 * I/O Address Mapping
46 ****************************************************************************/
47static struct map_desc dove_io_desc[] __initdata = {
48 {
49 .virtual = DOVE_SB_REGS_VIRT_BASE,
50 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
51 .length = DOVE_SB_REGS_SIZE,
52 .type = MT_DEVICE,
53 }, {
54 .virtual = DOVE_NB_REGS_VIRT_BASE,
55 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
56 .length = DOVE_NB_REGS_SIZE,
57 .type = MT_DEVICE,
58 }, {
59 .virtual = DOVE_PCIE0_IO_VIRT_BASE,
60 .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE),
61 .length = DOVE_PCIE0_IO_SIZE,
62 .type = MT_DEVICE,
63 }, {
64 .virtual = DOVE_PCIE1_IO_VIRT_BASE,
65 .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE),
66 .length = DOVE_PCIE1_IO_SIZE,
67 .type = MT_DEVICE,
68 },
69};
70
71void __init dove_map_io(void)
72{
73 iotable_init(dove_io_desc, ARRAY_SIZE(dove_io_desc));
74}
75
76/*****************************************************************************
77 * EHCI
78 ****************************************************************************/
79static struct orion_ehci_data dove_ehci_data = {
80 .dram = &dove_mbus_dram_info,
81 .phy_version = EHCI_PHY_NA,
82};
83
84static u64 ehci_dmamask = DMA_BIT_MASK(32);
85
86/*****************************************************************************
87 * EHCI0
88 ****************************************************************************/
89static struct resource dove_ehci0_resources[] = {
90 {
91 .start = DOVE_USB0_PHYS_BASE,
92 .end = DOVE_USB0_PHYS_BASE + SZ_4K - 1,
93 .flags = IORESOURCE_MEM,
94 }, {
95 .start = IRQ_DOVE_USB0,
96 .end = IRQ_DOVE_USB0,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct platform_device dove_ehci0 = {
102 .name = "orion-ehci",
103 .id = 0,
104 .dev = {
105 .dma_mask = &ehci_dmamask,
106 .coherent_dma_mask = DMA_BIT_MASK(32),
107 .platform_data = &dove_ehci_data,
108 },
109 .resource = dove_ehci0_resources,
110 .num_resources = ARRAY_SIZE(dove_ehci0_resources),
111};
112
113void __init dove_ehci0_init(void)
114{
115 platform_device_register(&dove_ehci0);
116}
117
118/*****************************************************************************
119 * EHCI1
120 ****************************************************************************/
121static struct resource dove_ehci1_resources[] = {
122 {
123 .start = DOVE_USB1_PHYS_BASE,
124 .end = DOVE_USB1_PHYS_BASE + SZ_4K - 1,
125 .flags = IORESOURCE_MEM,
126 }, {
127 .start = IRQ_DOVE_USB1,
128 .end = IRQ_DOVE_USB1,
129 .flags = IORESOURCE_IRQ,
130 },
131};
132
133static struct platform_device dove_ehci1 = {
134 .name = "orion-ehci",
135 .id = 1,
136 .dev = {
137 .dma_mask = &ehci_dmamask,
138 .coherent_dma_mask = DMA_BIT_MASK(32),
139 .platform_data = &dove_ehci_data,
140 },
141 .resource = dove_ehci1_resources,
142 .num_resources = ARRAY_SIZE(dove_ehci1_resources),
143};
144
145void __init dove_ehci1_init(void)
146{
147 platform_device_register(&dove_ehci1);
148}
149
150/*****************************************************************************
151 * GE00
152 ****************************************************************************/
153struct mv643xx_eth_shared_platform_data dove_ge00_shared_data = {
154 .t_clk = 0,
155 .dram = &dove_mbus_dram_info,
156};
157
158static struct resource dove_ge00_shared_resources[] = {
159 {
160 .name = "ge00 base",
161 .start = DOVE_GE00_PHYS_BASE + 0x2000,
162 .end = DOVE_GE00_PHYS_BASE + SZ_16K - 1,
163 .flags = IORESOURCE_MEM,
164 },
165};
166
167static struct platform_device dove_ge00_shared = {
168 .name = MV643XX_ETH_SHARED_NAME,
169 .id = 0,
170 .dev = {
171 .platform_data = &dove_ge00_shared_data,
172 },
173 .num_resources = 1,
174 .resource = dove_ge00_shared_resources,
175};
176
177static struct resource dove_ge00_resources[] = {
178 {
179 .name = "ge00 irq",
180 .start = IRQ_DOVE_GE00_SUM,
181 .end = IRQ_DOVE_GE00_SUM,
182 .flags = IORESOURCE_IRQ,
183 },
184};
185
186static struct platform_device dove_ge00 = {
187 .name = MV643XX_ETH_NAME,
188 .id = 0,
189 .num_resources = 1,
190 .resource = dove_ge00_resources,
191 .dev = {
192 .coherent_dma_mask = 0xffffffff,
193 },
194};
195
196void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data)
197{
198 eth_data->shared = &dove_ge00_shared;
199 dove_ge00.dev.platform_data = eth_data;
200
201 platform_device_register(&dove_ge00_shared);
202 platform_device_register(&dove_ge00);
203}
204
205/*****************************************************************************
206 * SoC RTC
207 ****************************************************************************/
208static struct resource dove_rtc_resource[] = {
209 {
210 .start = DOVE_RTC_PHYS_BASE,
211 .end = DOVE_RTC_PHYS_BASE + 32 - 1,
212 .flags = IORESOURCE_MEM,
213 }, {
214 .start = IRQ_DOVE_RTC,
215 .flags = IORESOURCE_IRQ,
216 }
217};
218
219void __init dove_rtc_init(void)
220{
221 platform_device_register_simple("rtc-mv", -1, dove_rtc_resource, 2);
222}
223
224/*****************************************************************************
225 * SATA
226 ****************************************************************************/
227static struct resource dove_sata_resources[] = {
228 {
229 .name = "sata base",
230 .start = DOVE_SATA_PHYS_BASE,
231 .end = DOVE_SATA_PHYS_BASE + 0x5000 - 1,
232 .flags = IORESOURCE_MEM,
233 }, {
234 .name = "sata irq",
235 .start = IRQ_DOVE_SATA,
236 .end = IRQ_DOVE_SATA,
237 .flags = IORESOURCE_IRQ,
238 },
239};
240
241static struct platform_device dove_sata = {
242 .name = "sata_mv",
243 .id = 0,
244 .dev = {
245 .coherent_dma_mask = DMA_BIT_MASK(32),
246 },
247 .num_resources = ARRAY_SIZE(dove_sata_resources),
248 .resource = dove_sata_resources,
249};
250
251void __init dove_sata_init(struct mv_sata_platform_data *sata_data)
252{
253 sata_data->dram = &dove_mbus_dram_info;
254 dove_sata.dev.platform_data = sata_data;
255 platform_device_register(&dove_sata);
256}
257
258/*****************************************************************************
259 * UART0
260 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300261void __init dove_uart0_init(void)
262{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200263 orion_uart0_init(DOVE_UART0_VIRT_BASE, DOVE_UART0_PHYS_BASE,
264 IRQ_DOVE_UART_0, get_tclk());
Saeed Bisharaedabd382009-08-06 15:12:43 +0300265}
266
267/*****************************************************************************
268 * UART1
269 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300270void __init dove_uart1_init(void)
271{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200272 orion_uart1_init(DOVE_UART1_VIRT_BASE, DOVE_UART1_PHYS_BASE,
273 IRQ_DOVE_UART_1, get_tclk());
Saeed Bisharaedabd382009-08-06 15:12:43 +0300274}
275
276/*****************************************************************************
277 * UART2
278 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300279void __init dove_uart2_init(void)
280{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200281 orion_uart2_init(DOVE_UART2_VIRT_BASE, DOVE_UART2_PHYS_BASE,
282 IRQ_DOVE_UART_2, get_tclk());
Saeed Bisharaedabd382009-08-06 15:12:43 +0300283}
284
285/*****************************************************************************
286 * UART3
287 ****************************************************************************/
Saeed Bisharaedabd382009-08-06 15:12:43 +0300288void __init dove_uart3_init(void)
289{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200290 orion_uart3_init(DOVE_UART3_VIRT_BASE, DOVE_UART3_PHYS_BASE,
291 IRQ_DOVE_UART_3, get_tclk());
Saeed Bisharaedabd382009-08-06 15:12:43 +0300292}
293
294/*****************************************************************************
295 * SPI0
296 ****************************************************************************/
297static struct orion_spi_info dove_spi0_data = {
298 .tclk = 0,
299};
300
301static struct resource dove_spi0_resources[] = {
302 {
303 .start = DOVE_SPI0_PHYS_BASE,
304 .end = DOVE_SPI0_PHYS_BASE + SZ_512 - 1,
305 .flags = IORESOURCE_MEM,
306 }, {
307 .start = IRQ_DOVE_SPI0,
308 .end = IRQ_DOVE_SPI0,
309 .flags = IORESOURCE_IRQ,
310 },
311};
312
313static struct platform_device dove_spi0 = {
314 .name = "orion_spi",
315 .id = 0,
316 .resource = dove_spi0_resources,
317 .dev = {
318 .platform_data = &dove_spi0_data,
319 },
320 .num_resources = ARRAY_SIZE(dove_spi0_resources),
321};
322
323void __init dove_spi0_init(void)
324{
325 platform_device_register(&dove_spi0);
326}
327
328/*****************************************************************************
329 * SPI1
330 ****************************************************************************/
331static struct orion_spi_info dove_spi1_data = {
332 .tclk = 0,
333};
334
335static struct resource dove_spi1_resources[] = {
336 {
337 .start = DOVE_SPI1_PHYS_BASE,
338 .end = DOVE_SPI1_PHYS_BASE + SZ_512 - 1,
339 .flags = IORESOURCE_MEM,
340 }, {
341 .start = IRQ_DOVE_SPI1,
342 .end = IRQ_DOVE_SPI1,
343 .flags = IORESOURCE_IRQ,
344 },
345};
346
347static struct platform_device dove_spi1 = {
348 .name = "orion_spi",
349 .id = 1,
350 .resource = dove_spi1_resources,
351 .dev = {
352 .platform_data = &dove_spi1_data,
353 },
354 .num_resources = ARRAY_SIZE(dove_spi1_resources),
355};
356
357void __init dove_spi1_init(void)
358{
359 platform_device_register(&dove_spi1);
360}
361
362/*****************************************************************************
363 * I2C
364 ****************************************************************************/
365static struct mv64xxx_i2c_pdata dove_i2c_data = {
366 .freq_m = 10, /* assumes 166 MHz TCLK gets 94.3kHz */
367 .freq_n = 3,
368 .timeout = 1000, /* Default timeout of 1 second */
369};
370
371static struct resource dove_i2c_resources[] = {
372 {
373 .name = "i2c base",
374 .start = DOVE_I2C_PHYS_BASE,
375 .end = DOVE_I2C_PHYS_BASE + 0x20 - 1,
376 .flags = IORESOURCE_MEM,
377 }, {
378 .name = "i2c irq",
379 .start = IRQ_DOVE_I2C,
380 .end = IRQ_DOVE_I2C,
381 .flags = IORESOURCE_IRQ,
382 },
383};
384
385static struct platform_device dove_i2c = {
386 .name = MV64XXX_I2C_CTLR_NAME,
387 .id = 0,
388 .num_resources = ARRAY_SIZE(dove_i2c_resources),
389 .resource = dove_i2c_resources,
390 .dev = {
391 .platform_data = &dove_i2c_data,
392 },
393};
394
395void __init dove_i2c_init(void)
396{
397 platform_device_register(&dove_i2c);
398}
399
400/*****************************************************************************
401 * Time handling
402 ****************************************************************************/
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200403void __init dove_init_early(void)
404{
405 orion_time_set_base(TIMER_VIRT_BASE);
406}
407
Saeed Bisharaedabd382009-08-06 15:12:43 +0300408static int get_tclk(void)
409{
410 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
411 return 166666667;
412}
413
414static void dove_timer_init(void)
415{
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200416 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
417 IRQ_DOVE_BRIDGE, get_tclk());
Saeed Bisharaedabd382009-08-06 15:12:43 +0300418}
419
420struct sys_timer dove_timer = {
421 .init = dove_timer_init,
422};
423
424/*****************************************************************************
425 * XOR
426 ****************************************************************************/
427static struct mv_xor_platform_shared_data dove_xor_shared_data = {
428 .dram = &dove_mbus_dram_info,
429};
430
431/*****************************************************************************
432 * XOR 0
433 ****************************************************************************/
434static u64 dove_xor0_dmamask = DMA_BIT_MASK(32);
435
436static struct resource dove_xor0_shared_resources[] = {
437 {
438 .name = "xor 0 low",
439 .start = DOVE_XOR0_PHYS_BASE,
440 .end = DOVE_XOR0_PHYS_BASE + 0xff,
441 .flags = IORESOURCE_MEM,
442 }, {
443 .name = "xor 0 high",
444 .start = DOVE_XOR0_HIGH_PHYS_BASE,
445 .end = DOVE_XOR0_HIGH_PHYS_BASE + 0xff,
446 .flags = IORESOURCE_MEM,
447 },
448};
449
450static struct platform_device dove_xor0_shared = {
451 .name = MV_XOR_SHARED_NAME,
452 .id = 0,
453 .dev = {
454 .platform_data = &dove_xor_shared_data,
455 },
456 .num_resources = ARRAY_SIZE(dove_xor0_shared_resources),
457 .resource = dove_xor0_shared_resources,
458};
459
460static struct resource dove_xor00_resources[] = {
461 [0] = {
462 .start = IRQ_DOVE_XOR_00,
463 .end = IRQ_DOVE_XOR_00,
464 .flags = IORESOURCE_IRQ,
465 },
466};
467
468static struct mv_xor_platform_data dove_xor00_data = {
469 .shared = &dove_xor0_shared,
470 .hw_id = 0,
471 .pool_size = PAGE_SIZE,
472};
473
474static struct platform_device dove_xor00_channel = {
475 .name = MV_XOR_NAME,
476 .id = 0,
477 .num_resources = ARRAY_SIZE(dove_xor00_resources),
478 .resource = dove_xor00_resources,
479 .dev = {
480 .dma_mask = &dove_xor0_dmamask,
481 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten639b9be2010-01-29 15:30:53 -0700482 .platform_data = &dove_xor00_data,
Saeed Bisharaedabd382009-08-06 15:12:43 +0300483 },
484};
485
486static struct resource dove_xor01_resources[] = {
487 [0] = {
488 .start = IRQ_DOVE_XOR_01,
489 .end = IRQ_DOVE_XOR_01,
490 .flags = IORESOURCE_IRQ,
491 },
492};
493
494static struct mv_xor_platform_data dove_xor01_data = {
495 .shared = &dove_xor0_shared,
496 .hw_id = 1,
497 .pool_size = PAGE_SIZE,
498};
499
500static struct platform_device dove_xor01_channel = {
501 .name = MV_XOR_NAME,
502 .id = 1,
503 .num_resources = ARRAY_SIZE(dove_xor01_resources),
504 .resource = dove_xor01_resources,
505 .dev = {
506 .dma_mask = &dove_xor0_dmamask,
507 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten639b9be2010-01-29 15:30:53 -0700508 .platform_data = &dove_xor01_data,
Saeed Bisharaedabd382009-08-06 15:12:43 +0300509 },
510};
511
512void __init dove_xor0_init(void)
513{
514 platform_device_register(&dove_xor0_shared);
515
516 /*
517 * two engines can't do memset simultaneously, this limitation
518 * satisfied by removing memset support from one of the engines.
519 */
520 dma_cap_set(DMA_MEMCPY, dove_xor00_data.cap_mask);
521 dma_cap_set(DMA_XOR, dove_xor00_data.cap_mask);
522 platform_device_register(&dove_xor00_channel);
523
524 dma_cap_set(DMA_MEMCPY, dove_xor01_data.cap_mask);
525 dma_cap_set(DMA_MEMSET, dove_xor01_data.cap_mask);
526 dma_cap_set(DMA_XOR, dove_xor01_data.cap_mask);
527 platform_device_register(&dove_xor01_channel);
528}
529
530/*****************************************************************************
531 * XOR 1
532 ****************************************************************************/
533static u64 dove_xor1_dmamask = DMA_BIT_MASK(32);
534
535static struct resource dove_xor1_shared_resources[] = {
536 {
537 .name = "xor 0 low",
538 .start = DOVE_XOR1_PHYS_BASE,
539 .end = DOVE_XOR1_PHYS_BASE + 0xff,
540 .flags = IORESOURCE_MEM,
541 }, {
542 .name = "xor 0 high",
543 .start = DOVE_XOR1_HIGH_PHYS_BASE,
544 .end = DOVE_XOR1_HIGH_PHYS_BASE + 0xff,
545 .flags = IORESOURCE_MEM,
546 },
547};
548
549static struct platform_device dove_xor1_shared = {
550 .name = MV_XOR_SHARED_NAME,
551 .id = 1,
552 .dev = {
553 .platform_data = &dove_xor_shared_data,
554 },
555 .num_resources = ARRAY_SIZE(dove_xor1_shared_resources),
556 .resource = dove_xor1_shared_resources,
557};
558
559static struct resource dove_xor10_resources[] = {
560 [0] = {
561 .start = IRQ_DOVE_XOR_10,
562 .end = IRQ_DOVE_XOR_10,
563 .flags = IORESOURCE_IRQ,
564 },
565};
566
567static struct mv_xor_platform_data dove_xor10_data = {
568 .shared = &dove_xor1_shared,
569 .hw_id = 0,
570 .pool_size = PAGE_SIZE,
571};
572
573static struct platform_device dove_xor10_channel = {
574 .name = MV_XOR_NAME,
575 .id = 2,
576 .num_resources = ARRAY_SIZE(dove_xor10_resources),
577 .resource = dove_xor10_resources,
578 .dev = {
579 .dma_mask = &dove_xor1_dmamask,
580 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten639b9be2010-01-29 15:30:53 -0700581 .platform_data = &dove_xor10_data,
Saeed Bisharaedabd382009-08-06 15:12:43 +0300582 },
583};
584
585static struct resource dove_xor11_resources[] = {
586 [0] = {
587 .start = IRQ_DOVE_XOR_11,
588 .end = IRQ_DOVE_XOR_11,
589 .flags = IORESOURCE_IRQ,
590 },
591};
592
593static struct mv_xor_platform_data dove_xor11_data = {
594 .shared = &dove_xor1_shared,
595 .hw_id = 1,
596 .pool_size = PAGE_SIZE,
597};
598
599static struct platform_device dove_xor11_channel = {
600 .name = MV_XOR_NAME,
601 .id = 3,
602 .num_resources = ARRAY_SIZE(dove_xor11_resources),
603 .resource = dove_xor11_resources,
604 .dev = {
605 .dma_mask = &dove_xor1_dmamask,
606 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten639b9be2010-01-29 15:30:53 -0700607 .platform_data = &dove_xor11_data,
Saeed Bisharaedabd382009-08-06 15:12:43 +0300608 },
609};
610
611void __init dove_xor1_init(void)
612{
613 platform_device_register(&dove_xor1_shared);
614
615 /*
616 * two engines can't do memset simultaneously, this limitation
617 * satisfied by removing memset support from one of the engines.
618 */
619 dma_cap_set(DMA_MEMCPY, dove_xor10_data.cap_mask);
620 dma_cap_set(DMA_XOR, dove_xor10_data.cap_mask);
621 platform_device_register(&dove_xor10_channel);
622
623 dma_cap_set(DMA_MEMCPY, dove_xor11_data.cap_mask);
624 dma_cap_set(DMA_MEMSET, dove_xor11_data.cap_mask);
625 dma_cap_set(DMA_XOR, dove_xor11_data.cap_mask);
626 platform_device_register(&dove_xor11_channel);
627}
628
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300629/*****************************************************************************
630 * SDIO
631 ****************************************************************************/
632static u64 sdio_dmamask = DMA_BIT_MASK(32);
633
634static struct resource dove_sdio0_resources[] = {
635 {
636 .start = DOVE_SDIO0_PHYS_BASE,
637 .end = DOVE_SDIO0_PHYS_BASE + 0xff,
638 .flags = IORESOURCE_MEM,
639 }, {
640 .start = IRQ_DOVE_SDIO0,
641 .end = IRQ_DOVE_SDIO0,
642 .flags = IORESOURCE_IRQ,
643 },
644};
645
646static struct platform_device dove_sdio0 = {
Mike Rapoport930e2fe2010-10-28 21:23:53 +0200647 .name = "sdhci-dove",
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300648 .id = 0,
649 .dev = {
650 .dma_mask = &sdio_dmamask,
651 .coherent_dma_mask = DMA_BIT_MASK(32),
652 },
653 .resource = dove_sdio0_resources,
654 .num_resources = ARRAY_SIZE(dove_sdio0_resources),
655};
656
657void __init dove_sdio0_init(void)
658{
659 platform_device_register(&dove_sdio0);
660}
661
662static struct resource dove_sdio1_resources[] = {
663 {
664 .start = DOVE_SDIO1_PHYS_BASE,
665 .end = DOVE_SDIO1_PHYS_BASE + 0xff,
666 .flags = IORESOURCE_MEM,
667 }, {
668 .start = IRQ_DOVE_SDIO1,
669 .end = IRQ_DOVE_SDIO1,
670 .flags = IORESOURCE_IRQ,
671 },
672};
673
674static struct platform_device dove_sdio1 = {
Mike Rapoport930e2fe2010-10-28 21:23:53 +0200675 .name = "sdhci-dove",
Saeed Bishara16bc90a2010-05-06 16:12:06 +0300676 .id = 1,
677 .dev = {
678 .dma_mask = &sdio_dmamask,
679 .coherent_dma_mask = DMA_BIT_MASK(32),
680 },
681 .resource = dove_sdio1_resources,
682 .num_resources = ARRAY_SIZE(dove_sdio1_resources),
683};
684
685void __init dove_sdio1_init(void)
686{
687 platform_device_register(&dove_sdio1);
688}
689
Saeed Bisharaedabd382009-08-06 15:12:43 +0300690void __init dove_init(void)
691{
692 int tclk;
693
694 tclk = get_tclk();
695
696 printk(KERN_INFO "Dove 88AP510 SoC, ");
697 printk(KERN_INFO "TCLK = %dMHz\n", (tclk + 499999) / 1000000);
698
Lennert Buytenhek573a6522009-11-24 19:33:52 +0200699#ifdef CONFIG_CACHE_TAUROS2
700 tauros2_init();
701#endif
Saeed Bisharaedabd382009-08-06 15:12:43 +0300702 dove_setup_cpu_mbus();
703
704 dove_ge00_shared_data.t_clk = tclk;
Saeed Bisharaedabd382009-08-06 15:12:43 +0300705 dove_spi0_data.tclk = tclk;
706 dove_spi1_data.tclk = tclk;
707
708 /* internal devices that every board has */
709 dove_rtc_init();
710 dove_xor0_init();
711 dove_xor1_init();
712}