From 974ab412d3593cf13fb1c2cfcbbdd316b77e2a72 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 13 Jun 2018 14:55:45 +0200 Subject: [PATCH] soc: samsung: Fix arm 32bit build break in Exynos PM code Signed-off-by: Marek Szyprowski Change-Id: If656a06064684707b4cea7d8cfb7f1e08c2c02f3 --- arch/arm/mach-exynos/firmware.c | 1 + arch/arm/mach-exynos/suspend.c | 1 + drivers/soc/samsung/Kconfig | 6 ++++++ drivers/soc/samsung/Makefile | 6 +++--- drivers/soc/samsung/exynos-pm.c | 24 +----------------------- drivers/soc/samsung/exynos-pmu.c | 8 +++++++- drivers/soc/samsung/exynos-pmu.h | 3 +++ drivers/soc/samsung/exynos-sysram.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/soc/samsung/exynos5433-pmu.c | 3 +++ 9 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 drivers/soc/samsung/exynos-sysram.c diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 2a51e46..08947c7 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 14a0558..f3792b5 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index e6dc8e1..ae4dc02 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -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 diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index cd7af1c..cd5498a 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -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 diff --git a/drivers/soc/samsung/exynos-pm.c b/drivers/soc/samsung/exynos-pm.c index c0f66e1..63a2066 100644 --- a/drivers/soc/samsung/exynos-pm.c +++ b/drivers/soc/samsung/exynos-pm.c @@ -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; diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 2c3e378..2796c39 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -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*/ }, }; diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h index 485ee54..5c50136 100644 --- a/drivers/soc/samsung/exynos-pmu.h +++ b/drivers/soc/samsung/exynos-pmu.h @@ -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 index 0000000..bc25cd6 --- /dev/null +++ b/drivers/soc/samsung/exynos-sysram.c @@ -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 +#include +#include + +#include + +#include + +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; + } +} diff --git a/drivers/soc/samsung/exynos5433-pmu.c b/drivers/soc/samsung/exynos5433-pmu.c index c233536..08bcdb3 100644 --- a/drivers/soc/samsung/exynos5433-pmu.c +++ b/drivers/soc/samsung/exynos5433-pmu.c @@ -6,8 +6,11 @@ // // EXYNOS5433 - CPU PMU (Power Management Unit) support +#include + #include #include +#include #include "exynos-pmu.h" -- 2.7.4