diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2010-10-14 13:14:00 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2010-10-26 05:32:48 -0400 |
commit | bb413db591d53c29292868577068fa822b84da82 (patch) | |
tree | 4a60e1015dd56ec54f00a809a9f3fffa99fa38a2 /arch | |
parent | 1345562b449e95e2098cc60eb0eed6d2415cd0b0 (diff) |
AT91: reset: extend alternate reset procedure to several chips
Several at91sam9 chips need the alternate reset procedure to be sure to halt
SDRAM smoothly before resetting the chip.
This is an extension of previous patch "Fix AT91SAM9G20 reset" to all chips
affected.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91/Makefile | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/generic.h | 3 |
6 files changed, 12 insertions, 35 deletions
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index c94485227b09..821eb842795f 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -11,11 +11,11 @@ obj-$(CONFIG_AT91_PMC_UNIT) += clock.o | |||
11 | 11 | ||
12 | # CPU-specific support | 12 | # CPU-specific support |
13 | obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o | 13 | obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o |
14 | obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o | 14 | obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o |
15 | obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o | 15 | obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o at91sam9_alt_reset.o |
16 | obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o | 16 | obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o at91sam9_alt_reset.o |
17 | obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o | 17 | obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o at91sam9_alt_reset.o |
18 | obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o | 18 | obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o at91sam9_alt_reset.o |
19 | obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o | 19 | obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o |
20 | obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o | 20 | obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o |
21 | obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o | 21 | obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index dfd3529cd101..195208b30024 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -25,8 +25,6 @@ | |||
25 | #include "generic.h" | 25 | #include "generic.h" |
26 | #include "clock.h" | 26 | #include "clock.h" |
27 | 27 | ||
28 | extern void at91sam9_alt_reset(void); | ||
29 | |||
30 | static struct map_desc at91sam9260_io_desc[] __initdata = { | 28 | static struct map_desc at91sam9260_io_desc[] __initdata = { |
31 | { | 29 | { |
32 | .virtual = AT91_VA_BASE_SYS, | 30 | .virtual = AT91_VA_BASE_SYS, |
@@ -281,11 +279,6 @@ static struct at91_gpio_bank at91sam9260_gpio[] = { | |||
281 | } | 279 | } |
282 | }; | 280 | }; |
283 | 281 | ||
284 | static void at91sam9260_reset(void) | ||
285 | { | ||
286 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | ||
287 | } | ||
288 | |||
289 | static void at91sam9260_poweroff(void) | 282 | static void at91sam9260_poweroff(void) |
290 | { | 283 | { |
291 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | 284 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); |
@@ -329,11 +322,7 @@ void __init at91sam9260_initialize(unsigned long main_clock) | |||
329 | else | 322 | else |
330 | iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); | 323 | iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); |
331 | 324 | ||
332 | if (cpu_is_at91sam9g20()) | 325 | at91_arch_reset = at91sam9_alt_reset; |
333 | at91_arch_reset = at91sam9_alt_reset; | ||
334 | else | ||
335 | at91_arch_reset = at91sam9260_reset; | ||
336 | |||
337 | pm_power_off = at91sam9260_poweroff; | 326 | pm_power_off = at91sam9260_poweroff; |
338 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) | 327 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) |
339 | | (1 << AT91SAM9260_ID_IRQ2); | 328 | | (1 << AT91SAM9260_ID_IRQ2); |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 4ecf37996c77..fcad88668504 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -257,11 +257,6 @@ static struct at91_gpio_bank at91sam9261_gpio[] = { | |||
257 | } | 257 | } |
258 | }; | 258 | }; |
259 | 259 | ||
260 | static void at91sam9261_reset(void) | ||
261 | { | ||
262 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | ||
263 | } | ||
264 | |||
265 | static void at91sam9261_poweroff(void) | 260 | static void at91sam9261_poweroff(void) |
266 | { | 261 | { |
267 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | 262 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); |
@@ -283,7 +278,7 @@ void __init at91sam9261_initialize(unsigned long main_clock) | |||
283 | iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc)); | 278 | iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc)); |
284 | 279 | ||
285 | 280 | ||
286 | at91_arch_reset = at91sam9261_reset; | 281 | at91_arch_reset = at91sam9_alt_reset; |
287 | pm_power_off = at91sam9261_poweroff; | 282 | pm_power_off = at91sam9261_poweroff; |
288 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) | 283 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) |
289 | | (1 << AT91SAM9261_ID_IRQ2); | 284 | | (1 << AT91SAM9261_ID_IRQ2); |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 942792d630d8..249f900954d8 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -269,11 +269,6 @@ static struct at91_gpio_bank at91sam9263_gpio[] = { | |||
269 | } | 269 | } |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static void at91sam9263_reset(void) | ||
273 | { | ||
274 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | ||
275 | } | ||
276 | |||
277 | static void at91sam9263_poweroff(void) | 272 | static void at91sam9263_poweroff(void) |
278 | { | 273 | { |
279 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | 274 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); |
@@ -289,7 +284,7 @@ void __init at91sam9263_initialize(unsigned long main_clock) | |||
289 | /* Map peripherals */ | 284 | /* Map peripherals */ |
290 | iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); | 285 | iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); |
291 | 286 | ||
292 | at91_arch_reset = at91sam9263_reset; | 287 | at91_arch_reset = at91sam9_alt_reset; |
293 | pm_power_off = at91sam9263_poweroff; | 288 | pm_power_off = at91sam9263_poweroff; |
294 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); | 289 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); |
295 | 290 | ||
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index 211c5c14a1e6..6a9d24e5ed8e 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -242,11 +242,6 @@ static struct at91_gpio_bank at91sam9rl_gpio[] = { | |||
242 | } | 242 | } |
243 | }; | 243 | }; |
244 | 244 | ||
245 | static void at91sam9rl_reset(void) | ||
246 | { | ||
247 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | ||
248 | } | ||
249 | |||
250 | static void at91sam9rl_poweroff(void) | 245 | static void at91sam9rl_poweroff(void) |
251 | { | 246 | { |
252 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | 247 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); |
@@ -281,7 +276,7 @@ void __init at91sam9rl_initialize(unsigned long main_clock) | |||
281 | /* Map SRAM */ | 276 | /* Map SRAM */ |
282 | iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); | 277 | iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); |
283 | 278 | ||
284 | at91_arch_reset = at91sam9rl_reset; | 279 | at91_arch_reset = at91sam9_alt_reset; |
285 | pm_power_off = at91sam9rl_poweroff; | 280 | pm_power_off = at91sam9rl_poweroff; |
286 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); | 281 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); |
287 | 282 | ||
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index 65c3dc5ba0d0..0c66deb2db39 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h | |||
@@ -46,6 +46,9 @@ extern void __init at91_clock_associate(const char *id, struct device *dev, cons | |||
46 | extern void at91_irq_suspend(void); | 46 | extern void at91_irq_suspend(void); |
47 | extern void at91_irq_resume(void); | 47 | extern void at91_irq_resume(void); |
48 | 48 | ||
49 | /* reset */ | ||
50 | extern void at91sam9_alt_reset(void); | ||
51 | |||
49 | /* GPIO */ | 52 | /* GPIO */ |
50 | #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ | 53 | #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ |
51 | #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ | 54 | #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ |