S5P64X0 PM Support
Subsystems (3)
v2 cover S5P64X0 PM Support
The patchset adds Power Mangement support for S5P64X0. The first two patches lay the groundwork for adding PM support, while the final patch adds the SoC specific PM code.
Changes since V1:
- Changed register naming as per User Manual.
- Dropped the pm-gpio warning patch as it will be taken care in the gpio movement patch by Kukjin Kim.
- Used soc_is_* for differentiating between 6440 and 6450.
- Merged all the sleep files of S5P SoCs while leaving the S3C64XX sleep code as is.
Abhilash Kesavan (3):
ARM: S5P: Make the common S5P PM code conditionally compile
ARM: S5P: Make the sleep code common for S5P series SoCs
ARM: S5P64X0: Add Power Management support
arch/arm/Kconfig | 2 +-
arch/arm/mach-exynos4/Kconfig | 4 +
arch/arm/mach-exynos4/Makefile | 2 +-
arch/arm/mach-s5p64x0/Kconfig | 4 +
arch/arm/mach-s5p64x0/Makefile | 1 +
arch/arm/mach-s5p64x0/include/mach/map.h | 1 +
arch/arm/mach-s5p64x0/include/mach/pm-core.h | 117 +++++++++++++
arch/arm/mach-s5p64x0/include/mach/regs-clock.h | 33 ++++
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 19 ++
arch/arm/mach-s5p64x0/irq-eint.c | 2 +
arch/arm/mach-s5p64x0/irq-pm.c | 92 ++++++++++
arch/arm/mach-s5p64x0/pm.c | 204 +++++++++++++++++++++++
arch/arm/mach-s5pv210/Kconfig | 2 +
arch/arm/mach-s5pv210/Makefile | 2 +-
arch/arm/mach-s5pv210/sleep.S | 52 ------
arch/arm/plat-s5p/Kconfig | 12 ++
arch/arm/plat-s5p/Makefile | 4 +-
arch/arm/{mach-exynos4 => plat-s5p}/sleep.S | 13 +-
18 files changed, 500 insertions(+), 66 deletions(-)
create mode 100644 arch/arm/mach-s5p64x0/include/mach/pm-core.h
create mode 100644 arch/arm/mach-s5p64x0/irq-pm.c
create mode 100644 arch/arm/mach-s5p64x0/pm.c
delete mode 100644 arch/arm/mach-s5pv210/sleep.S
rename arch/arm/{mach-exynos4 => plat-s5p}/sleep.S (81%)PATCH v2 1/3 ARM: S5P: Make the common S5P PM code conditionally compile
Pave the way for adding PM support on S5P64X0, which is more similar to the S3C64XX series than the S5P series. Hence, the common pm code (containing dummy functions) should not be used for S5P64X0.
--- arch/arm/mach-exynos4/Kconfig | 2 ++ arch/arm/mach-s5pv210/Kconfig | 1 + arch/arm/plat-s5p/Kconfig | 6 ++++++ arch/arm/plat-s5p/Makefile | 3 +-- 4 files changed, 10 insertions(+), 2 deletions(-)
arch/arm/mach-exynos4/Kconfig +2 -0
@@ -12,11 +12,13 @@ if ARCH_EXYNOS4 config CPU_EXYNOS4210 bool select SAMSUNG_DMADEV + select S5P_PM if PM help Enable EXYNOS4210 CPU support config SOC_EXYNOS4212 bool + select S5P_PM if PM help Enable EXYNOS4212 SoC support
arch/arm/mach-s5pv210/Kconfig +1 -0
@@ -14,6 +14,7 @@ config CPU_S5PV210 select SAMSUNG_DMADEV select S5P_EXT_INT select S5P_HRT + select S5P_PM if PM help Enable S5PV210 CPU support
arch/arm/plat-s5p/Kconfig +6 -0
@@ -40,6 +40,12 @@ config S5P_HRT help Use the High Resolution timer support +config S5P_PM + bool + help + Common code for power management support on S5P and newer SoCs + Note: Do not select this for S5P6440 and S5P6450. + comment "System MMU" config S5P_SYSTEM_MMU
arch/arm/plat-s5p/Makefile +1 -2
@@ -20,8 +20,7 @@ obj-y += irq.o obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o -obj-$(CONFIG_PM) += pm.o -obj-$(CONFIG_PM) += irq-pm.o +obj-$(CONFIG_S5P_PM) += pm.o irq-pm.o obj-$(CONFIG_S5P_HRT) += s5p-time.o # devices
Signature · 1 line
1.7.0.4
PATCH v2 2/3 ARM: S5P: Make the sleep code common for S5P series SoCs
In reply to Abhilash KesavanThe sleep code for S5PV210 and EXYNOS4 are identical; moreover S5p64X0 and S5PC100 for which support will be added soon can use the same procedure. Create a common sleep code in the plat-s5p directory so that it can be re-used.
---
arch/arm/mach-exynos4/Kconfig | 2 +
arch/arm/mach-exynos4/Makefile | 2 +-
arch/arm/mach-s5pv210/Kconfig | 1 +
arch/arm/mach-s5pv210/Makefile | 2 +-
arch/arm/mach-s5pv210/sleep.S | 52 ---------------------------
arch/arm/plat-s5p/Kconfig | 6 +++
arch/arm/plat-s5p/Makefile | 1 +
arch/arm/{mach-exynos4 => plat-s5p}/sleep.S | 13 ++-----
8 files changed, 16 insertions(+), 63 deletions(-)
delete mode 100644 arch/arm/mach-s5pv210/sleep.S
rename arch/arm/{mach-exynos4 => plat-s5p}/sleep.S (81%)arch/arm/mach-exynos4/Kconfig +2 -0
@@ -13,12 +13,14 @@ config CPU_EXYNOS4210 bool select SAMSUNG_DMADEV select S5P_PM if PM + select S5P_SLEEP if PM help Enable EXYNOS4210 CPU support config SOC_EXYNOS4212 bool select S5P_PM if PM + select S5P_SLEEP if PM help Enable EXYNOS4212 SoC support
arch/arm/mach-exynos4/Makefile +1 -1
@@ -16,7 +16,7 @@ obj-$(CONFIG_ARCH_EXYNOS4) += cpu.o init.o clock.o irq-combiner.o obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o irq-eint.o dma.o pmu.o obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o -obj-$(CONFIG_PM) += pm.o sleep.o +obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o
arch/arm/mach-s5pv210/Kconfig +1 -0
@@ -15,6 +15,7 @@ config CPU_S5PV210 select S5P_EXT_INT select S5P_HRT select S5P_PM if PM + select S5P_SLEEP if PM help Enable S5PV210 CPU support
arch/arm/mach-s5pv210/Makefile +1 -1
@@ -14,7 +14,7 @@ obj- := obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o -obj-$(CONFIG_PM) += pm.o sleep.o +obj-$(CONFIG_PM) += pm.o # machine support
arch/arm/mach-s5pv210/sleep.S deleted +0 -52
52 lines not on this page · raw message
arch/arm/plat-s5p/Kconfig +6 -0
@@ -54,6 +54,12 @@ config S5P_SYSTEM_MMU help Say Y here if you want to enable System MMU +config S5P_SLEEP + bool + help + Internal config node to apply common S5P sleep management code. + Can be selected by S5P and newer SoCs with similar sleep procedure. + config S5P_DEV_FIMC0 bool help
arch/arm/plat-s5p/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o obj-$(CONFIG_S5P_PM) += pm.o irq-pm.o +obj-$(CONFIG_S5P_SLEEP) += sleep.o obj-$(CONFIG_S5P_HRT) += s5p-time.o # devices
arch/arm/plat-s5p/sleep.S renamed from arch/arm/mach-exynos4/sleep.S +4 -9
@@ -1,15 +1,11 @@ -/* linux/arch/arm/mach-exynos4/sleep.S +/* linux/arch/arm/plat-s5p/sleep.S * * Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com * - * EXYNOS4210 power Manager (Suspend-To-RAM) support - * Based on S3C2410 sleep code by: - * Ben Dooks, (c) 2004 Simtec Electronics - * - * Based on PXA/SA1100 sleep code by: - * Nicolas Pitre, (c) 2002 Monta Vista Software Inc - * Cliff Brake, (c) 2001 + * Common S5P Sleep Code + * Based on S3C64XX sleep code by: + * Ben Dooks, (c) 2008 Simtec Electronics * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -28,7 +24,6 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <asm/memory.h> .text
Signature · 1 line
1.7.0.4
PATCH v2 3/3 ARM: S5P64X0: Add Power Management support
In reply to Abhilash KesavanAdd suspend-to-ram support for SMDK6440/50
--- arch/arm/Kconfig | 2 +- arch/arm/mach-s5p64x0/Kconfig | 4 + arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/include/mach/map.h | 1 + arch/arm/mach-s5p64x0/include/mach/pm-core.h | 117 +++++++++++++ arch/arm/mach-s5p64x0/include/mach/regs-clock.h | 33 ++++ arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 19 ++ arch/arm/mach-s5p64x0/irq-eint.c | 2 + arch/arm/mach-s5p64x0/irq-pm.c | 92 ++++++++++ arch/arm/mach-s5p64x0/pm.c | 204 +++++++++++++++++++++++ 10 files changed, 474 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/include/mach/pm-core.h create mode 100644 arch/arm/mach-s5p64x0/irq-pm.c create mode 100644 arch/arm/mach-s5p64x0/pm.c
arch/arm/Kconfig +1 -1
@@ -2079,7 +2079,7 @@ menu "Power management options" source "kernel/power/Kconfig" config ARCH_SUSPEND_POSSIBLE - depends on !ARCH_S5P64X0 && !ARCH_S5PC100 + depends on !ARCH_S5PC100 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE def_bool y
arch/arm/mach-s5p64x0/Kconfig +4 -0
@@ -11,6 +11,8 @@ config CPU_S5P6440 bool select SAMSUNG_DMADEV select S5P_HRT + select S5P_SLEEP if PM + select SAMSUNG_WAKEMASK if PM help Enable S5P6440 CPU support
@@ -18,6 +20,8 @@ config CPU_S5P6450 bool select SAMSUNG_DMADEV select S5P_HRT + select S5P_SLEEP if PM + select SAMSUNG_WAKEMASK if PM help Enable S5P6450 CPU support
arch/arm/mach-s5p64x0/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o irq-eint.o obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o +obj-$(CONFIG_PM) += pm.o irq-pm.o # machine support
arch/arm/mach-s5p64x0/include/mach/map.h +1 -0
@@ -85,5 +85,6 @@#define S5P_PA_UART5 S5P6450_PA_UART(5)#define S5P_SZ_UART SZ_256 +#define S3C_VA_UARTx (x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))#endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5p64x0/include/mach/pm-core.h new file +117 -0
117 lines not on this page · raw message
arch/arm/mach-s5p64x0/include/mach/regs-clock.h +33 -0
@@ -41,17 +41,50 @@#define S5P6450_DPLL_CON S5P_CLKREG(0x50)#define S5P6450_DPLL_CON_K S5P_CLKREG(0x54) +#define S5P64X0_AHB_CON0 S5P_CLKREG(0x100)#define S5P64X0_CLK_SRC1 S5P_CLKREG(0x10C)#define S5P64X0_SYS_ID S5P_CLKREG(0x118)#define S5P64X0_SYS_OTHERS S5P_CLKREG(0x11C)#define S5P64X0_PWR_CFG S5P_CLKREG(0x804) +#define S5P64X0_EINT_WAKEUP_MASK S5P_CLKREG(0x808) +#define S5P64X0_SLEEP_CFG S5P_CLKREG(0x818) +#define S5P64X0_PWR_STABLE S5P_CLKREG(0x828) +#define S5P64X0_OTHERS S5P_CLKREG(0x900) +#define S5P64X0_WAKEUP_STAT S5P_CLKREG(0x908) + +#define S5P64X0_INFORM0 S5P_CLKREG(0xA00)#define S5P64X0_CLKDIV0_HCLK_SHIFT (8)#define S5P64X0_CLKDIV0_HCLK_MASK (0xF << S5P64X0_CLKDIV0_HCLK_SHIFT) +/* HCLK GATE Registers */ +#define S5P64X0_CLK_GATE_HCLK1_FIMGVG (1 << 2) +#define S5P64X0_CLK_GATE_SCLK1_FIMGVG (1 << 2) + +/* PCLK GATE Registers */ +#define S5P64X0_CLK_GATE_PCLK_UART3 (1 << 4) +#define S5P64X0_CLK_GATE_PCLK_UART2 (1 << 3) +#define S5P64X0_CLK_GATE_PCLK_UART1 (1 << 2) +#define S5P64X0_CLK_GATE_PCLK_UART0 (1 << 1) + +#define S5P64X0_PWR_CFG_MMC1_DISABLE (1 << 15) +#define S5P64X0_PWR_CFG_MMC0_DISABLE (1 << 14) +#define S5P64X0_PWR_CFG_RTC_TICK_DISABLE (1 << 11) +#define S5P64X0_PWR_CFG_RTC_ALRM_DISABLE (1 << 10) +#define S5P64X0_PWR_CFG_WFI_MASK (3 << 5) +#define S5P64X0_PWR_CFG_WFI_SLEEP (3 << 5) + +#define S5P64X0_SLEEP_CFG_OSC_EN (1 << 0) + +#define S5P64X0_PWR_STABLE_PWR_CNT_VAL4 (4 << 0) + +#define S5P6450_OTHERS_DISABLE_INT (1 << 31) +#define S5P64X0_OTHERS_RET_UART (1 << 26) +#define S5P64X0_OTHERS_RET_MMC1 (1 << 25) +#define S5P64X0_OTHERS_RET_MMC0 (1 << 24)#define S5P64X0_OTHERS_USB_SIG_MASK (1 << 16)/* Compatibility defines */
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +19 -0
@@ -34,14 +34,33 @@#define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180)#define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) +#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0) +#define S5P64X0_SPCON1 (S5P_VA_GPIO + 0x2B0) + +#define S5P64X0_MEM0CONSLP0 (S5P_VA_GPIO + 0x1C0) +#define S5P64X0_MEM0CONSLP1 (S5P_VA_GPIO + 0x1C4) +#define S5P64X0_MEM0DRVCON (S5P_VA_GPIO + 0x1D0) +#define S5P64X0_MEM1DRVCON (S5P_VA_GPIO + 0x1D4) + +#define S5P64X0_EINT12CON (S5P_VA_GPIO + 0x200) +#define S5P64X0_EINT12FLTCON (S5P_VA_GPIO + 0x220) +#define S5P64X0_EINT12MASK (S5P_VA_GPIO + 0x240) +/* External interrupt control registers for group0 */ #define EINT0CON0_OFFSET (0x900) +#define EINT0FLTCON0_OFFSET (0x910) +#define EINT0FLTCON1_OFFSET (0x914)#define EINT0MASK_OFFSET (0x920)#define EINT0PEND_OFFSET (0x924)#define S5P64X0_EINT0CON0 (S5P_VA_GPIO + EINT0CON0_OFFSET) +#define S5P64X0_EINT0FLTCON0 (S5P_VA_GPIO + EINT0FLTCON0_OFFSET) +#define S5P64X0_EINT0FLTCON1 (S5P_VA_GPIO + EINT0FLTCON1_OFFSET)#define S5P64X0_EINT0MASK (S5P_VA_GPIO + EINT0MASK_OFFSET)#define S5P64X0_EINT0PEND (S5P_VA_GPIO + EINT0PEND_OFFSET) +#define S5P64X0_SLPEN (S5P_VA_GPIO + 0x930) +#define S5P64X0_SLPEN_USE_xSLP (1 << 0) +#endif /* __ASM_ARCH_REGS_GPIO_H */
arch/arm/mach-s5p64x0/irq-eint.c +2 -0
@@ -20,6 +20,7 @@#include <plat/cpu.h> #include <plat/regs-irqtype.h> #include <plat/gpio-cfg.h> +#include <plat/pm.h> #include <mach/regs-gpio.h> #include <mach/regs-clock.h>
@@ -134,6 +135,7 @@ static int s5p64x0_alloc_gc(void) ct->chip.irq_mask = irq_gc_mask_set_bit; ct->chip.irq_unmask = irq_gc_mask_clr_bit; ct->chip.irq_set_type = s5p64x0_irq_eint_set_type; + ct->chip.irq_set_wake = s3c_irqext_wake; ct->regs.ack =EINT0PEND_OFFSET ; ct->regs.mask =EINT0MASK_OFFSET ; irq_setup_generic_chip(gc, IRQ_MSK(16), IRQ_GC_INIT_MASK_CACHE,
arch/arm/mach-s5p64x0/irq-pm.c new file +92 -0
92 lines not on this page · raw message
arch/arm/mach-s5p64x0/pm.c new file +204 -0
204 lines not on this page · raw message
Signature · 1 line
1.7.0.4
v2 cover S5P64X0 PM Support
In reply to Abhilash KesavanQuoted 18 lines · Abhilash Kesavan
The patchset adds Power Mangement support for S5P64X0. The first two patches lay the groundwork for adding PM support, while the final patch adds the SoC specific PM code.
Changes since V1:
- Changed register naming as per User Manual.
- Dropped the pm-gpio warning patch as it will be taken care in the gpio movement patch by Kukjin Kim.
- Used soc_is_* for differentiating between 6440 and 6450.
- Merged all the sleep files of S5P SoCs while leaving the S3C64XX sleep code as is.Abhilash Kesavan (3):
ARM: S5P: Make the common S5P PM code conditionally compile
ARM: S5P: Make the sleep code common for S5P series SoCs
ARM: S5P64X0: Add Power Management support
Quoted 12 lines
arch/arm/Kconfig | 2 +- arch/arm/mach-exynos4/Kconfig | 4 + arch/arm/mach-exynos4/Makefile | 2 +- arch/arm/mach-s5p64x0/Kconfig | 4 + arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/include/mach/map.h | 1 + arch/arm/mach-s5p64x0/include/mach/pm-core.h | 117 +++++++++++++ arch/arm/mach-s5p64x0/include/mach/regs-clock.h | 33 ++++ arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 19 ++ arch/arm/mach-s5p64x0/irq-eint.c | 2 + arch/arm/mach-s5p64x0/irq-pm.c | 92 ++++++++++ arch/arm/mach-s5p64x0/pm.c | 204
+++++++++++++++++++++++
Quoted 4 lines
arch/arm/mach-s5pv210/Kconfig | 2 + arch/arm/mach-s5pv210/Makefile | 2 +- arch/arm/mach-s5pv210/sleep.S | 52 ------ arch/arm/plat-s5p/Kconfig | 12 ++
Quoted 8 lines
arch/arm/plat-s5p/Makefile | 4 +-
arch/arm/{mach-exynos4 => plat-s5p}/sleep.S | 13 +-
18 files changed, 500 insertions(+), 66 deletions(-)
create mode 100644 arch/arm/mach-s5p64x0/include/mach/pm-core.h
create mode 100644 arch/arm/mach-s5p64x0/irq-pm.c
create mode 100644 arch/arm/mach-s5p64x0/pm.c
delete mode 100644 arch/arm/mach-s5pv210/sleep.S
rename arch/arm/{mach-exynos4 => plat-s5p}/sleep.S (81%)Looks ok to me, will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.