soc: samsung: Fix arm 32bit build break in Exynos PM code
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 13 Jun 2018 12:55:45 +0000 (14:55 +0200)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:57:59 +0000 (14:57 +0900)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: If656a06064684707b4cea7d8cfb7f1e08c2c02f3

arch/arm/mach-exynos/firmware.c
arch/arm/mach-exynos/suspend.c
drivers/soc/samsung/Kconfig
drivers/soc/samsung/Makefile
drivers/soc/samsung/exynos-pm.c
drivers/soc/samsung/exynos-pmu.c
drivers/soc/samsung/exynos-pmu.h
drivers/soc/samsung/exynos-sysram.c [new file with mode: 0644]
drivers/soc/samsung/exynos5433-pmu.c

index 2a51e46..08947c7 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/soc/samsung/exynos-pm.h>
 
 #include <asm/cacheflush.h>
 #include <asm/cputype.h>
index 14a0558..f3792b5 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/of_address.h>
 #include <linux/err.h>
 #include <linux/regulator/machine.h>
+#include <linux/soc/samsung/exynos-pm.h>
 #include <linux/soc/samsung/exynos-pmu.h>
 #include <linux/soc/samsung/exynos-regs-pmu.h>
 
index e6dc8e1..ae4dc02 100644 (file)
@@ -20,12 +20,18 @@ config EXYNOS_PMU
        bool "Exynos PMU controller driver" if COMPILE_TEST
        depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST)
        select EXYNOS_PMU_ARM_DRIVERS if ARM && ARCH_EXYNOS
+       select EXYNOS_PMU_ARM64_DRIVERS if ARM64 && ARCH_EXYNOS
 
 # There is no need to enable these drivers for ARMv8
 config EXYNOS_PMU_ARM_DRIVERS
        bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST
        depends on EXYNOS_PMU
 
+# There is no need to enable these drivers for ARMv7
+config EXYNOS_PMU_ARM64_DRIVERS
+       bool "Exynos PMU ARMv8-specific driver extensions" if COMPILE_TEST
+       depends on EXYNOS_PMU
+
 config EXYNOS_PM_DOMAINS
        bool "Exynos PM domains" if COMPILE_TEST
        depends on PM_GENERIC_DOMAINS || COMPILE_TEST
index cd7af1c..cd5498a 100644 (file)
@@ -1,9 +1,9 @@
 obj-$(CONFIG_EXYNOS_CHIPID)    += exynos-chipid.o
-obj-$(CONFIG_EXYNOS_PMU)       += exynos-pmu.o exynos-pm.o
+obj-$(CONFIG_EXYNOS_PMU)       += exynos-pmu.o exynos-sysram.o
 
 obj-$(CONFIG_EXYNOS_ASV)       += exynos-asv.o
 
 obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS)   += exynos3250-pmu.o exynos4-pmu.o \
-                                       exynos5250-pmu.o exynos5420-pmu.o \
-                                       exynos5433-pmu.o
+                                       exynos5250-pmu.o exynos5420-pmu.o
+obj-$(CONFIG_EXYNOS_PMU_ARM64_DRIVERS) += exynos-pm.o exynos5433-pmu.o
 obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o
index c0f66e1..63a2066 100644 (file)
@@ -39,9 +39,6 @@ static struct platform_suspend_ops exynos_pm_suspend_ops;
 static struct syscore_ops exynos_pm_syscore_ops;
 static const struct exynos_pm_data *pm_data  __ro_after_init;
 
-void __iomem *sysram_base_addr __ro_after_init;
-void __iomem *sysram_ns_base_addr __ro_after_init;
-
 static int exynos_pm_prepare(void)
 {
        int ret;
@@ -116,7 +113,7 @@ static void exynos_pm_finish(void)
  * Split the data between ARM architectures because it is relatively big
  * and useless on other arch.
  */
-#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
+#ifdef CONFIG_EXYNOS_PMU_ARM64_DRIVERS
 #define exynos_pm_data_arm_ptr(data)   (&data)
 #else
 #define exynos_pm_data_arm_ptr(data)   NULL
@@ -163,25 +160,6 @@ static const struct of_device_id exynos_pm_of_device_ids[] = {
        { /*sentinel*/ },
 };
 
-void __init exynos_sysram_init(void)
-{
-       struct device_node *np;
-
-       for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram") {
-               if (!of_device_is_available(np))
-                       continue;
-               sysram_base_addr = of_iomap(np, 0);
-               break;
-       }
-
-       for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram-ns") {
-               if (!of_device_is_available(np))
-                       continue;
-               sysram_ns_base_addr = of_iomap(np, 0);
-               break;
-       }
-}
-
 static int __init exynos_pm_init(void)
 {
        const struct of_device_id *match;
index 2c3e378..2796c39 100644 (file)
@@ -72,6 +72,12 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
 #define exynos_pmu_data_arm_ptr(data)  NULL
 #endif
 
+#ifdef CONFIG_EXYNOS_PMU_ARM64_DRIVERS
+#define exynos_pmu_data_arm64_ptr(data)        (&data)
+#else
+#define exynos_pmu_data_arm64_ptr(data)        NULL
+#endif
+
 /*
  * PMU platform driver and devicetree bindings.
  */
@@ -93,7 +99,7 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
                .data = exynos_pmu_data_arm_ptr(exynos5420_pmu_data),
        }, {
                .compatible = "samsung,exynos5433-pmu",
-               .data = exynos_pmu_data_arm_ptr(exynos5433_pmu_data),
+               .data = exynos_pmu_data_arm64_ptr(exynos5433_pmu_data),
        },
        { /*sentinel*/ },
 };
index 485ee54..5c50136 100644 (file)
@@ -38,6 +38,9 @@ extern const struct exynos_pmu_data exynos4210_pmu_data;
 extern const struct exynos_pmu_data exynos4412_pmu_data;
 extern const struct exynos_pmu_data exynos5250_pmu_data;
 extern const struct exynos_pmu_data exynos5420_pmu_data;
+#endif
+
+#ifdef CONFIG_EXYNOS_PMU_ARM64_DRIVERS
 extern const struct exynos_pmu_data exynos5433_pmu_data;
 #endif
 
diff --git a/drivers/soc/samsung/exynos-sysram.c b/drivers/soc/samsung/exynos-sysram.c
new file mode 100644 (file)
index 0000000..bc25cd6
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// based on arch/arm/mach-exynos/suspend.c
+// Copyright (c) 2018 Samsung Electronics Co., Ltd.
+//
+// Exynos Power Management support driver
+
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/kernel.h>
+
+#include <asm/io.h>
+
+#include <linux/soc/samsung/exynos-pm.h>
+
+void __iomem *sysram_base_addr __ro_after_init;
+void __iomem *sysram_ns_base_addr __ro_after_init;
+
+void __init exynos_sysram_init(void)
+{
+       struct device_node *np;
+
+       for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram") {
+               if (!of_device_is_available(np))
+                       continue;
+               sysram_base_addr = of_iomap(np, 0);
+               break;
+       }
+
+       for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram-ns") {
+               if (!of_device_is_available(np))
+                       continue;
+               sysram_ns_base_addr = of_iomap(np, 0);
+               break;
+       }
+}
index c233536..08bcdb3 100644 (file)
@@ -6,8 +6,11 @@
 //
 // EXYNOS5433 - CPU PMU (Power Management Unit) support
 
+#include <linux/io.h>
+
 #include <linux/soc/samsung/exynos-regs-pmu.h>
 #include <linux/soc/samsung/exynos-pmu.h>
+#include <linux/soc/samsung/exynos-pm.h>
 
 #include "exynos-pmu.h"