diff options
author | Jiri Kosina <jkosina@suse.cz> | 2013-12-19 09:08:03 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-12-19 09:08:32 -0500 |
commit | e23c34bb41da65f354fb7eee04300c56ee48f60c (patch) | |
tree | 549fbe449d55273b81ef104a9755109bf4ae7817 /arch/arm/mach-at91 | |
parent | b481c2cb3534c85dca625973b33eba15f9af3e4c (diff) | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply fixes on top of newer things
in tree (efi-stub).
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/arm/mach-at91')
41 files changed, 304 insertions, 179 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 | ||
5 | obj-y := irq.o gpio.o setup.o | 5 | obj-y := irq.o gpio.o setup.o sysirq_mask.o |
6 | obj-m := | 6 | obj-m := |
7 | obj-n := | 7 | obj-n := |
8 | obj- := | 8 | obj- := |
@@ -98,7 +98,6 @@ obj-y += leds.o | |||
98 | # Power Management | 98 | # Power Management |
99 | obj-$(CONFIG_PM) += pm.o | 99 | obj-$(CONFIG_PM) += pm.o |
100 | obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o | 100 | obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o |
101 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | ||
102 | 101 | ||
103 | ifeq ($(CONFIG_PM_DEBUG),y) | 102 | ifeq ($(CONFIG_PM_DEBUG),y) |
104 | CFLAGS_pm.o += -DDEBUG | 103 | CFLAGS_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 | ||
332 | static void __init at91rm9200_initialize(void) | 334 | static 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..bc7b363a3083 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 | ||
94 | static struct irqaction at91rm9200_timer_irq = { | 94 | static 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 | }; |
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) | |||
174 | static struct clock_event_device clkevt = { | 174 | static struct clock_event_device clkevt = { |
175 | .name = "at91_tick", | 175 | .name = "at91_tick", |
176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
177 | .shift = 32, | ||
178 | .rating = 150, | 177 | .rating = 150, |
179 | .set_next_event = clkevt32k_next_event, | 178 | .set_next_event = clkevt32k_next_event, |
180 | .set_mode = clkevt32k_mode, | 179 | .set_mode = clkevt32k_mode, |
@@ -265,11 +264,9 @@ void __init at91rm9200_timer_init(void) | |||
265 | at91_st_write(AT91_ST_RTMR, 1); | 264 | at91_st_write(AT91_ST_RTMR, 1); |
266 | 265 | ||
267 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ | 266 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ |
268 | clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift); | ||
269 | clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt); | ||
270 | clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1; | ||
271 | clkevt.cpumask = cpumask_of(0); | 267 | clkevt.cpumask = cpumask_of(0); |
272 | clockevents_register_device(&clkevt); | 268 | clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK, |
269 | 2, AT91_ST_ALMV); | ||
273 | 270 | ||
274 | /* register clocksource */ | 271 | /* register clocksource */ |
275 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); | 272 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); |
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 | ||
347 | static void __init at91sam9260_initialize(void) | 349 | static 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 | ||
289 | static void __init at91sam9261_initialize(void) | 291 | static 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) |
467 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); | 467 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
468 | static struct atmel_lcdfb_info lcdc_data; | 468 | static struct atmel_lcdfb_pdata lcdc_data; |
469 | 469 | ||
470 | static struct resource lcdc_resources[] = { | 470 | static 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 | ||
501 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | 501 | void __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 |
562 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | 562 | void __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 | ||
326 | static void __init at91sam9263_initialize(void) | 328 | static 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) |
834 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); | 834 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
835 | static struct atmel_lcdfb_info lcdc_data; | 835 | static struct atmel_lcdfb_pdata lcdc_data; |
836 | 836 | ||
837 | static struct resource lcdc_resources[] = { | 837 | static 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 | ||
862 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | 862 | void __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 |
894 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | 894 | void __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 | ||
172 | static struct irqaction at91sam926x_pit_irq = { | 172 | static 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 | ||
375 | static void __init at91sam9g45_initialize(void) | 377 | static 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) |
967 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); | 967 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
968 | static struct atmel_lcdfb_info lcdc_data; | 968 | static struct atmel_lcdfb_pdata lcdc_data; |
969 | 969 | ||
970 | static struct resource lcdc_resources[] = { | 970 | static 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 | ||
994 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | 994 | void __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 |
1040 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | 1040 | void __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 | ||
21 | at91sam9g45_restart: | 25 | at91sam9g45_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 | ||
227 | static void __init at91sam9n12_initialize(void) | ||
228 | { | ||
229 | at91_sysirq_mask_rtc(AT91SAM9N12_BASE_RTC); | ||
230 | } | ||
231 | |||
226 | AT91_SOC_START(at91sam9n12) | 232 | AT91_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, | ||
229 | AT91_SOC_END | 236 | AT91_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 | ||
292 | static void __init at91sam9rl_initialize(void) | 294 | static 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) |
500 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); | 500 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
501 | static struct atmel_lcdfb_info lcdc_data; | 501 | static struct atmel_lcdfb_pdata lcdc_data; |
502 | 502 | ||
503 | static struct resource lcdc_resources[] = { | 503 | static 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 | ||
528 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | 528 | void __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 |
560 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | 560 | void __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 | ||
325 | static 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) | |||
329 | AT91_SOC_START(at91sam9x5) | 334 | AT91_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, | ||
332 | AT91_SOC_END | 338 | AT91_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 | ||
58 | static struct irqaction at91x40_timer_irq = { | 58 | static 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 | */ |
115 | static struct __initdata macb_platform_data cam60_macb_data = { | 115 | static 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 | ||
39 | static void __init at91rm9200_dt_device_init(void) | ||
40 | { | ||
41 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
42 | } | ||
43 | |||
44 | static const char *at91rm9200_dt_board_compat[] __initdata = { | 38 | static 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, |
57 | MACHINE_END | 50 | MACHINE_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 | ||
40 | static void __init at91_dt_device_init(void) | ||
41 | { | ||
42 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
43 | } | ||
44 | |||
45 | static const char *at91_dt_board_compat[] __initdata = { | 39 | static 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, |
59 | MACHINE_END | 52 | MACHINE_END |
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index ad95f6a23a28..bf00d15d954d 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c | |||
@@ -42,20 +42,15 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy) | |||
42 | { | 42 | { |
43 | int value; | 43 | int value; |
44 | 44 | ||
45 | #define GMII_RCCPSR 260 | ||
46 | #define GMII_RRDPSR 261 | ||
47 | #define GMII_ERCR 11 | ||
48 | #define GMII_ERDWR 12 | ||
49 | |||
50 | /* Set delay values */ | 45 | /* Set delay values */ |
51 | value = GMII_RCCPSR | 0x8000; | 46 | value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW | 0x8000; |
52 | phy_write(phy, GMII_ERCR, value); | 47 | phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value); |
53 | value = 0xF2F4; | 48 | value = 0xF2F4; |
54 | phy_write(phy, GMII_ERDWR, value); | 49 | phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value); |
55 | value = GMII_RRDPSR | 0x8000; | 50 | value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW | 0x8000; |
56 | phy_write(phy, GMII_ERCR, value); | 51 | phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value); |
57 | value = 0x2222; | 52 | value = 0x2222; |
58 | phy_write(phy, GMII_ERDWR, value); | 53 | phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value); |
59 | 54 | ||
60 | return 0; | 55 | return 0; |
61 | } | 56 | } |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index 0b153c87521d..f4f8735315da 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/spi/at73c213.h> | 29 | #include <linux/spi/at73c213.h> |
30 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
31 | #include <linux/i2c/at24.h> | 31 | #include <linux/platform_data/at24.h> |
32 | #include <linux/gpio_keys.h> | 32 | #include <linux/gpio_keys.h> |
33 | #include <linux/input.h> | 33 | #include <linux/input.h> |
34 | 34 | ||
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 | ||
392 | static void at91_lcdc_stn_power_control(int on) | 392 | static 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 | ||
404 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 404 | static 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 | ||
448 | static void at91_lcdc_tft_power_control(int on) | 448 | static 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 | ||
456 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 456 | static 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 |
468 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; | 468 | static 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 3284df05df14..2f931915c80c 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/spi/ads7846.h> | 29 | #include <linux/spi/ads7846.h> |
30 | #include <linux/i2c/at24.h> | 30 | #include <linux/platform_data/at24.h> |
31 | #include <linux/fb.h> | 31 | #include <linux/fb.h> |
32 | #include <linux/gpio_keys.h> | 32 | #include <linux/gpio_keys.h> |
33 | #include <linux/input.h> | 33 | #include <linux/input.h> |
@@ -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 | ||
278 | static void at91_lcdc_power_control(int on) | 278 | static 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 */ |
284 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 284 | static 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 |
295 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; | 295 | static 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 */ |
287 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 287 | static 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 |
298 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; | 298 | static 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 | ||
173 | static void at91_lcdc_power_control(int on) | 173 | static 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 */ |
182 | static struct atmel_lcdfb_info __initdata ek_lcdc_data = { | 182 | static 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 |
194 | static struct atmel_lcdfb_info __initdata ek_lcdc_data; | 194 | static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | 197 | ||
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c index 3aaa9784cf0e..f1d49e929ccb 100644 --- a/arch/arm/mach-at91/board-snapper9260.c +++ b/arch/arm/mach-at91/board-snapper9260.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/i2c/pca953x.h> | 29 | #include <linux/platform_data/pca953x.h> |
30 | 30 | ||
31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
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); | |||
107 | extern void __init at91_add_device_ssc(unsigned id, unsigned pins); | 107 | extern void __init at91_add_device_ssc(unsigned id, unsigned pins); |
108 | 108 | ||
109 | /* LCD Controller */ | 109 | /* LCD Controller */ |
110 | struct atmel_lcdfb_info; | 110 | struct atmel_lcdfb_pdata; |
111 | extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data); | 111 | extern void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data); |
112 | 112 | ||
113 | /* AC97 */ | 113 | /* AC97 */ |
114 | extern void __init at91_add_device_ac97(struct ac97c_platform_data *data); | 114 | extern 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 */ | ||
31 | static 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 | |||
47 | static 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 */ | ||
63 | static int __init at91_init_cpuidle(void) | ||
64 | { | ||
65 | return cpuidle_register(&at91_idle_driver, NULL); | ||
66 | } | ||
67 | |||
68 | device_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); |
35 | extern int __init at91_aic5_of_init(struct device_node *node, | 35 | extern int __init at91_aic5_of_init(struct device_node *node, |
36 | struct device_node *parent); | 36 | struct device_node *parent); |
37 | extern void __init at91_sysirq_mask_rtc(u32 rtc_base); | ||
38 | extern 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/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index a832e0707611..f17aa3150019 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <mach/at91sam9g45.h> | 33 | #include <mach/at91sam9g45.h> |
34 | #include <mach/at91sam9x5.h> | 34 | #include <mach/at91sam9x5.h> |
35 | #include <mach/at91sam9n12.h> | 35 | #include <mach/at91sam9n12.h> |
36 | #include <mach/sama5d3.h> | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * On all at91 except rm9200 and x40 have the System Controller starts | 39 | * On all at91 except rm9200 and x40 have the System Controller starts |
diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h index 6dc81ee38048..25613d8c6dcd 100644 --- a/arch/arm/mach-at91/include/mach/sama5d3.h +++ b/arch/arm/mach-at91/include/mach/sama5d3.h | |||
@@ -65,6 +65,19 @@ | |||
65 | #define SAMA5D3_ID_IRQ0 47 /* Advanced Interrupt Controller (IRQ0) */ | 65 | #define SAMA5D3_ID_IRQ0 47 /* Advanced Interrupt Controller (IRQ0) */ |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * User Peripheral physical base addresses. | ||
69 | */ | ||
70 | #define SAMA5D3_BASE_USART0 0xf001c000 | ||
71 | #define SAMA5D3_BASE_USART1 0xf0020000 | ||
72 | #define SAMA5D3_BASE_USART2 0xf8020000 | ||
73 | #define SAMA5D3_BASE_USART3 0xf8024000 | ||
74 | |||
75 | /* | ||
76 | * System Peripherals | ||
77 | */ | ||
78 | #define SAMA5D3_BASE_RTC 0xfffffeb0 | ||
79 | |||
80 | /* | ||
68 | * Internal Memory | 81 | * Internal Memory |
69 | */ | 82 | */ |
70 | #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/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h index 5659f7c72120..4bb644f8e87c 100644 --- a/arch/arm/mach-at91/include/mach/uncompress.h +++ b/arch/arm/mach-at91/include/mach/uncompress.h | |||
@@ -94,6 +94,15 @@ static const u32 uarts_sam9x5[] = { | |||
94 | 0, | 94 | 0, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static const u32 uarts_sama5[] = { | ||
98 | AT91_BASE_DBGU1, | ||
99 | SAMA5D3_BASE_USART0, | ||
100 | SAMA5D3_BASE_USART1, | ||
101 | SAMA5D3_BASE_USART2, | ||
102 | SAMA5D3_BASE_USART3, | ||
103 | 0, | ||
104 | }; | ||
105 | |||
97 | static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) | 106 | static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) |
98 | { | 107 | { |
99 | u32 cidr, socid; | 108 | u32 cidr, socid; |
@@ -121,8 +130,12 @@ static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) | |||
121 | case ARCH_ID_AT91SAM9RL64: | 130 | case ARCH_ID_AT91SAM9RL64: |
122 | return uarts_sam9rl; | 131 | return uarts_sam9rl; |
123 | 132 | ||
133 | case ARCH_ID_AT91SAM9N12: | ||
124 | case ARCH_ID_AT91SAM9X5: | 134 | case ARCH_ID_AT91SAM9X5: |
125 | return uarts_sam9x5; | 135 | return uarts_sam9x5; |
136 | |||
137 | case ARCH_ID_SAMA5D3: | ||
138 | return uarts_sama5; | ||
126 | } | 139 | } |
127 | 140 | ||
128 | /* at91sam9g10 */ | 141 | /* at91sam9g10 */ |
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 | ||
42 | static void (*at91_pm_standby)(void); | ||
43 | |||
42 | static void __init show_reset_status(void) | 44 | static 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 | ||
313 | static struct platform_device at91_cpuidle_device = { | ||
314 | .name = "cpuidle-at91", | ||
315 | }; | ||
316 | |||
317 | void 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 | |||
317 | static int __init at91_pm_init(void) | 325 | static 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..c5101dcb4fb0 100644 --- a/arch/arm/mach-at91/pm.h +++ b/arch/arm/mach-at91/pm.h | |||
@@ -11,9 +11,17 @@ | |||
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 | ||
19 | #ifdef CONFIG_PM | ||
20 | extern void at91_pm_set_standby(void (*at91_standby)(void)); | ||
21 | #else | ||
22 | static inline void at91_pm_set_standby(void (*at91_standby)(void)) { } | ||
23 | #endif | ||
24 | |||
17 | /* | 25 | /* |
18 | * The AT91RM9200 goes into self-refresh mode with this command, and will | 26 | * The AT91RM9200 goes into self-refresh mode with this command, and will |
19 | * terminate self-refresh automatically on the next SDRAM access. | 27 | * terminate self-refresh automatically on the next SDRAM access. |
@@ -45,16 +53,18 @@ static inline void at91rm9200_standby(void) | |||
45 | /* We manage both DDRAM/SDRAM controllers, we need more than one value to | 53 | /* We manage both DDRAM/SDRAM controllers, we need more than one value to |
46 | * remember. | 54 | * remember. |
47 | */ | 55 | */ |
48 | static inline void at91sam9g45_standby(void) | 56 | static inline void at91_ddr_standby(void) |
49 | { | 57 | { |
50 | /* Those two values allow us to delay self-refresh activation | 58 | /* Those two values allow us to delay self-refresh activation |
51 | * to the maximum. */ | 59 | * to the maximum. */ |
52 | u32 lpr0, lpr1; | 60 | u32 lpr0, lpr1 = 0; |
53 | u32 saved_lpr0, saved_lpr1; | 61 | u32 saved_lpr0, saved_lpr1 = 0; |
54 | 62 | ||
55 | saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); | 63 | if (at91_ramc_base[1]) { |
56 | lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; | 64 | saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); |
57 | lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; | 65 | lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; |
66 | lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; | ||
67 | } | ||
58 | 68 | ||
59 | saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); | 69 | saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); |
60 | lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; | 70 | lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; |
@@ -62,25 +72,29 @@ static inline void at91sam9g45_standby(void) | |||
62 | 72 | ||
63 | /* self-refresh mode now */ | 73 | /* self-refresh mode now */ |
64 | at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); | 74 | at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); |
65 | at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); | 75 | if (at91_ramc_base[1]) |
76 | at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); | ||
66 | 77 | ||
67 | cpu_do_idle(); | 78 | cpu_do_idle(); |
68 | 79 | ||
69 | at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); | 80 | at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); |
70 | at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); | 81 | if (at91_ramc_base[1]) |
82 | at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); | ||
71 | } | 83 | } |
72 | 84 | ||
73 | /* We manage both DDRAM/SDRAM controllers, we need more than one value to | 85 | /* We manage both DDRAM/SDRAM controllers, we need more than one value to |
74 | * remember. | 86 | * remember. |
75 | */ | 87 | */ |
76 | static inline void at91sam9263_standby(void) | 88 | static inline void at91sam9_sdram_standby(void) |
77 | { | 89 | { |
78 | u32 lpr0, lpr1; | 90 | u32 lpr0, lpr1 = 0; |
79 | u32 saved_lpr0, saved_lpr1; | 91 | u32 saved_lpr0, saved_lpr1 = 0; |
80 | 92 | ||
81 | saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR); | 93 | if (at91_ramc_base[1]) { |
82 | lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB; | 94 | saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR); |
83 | lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH; | 95 | lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB; |
96 | lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH; | ||
97 | } | ||
84 | 98 | ||
85 | saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR); | 99 | saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR); |
86 | lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB; | 100 | lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB; |
@@ -88,27 +102,14 @@ static inline void at91sam9263_standby(void) | |||
88 | 102 | ||
89 | /* self-refresh mode now */ | 103 | /* self-refresh mode now */ |
90 | at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0); | 104 | at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0); |
91 | at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1); | 105 | if (at91_ramc_base[1]) |
106 | at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1); | ||
92 | 107 | ||
93 | cpu_do_idle(); | 108 | cpu_do_idle(); |
94 | 109 | ||
95 | at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0); | 110 | at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0); |
96 | at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); | 111 | if (at91_ramc_base[1]) |
97 | } | 112 | at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); |
98 | |||
99 | static 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 | } | 113 | } |
113 | 114 | ||
114 | #endif | 115 | #endif |
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c index 401279715ab1..a28873fe3049 100644 --- a/arch/arm/mach-at91/sama5d3.c +++ b/arch/arm/mach-at91/sama5d3.c | |||
@@ -95,19 +95,19 @@ static struct clk twi0_clk = { | |||
95 | .name = "twi0_clk", | 95 | .name = "twi0_clk", |
96 | .pid = SAMA5D3_ID_TWI0, | 96 | .pid = SAMA5D3_ID_TWI0, |
97 | .type = CLK_TYPE_PERIPHERAL, | 97 | .type = CLK_TYPE_PERIPHERAL, |
98 | .div = AT91_PMC_PCR_DIV2, | 98 | .div = AT91_PMC_PCR_DIV8, |
99 | }; | 99 | }; |
100 | static struct clk twi1_clk = { | 100 | static struct clk twi1_clk = { |
101 | .name = "twi1_clk", | 101 | .name = "twi1_clk", |
102 | .pid = SAMA5D3_ID_TWI1, | 102 | .pid = SAMA5D3_ID_TWI1, |
103 | .type = CLK_TYPE_PERIPHERAL, | 103 | .type = CLK_TYPE_PERIPHERAL, |
104 | .div = AT91_PMC_PCR_DIV2, | 104 | .div = AT91_PMC_PCR_DIV8, |
105 | }; | 105 | }; |
106 | static struct clk twi2_clk = { | 106 | static struct clk twi2_clk = { |
107 | .name = "twi2_clk", | 107 | .name = "twi2_clk", |
108 | .pid = SAMA5D3_ID_TWI2, | 108 | .pid = SAMA5D3_ID_TWI2, |
109 | .type = CLK_TYPE_PERIPHERAL, | 109 | .type = CLK_TYPE_PERIPHERAL, |
110 | .div = AT91_PMC_PCR_DIV2, | 110 | .div = AT91_PMC_PCR_DIV8, |
111 | }; | 111 | }; |
112 | static struct clk mmc0_clk = { | 112 | static struct clk mmc0_clk = { |
113 | .name = "mci0_clk", | 113 | .name = "mci0_clk", |
@@ -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 | ||
374 | static void __init sama5d3_initialize(void) | ||
375 | { | ||
376 | at91_sysirq_mask_rtc(SAMA5D3_BASE_RTC); | ||
377 | } | ||
378 | |||
374 | AT91_SOC_START(sama5d3) | 379 | AT91_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, | ||
377 | AT91_SOC_END | 383 | AT91_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 | ||
27 | struct at91_init_soc __initdata at91_boot_soc; | 28 | struct at91_init_soc __initdata at91_boot_soc; |
28 | 29 | ||
@@ -376,15 +377,16 @@ static void at91_dt_rstc(void) | |||
376 | } | 377 | } |
377 | 378 | ||
378 | static struct of_device_id ramc_ids[] = { | 379 | static 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 | ||
385 | static void at91_dt_ramc(void) | 386 | static 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 | |||
31 | void __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 | |||
50 | void __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 | } | ||