8 #include <linux/module.h>
14 #include <asm/system_misc.h>
17 #include <mach/hardware.h>
38 pr_info(
"AT91: filled in soc subtype: %s\n",
62 pr_emerg(
"Wrong RAM controller id (%d), cannot continue\n",
id);
67 panic(
"Impossible to ioremap ramc.%d 0x%x\n",
id, addr);
78 desc->
virtual -= sram_desc[bank - 1].length;
84 pr_info(
"AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n",
97 static void __init soc_detect(
u32 dbgu_base)
165 if (!at91_soc_is_detected())
208 static const char *soc_name[] = {
224 return soc_name[c->
type];
228 static const char *soc_subtype_name[] = {
246 return soc_subtype_name[c->
subtype];
259 if (!at91_soc_is_detected())
262 if (!at91_soc_is_detected())
263 panic(
"AT91: Impossible to detect the SOC type");
265 pr_info(
"AT91: Detected soc type: %s\n",
267 pr_info(
"AT91: Detected soc subtype: %s\n",
270 if (!at91_soc_is_enabled())
271 panic(
"AT91: Soc not enabled");
279 static void at91sam9_poweroff(
void)
286 at91_shdwc_base =
ioremap(base_addr, 16);
287 if (!at91_shdwc_base)
288 panic(
"Impossible to ioremap at91_shdwc_base\n");
296 at91_rstc_base =
ioremap(base_addr, 16);
298 panic(
"Impossible to ioremap at91_rstc_base\n");
306 at91_matrix_base =
ioremap(base_addr, 512);
307 if (!at91_matrix_base)
308 panic(
"Impossible to ioremap at91_matrix_base\n");
311 #if defined(CONFIG_OF)
318 static void at91_dt_rstc(
void)
325 panic(
"unable to find compatible rstc node in dtb\n");
329 panic(
"unable to map rstc cpu registers\n");
333 panic(
"AT91: rtsc no restart function availlable\n");
342 { .compatible =
"atmel,at91sam9g45-ddramc" },
346 static void at91_dt_ramc(
void)
352 panic(
"unable to find compatible ram conroller node in dtb\n");
356 panic(
"unable to map ramc[0] cpu registers\n");
365 { .compatible =
"atmel,at91sam9rl-shdwc", },
366 { .compatible =
"atmel,at91sam9x5-shdwc", },
370 static const char *shdwc_wakeup_modes[] = {
377 const int at91_dtget_shdwc_wakeup_mode(
struct device_node *np)
386 for (i = 0; i <
ARRAY_SIZE(shdwc_wakeup_modes); i++)
393 static void at91_dt_shdwc(
void)
402 pr_debug(
"AT91: unable to find compatible shutdown (shdwc) conroller node in dtb\n");
407 if (!at91_shdwc_base)
408 panic(
"AT91: unable to map shdwc cpu registers\n");
410 wakeup_mode = at91_dtget_shdwc_wakeup_mode(np);
411 if (wakeup_mode < 0) {
412 pr_warn(
"AT91: shdwc unknown wakeup mode\n");
416 if (!of_property_read_u32(np,
"atmel,wakeup-counter", ®)) {
418 pr_warn(
"AT91: shdwc wakeup conter 0x%x > 0x%x reduce it to 0x%x\n",
425 if (of_property_read_bool(np,
"atmel,wakeup-rtc-timer"))
428 if (of_property_read_bool(np,
"atmel,wakeup-rtt-timer"))
446 at91_dt_clock_init();