From 23067d39761626a0bd814a092404a7d424ebf0c3 Mon Sep 17 00:00:00 2001 From: Alim Akhtar Date: Fri, 20 Nov 2015 10:47:09 +0530 Subject: ARM: EXYNOS: Switch to syscon reboot and poweroff Since we switch to use generic syscon regmap based reset/poweroff driver for exynos SoC, lets select it from ARCH_EXYNOS instead of enabling it from various defconfigs. This also select POWER_RESET as SYSCON-{reset, poweroff} drivers depends on it. Also because of the above changes we don't need special handling for reboot/poweroff in exynos pmu driver. This patch also removes the same from exynos pmu driver to keep git bisect working. Note: This will break reboot/poweroff on boards with older dtbs with a newer kernel. Signed-off-by: Alim Akhtar Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Tested-by: Krzysztof Kozlowski Acked-by: Moritz Fischer Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/Kconfig | 3 +++ arch/arm/mach-exynos/pmu.c | 43 ------------------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) (limited to 'arch/arm/mach-exynos') diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 3a10f1a8317a..d279edf9b10d 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -27,6 +27,9 @@ menuconfig ARCH_EXYNOS select SRAM select THERMAL select MFD_SYSCON + select POWER_RESET + select POWER_RESET_SYSCON + select POWER_RESET_SYSCON_POWEROFF help Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5) diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index de68938ee6aa..393c04aa727e 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -14,9 +14,6 @@ #include #include #include -#include -#include - #include "exynos-pmu.h" #include "regs-pmu.h" @@ -681,23 +678,6 @@ static unsigned int const exynos5420_list_disable_pmu_reg[] = { EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG, }; -static void exynos_power_off(void) -{ - unsigned int tmp; - - pr_info("Power down.\n"); - tmp = pmu_raw_readl(EXYNOS_PS_HOLD_CONTROL); - tmp ^= (1 << 8); - pmu_raw_writel(tmp, EXYNOS_PS_HOLD_CONTROL); - - /* Wait a little so we don't give a false warning below */ - mdelay(100); - - pr_err("Power down failed, please power off system manually.\n"); - while (1) - ; -} - static void exynos5420_powerdown_conf(enum sys_powerdown mode) { u32 this_cluster; @@ -875,14 +855,6 @@ static void exynos5420_pmu_init(void) pr_info("EXYNOS5420 PMU initialized\n"); } -static int pmu_restart_notify(struct notifier_block *this, - unsigned long code, void *unused) -{ - pmu_raw_writel(0x1, EXYNOS_SWRESET); - - return NOTIFY_DONE; -} - static const struct exynos_pmu_data exynos3250_pmu_data = { .pmu_config = exynos3250_pmu_config, .pmu_init = exynos3250_pmu_init, @@ -940,20 +912,11 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { { /*sentinel*/ }, }; -/* - * Exynos PMU restart notifier, handles restart functionality - */ -static struct notifier_block pmu_restart_handler = { - .notifier_call = pmu_restart_notify, - .priority = 128, -}; - static int exynos_pmu_probe(struct platform_device *pdev) { const struct of_device_id *match; struct device *dev = &pdev->dev; struct resource *res; - int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pmu_base_addr = devm_ioremap_resource(dev, res); @@ -978,12 +941,6 @@ static int exynos_pmu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pmu_context); - ret = register_restart_handler(&pmu_restart_handler); - if (ret) - dev_warn(dev, "can't register restart handler err=%d\n", ret); - - pm_power_off = exynos_power_off; - dev_dbg(dev, "Exynos PMU Driver probe done\n"); return 0; } -- cgit v1.2.3 From f31c7c7a0e4cedeee3cac9dbcb0a202008b86b54 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Thu, 29 Oct 2015 10:38:05 +0900 Subject: ARM: EXYNOS: Constify local exynos_pmu_data structure The Exynos5420 instance of exynos_pmu_data structure is not modified and can be made const. Suggested-by: Pavel Fedin Signed-off-by: Krzysztof Kozlowski Reviewed-by: Pankaj Dubey --- arch/arm/mach-exynos/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-exynos') diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 393c04aa727e..28b7a72ae9a6 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -880,7 +880,7 @@ static const struct exynos_pmu_data exynos5250_pmu_data = { .powerdown_conf = exynos5_powerdown_conf, }; -static struct exynos_pmu_data exynos5420_pmu_data = { +static const struct exynos_pmu_data exynos5420_pmu_data = { .pmu_config = exynos5420_pmu_config, .pmu_init = exynos5420_pmu_init, .powerdown_conf = exynos5420_powerdown_conf, -- cgit v1.2.3 From 8438aef01d3560549b3a95d247b3a69311fa6f2d Mon Sep 17 00:00:00 2001 From: Pankaj Dubey Date: Fri, 13 Nov 2015 14:59:35 +0530 Subject: ARM: EXYNOS: Remove redundant code from regs-pmu.h Commit 6ec4f8d0d91f ("ARM: EXYNOS: add generic function to calculate cpu number") introduced exynos_pmu_cpunr to be used by multi-cluster SoCs e.g. Exynos5420, but it's no more used in the codebase and hence removing this part of code. Signed-off-by: Pankaj Dubey Reviewed-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/pmu.c | 2 ++ arch/arm/mach-exynos/regs-pmu.h | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-exynos') diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 28b7a72ae9a6..628ae094ae0c 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -15,6 +15,8 @@ #include #include +#include + #include "exynos-pmu.h" #include "regs-pmu.h" diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index fba9068ed260..5e4f4c23b06a 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -484,15 +484,6 @@ #define EXYNOS5420_SWRESET_KFC_SEL 0x3 -#include -#define MAX_CPUS_IN_CLUSTER 4 - -static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr) -{ - return ((MPIDR_AFFINITY_LEVEL(mpidr, 1) * MAX_CPUS_IN_CLUSTER) - + MPIDR_AFFINITY_LEVEL(mpidr, 0)); -} - /* Only for EXYNOS5420 */ #define EXYNOS5420_ISP_ARM_OPTION 0x2488 #define EXYNOS5420_L2RSTDISABLE_VALUE BIT(3) -- cgit v1.2.3