diff options
Diffstat (limited to 'arch/arm/mach-at91/setup.c')
-rw-r--r-- | arch/arm/mach-at91/setup.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index cf98a8f94dc5..8bdcc3cb6012 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/pm.h> | ||
11 | 12 | ||
12 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
13 | 14 | ||
@@ -15,6 +16,7 @@ | |||
15 | #include <mach/cpu.h> | 16 | #include <mach/cpu.h> |
16 | #include <mach/at91_dbgu.h> | 17 | #include <mach/at91_dbgu.h> |
17 | #include <mach/at91_pmc.h> | 18 | #include <mach/at91_pmc.h> |
19 | #include <mach/at91_shdwc.h> | ||
18 | 20 | ||
19 | #include "soc.h" | 21 | #include "soc.h" |
20 | #include "generic.h" | 22 | #include "generic.h" |
@@ -73,9 +75,6 @@ static struct map_desc at91_io_desc __initdata = { | |||
73 | .type = MT_DEVICE, | 75 | .type = MT_DEVICE, |
74 | }; | 76 | }; |
75 | 77 | ||
76 | #define AT91_DBGU0 0xfffff200 | ||
77 | #define AT91_DBGU1 0xffffee00 | ||
78 | |||
79 | static void __init soc_detect(u32 dbgu_base) | 78 | static void __init soc_detect(u32 dbgu_base) |
80 | { | 79 | { |
81 | u32 cidr, socid; | 80 | u32 cidr, socid; |
@@ -248,9 +247,9 @@ void __init at91_map_io(void) | |||
248 | at91_soc_initdata.type = AT91_SOC_NONE; | 247 | at91_soc_initdata.type = AT91_SOC_NONE; |
249 | at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; | 248 | at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; |
250 | 249 | ||
251 | soc_detect(AT91_DBGU0); | 250 | soc_detect(AT91_BASE_DBGU0); |
252 | if (!at91_soc_is_detected()) | 251 | if (!at91_soc_is_detected()) |
253 | soc_detect(AT91_DBGU1); | 252 | soc_detect(AT91_BASE_DBGU1); |
254 | 253 | ||
255 | if (!at91_soc_is_detected()) | 254 | if (!at91_soc_is_detected()) |
256 | panic("AT91: Impossible to detect the SOC type"); | 255 | panic("AT91: Impossible to detect the SOC type"); |
@@ -267,8 +266,25 @@ void __init at91_map_io(void) | |||
267 | at91_boot_soc.map_io(); | 266 | at91_boot_soc.map_io(); |
268 | } | 267 | } |
269 | 268 | ||
269 | void __iomem *at91_shdwc_base = NULL; | ||
270 | |||
271 | static void at91sam9_poweroff(void) | ||
272 | { | ||
273 | at91_shdwc_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
274 | } | ||
275 | |||
276 | void __init at91_ioremap_shdwc(u32 base_addr) | ||
277 | { | ||
278 | at91_shdwc_base = ioremap(base_addr, 16); | ||
279 | if (!at91_shdwc_base) | ||
280 | panic("Impossible to ioremap at91_shdwc_base\n"); | ||
281 | pm_power_off = at91sam9_poweroff; | ||
282 | } | ||
283 | |||
270 | void __init at91_initialize(unsigned long main_clock) | 284 | void __init at91_initialize(unsigned long main_clock) |
271 | { | 285 | { |
286 | at91_boot_soc.ioremap_registers(); | ||
287 | |||
272 | /* Init clock subsystem */ | 288 | /* Init clock subsystem */ |
273 | at91_clock_init(main_clock); | 289 | at91_clock_init(main_clock); |
274 | 290 | ||