exynos: Move pmu driver to driver/soc folder and add exynos7 support
Subsystems (5)
v3 cover exynos: Move pmu driver to driver/soc folder and add exynos7 support
This patch series [1 - 5] performs,
1) Moves pmu driver to driver/soc/samsung folder. This is needed as exynos7 is an arm64 based platform and hence PMU driver should be in driver folder. Some discussion happened about this in the v1 version. Finally adding it in driver/soc folder as it too SoC specific and not a general driver. Entire discussion can be found here (A).
2) Add exynos7 PMU support.
3) Enables the driver for 32bit arm exynos platforms.
Changes from V2:
* Added review comment changes suggested by Pankaj.
* Removed mfd client support in this patch series. This will be added later in the power domain patch series.
* Link to V2 can be found here (B)
Changes from V1:
* Move pmu driver in driver/soc/samsung folder
* Removed the power domain features. They will posted as a separate series.
* Added exynos7 PMU support.
* Link to v1 can be found here (A)
This complete patch series is rebased on Kukjin for-next tree.
(A) - http://www.spinics.net/lists/linux-samsung-soc/msg38442.html
(B) - http://www.spinics.net/lists/arm-kernel/msg375910.html
Amit Daniel Kachhap (5):
ARM: EXYNOS: Move pmu specific header files under "linux/soc/samsung"
drivers: soc: Add support for Exynos PMU driver
driver: soc: exynos-pmu: Add an API to be called after wakeup
drivers: soc: exynos-pmu: Add support for Exynos7
arm: exynos: Select SOC_SAMSUNG config option
.../devicetree/bindings/arm/samsung/pmu.txt | 1 +
arch/arm/mach-exynos/Kconfig | 1 +
arch/arm/mach-exynos/Makefile | 2 +-
arch/arm/mach-exynos/exynos.c | 2 +-
arch/arm/mach-exynos/mcpm-exynos.c | 2 +-
arch/arm/mach-exynos/platsmp.c | 2 +-
arch/arm/mach-exynos/pm.c | 4 +-
arch/arm/mach-exynos/suspend.c | 4 +-
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
drivers/soc/samsung/Kconfig | 20 +
drivers/soc/samsung/Makefile | 1 +
.../pmu.c => drivers/soc/samsung/exynos-pmu.c | 445 +++++++++++++++++++-
.../linux/soc/samsung}/exynos-pmu.h | 1 +
.../linux/soc/samsung/exynos-regs-pmu.h | 273 ++++++++++++
15 files changed, 745 insertions(+), 15 deletions(-)
create mode 100644 drivers/soc/samsung/Kconfig
create mode 100644 drivers/soc/samsung/Makefile
rename arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c (63%)
rename {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h (89%)
rename arch/arm/mach-exynos/regs-pmu.h => include/linux/soc/samsung/exynos-regs-pmu.h (63%)Signature · 1 line
1.7.9.5
PATCH v3 1/5 ARM: EXYNOS: Move pmu specific header files under "linux/soc/samsung"
Moving Exynos PMU specific header file into "include/linux/soc/samsung" thus updated affected files under "mach-exynos" to use new location of these header files.
---
arch/arm/mach-exynos/exynos.c | 2 +-
arch/arm/mach-exynos/mcpm-exynos.c | 2 +-
arch/arm/mach-exynos/platsmp.c | 2 +-
arch/arm/mach-exynos/pm.c | 4 ++--
arch/arm/mach-exynos/pmu.c | 6 ++----
arch/arm/mach-exynos/suspend.c | 4 ++--
.../linux/soc/samsung}/exynos-pmu.h | 0
.../linux/soc/samsung/exynos-regs-pmu.h | 0
8 files changed, 9 insertions(+), 11 deletions(-)
rename {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h (100%)
rename arch/arm/mach-exynos/regs-pmu.h => include/linux/soc/samsung/exynos-regs-pmu.h (100%)arch/arm/mach-exynos/exynos.c +1 -1
@@ -20,6 +20,7 @@#include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/irqchip.h> +#include <linux/soc/samsung/exynos-regs-pmu.h> #include <asm/cacheflush.h> #include <asm/hardware/cache-l2x0.h>
@@ -29,7 +30,6 @@#include "common.h" #include "mfc.h" -#include "regs-pmu.h" #include "regs-sys.h" void __iomem *pmu_base_addr;
arch/arm/mach-exynos/mcpm-exynos.c +1 -1
@@ -16,12 +16,12 @@#include <linux/io.h> #include <linux/of_address.h> #include <linux/syscore_ops.h> +#include <linux/soc/samsung/exynos-regs-pmu.h> #include <asm/cputype.h> #include <asm/cp15.h> #include <asm/mcpm.h> -#include "regs-pmu.h" #include "common.h" #define EXYNOS5420_CPUS_PER_CLUSTER 4
arch/arm/mach-exynos/platsmp.c +1 -1
@@ -20,6 +20,7 @@#include <linux/smp.h> #include <linux/io.h> #include <linux/of_address.h> +#include <linux/soc/samsung/exynos-regs-pmu.h> #include <asm/cacheflush.h> #include <asm/cp15.h>
@@ -30,7 +31,6 @@#include <mach/map.h> #include "common.h" -#include "regs-pmu.h" extern void exynos4_secondary_startup (void );
arch/arm/mach-exynos/pm.c +2 -2
@@ -18,6 +18,8 @@#include <linux/cpu_pm.h> #include <linux/io.h> #include <linux/err.h> +#include <linux/soc/samsung/exynos-regs-pmu.h> +#include <linux/soc/samsung/exynos-pmu.h> #include <asm/firmware.h> #include <asm/smp_scu.h>
@@ -26,8 +28,6 @@#include <plat/pm-common.h> #include "common.h" -#include "exynos-pmu.h" -#include "regs-pmu.h" #include "regs-sys.h" static inline void __iomem *exynos_boot_vector_addr (void )
arch/arm/mach-exynos/pmu.c +2 -4
@@ -13,10 +13,8 @@#include <linux/of.h> #include <linux/platform_device.h> #include <linux/delay.h> - - -#include "exynos-pmu.h" -#include "regs-pmu.h" +#include <linux/soc/samsung/exynos-regs-pmu.h> +#include <linux/soc/samsung/exynos-pmu.h> #define PMU_TABLE_END (-1U)
arch/arm/mach-exynos/suspend.c +2 -2
@@ -21,6 +21,8 @@#include <linux/irqchip/arm-gic.h> #include <linux/err.h> #include <linux/regulator/machine.h> +#include <linux/soc/samsung/exynos-pmu.h> +#include <linux/soc/samsung/exynos-regs-pmu.h> #include <asm/cacheflush.h> #include <asm/hardware/cache-l2x0.h>
@@ -33,9 +35,7 @@#include <plat/regs-srom.h> #include "common.h" -#include "regs-pmu.h" #include "regs-sys.h" -#include "exynos-pmu.h" #define S5P_CHECK_SLEEP 0x00000BAD
include/linux/soc/samsung/exynos-pmu.h renamed from arch/arm/mach-exynos/exynos-pmu.h +0 -0
include/linux/soc/samsung/exynos-regs-pmu.h renamed from arch/arm/mach-exynos/regs-pmu.h +0 -0
Signature · 1 line
1.7.9.5
PATCH v3 2/5 drivers: soc: Add support for Exynos PMU driver
In reply to Amit Daniel KachhapThis patch moves Exynos PMU driver implementation from "arm/mach-exynos" to "drivers/soc/samsung". This driver is mainly used for setting misc bits of register from PMU IP of Exynos SoC which will be required to configure before Suspend/Resume. Currently all these settings are done in "arch/arm/mach-exynos/pmu.c" but moving ahead for ARM64 based SoC support, there is a need of this PMU driver in driver/* folder.
This driver uses existing DT binding information and there should be no functionality change in the supported platforms.
--- arch/arm/mach-exynos/Makefile | 2 +- drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/samsung/Kconfig | 20 ++++++++++++++++++++ drivers/soc/samsung/Makefile | 1 + .../pmu.c => drivers/soc/samsung/exynos-pmu.c | 0 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/samsung/Kconfig create mode 100644 drivers/soc/samsung/Makefile rename arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c (100%)
arch/arm/mach-exynos/Makefile +1 -1
@@ -9,7 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree) # Core -obj-$(CONFIG_ARCH_EXYNOS) += exynos.o pmu.o exynos-smc.o firmware.o +obj-$(CONFIG_ARCH_EXYNOS) += exynos.o exynos-smc.o firmware.o obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o obj-$(CONFIG_PM_SLEEP) += suspend.o
drivers/soc/Kconfig +1 -0
@@ -3,5 +3,6 @@ menu "SOC (System On Chip) specific Drivers" source "drivers/soc/qcom/Kconfig" source "drivers/soc/ti/Kconfig" source "drivers/soc/versatile/Kconfig" +source "drivers/soc/samsung/Kconfig" endmenu
drivers/soc/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_SOC_TI) += ti/ obj-$(CONFIG_PLAT_VERSATILE) += versatile/ +obj-$(CONFIG_ARCH_EXYNOS) += samsung/
drivers/soc/samsung/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +# +# SAMSUNG SOC drivers +# +menuconfig SOC_SAMSUNG + bool "Samsung SOC drivers support" + +if SOC_SAMSUNG + +config EXYNOS_PMU + bool "Support Exynos Power Management Unit" + depends on ARCH_EXYNOS + default y + help + Exynos SoC have Power Management Unit (PMU) which controls power and + operation state of various components in Exynos SoC. This driver + provides implementation of PMU driver and provides various + functionality like initialisation and transition to various low power + states. + +endif #SOC_SAMSUNG
drivers/soc/samsung/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o
drivers/soc/samsung/exynos-pmu.c renamed from arch/arm/mach-exynos/pmu.c +0 -0
Signature · 1 line
1.7.9.5
Re: [PATCH v3 2/5] drivers: soc: Add support for Exynos PMU driver
drivers/soc/Makefile obj-$(CONFIG_ARCH_QCOM) += qcom/ · line 9
Quoted 9 lines · Amit Daniel Kachhap
drivers/soc/Makefile +1
-0@@ -6,3 +6,4 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_SOC_TI) += ti/ obj-$(CONFIG_PLAT_VERSATILE) += versatile/ +obj-$(CONFIG_ARCH_EXYNOS) += samsung/
Is ARCH_EXYNOS appropriate here, or is your new SOC_SAMSUNG better?
drivers/soc/samsung/Kconfig line 5
Quoted 11 lines
drivers/soc/samsung/Kconfig new file +5
-0@@ -0,0 +1,20 @@ +# +# SAMSUNG SOC drivers +# +menuconfig SOC_SAMSUNG + bool "Samsung SOC drivers support"
If you intend to select SOC_SAMSUNG, is there any point in making this a user-visible symbol?
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net.
Re: [PATCH v3 2/5] drivers: soc: Add support for Exynos PMU driver
Quoted 12 lines · Russell King - ARM Linux
drivers/soc/Makefile obj-$(CONFIG_ARCH_QCOM) += qcom/ · line 9
Quoted 9 lines · Amit Daniel Kachhap
drivers/soc/Makefile +1
-0@@ -6,3 +6,4 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_SOC_TI) += ti/ obj-$(CONFIG_PLAT_VERSATILE) += versatile/ +obj-$(CONFIG_ARCH_EXYNOS) += samsung/Is
ARCH_EXYNOSappropriate here, or is your newSOC_SAMSUNGbetter?
yes, SOC_SAMSUNG is more appropriate.
Quoted 15 lines
drivers/soc/samsung/Kconfig line 5
Quoted 12 lines
drivers/soc/samsung/Kconfig new file +5
-0@@ -0,0 +1,20 @@ +# +# SAMSUNG SOC drivers +# +menuconfig SOC_SAMSUNG + bool "Samsung SOC drivers support"If you intend to select
SOC_SAMSUNG, is there any point in making this a user-visible symbol?
Agreed, only menu "Samsung SOC drivers support" will be fine.
Regards,
Amit
Quoted 9 lines
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 3/5 driver: soc: exynos-pmu: Add an API to be called after wakeup
In reply to Amit Daniel KachhapThis patch adds an API exynos_sys_powerup_conf to be called after system sleep wakeup. This will useful for exynos7 SoC to perform resume related initialisations. This is similar to currently existing API exynos_sys_powerdown_conf.
--- drivers/soc/samsung/exynos-pmu.c | 9 +++++++++ include/linux/soc/samsung/exynos-pmu.h | 1 + 2 files changed, 10 insertions(+)
drivers/soc/samsung/exynos-pmu.c +9 -0
@@ -29,6 +29,7 @@ struct exynos_pmu_data {void (*pmu_init)(void );void (*powerdown_conf)(enum sys_powerdown ); +void (*powerup_conf)(enum sys_powerdown ); };struct exynos_pmu_context {
@@ -637,6 +638,14 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) } } +void exynos_sys_powerup_conf (enum sys_powerdown mode) +{ +const struct exynos_pmu_data *pmu_data = pmu_context->pmu_data; + +if (pmu_data->powerup_conf) + pmu_data->powerup_conf (mode); +} +static void exynos5250_pmu_init (void ) {unsigned int value;
include/linux/soc/samsung/exynos-pmu.h +1 -0
@@ -20,5 +20,6 @@ enum sys_powerdown { };extern void exynos_sys_powerdown_conf (enum sys_powerdown mode); +extern void exynos_sys_powerup_conf (enum sys_powerdown mode);#endif /* __EXYNOS_PMU_H */
Signature · 1 line
1.7.9.5
PATCH v3 4/5 drivers: soc: exynos-pmu: Add support for Exynos7
In reply to Amit Daniel KachhapAdd PMU settings for exynos7. This is required for future suspend-to-ram, cpuidle and power domain support.
Note: In this patch some static declarations lines are over 80 characters per line for easy redability.
--- .../devicetree/bindings/arm/samsung/pmu.txt | 1 + drivers/soc/samsung/exynos-pmu.c | 430 +++++++++++++++++++- include/linux/soc/samsung/exynos-regs-pmu.h | 273 +++++++++++++ 3 files changed, 701 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/arm/samsung/pmu.txt +1 -0
@@ -10,6 +10,7 @@ Properties: - "samsung,exynos5260-pmu" - for Exynos5260 SoC. - "samsung,exynos5410-pmu" - for Exynos5410 SoC, - "samsung,exynos5420-pmu" - for Exynos5420 SoC. + - "samsung,exynos7-pmu" - for Exynos7 SoC. second value must be always "syscon". - reg : offset and length of the register set.
drivers/soc/samsung/exynos-pmu.c +426 -1
475 lines not on this page · raw message
include/linux/soc/samsung/exynos-regs-pmu.h +273 -0
277 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v3 5/5 arm: exynos: Select SOC_SAMSUNG config option
In reply to Amit Daniel KachhapThe config option SOC_SAMSUNG is needed to enable all soc samsung drivers inside driver/soc/samsung folder. Currently, this will be useful to enable exynos pmu driver which is moved to that folder.
--- arch/arm/mach-exynos/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-exynos/Kconfig +1 -0
@@ -25,6 +25,7 @@ menuconfig ARCH_EXYNOS select S5P_DEV_MFC select SRAM select MFD_SYSCON + select SOC_SAMSUNG help Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
Signature · 1 line
1.7.9.5