ARM: at91: pm: initial PM support for SAM9X60
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 14 Feb 2019 15:54:41 +0000 (15:54 +0000)
committerLudovic Desroches <ludovic.desroches@microchip.com>
Thu, 28 Mar 2019 10:05:53 +0000 (11:05 +0100)
Add initial PM support for SAM9X60. This include idle, WFI and ULP0.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
arch/arm/mach-at91/at91sam9.c
arch/arm/mach-at91/generic.h
arch/arm/mach-at91/pm.c

index 3dbdef4d3cbf5a5f979046abcf6de8241365ae71..c12563b09656f266ae6bb3e40e0d238013231e23 100644 (file)
@@ -32,3 +32,21 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9")
        .init_machine   = at91sam9_init,
        .dt_compat      = at91_dt_board_compat,
 MACHINE_END
+
+static void __init sam9x60_init(void)
+{
+       of_platform_default_populate(NULL, NULL, NULL);
+
+       sam9x60_pm_init();
+}
+
+static const char *const sam9x60_dt_board_compat[] __initconst = {
+       "microchip,sam9x60",
+       NULL
+};
+
+DT_MACHINE_START(sam9x60_dt, "Microchip SAM9X60")
+       /* Maintainer: Microchip */
+       .init_machine   = sam9x60_init,
+       .dt_compat      = sam9x60_dt_board_compat,
+MACHINE_END
index e2bd172379648548d35e942ad705cf56cb09655d..72b45accfa0fbd0bb6815d1cbc020834f38b727d 100644 (file)
 #ifdef CONFIG_PM
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9_pm_init(void);
+extern void __init sam9x60_pm_init(void);
 extern void __init sama5_pm_init(void);
 extern void __init sama5d2_pm_init(void);
 #else
 static inline void __init at91rm9200_pm_init(void) { }
 static inline void __init at91sam9_pm_init(void) { }
+static inline void __init sam9x60_pm_init(void) { }
 static inline void __init sama5_pm_init(void) { }
 static inline void __init sama5d2_pm_init(void) { }
 #endif
index ce2ff86968f6ef26776e9620f542d41325fa0291..e42db02eafe4202993745fc92c21fd6f850a667a 100644 (file)
@@ -518,6 +518,11 @@ static void at91rm9200_idle(void)
        writel(AT91_PMC_PCK, soc_pm.data.pmc + AT91_PMC_SCDR);
 }
 
+static void at91sam9x60_idle(void)
+{
+       cpu_do_idle();
+}
+
 static void at91sam9_idle(void)
 {
        writel(AT91_PMC_PCK, soc_pm.data.pmc + AT91_PMC_SCDR);
@@ -754,6 +759,15 @@ void __init at91rm9200_pm_init(void)
        at91_pm_init(at91rm9200_idle);
 }
 
+void __init sam9x60_pm_init(void)
+{
+       if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
+               return;
+
+       at91_dt_ramc();
+       at91_pm_init(at91sam9x60_idle);
+}
+
 void __init at91sam9_pm_init(void)
 {
        if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))