ARM: at91: pm: move SAM9X60's PM under its own SoC config flag
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Fri, 29 Nov 2019 13:51:39 +0000 (15:51 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 9 Dec 2019 23:44:53 +0000 (00:44 +0100)
Move SAM9X60's PM part under SoC config flag. This allows the building
of SAM9X60 platform withouth depending on CONFIG_SOC_AT91SAM9 flag,
allowing us to select only necessary config flags for SAM9X60.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1575035505-6310-4-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
arch/arm/mach-at91/Makefile
arch/arm/mach-at91/at91sam9.c
arch/arm/mach-at91/pm.c
arch/arm/mach-at91/sam9x60.c [new file with mode: 0644]

index de64301dcff25143ad94fb0222d9eb427f71687e..f565490f1b70ba396219a1c0bbc426ce857fdc2b 100644 (file)
@@ -6,6 +6,7 @@
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)   += at91rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9)     += at91sam9.o
+obj-$(CONFIG_SOC_SAM9X60)      += sam9x60.o
 obj-$(CONFIG_SOC_SAMA5)                += sama5.o
 obj-$(CONFIG_SOC_SAMV7)                += samv7.o
 
index bf629c90c758e878f026d544dbff1d5f7ce2cd48..7e572189a5eb6a2f65aaa36ad601a57f2e5bb7f9 100644 (file)
@@ -31,21 +31,3 @@ 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 d5af6aedc02c4d4d8a9ac598ae30413c7b063d86..56a6a49b19e28a42899dd17e6e2ce890317ba5de 100644 (file)
@@ -805,7 +805,7 @@ void __init at91rm9200_pm_init(void)
 
 void __init sam9x60_pm_init(void)
 {
-       if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
+       if (!IS_ENABLED(CONFIG_SOC_SAM9X60))
                return;
 
        at91_pm_modes_init();
diff --git a/arch/arm/mach-at91/sam9x60.c b/arch/arm/mach-at91/sam9x60.c
new file mode 100644 (file)
index 0000000..d8c739d
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Setup code for SAM9X60.
+ *
+ * Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Claudiu Beznea <claudiu.beznea@microchip.com>
+ */
+
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+#include <asm/mach/arch.h>
+#include <asm/system_misc.h>
+
+#include "generic.h"
+
+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