aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9rl_devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/at91sam9rl_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c102
1 files changed, 102 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 728186515cdf..d345f5453dbe 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -21,11 +21,57 @@
21#include <mach/at91sam9rl.h> 21#include <mach/at91sam9rl.h>
22#include <mach/at91sam9rl_matrix.h> 22#include <mach/at91sam9rl_matrix.h>
23#include <mach/at91sam9_smc.h> 23#include <mach/at91sam9_smc.h>
24#include <mach/at_hdmac.h>
24 25
25#include "generic.h" 26#include "generic.h"
26 27
27 28
28/* -------------------------------------------------------------------- 29/* --------------------------------------------------------------------
30 * HDMAC - AHB DMA Controller
31 * -------------------------------------------------------------------- */
32
33#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
34static u64 hdmac_dmamask = DMA_BIT_MASK(32);
35
36static struct at_dma_platform_data atdma_pdata = {
37 .nr_channels = 2,
38};
39
40static struct resource hdmac_resources[] = {
41 [0] = {
42 .start = AT91_BASE_SYS + AT91_DMA,
43 .end = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1,
44 .flags = IORESOURCE_MEM,
45 },
46 [2] = {
47 .start = AT91SAM9RL_ID_DMA,
48 .end = AT91SAM9RL_ID_DMA,
49 .flags = IORESOURCE_IRQ,
50 },
51};
52
53static struct platform_device at_hdmac_device = {
54 .name = "at_hdmac",
55 .id = -1,
56 .dev = {
57 .dma_mask = &hdmac_dmamask,
58 .coherent_dma_mask = DMA_BIT_MASK(32),
59 .platform_data = &atdma_pdata,
60 },
61 .resource = hdmac_resources,
62 .num_resources = ARRAY_SIZE(hdmac_resources),
63};
64
65void __init at91_add_device_hdmac(void)
66{
67 dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
68 platform_device_register(&at_hdmac_device);
69}
70#else
71void __init at91_add_device_hdmac(void) {}
72#endif
73
74/* --------------------------------------------------------------------
29 * USB HS Device (Gadget) 75 * USB HS Device (Gadget)
30 * -------------------------------------------------------------------- */ 76 * -------------------------------------------------------------------- */
31 77
@@ -398,6 +444,61 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
398 444
399 445
400/* -------------------------------------------------------------------- 446/* --------------------------------------------------------------------
447 * AC97
448 * -------------------------------------------------------------------- */
449
450#if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE)
451static u64 ac97_dmamask = DMA_BIT_MASK(32);
452static struct ac97c_platform_data ac97_data;
453
454static struct resource ac97_resources[] = {
455 [0] = {
456 .start = AT91SAM9RL_BASE_AC97C,
457 .end = AT91SAM9RL_BASE_AC97C + SZ_16K - 1,
458 .flags = IORESOURCE_MEM,
459 },
460 [1] = {
461 .start = AT91SAM9RL_ID_AC97C,
462 .end = AT91SAM9RL_ID_AC97C,
463 .flags = IORESOURCE_IRQ,
464 },
465};
466
467static struct platform_device at91sam9rl_ac97_device = {
468 .name = "atmel_ac97c",
469 .id = 0,
470 .dev = {
471 .dma_mask = &ac97_dmamask,
472 .coherent_dma_mask = DMA_BIT_MASK(32),
473 .platform_data = &ac97_data,
474 },
475 .resource = ac97_resources,
476 .num_resources = ARRAY_SIZE(ac97_resources),
477};
478
479void __init at91_add_device_ac97(struct ac97c_platform_data *data)
480{
481 if (!data)
482 return;
483
484 at91_set_A_periph(AT91_PIN_PD1, 0); /* AC97FS */
485 at91_set_A_periph(AT91_PIN_PD2, 0); /* AC97CK */
486 at91_set_A_periph(AT91_PIN_PD3, 0); /* AC97TX */
487 at91_set_A_periph(AT91_PIN_PD4, 0); /* AC97RX */
488
489 /* reset */
490 if (data->reset_pin)
491 at91_set_gpio_output(data->reset_pin, 0);
492
493 ac97_data = *data;
494 platform_device_register(&at91sam9rl_ac97_device);
495}
496#else
497void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
498#endif
499
500
501/* --------------------------------------------------------------------
401 * LCD Controller 502 * LCD Controller
402 * -------------------------------------------------------------------- */ 503 * -------------------------------------------------------------------- */
403 504
@@ -1103,6 +1204,7 @@ void __init at91_add_device_serial(void) {}
1103 */ 1204 */
1104static int __init at91_add_standard_devices(void) 1205static int __init at91_add_standard_devices(void)
1105{ 1206{
1207 at91_add_device_hdmac();
1106 at91_add_device_rtc(); 1208 at91_add_device_rtc();
1107 at91_add_device_rtt(); 1209 at91_add_device_rtt();
1108 at91_add_device_watchdog(); 1210 at91_add_device_watchdog();