aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c104
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c102
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c2
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c10
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c10
7 files changed, 233 insertions, 7 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index 412aa49ad2fb..d1f775e86353 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -771,9 +771,9 @@ void __init at91_add_device_pwm(u32 mask) {}
771 * AC97 771 * AC97
772 * -------------------------------------------------------------------- */ 772 * -------------------------------------------------------------------- */
773 773
774#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE) 774#if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE)
775static u64 ac97_dmamask = DMA_BIT_MASK(32); 775static u64 ac97_dmamask = DMA_BIT_MASK(32);
776static struct atmel_ac97_data ac97_data; 776static struct ac97c_platform_data ac97_data;
777 777
778static struct resource ac97_resources[] = { 778static struct resource ac97_resources[] = {
779 [0] = { 779 [0] = {
@@ -789,7 +789,7 @@ static struct resource ac97_resources[] = {
789}; 789};
790 790
791static struct platform_device at91cap9_ac97_device = { 791static struct platform_device at91cap9_ac97_device = {
792 .name = "ac97c", 792 .name = "atmel_ac97c",
793 .id = 1, 793 .id = 1,
794 .dev = { 794 .dev = {
795 .dma_mask = &ac97_dmamask, 795 .dma_mask = &ac97_dmamask,
@@ -800,7 +800,7 @@ static struct platform_device at91cap9_ac97_device = {
800 .num_resources = ARRAY_SIZE(ac97_resources), 800 .num_resources = ARRAY_SIZE(ac97_resources),
801}; 801};
802 802
803void __init at91_add_device_ac97(struct atmel_ac97_data *data) 803void __init at91_add_device_ac97(struct ac97c_platform_data *data)
804{ 804{
805 if (!data) 805 if (!data)
806 return; 806 return;
@@ -818,7 +818,7 @@ void __init at91_add_device_ac97(struct atmel_ac97_data *data)
818 platform_device_register(&at91cap9_ac97_device); 818 platform_device_register(&at91cap9_ac97_device);
819} 819}
820#else 820#else
821void __init at91_add_device_ac97(struct atmel_ac97_data *data) {} 821void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
822#endif 822#endif
823 823
824 824
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index d746e8621bc2..d581cff80c4c 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -24,11 +24,59 @@
24#include <mach/at91sam9g45.h> 24#include <mach/at91sam9g45.h>
25#include <mach/at91sam9g45_matrix.h> 25#include <mach/at91sam9g45_matrix.h>
26#include <mach/at91sam9_smc.h> 26#include <mach/at91sam9_smc.h>
27#include <mach/at_hdmac.h>
27 28
28#include "generic.h" 29#include "generic.h"
29 30
30 31
31/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
33 * HDMAC - AHB DMA Controller
34 * -------------------------------------------------------------------- */
35
36#if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
37static u64 hdmac_dmamask = DMA_BIT_MASK(32);
38
39static struct at_dma_platform_data atdma_pdata = {
40 .nr_channels = 8,
41};
42
43static struct resource hdmac_resources[] = {
44 [0] = {
45 .start = AT91_BASE_SYS + AT91_DMA,
46 .end = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1,
47 .flags = IORESOURCE_MEM,
48 },
49 [2] = {
50 .start = AT91SAM9G45_ID_DMA,
51 .end = AT91SAM9G45_ID_DMA,
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
56static struct platform_device at_hdmac_device = {
57 .name = "at_hdmac",
58 .id = -1,
59 .dev = {
60 .dma_mask = &hdmac_dmamask,
61 .coherent_dma_mask = DMA_BIT_MASK(32),
62 .platform_data = &atdma_pdata,
63 },
64 .resource = hdmac_resources,
65 .num_resources = ARRAY_SIZE(hdmac_resources),
66};
67
68void __init at91_add_device_hdmac(void)
69{
70 dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
71 dma_cap_set(DMA_SLAVE, atdma_pdata.cap_mask);
72 platform_device_register(&at_hdmac_device);
73}
74#else
75void __init at91_add_device_hdmac(void) {}
76#endif
77
78
79/* --------------------------------------------------------------------
32 * USB Host (OHCI) 80 * USB Host (OHCI)
33 * -------------------------------------------------------------------- */ 81 * -------------------------------------------------------------------- */
34 82
@@ -550,6 +598,61 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
550 598
551 599
552/* -------------------------------------------------------------------- 600/* --------------------------------------------------------------------
601 * AC97
602 * -------------------------------------------------------------------- */
603
604#if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE)
605static u64 ac97_dmamask = DMA_BIT_MASK(32);
606static struct ac97c_platform_data ac97_data;
607
608static struct resource ac97_resources[] = {
609 [0] = {
610 .start = AT91SAM9G45_BASE_AC97C,
611 .end = AT91SAM9G45_BASE_AC97C + SZ_16K - 1,
612 .flags = IORESOURCE_MEM,
613 },
614 [1] = {
615 .start = AT91SAM9G45_ID_AC97C,
616 .end = AT91SAM9G45_ID_AC97C,
617 .flags = IORESOURCE_IRQ,
618 },
619};
620
621static struct platform_device at91sam9g45_ac97_device = {
622 .name = "atmel_ac97c",
623 .id = 0,
624 .dev = {
625 .dma_mask = &ac97_dmamask,
626 .coherent_dma_mask = DMA_BIT_MASK(32),
627 .platform_data = &ac97_data,
628 },
629 .resource = ac97_resources,
630 .num_resources = ARRAY_SIZE(ac97_resources),
631};
632
633void __init at91_add_device_ac97(struct ac97c_platform_data *data)
634{
635 if (!data)
636 return;
637
638 at91_set_A_periph(AT91_PIN_PD8, 0); /* AC97FS */
639 at91_set_A_periph(AT91_PIN_PD9, 0); /* AC97CK */
640 at91_set_A_periph(AT91_PIN_PD7, 0); /* AC97TX */
641 at91_set_A_periph(AT91_PIN_PD6, 0); /* AC97RX */
642
643 /* reset */
644 if (data->reset_pin)
645 at91_set_gpio_output(data->reset_pin, 0);
646
647 ac97_data = *data;
648 platform_device_register(&at91sam9g45_ac97_device);
649}
650#else
651void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
652#endif
653
654
655/* --------------------------------------------------------------------
553 * LCD Controller 656 * LCD Controller
554 * -------------------------------------------------------------------- */ 657 * -------------------------------------------------------------------- */
555 658
@@ -1220,6 +1323,7 @@ void __init at91_add_device_serial(void) {}
1220 */ 1323 */
1221static int __init at91_add_standard_devices(void) 1324static int __init at91_add_standard_devices(void)
1222{ 1325{
1326 at91_add_device_hdmac();
1223 at91_add_device_rtc(); 1327 at91_add_device_rtc();
1224 at91_add_device_rtt(); 1328 at91_add_device_rtt();
1225 at91_add_device_watchdog(); 1329 at91_add_device_watchdog();
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();
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 83a1a0fef47b..d6940870e403 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -364,7 +364,7 @@ static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data;
364/* 364/*
365 * AC97 365 * AC97
366 */ 366 */
367static struct atmel_ac97_data cap9adk_ac97_data = { 367static struct ac97c_platform_data cap9adk_ac97_data = {
368// .reset_pin = ... not connected 368// .reset_pin = ... not connected
369}; 369};
370 370
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 8c0b71c95be4..7c1e382330fb 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -340,7 +340,7 @@ static void __init neocore926_add_device_buttons(void) {}
340/* 340/*
341 * AC97 341 * AC97
342 */ 342 */
343static struct atmel_ac97_data neocore926_ac97_data = { 343static struct ac97c_platform_data neocore926_ac97_data = {
344 .reset_pin = AT91_PIN_PA13, 344 .reset_pin = AT91_PIN_PA13,
345}; 345};
346 346
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index b8558eae5229..64c3843f323d 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -311,6 +311,14 @@ static void __init ek_add_device_buttons(void) {}
311 311
312 312
313/* 313/*
314 * AC97
315 * reset_pin is not connected: NRST
316 */
317static struct ac97c_platform_data ek_ac97_data = {
318};
319
320
321/*
314 * LEDs ... these could all be PWM-driven, for variable brightness 322 * LEDs ... these could all be PWM-driven, for variable brightness
315 */ 323 */
316static struct gpio_led ek_leds[] = { 324static struct gpio_led ek_leds[] = {
@@ -372,6 +380,8 @@ static void __init ek_board_init(void)
372 at91_add_device_lcdc(&ek_lcdc_data); 380 at91_add_device_lcdc(&ek_lcdc_data);
373 /* Push Buttons */ 381 /* Push Buttons */
374 ek_add_device_buttons(); 382 ek_add_device_buttons();
383 /* AC97 */
384 at91_add_device_ac97(&ek_ac97_data);
375 /* LEDs */ 385 /* LEDs */
376 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 386 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
377 at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); 387 at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led));
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 94ffb5c103b9..bd28e989e54e 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -211,6 +211,14 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
211 211
212 212
213/* 213/*
214 * AC97
215 * reset_pin is not connected: NRST
216 */
217static struct ac97c_platform_data ek_ac97_data = {
218};
219
220
221/*
214 * LEDs 222 * LEDs
215 */ 223 */
216static struct gpio_led ek_leds[] = { 224static struct gpio_led ek_leds[] = {
@@ -299,6 +307,8 @@ static void __init ek_board_init(void)
299 at91_add_device_mmc(0, &ek_mmc_data); 307 at91_add_device_mmc(0, &ek_mmc_data);
300 /* LCD Controller */ 308 /* LCD Controller */
301 at91_add_device_lcdc(&ek_lcdc_data); 309 at91_add_device_lcdc(&ek_lcdc_data);
310 /* AC97 */
311 at91_add_device_ac97(&ek_ac97_data);
302 /* Touch Screen Controller */ 312 /* Touch Screen Controller */
303 at91_add_device_tsadcc(); 313 at91_add_device_tsadcc();
304 /* LEDs */ 314 /* LEDs */