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/Makefile3
-rw-r--r--arch/arm/mach-at91/at91rm9200.c2
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c2
-rw-r--r--arch/arm/mach-at91/at91sam9260.c4
-rw-r--r--arch/arm/mach-at91/at91sam9261.c4
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9263.c5
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c5
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9g45_reset.S8
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c7
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c5
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c6
-rw-r--r--arch/arm/mach-at91/at91x40_time.c2
-rw-r--r--arch/arm/mach-at91/board-cam60.c2
-rw-r--r--arch/arm/mach-at91/board-dt-rm9200.c7
-rw-r--r--arch/arm/mach-at91/board-dt-sam9.c7
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c10
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c6
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c4
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c6
-rw-r--r--arch/arm/mach-at91/board.h4
-rw-r--r--arch/arm/mach-at91/cpuidle.c68
-rw-r--r--arch/arm/mach-at91/generic.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91_adc.h34
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9n12.h5
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9x5.h5
-rw-r--r--arch/arm/mach-at91/include/mach/sama5d3.h5
-rw-r--r--arch/arm/mach-at91/pm.c27
-rw-r--r--arch/arm/mach-at91/pm.h59
-rw-r--r--arch/arm/mach-at91/sama5d3.c6
-rw-r--r--arch/arm/mach-at91/setup.c14
-rw-r--r--arch/arm/mach-at91/sysirq_mask.c71
36 files changed, 264 insertions, 157 deletions
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 3b0a9538093c..90aab2d5a07f 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := irq.o gpio.o setup.o 5obj-y := irq.o gpio.o setup.o sysirq_mask.o
6obj-m := 6obj-m :=
7obj-n := 7obj-n :=
8obj- := 8obj- :=
@@ -98,7 +98,6 @@ obj-y += leds.o
98# Power Management 98# Power Management
99obj-$(CONFIG_PM) += pm.o 99obj-$(CONFIG_PM) += pm.o
100obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o 100obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
101obj-$(CONFIG_CPU_IDLE) += cpuidle.o
102 101
103ifeq ($(CONFIG_PM_DEBUG),y) 102ifeq ($(CONFIG_PM_DEBUG),y)
104CFLAGS_pm.o += -DDEBUG 103CFLAGS_pm.o += -DDEBUG
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 4aad93d54d6f..25805f2f6010 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -27,6 +27,7 @@
27#include "generic.h" 27#include "generic.h"
28#include "clock.h" 28#include "clock.h"
29#include "sam9_smc.h" 29#include "sam9_smc.h"
30#include "pm.h"
30 31
31/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
32 * Clocks 33 * Clocks
@@ -327,6 +328,7 @@ static void __init at91rm9200_ioremap_registers(void)
327{ 328{
328 at91rm9200_ioremap_st(AT91RM9200_BASE_ST); 329 at91rm9200_ioremap_st(AT91RM9200_BASE_ST);
329 at91_ioremap_ramc(0, AT91RM9200_BASE_MC, 256); 330 at91_ioremap_ramc(0, AT91RM9200_BASE_MC, 256);
331 at91_pm_set_standby(at91rm9200_standby);
330} 332}
331 333
332static void __init at91rm9200_initialize(void) 334static void __init at91rm9200_initialize(void)
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 180b3024bec3..f607deb40f4d 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -93,7 +93,7 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
93 93
94static struct irqaction at91rm9200_timer_irq = { 94static struct irqaction at91rm9200_timer_irq = {
95 .name = "at91_tick", 95 .name = "at91_tick",
96 .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 96 .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
97 .handler = at91rm9200_timer_interrupt, 97 .handler = at91rm9200_timer_interrupt,
98 .irq = NR_IRQS_LEGACY + AT91_ID_SYS, 98 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
99}; 99};
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 5de6074b4f4f..d6a1fa85371d 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -28,6 +28,7 @@
28#include "generic.h" 28#include "generic.h"
29#include "clock.h" 29#include "clock.h"
30#include "sam9_smc.h" 30#include "sam9_smc.h"
31#include "pm.h"
31 32
32/* -------------------------------------------------------------------- 33/* --------------------------------------------------------------------
33 * Clocks 34 * Clocks
@@ -342,6 +343,7 @@ static void __init at91sam9260_ioremap_registers(void)
342 at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); 343 at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT);
343 at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); 344 at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
344 at91_ioremap_matrix(AT91SAM9260_BASE_MATRIX); 345 at91_ioremap_matrix(AT91SAM9260_BASE_MATRIX);
346 at91_pm_set_standby(at91sam9_sdram_standby);
345} 347}
346 348
347static void __init at91sam9260_initialize(void) 349static void __init at91sam9260_initialize(void)
@@ -349,6 +351,8 @@ static void __init at91sam9260_initialize(void)
349 arm_pm_idle = at91sam9_idle; 351 arm_pm_idle = at91sam9_idle;
350 arm_pm_restart = at91sam9_alt_restart; 352 arm_pm_restart = at91sam9_alt_restart;
351 353
354 at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT);
355
352 /* Register GPIO subsystem */ 356 /* Register GPIO subsystem */
353 at91_gpio_init(at91sam9260_gpio, 3); 357 at91_gpio_init(at91sam9260_gpio, 3);
354} 358}
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 0e0793241ab7..23ba1d8a1531 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -27,6 +27,7 @@
27#include "generic.h" 27#include "generic.h"
28#include "clock.h" 28#include "clock.h"
29#include "sam9_smc.h" 29#include "sam9_smc.h"
30#include "pm.h"
30 31
31/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
32 * Clocks 33 * Clocks
@@ -284,6 +285,7 @@ static void __init at91sam9261_ioremap_registers(void)
284 at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT); 285 at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT);
285 at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); 286 at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
286 at91_ioremap_matrix(AT91SAM9261_BASE_MATRIX); 287 at91_ioremap_matrix(AT91SAM9261_BASE_MATRIX);
288 at91_pm_set_standby(at91sam9_sdram_standby);
287} 289}
288 290
289static void __init at91sam9261_initialize(void) 291static void __init at91sam9261_initialize(void)
@@ -291,6 +293,8 @@ static void __init at91sam9261_initialize(void)
291 arm_pm_idle = at91sam9_idle; 293 arm_pm_idle = at91sam9_idle;
292 arm_pm_restart = at91sam9_alt_restart; 294 arm_pm_restart = at91sam9_alt_restart;
293 295
296 at91_sysirq_mask_rtt(AT91SAM9261_BASE_RTT);
297
294 /* Register GPIO subsystem */ 298 /* Register GPIO subsystem */
295 at91_gpio_init(at91sam9261_gpio, 3); 299 at91_gpio_init(at91sam9261_gpio, 3);
296} 300}
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 629ea5fc95cf..b2a34740146a 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -465,7 +465,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
465 465
466#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 466#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
467static u64 lcdc_dmamask = DMA_BIT_MASK(32); 467static u64 lcdc_dmamask = DMA_BIT_MASK(32);
468static struct atmel_lcdfb_info lcdc_data; 468static struct atmel_lcdfb_pdata lcdc_data;
469 469
470static struct resource lcdc_resources[] = { 470static struct resource lcdc_resources[] = {
471 [0] = { 471 [0] = {
@@ -498,7 +498,7 @@ static struct platform_device at91_lcdc_device = {
498 .num_resources = ARRAY_SIZE(lcdc_resources), 498 .num_resources = ARRAY_SIZE(lcdc_resources),
499}; 499};
500 500
501void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) 501void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data)
502{ 502{
503 if (!data) { 503 if (!data) {
504 return; 504 return;
@@ -559,7 +559,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
559 platform_device_register(&at91_lcdc_device); 559 platform_device_register(&at91_lcdc_device);
560} 560}
561#else 561#else
562void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} 562void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {}
563#endif 563#endif
564 564
565 565
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 6ce7d1850893..7eccb0fc57bc 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -26,6 +26,7 @@
26#include "generic.h" 26#include "generic.h"
27#include "clock.h" 27#include "clock.h"
28#include "sam9_smc.h" 28#include "sam9_smc.h"
29#include "pm.h"
29 30
30/* -------------------------------------------------------------------- 31/* --------------------------------------------------------------------
31 * Clocks 32 * Clocks
@@ -321,6 +322,7 @@ static void __init at91sam9263_ioremap_registers(void)
321 at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0); 322 at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
322 at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); 323 at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
323 at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX); 324 at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX);
325 at91_pm_set_standby(at91sam9_sdram_standby);
324} 326}
325 327
326static void __init at91sam9263_initialize(void) 328static void __init at91sam9263_initialize(void)
@@ -328,6 +330,9 @@ static void __init at91sam9263_initialize(void)
328 arm_pm_idle = at91sam9_idle; 330 arm_pm_idle = at91sam9_idle;
329 arm_pm_restart = at91sam9_alt_restart; 331 arm_pm_restart = at91sam9_alt_restart;
330 332
333 at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT0);
334 at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT1);
335
331 /* Register GPIO subsystem */ 336 /* Register GPIO subsystem */
332 at91_gpio_init(at91sam9263_gpio, 5); 337 at91_gpio_init(at91sam9263_gpio, 5);
333} 338}
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 858c8aac2daf..4aeadddbc181 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -832,7 +832,7 @@ void __init at91_add_device_can(struct at91_can_data *data) {}
832 832
833#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 833#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
834static u64 lcdc_dmamask = DMA_BIT_MASK(32); 834static u64 lcdc_dmamask = DMA_BIT_MASK(32);
835static struct atmel_lcdfb_info lcdc_data; 835static struct atmel_lcdfb_pdata lcdc_data;
836 836
837static struct resource lcdc_resources[] = { 837static struct resource lcdc_resources[] = {
838 [0] = { 838 [0] = {
@@ -859,7 +859,7 @@ static struct platform_device at91_lcdc_device = {
859 .num_resources = ARRAY_SIZE(lcdc_resources), 859 .num_resources = ARRAY_SIZE(lcdc_resources),
860}; 860};
861 861
862void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) 862void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data)
863{ 863{
864 if (!data) 864 if (!data)
865 return; 865 return;
@@ -891,7 +891,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
891 platform_device_register(&at91_lcdc_device); 891 platform_device_register(&at91_lcdc_device);
892} 892}
893#else 893#else
894void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} 894void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {}
895#endif 895#endif
896 896
897 897
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 3a4bc2e1a65e..bb392320a0dd 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -171,7 +171,7 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
171 171
172static struct irqaction at91sam926x_pit_irq = { 172static struct irqaction at91sam926x_pit_irq = {
173 .name = "at91_tick", 173 .name = "at91_tick",
174 .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 174 .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
175 .handler = at91sam926x_pit_interrupt, 175 .handler = at91sam926x_pit_interrupt,
176 .irq = NR_IRQS_LEGACY + AT91_ID_SYS, 176 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
177}; 177};
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 474ee04d24b9..9405aa08b104 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -26,6 +26,7 @@
26#include "generic.h" 26#include "generic.h"
27#include "clock.h" 27#include "clock.h"
28#include "sam9_smc.h" 28#include "sam9_smc.h"
29#include "pm.h"
29 30
30/* -------------------------------------------------------------------- 31/* --------------------------------------------------------------------
31 * Clocks 32 * Clocks
@@ -370,6 +371,7 @@ static void __init at91sam9g45_ioremap_registers(void)
370 at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT); 371 at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT);
371 at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC); 372 at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC);
372 at91_ioremap_matrix(AT91SAM9G45_BASE_MATRIX); 373 at91_ioremap_matrix(AT91SAM9G45_BASE_MATRIX);
374 at91_pm_set_standby(at91_ddr_standby);
373} 375}
374 376
375static void __init at91sam9g45_initialize(void) 377static void __init at91sam9g45_initialize(void)
@@ -377,6 +379,9 @@ static void __init at91sam9g45_initialize(void)
377 arm_pm_idle = at91sam9_idle; 379 arm_pm_idle = at91sam9_idle;
378 arm_pm_restart = at91sam9g45_restart; 380 arm_pm_restart = at91sam9g45_restart;
379 381
382 at91_sysirq_mask_rtc(AT91SAM9G45_BASE_RTC);
383 at91_sysirq_mask_rtt(AT91SAM9G45_BASE_RTT);
384
380 /* Register GPIO subsystem */ 385 /* Register GPIO subsystem */
381 at91_gpio_init(at91sam9g45_gpio, 5); 386 at91_gpio_init(at91sam9g45_gpio, 5);
382} 387}
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index acb703e13331..cb36fa872d30 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -965,7 +965,7 @@ void __init at91_add_device_isi(struct isi_platform_data *data,
965 965
966#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 966#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
967static u64 lcdc_dmamask = DMA_BIT_MASK(32); 967static u64 lcdc_dmamask = DMA_BIT_MASK(32);
968static struct atmel_lcdfb_info lcdc_data; 968static struct atmel_lcdfb_pdata lcdc_data;
969 969
970static struct resource lcdc_resources[] = { 970static struct resource lcdc_resources[] = {
971 [0] = { 971 [0] = {
@@ -991,7 +991,7 @@ static struct platform_device at91_lcdc_device = {
991 .num_resources = ARRAY_SIZE(lcdc_resources), 991 .num_resources = ARRAY_SIZE(lcdc_resources),
992}; 992};
993 993
994void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) 994void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data)
995{ 995{
996 if (!data) 996 if (!data)
997 return; 997 return;
@@ -1037,7 +1037,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
1037 platform_device_register(&at91_lcdc_device); 1037 platform_device_register(&at91_lcdc_device);
1038} 1038}
1039#else 1039#else
1040void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} 1040void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {}
1041#endif 1041#endif
1042 1042
1043 1043
diff --git a/arch/arm/mach-at91/at91sam9g45_reset.S b/arch/arm/mach-at91/at91sam9g45_reset.S
index 721a1a34dd1d..c40c1e2ef80f 100644
--- a/arch/arm/mach-at91/at91sam9g45_reset.S
+++ b/arch/arm/mach-at91/at91sam9g45_reset.S
@@ -16,11 +16,17 @@
16#include "at91_rstc.h" 16#include "at91_rstc.h"
17 .arm 17 .arm
18 18
19/*
20 * at91_ramc_base is an array void*
21 * init at NULL if only one DDR controler is present in or DT
22 */
19 .globl at91sam9g45_restart 23 .globl at91sam9g45_restart
20 24
21at91sam9g45_restart: 25at91sam9g45_restart:
22 ldr r5, =at91_ramc_base @ preload constants 26 ldr r5, =at91_ramc_base @ preload constants
23 ldr r0, [r5] 27 ldr r0, [r5]
28 ldr r5, [r5, #4] @ ddr1
29 cmp r5, #0
24 ldr r4, =at91_rstc_base 30 ldr r4, =at91_rstc_base
25 ldr r1, [r4] 31 ldr r1, [r4]
26 32
@@ -30,6 +36,8 @@ at91sam9g45_restart:
30 36
31 .balign 32 @ align to cache line 37 .balign 32 @ align to cache line
32 38
39 strne r2, [r5, #AT91_DDRSDRC_RTR] @ disable DDR1 access
40 strne r3, [r5, #AT91_DDRSDRC_LPR] @ power down DDR1
33 str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access 41 str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access
34 str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 42 str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0
35 str r4, [r1, #AT91_RSTC_CR] @ reset processor 43 str r4, [r1, #AT91_RSTC_CR] @ reset processor
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index c7d670d11802..388ec3aec4b9 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -169,6 +169,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
169 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk), 169 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk),
170 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk), 170 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk),
171 CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc_clk), 171 CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc_clk),
172 CLKDEV_CON_DEV_ID(NULL, "f0010000.ssc", &ssc_clk),
172 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk), 173 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk),
173 CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk), 174 CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
174 CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk), 175 CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
@@ -223,7 +224,13 @@ static void __init at91sam9n12_map_io(void)
223 at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE); 224 at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
224} 225}
225 226
227static void __init at91sam9n12_initialize(void)
228{
229 at91_sysirq_mask_rtc(AT91SAM9N12_BASE_RTC);
230}
231
226AT91_SOC_START(at91sam9n12) 232AT91_SOC_START(at91sam9n12)
227 .map_io = at91sam9n12_map_io, 233 .map_io = at91sam9n12_map_io,
228 .register_clocks = at91sam9n12_register_clocks, 234 .register_clocks = at91sam9n12_register_clocks,
235 .init = at91sam9n12_initialize,
229AT91_SOC_END 236AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index d4ec0d9a9872..0750ffb7e6b1 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -27,6 +27,7 @@
27#include "generic.h" 27#include "generic.h"
28#include "clock.h" 28#include "clock.h"
29#include "sam9_smc.h" 29#include "sam9_smc.h"
30#include "pm.h"
30 31
31/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
32 * Clocks 33 * Clocks
@@ -287,6 +288,7 @@ static void __init at91sam9rl_ioremap_registers(void)
287 at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT); 288 at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT);
288 at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); 289 at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
289 at91_ioremap_matrix(AT91SAM9RL_BASE_MATRIX); 290 at91_ioremap_matrix(AT91SAM9RL_BASE_MATRIX);
291 at91_pm_set_standby(at91sam9_sdram_standby);
290} 292}
291 293
292static void __init at91sam9rl_initialize(void) 294static void __init at91sam9rl_initialize(void)
@@ -294,6 +296,9 @@ static void __init at91sam9rl_initialize(void)
294 arm_pm_idle = at91sam9_idle; 296 arm_pm_idle = at91sam9_idle;
295 arm_pm_restart = at91sam9_alt_restart; 297 arm_pm_restart = at91sam9_alt_restart;
296 298
299 at91_sysirq_mask_rtc(AT91SAM9RL_BASE_RTC);
300 at91_sysirq_mask_rtt(AT91SAM9RL_BASE_RTT);
301
297 /* Register GPIO subsystem */ 302 /* Register GPIO subsystem */
298 at91_gpio_init(at91sam9rl_gpio, 4); 303 at91_gpio_init(at91sam9rl_gpio, 4);
299} 304}
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 352468f265a9..a698bdab2cce 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -498,7 +498,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
498 498
499#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 499#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
500static u64 lcdc_dmamask = DMA_BIT_MASK(32); 500static u64 lcdc_dmamask = DMA_BIT_MASK(32);
501static struct atmel_lcdfb_info lcdc_data; 501static struct atmel_lcdfb_pdata lcdc_data;
502 502
503static struct resource lcdc_resources[] = { 503static struct resource lcdc_resources[] = {
504 [0] = { 504 [0] = {
@@ -525,7 +525,7 @@ static struct platform_device at91_lcdc_device = {
525 .num_resources = ARRAY_SIZE(lcdc_resources), 525 .num_resources = ARRAY_SIZE(lcdc_resources),
526}; 526};
527 527
528void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) 528void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data)
529{ 529{
530 if (!data) { 530 if (!data) {
531 return; 531 return;
@@ -557,7 +557,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
557 platform_device_register(&at91_lcdc_device); 557 platform_device_register(&at91_lcdc_device);
558} 558}
559#else 559#else
560void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} 560void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {}
561#endif 561#endif
562 562
563 563
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 916e5a142917..e8a2e075a1b8 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -322,6 +322,11 @@ static void __init at91sam9x5_map_io(void)
322 at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE); 322 at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
323} 323}
324 324
325static void __init at91sam9x5_initialize(void)
326{
327 at91_sysirq_mask_rtc(AT91SAM9X5_BASE_RTC);
328}
329
325/* -------------------------------------------------------------------- 330/* --------------------------------------------------------------------
326 * Interrupt initialization 331 * Interrupt initialization
327 * -------------------------------------------------------------------- */ 332 * -------------------------------------------------------------------- */
@@ -329,4 +334,5 @@ static void __init at91sam9x5_map_io(void)
329AT91_SOC_START(at91sam9x5) 334AT91_SOC_START(at91sam9x5)
330 .map_io = at91sam9x5_map_io, 335 .map_io = at91sam9x5_map_io,
331 .register_clocks = at91sam9x5_register_clocks, 336 .register_clocks = at91sam9x5_register_clocks,
337 .init = at91sam9x5_initialize,
332AT91_SOC_END 338AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index 2919eba41ff4..c0e637adf65d 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -57,7 +57,7 @@ static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
57 57
58static struct irqaction at91x40_timer_irq = { 58static struct irqaction at91x40_timer_irq = {
59 .name = "at91_tick", 59 .name = "at91_tick",
60 .flags = IRQF_DISABLED | IRQF_TIMER, 60 .flags = IRQF_TIMER,
61 .handler = at91x40_timer_interrupt 61 .handler = at91x40_timer_interrupt
62}; 62};
63 63
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index ade948b82662..112e867c4abe 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -112,7 +112,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
112/* 112/*
113 * MACB Ethernet device 113 * MACB Ethernet device
114 */ 114 */
115static struct __initdata macb_platform_data cam60_macb_data = { 115static struct macb_platform_data cam60_macb_data __initdata = {
116 .phy_irq_pin = AT91_PIN_PB5, 116 .phy_irq_pin = AT91_PIN_PB5,
117 .is_rmii = 0, 117 .is_rmii = 0,
118}; 118};
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
index 3fcb6623a33e..3a185faee795 100644
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ b/arch/arm/mach-at91/board-dt-rm9200.c
@@ -14,7 +14,6 @@
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_irq.h> 16#include <linux/of_irq.h>
17#include <linux/of_platform.h>
18 17
19#include <asm/setup.h> 18#include <asm/setup.h>
20#include <asm/irq.h> 19#include <asm/irq.h>
@@ -36,11 +35,6 @@ static void __init at91rm9200_dt_init_irq(void)
36 of_irq_init(irq_of_match); 35 of_irq_init(irq_of_match);
37} 36}
38 37
39static void __init at91rm9200_dt_device_init(void)
40{
41 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
42}
43
44static const char *at91rm9200_dt_board_compat[] __initdata = { 38static const char *at91rm9200_dt_board_compat[] __initdata = {
45 "atmel,at91rm9200", 39 "atmel,at91rm9200",
46 NULL 40 NULL
@@ -52,6 +46,5 @@ DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
52 .handle_irq = at91_aic_handle_irq, 46 .handle_irq = at91_aic_handle_irq,
53 .init_early = at91rm9200_dt_initialize, 47 .init_early = at91rm9200_dt_initialize,
54 .init_irq = at91rm9200_dt_init_irq, 48 .init_irq = at91rm9200_dt_init_irq,
55 .init_machine = at91rm9200_dt_device_init,
56 .dt_compat = at91rm9200_dt_board_compat, 49 .dt_compat = at91rm9200_dt_board_compat,
57MACHINE_END 50MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 8db30132abed..3dab868b02fa 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -13,7 +13,6 @@
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/of_irq.h> 15#include <linux/of_irq.h>
16#include <linux/of_platform.h>
17 16
18#include <asm/setup.h> 17#include <asm/setup.h>
19#include <asm/irq.h> 18#include <asm/irq.h>
@@ -37,11 +36,6 @@ static void __init at91_dt_init_irq(void)
37 of_irq_init(irq_of_match); 36 of_irq_init(irq_of_match);
38} 37}
39 38
40static void __init at91_dt_device_init(void)
41{
42 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
43}
44
45static const char *at91_dt_board_compat[] __initdata = { 39static const char *at91_dt_board_compat[] __initdata = {
46 "atmel,at91sam9", 40 "atmel,at91sam9",
47 NULL 41 NULL
@@ -54,6 +48,5 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
54 .handle_irq = at91_aic_handle_irq, 48 .handle_irq = at91_aic_handle_irq,
55 .init_early = at91_dt_initialize, 49 .init_early = at91_dt_initialize,
56 .init_irq = at91_dt_init_irq, 50 .init_irq = at91_dt_init_irq,
57 .init_machine = at91_dt_device_init,
58 .dt_compat = at91_dt_board_compat, 51 .dt_compat = at91_dt_board_compat,
59MACHINE_END 52MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index d3437624ca4e..473546b9408b 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -389,7 +389,7 @@ static struct fb_monspecs at91fb_default_stn_monspecs = {
389 | ATMEL_LCDC_IFWIDTH_4 \ 389 | ATMEL_LCDC_IFWIDTH_4 \
390 | ATMEL_LCDC_SCANMOD_SINGLE) 390 | ATMEL_LCDC_SCANMOD_SINGLE)
391 391
392static void at91_lcdc_stn_power_control(int on) 392static void at91_lcdc_stn_power_control(struct atmel_lcdfb_pdata *pdata, int on)
393{ 393{
394 /* backlight */ 394 /* backlight */
395 if (on) { /* power up */ 395 if (on) { /* power up */
@@ -401,7 +401,7 @@ static void at91_lcdc_stn_power_control(int on)
401 } 401 }
402} 402}
403 403
404static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 404static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = {
405 .default_bpp = 1, 405 .default_bpp = 1,
406 .default_dmacon = ATMEL_LCDC_DMAEN, 406 .default_dmacon = ATMEL_LCDC_DMAEN,
407 .default_lcdcon2 = AT91SAM9261_DEFAULT_STN_LCDCON2, 407 .default_lcdcon2 = AT91SAM9261_DEFAULT_STN_LCDCON2,
@@ -445,7 +445,7 @@ static struct fb_monspecs at91fb_default_tft_monspecs = {
445 | ATMEL_LCDC_DISTYPE_TFT \ 445 | ATMEL_LCDC_DISTYPE_TFT \
446 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 446 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
447 447
448static void at91_lcdc_tft_power_control(int on) 448static void at91_lcdc_tft_power_control(struct atmel_lcdfb_pdata *pdata, int on)
449{ 449{
450 if (on) 450 if (on)
451 at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */ 451 at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */
@@ -453,7 +453,7 @@ static void at91_lcdc_tft_power_control(int on)
453 at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */ 453 at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */
454} 454}
455 455
456static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 456static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = {
457 .lcdcon_is_backlight = true, 457 .lcdcon_is_backlight = true,
458 .default_bpp = 16, 458 .default_bpp = 16,
459 .default_dmacon = ATMEL_LCDC_DMAEN, 459 .default_dmacon = ATMEL_LCDC_DMAEN,
@@ -465,7 +465,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
465#endif 465#endif
466 466
467#else 467#else
468static struct atmel_lcdfb_info __initdata ek_lcdc_data; 468static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
469#endif 469#endif
470 470
471 471
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 947e134ac4c3..2f931915c80c 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -275,13 +275,13 @@ static struct fb_monspecs at91fb_default_monspecs = {
275 | ATMEL_LCDC_DISTYPE_TFT \ 275 | ATMEL_LCDC_DISTYPE_TFT \
276 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 276 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
277 277
278static void at91_lcdc_power_control(int on) 278static void at91_lcdc_power_control(struct atmel_lcdfb_pdata *pdata, int on)
279{ 279{
280 at91_set_gpio_value(AT91_PIN_PA30, on); 280 at91_set_gpio_value(AT91_PIN_PA30, on);
281} 281}
282 282
283/* Driver datas */ 283/* Driver datas */
284static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 284static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = {
285 .lcdcon_is_backlight = true, 285 .lcdcon_is_backlight = true,
286 .default_bpp = 16, 286 .default_bpp = 16,
287 .default_dmacon = ATMEL_LCDC_DMAEN, 287 .default_dmacon = ATMEL_LCDC_DMAEN,
@@ -292,7 +292,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
292}; 292};
293 293
294#else 294#else
295static struct atmel_lcdfb_info __initdata ek_lcdc_data; 295static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
296#endif 296#endif
297 297
298 298
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 2a94896a1375..ef39078c8ce2 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -284,7 +284,7 @@ static struct fb_monspecs at91fb_default_monspecs = {
284 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 284 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
285 285
286/* Driver datas */ 286/* Driver datas */
287static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 287static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = {
288 .lcdcon_is_backlight = true, 288 .lcdcon_is_backlight = true,
289 .default_bpp = 32, 289 .default_bpp = 32,
290 .default_dmacon = ATMEL_LCDC_DMAEN, 290 .default_dmacon = ATMEL_LCDC_DMAEN,
@@ -295,7 +295,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
295}; 295};
296 296
297#else 297#else
298static struct atmel_lcdfb_info __initdata ek_lcdc_data; 298static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
299#endif 299#endif
300 300
301 301
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index aa265dcf2128..604eecf6cd70 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -170,7 +170,7 @@ static struct fb_monspecs at91fb_default_monspecs = {
170 | ATMEL_LCDC_DISTYPE_TFT \ 170 | ATMEL_LCDC_DISTYPE_TFT \
171 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 171 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
172 172
173static void at91_lcdc_power_control(int on) 173static void at91_lcdc_power_control(struct atmel_lcdfb_pdata *pdata, int on)
174{ 174{
175 if (on) 175 if (on)
176 at91_set_gpio_value(AT91_PIN_PC1, 0); /* power up */ 176 at91_set_gpio_value(AT91_PIN_PC1, 0); /* power up */
@@ -179,7 +179,7 @@ static void at91_lcdc_power_control(int on)
179} 179}
180 180
181/* Driver datas */ 181/* Driver datas */
182static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 182static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = {
183 .lcdcon_is_backlight = true, 183 .lcdcon_is_backlight = true,
184 .default_bpp = 16, 184 .default_bpp = 16,
185 .default_dmacon = ATMEL_LCDC_DMAEN, 185 .default_dmacon = ATMEL_LCDC_DMAEN,
@@ -191,7 +191,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
191}; 191};
192 192
193#else 193#else
194static struct atmel_lcdfb_info __initdata ek_lcdc_data; 194static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
195#endif 195#endif
196 196
197 197
diff --git a/arch/arm/mach-at91/board.h b/arch/arm/mach-at91/board.h
index 4a234fb2ab3b..6c08b341167d 100644
--- a/arch/arm/mach-at91/board.h
+++ b/arch/arm/mach-at91/board.h
@@ -107,8 +107,8 @@ extern void __init at91_add_device_pwm(u32 mask);
107extern void __init at91_add_device_ssc(unsigned id, unsigned pins); 107extern void __init at91_add_device_ssc(unsigned id, unsigned pins);
108 108
109 /* LCD Controller */ 109 /* LCD Controller */
110struct atmel_lcdfb_info; 110struct atmel_lcdfb_pdata;
111extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data); 111extern void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data);
112 112
113 /* AC97 */ 113 /* AC97 */
114extern void __init at91_add_device_ac97(struct ac97c_platform_data *data); 114extern void __init at91_add_device_ac97(struct ac97c_platform_data *data);
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
deleted file mode 100644
index 4ec6a6d9b9be..000000000000
--- a/arch/arm/mach-at91/cpuidle.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * based on arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle support for AT91 SoC
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 * The cpu idle uses wait-for-interrupt and RAM self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and RAM self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/cpuidle.h>
20#include <linux/io.h>
21#include <linux/export.h>
22#include <asm/proc-fns.h>
23#include <asm/cpuidle.h>
24#include <mach/cpu.h>
25
26#include "pm.h"
27
28#define AT91_MAX_STATES 2
29
30/* Actual code that puts the SoC in different idle states */
31static int at91_enter_idle(struct cpuidle_device *dev,
32 struct cpuidle_driver *drv,
33 int index)
34{
35 if (cpu_is_at91rm9200())
36 at91rm9200_standby();
37 else if (cpu_is_at91sam9g45())
38 at91sam9g45_standby();
39 else if (cpu_is_at91sam9263())
40 at91sam9263_standby();
41 else
42 at91sam9_standby();
43
44 return index;
45}
46
47static struct cpuidle_driver at91_idle_driver = {
48 .name = "at91_idle",
49 .owner = THIS_MODULE,
50 .states[0] = ARM_CPUIDLE_WFI_STATE,
51 .states[1] = {
52 .enter = at91_enter_idle,
53 .exit_latency = 10,
54 .target_residency = 10000,
55 .flags = CPUIDLE_FLAG_TIME_VALID,
56 .name = "RAM_SR",
57 .desc = "WFI and DDR Self Refresh",
58 },
59 .state_count = AT91_MAX_STATES,
60};
61
62/* Initialize CPU idle by registering the idle states */
63static int __init at91_init_cpuidle(void)
64{
65 return cpuidle_register(&at91_idle_driver, NULL);
66}
67
68device_initcall(at91_init_cpuidle);
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index dc6e2f5f804d..26dee3ce9397 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -34,6 +34,8 @@ extern int __init at91_aic_of_init(struct device_node *node,
34 struct device_node *parent); 34 struct device_node *parent);
35extern int __init at91_aic5_of_init(struct device_node *node, 35extern int __init at91_aic5_of_init(struct device_node *node,
36 struct device_node *parent); 36 struct device_node *parent);
37extern void __init at91_sysirq_mask_rtc(u32 rtc_base);
38extern void __init at91_sysirq_mask_rtt(u32 rtt_base);
37 39
38 40
39 /* Timer */ 41 /* Timer */
diff --git a/arch/arm/mach-at91/include/mach/at91_adc.h b/arch/arm/mach-at91/include/mach/at91_adc.h
index 048a57f76bd3..c287307b9a3b 100644
--- a/arch/arm/mach-at91/include/mach/at91_adc.h
+++ b/arch/arm/mach-at91/include/mach/at91_adc.h
@@ -60,14 +60,48 @@
60#define AT91_ADC_IER 0x24 /* Interrupt Enable Register */ 60#define AT91_ADC_IER 0x24 /* Interrupt Enable Register */
61#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */ 61#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */
62#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */ 62#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */
63#define AT91_ADC_IER_PEN (1 << 29)
64#define AT91_ADC_IER_NOPEN (1 << 30)
65#define AT91_ADC_IER_XRDY (1 << 20)
66#define AT91_ADC_IER_YRDY (1 << 21)
67#define AT91_ADC_IER_PRDY (1 << 22)
68#define AT91_ADC_ISR_PENS (1 << 31)
63 69
64#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */ 70#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */
65#define AT91_ADC_DATA (0x3ff) 71#define AT91_ADC_DATA (0x3ff)
66 72
67#define AT91_ADC_CDR0_9X5 (0x50) /* Channel Data Register 0 for 9X5 */ 73#define AT91_ADC_CDR0_9X5 (0x50) /* Channel Data Register 0 for 9X5 */
68 74
75#define AT91_ADC_ACR 0x94 /* Analog Control Register */
76#define AT91_ADC_ACR_PENDETSENS (0x3 << 0) /* pull-up resistor */
77
78#define AT91_ADC_TSMR 0xB0
79#define AT91_ADC_TSMR_TSMODE (3 << 0) /* Touch Screen Mode */
80#define AT91_ADC_TSMR_TSMODE_NONE (0 << 0)
81#define AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS (1 << 0)
82#define AT91_ADC_TSMR_TSMODE_4WIRE_PRESS (2 << 0)
83#define AT91_ADC_TSMR_TSMODE_5WIRE (3 << 0)
84#define AT91_ADC_TSMR_TSAV (3 << 4) /* Averages samples */
85#define AT91_ADC_TSMR_TSAV_(x) ((x) << 4)
86#define AT91_ADC_TSMR_SCTIM (0x0f << 16) /* Switch closure time */
87#define AT91_ADC_TSMR_PENDBC (0x0f << 28) /* Pen Debounce time */
88#define AT91_ADC_TSMR_PENDBC_(x) ((x) << 28)
89#define AT91_ADC_TSMR_NOTSDMA (1 << 22) /* No Touchscreen DMA */
90#define AT91_ADC_TSMR_PENDET_DIS (0 << 24) /* Pen contact detection disable */
91#define AT91_ADC_TSMR_PENDET_ENA (1 << 24) /* Pen contact detection enable */
92
93#define AT91_ADC_TSXPOSR 0xB4
94#define AT91_ADC_TSYPOSR 0xB8
95#define AT91_ADC_TSPRESSR 0xBC
96
69#define AT91_ADC_TRGR_9260 AT91_ADC_MR 97#define AT91_ADC_TRGR_9260 AT91_ADC_MR
70#define AT91_ADC_TRGR_9G45 0x08 98#define AT91_ADC_TRGR_9G45 0x08
71#define AT91_ADC_TRGR_9X5 0xC0 99#define AT91_ADC_TRGR_9X5 0xC0
72 100
101/* Trigger Register bit field */
102#define AT91_ADC_TRGR_TRGPER (0xffff << 16)
103#define AT91_ADC_TRGR_TRGPER_(x) ((x) << 16)
104#define AT91_ADC_TRGR_TRGMOD (0x7 << 0)
105#define AT91_ADC_TRGR_MOD_PERIOD_TRIG (5 << 0)
106
73#endif 107#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h
index d374b87c0459..0151bcf6163c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9n12.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h
@@ -49,6 +49,11 @@
49#define AT91SAM9N12_BASE_USART3 0xf8028000 49#define AT91SAM9N12_BASE_USART3 0xf8028000
50 50
51/* 51/*
52 * System Peripherals
53 */
54#define AT91SAM9N12_BASE_RTC 0xfffffeb0
55
56/*
52 * Internal Memory. 57 * Internal Memory.
53 */ 58 */
54#define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 59#define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5.h b/arch/arm/mach-at91/include/mach/at91sam9x5.h
index c75ee19b58d3..2fc76c49e97c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9x5.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9x5.h
@@ -55,6 +55,11 @@
55#define AT91SAM9X5_BASE_USART2 0xf8024000 55#define AT91SAM9X5_BASE_USART2 0xf8024000
56 56
57/* 57/*
58 * System Peripherals
59 */
60#define AT91SAM9X5_BASE_RTC 0xfffffeb0
61
62/*
58 * Internal Memory. 63 * Internal Memory.
59 */ 64 */
60#define AT91SAM9X5_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 65#define AT91SAM9X5_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h
index 31096a8aaf1d..25613d8c6dcd 100644
--- a/arch/arm/mach-at91/include/mach/sama5d3.h
+++ b/arch/arm/mach-at91/include/mach/sama5d3.h
@@ -73,6 +73,11 @@
73#define SAMA5D3_BASE_USART3 0xf8024000 73#define SAMA5D3_BASE_USART3 0xf8024000
74 74
75/* 75/*
76 * System Peripherals
77 */
78#define SAMA5D3_BASE_RTC 0xfffffeb0
79
80/*
76 * Internal Memory 81 * Internal Memory
77 */ 82 */
78#define SAMA5D3_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 83#define SAMA5D3_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 15afb5d9271f..9986542e8060 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -39,6 +39,8 @@
39#include "at91_rstc.h" 39#include "at91_rstc.h"
40#include "at91_shdwc.h" 40#include "at91_shdwc.h"
41 41
42static void (*at91_pm_standby)(void);
43
42static void __init show_reset_status(void) 44static void __init show_reset_status(void)
43{ 45{
44 static char reset[] __initdata = "reset"; 46 static char reset[] __initdata = "reset";
@@ -266,14 +268,8 @@ static int at91_pm_enter(suspend_state_t state)
266 * For ARM 926 based chips, this requirement is weaker 268 * For ARM 926 based chips, this requirement is weaker
267 * as at91sam9 can access a RAM in self-refresh mode. 269 * as at91sam9 can access a RAM in self-refresh mode.
268 */ 270 */
269 if (cpu_is_at91rm9200()) 271 if (at91_pm_standby)
270 at91rm9200_standby(); 272 at91_pm_standby();
271 else if (cpu_is_at91sam9g45())
272 at91sam9g45_standby();
273 else if (cpu_is_at91sam9263())
274 at91sam9263_standby();
275 else
276 at91sam9_standby();
277 break; 273 break;
278 274
279 case PM_SUSPEND_ON: 275 case PM_SUSPEND_ON:
@@ -314,6 +310,18 @@ static const struct platform_suspend_ops at91_pm_ops = {
314 .end = at91_pm_end, 310 .end = at91_pm_end,
315}; 311};
316 312
313static struct platform_device at91_cpuidle_device = {
314 .name = "cpuidle-at91",
315};
316
317void at91_pm_set_standby(void (*at91_standby)(void))
318{
319 if (at91_standby) {
320 at91_cpuidle_device.dev.platform_data = at91_standby;
321 at91_pm_standby = at91_standby;
322 }
323}
324
317static int __init at91_pm_init(void) 325static int __init at91_pm_init(void)
318{ 326{
319#ifdef CONFIG_AT91_SLOW_CLOCK 327#ifdef CONFIG_AT91_SLOW_CLOCK
@@ -325,6 +333,9 @@ static int __init at91_pm_init(void)
325 /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */ 333 /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */
326 if (cpu_is_at91rm9200()) 334 if (cpu_is_at91rm9200())
327 at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 335 at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
336
337 if (at91_cpuidle_device.dev.platform_data)
338 platform_device_register(&at91_cpuidle_device);
328 339
329 suspend_set_ops(&at91_pm_ops); 340 suspend_set_ops(&at91_pm_ops);
330 341
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 2f5908f0b8c5..3ed190ce062b 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -11,9 +11,13 @@
11#ifndef __ARCH_ARM_MACH_AT91_PM 11#ifndef __ARCH_ARM_MACH_AT91_PM
12#define __ARCH_ARM_MACH_AT91_PM 12#define __ARCH_ARM_MACH_AT91_PM
13 13
14#include <asm/proc-fns.h>
15
14#include <mach/at91_ramc.h> 16#include <mach/at91_ramc.h>
15#include <mach/at91rm9200_sdramc.h> 17#include <mach/at91rm9200_sdramc.h>
16 18
19extern void at91_pm_set_standby(void (*at91_standby)(void));
20
17/* 21/*
18 * The AT91RM9200 goes into self-refresh mode with this command, and will 22 * The AT91RM9200 goes into self-refresh mode with this command, and will
19 * terminate self-refresh automatically on the next SDRAM access. 23 * terminate self-refresh automatically on the next SDRAM access.
@@ -45,16 +49,18 @@ static inline void at91rm9200_standby(void)
45/* We manage both DDRAM/SDRAM controllers, we need more than one value to 49/* We manage both DDRAM/SDRAM controllers, we need more than one value to
46 * remember. 50 * remember.
47 */ 51 */
48static inline void at91sam9g45_standby(void) 52static inline void at91_ddr_standby(void)
49{ 53{
50 /* Those two values allow us to delay self-refresh activation 54 /* Those two values allow us to delay self-refresh activation
51 * to the maximum. */ 55 * to the maximum. */
52 u32 lpr0, lpr1; 56 u32 lpr0, lpr1 = 0;
53 u32 saved_lpr0, saved_lpr1; 57 u32 saved_lpr0, saved_lpr1 = 0;
54 58
55 saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); 59 if (at91_ramc_base[1]) {
56 lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; 60 saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR);
57 lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; 61 lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB;
62 lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
63 }
58 64
59 saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); 65 saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR);
60 lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; 66 lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB;
@@ -62,25 +68,29 @@ static inline void at91sam9g45_standby(void)
62 68
63 /* self-refresh mode now */ 69 /* self-refresh mode now */
64 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); 70 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
65 at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); 71 if (at91_ramc_base[1])
72 at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1);
66 73
67 cpu_do_idle(); 74 cpu_do_idle();
68 75
69 at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); 76 at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0);
70 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); 77 if (at91_ramc_base[1])
78 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
71} 79}
72 80
73/* We manage both DDRAM/SDRAM controllers, we need more than one value to 81/* We manage both DDRAM/SDRAM controllers, we need more than one value to
74 * remember. 82 * remember.
75 */ 83 */
76static inline void at91sam9263_standby(void) 84static inline void at91sam9_sdram_standby(void)
77{ 85{
78 u32 lpr0, lpr1; 86 u32 lpr0, lpr1 = 0;
79 u32 saved_lpr0, saved_lpr1; 87 u32 saved_lpr0, saved_lpr1 = 0;
80 88
81 saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR); 89 if (at91_ramc_base[1]) {
82 lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB; 90 saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR);
83 lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH; 91 lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB;
92 lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH;
93 }
84 94
85 saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR); 95 saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR);
86 lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB; 96 lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB;
@@ -88,27 +98,14 @@ static inline void at91sam9263_standby(void)
88 98
89 /* self-refresh mode now */ 99 /* self-refresh mode now */
90 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0); 100 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0);
91 at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1); 101 if (at91_ramc_base[1])
102 at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1);
92 103
93 cpu_do_idle(); 104 cpu_do_idle();
94 105
95 at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0); 106 at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0);
96 at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); 107 if (at91_ramc_base[1])
97} 108 at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1);
98
99static inline void at91sam9_standby(void)
100{
101 u32 saved_lpr, lpr;
102
103 saved_lpr = at91_ramc_read(0, AT91_SDRAMC_LPR);
104
105 lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
106 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr |
107 AT91_SDRAMC_LPCB_SELF_REFRESH);
108
109 cpu_do_idle();
110
111 at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr);
112} 109}
113 110
114#endif 111#endif
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 401279715ab1..3ea86428ee09 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -371,7 +371,13 @@ static void __init sama5d3_map_io(void)
371 at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE); 371 at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
372} 372}
373 373
374static void __init sama5d3_initialize(void)
375{
376 at91_sysirq_mask_rtc(SAMA5D3_BASE_RTC);
377}
378
374AT91_SOC_START(sama5d3) 379AT91_SOC_START(sama5d3)
375 .map_io = sama5d3_map_io, 380 .map_io = sama5d3_map_io,
376 .register_clocks = sama5d3_register_clocks, 381 .register_clocks = sama5d3_register_clocks,
382 .init = sama5d3_initialize,
377AT91_SOC_END 383AT91_SOC_END
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index b17fbcf4d9e8..094b3459c288 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -23,6 +23,7 @@
23#include "at91_shdwc.h" 23#include "at91_shdwc.h"
24#include "soc.h" 24#include "soc.h"
25#include "generic.h" 25#include "generic.h"
26#include "pm.h"
26 27
27struct at91_init_soc __initdata at91_boot_soc; 28struct at91_init_soc __initdata at91_boot_soc;
28 29
@@ -376,15 +377,16 @@ static void at91_dt_rstc(void)
376} 377}
377 378
378static struct of_device_id ramc_ids[] = { 379static struct of_device_id ramc_ids[] = {
379 { .compatible = "atmel,at91rm9200-sdramc" }, 380 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
380 { .compatible = "atmel,at91sam9260-sdramc" }, 381 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
381 { .compatible = "atmel,at91sam9g45-ddramc" }, 382 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
382 { /*sentinel*/ } 383 { /*sentinel*/ }
383}; 384};
384 385
385static void at91_dt_ramc(void) 386static void at91_dt_ramc(void)
386{ 387{
387 struct device_node *np; 388 struct device_node *np;
389 const struct of_device_id *of_id;
388 390
389 np = of_find_matching_node(NULL, ramc_ids); 391 np = of_find_matching_node(NULL, ramc_ids);
390 if (!np) 392 if (!np)
@@ -396,6 +398,12 @@ static void at91_dt_ramc(void)
396 /* the controller may have 2 banks */ 398 /* the controller may have 2 banks */
397 at91_ramc_base[1] = of_iomap(np, 1); 399 at91_ramc_base[1] = of_iomap(np, 1);
398 400
401 of_id = of_match_node(ramc_ids, np);
402 if (!of_id)
403 pr_warn("AT91: ramc no standby function available\n");
404 else
405 at91_pm_set_standby(of_id->data);
406
399 of_node_put(np); 407 of_node_put(np);
400} 408}
401 409
diff --git a/arch/arm/mach-at91/sysirq_mask.c b/arch/arm/mach-at91/sysirq_mask.c
new file mode 100644
index 000000000000..2ba694f9626b
--- /dev/null
+++ b/arch/arm/mach-at91/sysirq_mask.c
@@ -0,0 +1,71 @@
1/*
2 * sysirq_mask.c - System-interrupt masking
3 *
4 * Copyright (C) 2013 Johan Hovold <jhovold@gmail.com>
5 *
6 * Functions to disable system interrupts from backup-powered peripherals.
7 *
8 * The RTC and RTT-peripherals are generally powered by backup power (VDDBU)
9 * and are not reset on wake-up, user, watchdog or software reset. This means
10 * that their interrupts may be enabled during early boot (e.g. after a user
11 * reset).
12 *
13 * As the RTC and RTT share the system-interrupt line with the PIT, an
14 * interrupt occurring before a handler has been installed would lead to the
15 * system interrupt being disabled and prevent the system from booting.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 */
22
23#include <linux/io.h>
24#include <mach/at91_rtt.h>
25
26#include "generic.h"
27
28#define AT91_RTC_IDR 0x24 /* Interrupt Disable Register */
29#define AT91_RTC_IMR 0x28 /* Interrupt Mask Register */
30
31void __init at91_sysirq_mask_rtc(u32 rtc_base)
32{
33 void __iomem *base;
34 u32 mask;
35
36 base = ioremap(rtc_base, 64);
37 if (!base)
38 return;
39
40 mask = readl_relaxed(base + AT91_RTC_IMR);
41 if (mask) {
42 pr_info("AT91: Disabling rtc irq\n");
43 writel_relaxed(mask, base + AT91_RTC_IDR);
44 (void)readl_relaxed(base + AT91_RTC_IMR); /* flush */
45 }
46
47 iounmap(base);
48}
49
50void __init at91_sysirq_mask_rtt(u32 rtt_base)
51{
52 void __iomem *base;
53 void __iomem *reg;
54 u32 mode;
55
56 base = ioremap(rtt_base, 16);
57 if (!base)
58 return;
59
60 reg = base + AT91_RTT_MR;
61
62 mode = readl_relaxed(reg);
63 if (mode & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)) {
64 pr_info("AT91: Disabling rtt irq\n");
65 mode &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
66 writel_relaxed(mode, reg);
67 (void)readl_relaxed(reg); /* flush */
68 }
69
70 iounmap(base);
71}