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.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 9be71c11d0f0..eda72e83037d 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
@@ -265,8 +266,8 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
265 if (!data) 266 if (!data)
266 return; 267 return;
267 268
268 csa = at91_sys_read(AT91_MATRIX_EBICSA); 269 csa = at91_matrix_read(AT91_MATRIX_EBICSA);
269 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);
270 271
271 /* enable pin */ 272 /* enable pin */
272 if (gpio_is_valid(data->enable_pin)) 273 if (gpio_is_valid(data->enable_pin))
@@ -682,6 +683,8 @@ static struct resource rtt_resources[] = {
682 .start = AT91SAM9RL_BASE_RTT, 683 .start = AT91SAM9RL_BASE_RTT,
683 .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, 684 .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1,
684 .flags = IORESOURCE_MEM, 685 .flags = IORESOURCE_MEM,
686 }, {
687 .flags = IORESOURCE_MEM,
685 } 688 }
686}; 689};
687 690
@@ -689,11 +692,32 @@ static struct platform_device at91sam9rl_rtt_device = {
689 .name = "at91_rtt", 692 .name = "at91_rtt",
690 .id = 0, 693 .id = 0,
691 .resource = rtt_resources, 694 .resource = rtt_resources,
692 .num_resources = ARRAY_SIZE(rtt_resources),
693}; 695};
694 696
697#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
698static 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
711static 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
695static void __init at91_add_device_rtt(void) 718static void __init at91_add_device_rtt(void)
696{ 719{
720 at91_add_device_rtt_rtc();
697 platform_device_register(&at91sam9rl_rtt_device); 721 platform_device_register(&at91sam9rl_rtt_device);
698} 722}
699 723
@@ -1128,7 +1152,6 @@ static inline void configure_usart3_pins(unsigned pins)
1128} 1152}
1129 1153
1130static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1154static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1131struct platform_device *atmel_default_console_device; /* the serial console device */
1132 1155
1133void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1156void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1134{ 1157{