diff options
Diffstat (limited to 'arch/arm/mach-at91/at91sam9rl_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 61908dce978..eda72e83037 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <mach/board.h> | 20 | #include <mach/board.h> |
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/at91_matrix.h> | ||
23 | #include <mach/at91sam9_smc.h> | 24 | #include <mach/at91sam9_smc.h> |
24 | #include <mach/at_hdmac.h> | 25 | #include <mach/at_hdmac.h> |
25 | 26 | ||
@@ -33,10 +34,6 @@ | |||
33 | #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE) | 34 | #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE) |
34 | static u64 hdmac_dmamask = DMA_BIT_MASK(32); | 35 | static u64 hdmac_dmamask = DMA_BIT_MASK(32); |
35 | 36 | ||
36 | static struct at_dma_platform_data atdma_pdata = { | ||
37 | .nr_channels = 2, | ||
38 | }; | ||
39 | |||
40 | static struct resource hdmac_resources[] = { | 37 | static struct resource hdmac_resources[] = { |
41 | [0] = { | 38 | [0] = { |
42 | .start = AT91SAM9RL_BASE_DMA, | 39 | .start = AT91SAM9RL_BASE_DMA, |
@@ -51,12 +48,11 @@ static struct resource hdmac_resources[] = { | |||
51 | }; | 48 | }; |
52 | 49 | ||
53 | static struct platform_device at_hdmac_device = { | 50 | static struct platform_device at_hdmac_device = { |
54 | .name = "at_hdmac", | 51 | .name = "at91sam9rl_dma", |
55 | .id = -1, | 52 | .id = -1, |
56 | .dev = { | 53 | .dev = { |
57 | .dma_mask = &hdmac_dmamask, | 54 | .dma_mask = &hdmac_dmamask, |
58 | .coherent_dma_mask = DMA_BIT_MASK(32), | 55 | .coherent_dma_mask = DMA_BIT_MASK(32), |
59 | .platform_data = &atdma_pdata, | ||
60 | }, | 56 | }, |
61 | .resource = hdmac_resources, | 57 | .resource = hdmac_resources, |
62 | .num_resources = ARRAY_SIZE(hdmac_resources), | 58 | .num_resources = ARRAY_SIZE(hdmac_resources), |
@@ -64,7 +60,6 @@ static struct platform_device at_hdmac_device = { | |||
64 | 60 | ||
65 | void __init at91_add_device_hdmac(void) | 61 | void __init at91_add_device_hdmac(void) |
66 | { | 62 | { |
67 | dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask); | ||
68 | platform_device_register(&at_hdmac_device); | 63 | platform_device_register(&at_hdmac_device); |
69 | } | 64 | } |
70 | #else | 65 | #else |
@@ -271,8 +266,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
271 | if (!data) | 266 | if (!data) |
272 | return; | 267 | return; |
273 | 268 | ||
274 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 269 | csa = at91_matrix_read(AT91_MATRIX_EBICSA); |
275 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); | 270 | at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); |
276 | 271 | ||
277 | /* enable pin */ | 272 | /* enable pin */ |
278 | if (gpio_is_valid(data->enable_pin)) | 273 | if (gpio_is_valid(data->enable_pin)) |
@@ -688,6 +683,8 @@ static struct resource rtt_resources[] = { | |||
688 | .start = AT91SAM9RL_BASE_RTT, | 683 | .start = AT91SAM9RL_BASE_RTT, |
689 | .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, | 684 | .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, |
690 | .flags = IORESOURCE_MEM, | 685 | .flags = IORESOURCE_MEM, |
686 | }, { | ||
687 | .flags = IORESOURCE_MEM, | ||
691 | } | 688 | } |
692 | }; | 689 | }; |
693 | 690 | ||
@@ -695,11 +692,32 @@ static struct platform_device at91sam9rl_rtt_device = { | |||
695 | .name = "at91_rtt", | 692 | .name = "at91_rtt", |
696 | .id = 0, | 693 | .id = 0, |
697 | .resource = rtt_resources, | 694 | .resource = rtt_resources, |
698 | .num_resources = ARRAY_SIZE(rtt_resources), | ||
699 | }; | 695 | }; |
700 | 696 | ||
697 | #if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) | ||
698 | static void __init at91_add_device_rtt_rtc(void) | ||
699 | { | ||
700 | at91sam9rl_rtt_device.name = "rtc-at91sam9"; | ||
701 | /* | ||
702 | * The second resource is needed: | ||
703 | * GPBR will serve as the storage for RTC time offset | ||
704 | */ | ||
705 | at91sam9rl_rtt_device.num_resources = 2; | ||
706 | rtt_resources[1].start = AT91SAM9RL_BASE_GPBR + | ||
707 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | ||
708 | rtt_resources[1].end = rtt_resources[1].start + 3; | ||
709 | } | ||
710 | #else | ||
711 | static void __init at91_add_device_rtt_rtc(void) | ||
712 | { | ||
713 | /* Only one resource is needed: RTT not used as RTC */ | ||
714 | at91sam9rl_rtt_device.num_resources = 1; | ||
715 | } | ||
716 | #endif | ||
717 | |||
701 | static void __init at91_add_device_rtt(void) | 718 | static void __init at91_add_device_rtt(void) |
702 | { | 719 | { |
720 | at91_add_device_rtt_rtc(); | ||
703 | platform_device_register(&at91sam9rl_rtt_device); | 721 | platform_device_register(&at91sam9rl_rtt_device); |
704 | } | 722 | } |
705 | 723 | ||
@@ -1134,7 +1152,6 @@ static inline void configure_usart3_pins(unsigned pins) | |||
1134 | } | 1152 | } |
1135 | 1153 | ||
1136 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1154 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
1137 | struct platform_device *atmel_default_console_device; /* the serial console device */ | ||
1138 | 1155 | ||
1139 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1156 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1140 | { | 1157 | { |