* [PATCH V4 1/5] ARM: exynos: Add support AFTR mode on EXYNOS4210
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
@ 2011-12-05 11:06 ` Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 2/5] ARM: exynos: save L2 settings during bootup Amit Daniel Kachhap
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Daniel Kachhap @ 2011-12-05 11:06 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds support AFTR(ARM OFF TOP RUNNING) mode in
cpuidle driver. L2 cache keeps their data in this mode.
This patch ports the code to the latest interfaces to
save/restore CPU state inclusive of CPU PM notifiers, l2
resume and cpu_suspend/resume.
Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
---
arch/arm/mach-exynos/cpuidle.c | 152 ++++++++++++++++++++++++++++++-
arch/arm/mach-exynos/include/mach/pmu.h | 2 +
2 files changed, 151 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 21403c8..89afa93 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -12,15 +12,37 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpuidle.h>
+#include <linux/cpu_pm.h>
#include <linux/io.h>
#include <linux/export.h>
#include <linux/time.h>
#include <asm/proc-fns.h>
+#include <asm/smp_scu.h>
+#include <asm/suspend.h>
+#include <asm/unified.h>
+#include <mach/regs-pmu.h>
+#include <mach/pmu.h>
+
+#include <plat/exynos4.h>
+#include <plat/cpu.h>
+
+#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \
+ S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
+ (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0))
+#define REG_DIRECTGO_FLAG (samsung_rev() == EXYNOS4210_REV_1_1 ? \
+ S5P_INFORM6 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
+ (S5P_VA_SYSRAM + 0x20) : S5P_INFORM1))
+
+#define S5P_CHECK_AFTR (samsung_rev() == EXYNOS4210_REV_1_0 ? \
+ 0xBAD00000 : 0xFCBA0D10)
static int exynos4_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index);
+static int exynos4_enter_lowpower(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv,
+ int index);
static struct cpuidle_state exynos4_cpuidle_set[] = {
[0] = {
@@ -28,9 +50,17 @@ static struct cpuidle_state exynos4_cpuidle_set[] = {
.exit_latency = 1,
.target_residency = 100000,
.flags = CPUIDLE_FLAG_TIME_VALID,
- .name = "IDLE",
+ .name = "C0",
.desc = "ARM clock gating(WFI)",
},
+ [1] = {
+ .enter = exynos4_enter_lowpower,
+ .exit_latency = 300,
+ .target_residency = 100000,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .name = "C1",
+ .desc = "ARM power down",
+ },
};
static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device);
@@ -40,9 +70,101 @@ static struct cpuidle_driver exynos4_idle_driver = {
.owner = THIS_MODULE,
};
+/* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */
+static void exynos4_set_wakeupmask(void)
+{
+ __raw_writel(0x0000ff3e, S5P_WAKEUP_MASK);
+}
+
+static unsigned int g_pwr_ctrl, g_diag_reg;
+
+static void save_cpu_arch_register(void)
+{
+ /*read power control register*/
+ asm("mrc p15, 0, %0, c15, c0, 0" : "=r"(g_pwr_ctrl) : : "cc");
+ /*read diagnostic register*/
+ asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
+ return;
+}
+
+static void restore_cpu_arch_register(void)
+{
+ /*write power control register*/
+ asm("mcr p15, 0, %0, c15, c0, 0" : : "r"(g_pwr_ctrl) : "cc");
+ /*write diagnostic register*/
+ asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
+ return;
+}
+
+static int idle_finisher(unsigned long flags)
+{
+ cpu_do_idle();
+ return 1;
+}
+
+static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv,
+ int index)
+{
+ struct timeval before, after;
+ int idle_time;
+ unsigned long tmp;
+
+ local_irq_disable();
+ do_gettimeofday(&before);
+
+ exynos4_set_wakeupmask();
+
+ /* Set value of power down register for aftr mode */
+ exynos4_sys_powerdown_conf(SYS_AFTR);
+
+ __raw_writel(BSYM(virt_to_phys(s3c_cpu_resume)),
+ REG_DIRECTGO_ADDR);
+ __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG);
+
+ save_cpu_arch_register();
+
+ /* Setting Central Sequence Register for power down mode */
+ tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
+ tmp &= ~S5P_CENTRAL_LOWPWR_CFG;
+ __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
+
+ cpu_pm_enter();
+ cpu_suspend(0, idle_finisher);
+
+ scu_enable(S5P_VA_SCU);
+ cpu_pm_exit();
+
+ restore_cpu_arch_register();
+
+ /*
+ * If PMU failed while entering sleep mode, WFI will be
+ * ignored by PMU and then exiting cpu_do_idle().
+ * S5P_CENTRAL_LOWPWR_CFG bit will not be set automatically
+ * in this situation.
+ */
+ tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
+ if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) {
+ tmp |= S5P_CENTRAL_LOWPWR_CFG;
+ __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
+ }
+
+ /* Clear wakeup state register */
+ __raw_writel(0x0, S5P_WAKEUP_STAT);
+
+ do_gettimeofday(&after);
+
+ local_irq_enable();
+ idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
+ (after.tv_usec - before.tv_usec);
+
+ dev->last_residency = idle_time;
+ return index;
+}
+
static int exynos4_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
- int index)
+ int index)
{
struct timeval before, after;
int idle_time;
@@ -61,6 +183,24 @@ static int exynos4_enter_idle(struct cpuidle_device *dev,
return index;
}
+static int exynos4_enter_lowpower(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv,
+ int index)
+{
+ int new_index = index;
+
+ /* This mode only can be entered when other core's are offline */
+ if (num_online_cpus() > 1) {
+ new_index = drv->safe_state_index;
+ BUG_ON(new_index > drv->state_count);
+ }
+
+ if (new_index == 0)
+ return exynos4_enter_idle(dev, drv, new_index);
+ else
+ return exynos4_enter_core0_aftr(dev, drv, new_index);
+}
+
static int __init exynos4_init_cpuidle(void)
{
int i, max_cpuidle_state, cpu_id;
@@ -75,19 +215,25 @@ static int __init exynos4_init_cpuidle(void)
memcpy(&drv->states[i], &exynos4_cpuidle_set[i],
sizeof(struct cpuidle_state));
}
+ drv->safe_state_index = 0;
cpuidle_register_driver(&exynos4_idle_driver);
for_each_cpu(cpu_id, cpu_online_mask) {
device = &per_cpu(exynos4_cpuidle_device, cpu_id);
device->cpu = cpu_id;
- device->state_count = drv->state_count;
+ if (cpu_id == 0)
+ device->state_count = (sizeof(exynos4_cpuidle_set) /
+ sizeof(struct cpuidle_state));
+ else
+ device->state_count = 1; /* Support IDLE only */
if (cpuidle_register_device(device)) {
printk(KERN_ERR "CPUidle register device failed\n,");
return -EIO;
}
}
+
return 0;
}
device_initcall(exynos4_init_cpuidle);
diff --git a/arch/arm/mach-exynos/include/mach/pmu.h b/arch/arm/mach-exynos/include/mach/pmu.h
index 632dd56..e76b7fa 100644
--- a/arch/arm/mach-exynos/include/mach/pmu.h
+++ b/arch/arm/mach-exynos/include/mach/pmu.h
@@ -22,11 +22,13 @@ enum sys_powerdown {
NUM_SYS_POWERDOWN,
};
+extern unsigned long l2x0_regs_phys;
struct exynos4_pmu_conf {
void __iomem *reg;
unsigned int val[NUM_SYS_POWERDOWN];
};
extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode);
+extern void s3c_cpu_resume(void);
#endif /* __ASM_ARCH_PMU_H */
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH V4 2/5] ARM: exynos: save L2 settings during bootup
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 1/5] ARM: exynos: Add support AFTR mode on EXYNOS4210 Amit Daniel Kachhap
@ 2011-12-05 11:06 ` Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 3/5] ARM: s5p: add L2 early resume code Amit Daniel Kachhap
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Daniel Kachhap @ 2011-12-05 11:06 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds code to save L2 register configuration at boot, and
later used to resume L2 before MMU is enabled in suspend and cpuidle
resume paths.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
---
arch/arm/mach-exynos/cpu.c | 42 +++++++++++++++++++++++++++++++-----------
1 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c
index 8e09f34..252e346 100644
--- a/arch/arm/mach-exynos/cpu.c
+++ b/arch/arm/mach-exynos/cpu.c
@@ -19,6 +19,7 @@
#include <asm/proc-fns.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/hardware/gic.h>
+#include <asm/cacheflush.h>
#include <plat/cpu.h>
#include <plat/clock.h>
@@ -34,6 +35,7 @@
#include <mach/regs-irq.h>
#include <mach/regs-pmu.h>
+#include <mach/pmu.h>
unsigned int gic_bank_offset __read_mostly;
@@ -297,20 +299,38 @@ core_initcall(exynos4_core_init);
#ifdef CONFIG_CACHE_L2X0
static int __init exynos4_l2x0_cache_init(void)
{
- /* TAG, Data Latency Control: 2cycle */
- __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
+ if (!(__raw_readl(S5P_VA_L2CC + L2X0_CTRL) & 0x1)) {
+ l2x0_saved_regs.phy_base = EXYNOS4_PA_L2CC;
+ /* TAG, Data Latency Control: 2 cycles */
+ l2x0_saved_regs.tag_latency = 0x110;
- if (soc_is_exynos4210())
- __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
- else if (soc_is_exynos4212() || soc_is_exynos4412())
- __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
+ if (soc_is_exynos4212() || soc_is_exynos4412())
+ l2x0_saved_regs.data_latency = 0x120;
+ else
+ l2x0_saved_regs.data_latency = 0x110;
+
+ l2x0_saved_regs.prefetch_ctrl = 0x30000007;
+ l2x0_saved_regs.pwr_ctrl =
+ (L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN);
+
+ l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs);
- /* L2X0 Prefetch Control */
- __raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
+ __raw_writel(l2x0_saved_regs.tag_latency,
+ S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
+ __raw_writel(l2x0_saved_regs.data_latency,
+ S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
- /* L2X0 Power Control */
- __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN,
- S5P_VA_L2CC + L2X0_POWER_CTRL);
+ /* L2X0 Prefetch Control */
+ __raw_writel(l2x0_saved_regs.prefetch_ctrl,
+ S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
+
+ /* L2X0 Power Control */
+ __raw_writel(l2x0_saved_regs.pwr_ctrl,
+ S5P_VA_L2CC + L2X0_POWER_CTRL);
+
+ clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long));
+ clean_dcache_area(&l2x0_saved_regs, sizeof(struct l2x0_regs));
+ }
l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff);
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH V4 3/5] ARM: s5p: add L2 early resume code
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 1/5] ARM: exynos: Add support AFTR mode on EXYNOS4210 Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 2/5] ARM: exynos: save L2 settings during bootup Amit Daniel Kachhap
@ 2011-12-05 11:06 ` Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 4/5] ARM: exynos: remove useless code to save/restore L2 Amit Daniel Kachhap
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Daniel Kachhap @ 2011-12-05 11:06 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds code to resume L2 before MMU is enabled in
suspend and cpuidle resume paths. s3c_cpu_resume is moved to the
data section with appropriate comments.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
---
arch/arm/plat-s5p/sleep.S | 44 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/arch/arm/plat-s5p/sleep.S b/arch/arm/plat-s5p/sleep.S
index 0fd591b..006bd01 100644
--- a/arch/arm/plat-s5p/sleep.S
+++ b/arch/arm/plat-s5p/sleep.S
@@ -23,9 +23,18 @@
*/
#include <linux/linkage.h>
-#include <asm/assembler.h>
+#include <asm/asm-offsets.h>
+#include <asm/hardware/cache-l2x0.h>
- .text
+/*
+ * The following code is located into the .data section. This is to
+ * allow l2x0_regs_phys to be accessed with a relative load while we
+ * can't rely on any MMU translation. We could have put l2x0_regs_phys
+ * in the .text section as well, but some setups might insist on it to
+ * be truly read-only. (Reference from: arch/arm/kernel/sleep.S)
+ */
+ .data
+ .align
/*
* sleep magic, to allow the bootloader to check for an valid
@@ -39,11 +48,34 @@
* s3c_cpu_resume
*
* resume code entry for bootloader to call
- *
- * we must put this code here in the data segment as we have no
- * other way of restoring the stack pointer after sleep, and we
- * must not write to the code segment (code is read-only)
*/
ENTRY(s3c_cpu_resume)
+#ifdef CONFIG_CACHE_L2X0
+ adr r0, l2x0_regs_phys
+ ldr r0, [r0]
+ ldr r1, [r0, #L2X0_R_PHY_BASE]
+ ldr r2, [r1, #L2X0_CTRL]
+ tst r2, #0x1
+ bne resume_l2on
+ ldr r2, [r0, #L2X0_R_AUX_CTRL]
+ str r2, [r1, #L2X0_AUX_CTRL]
+ ldr r2, [r0, #L2X0_R_TAG_LATENCY]
+ str r2, [r1, #L2X0_TAG_LATENCY_CTRL]
+ ldr r2, [r0, #L2X0_R_DATA_LATENCY]
+ str r2, [r1, #L2X0_DATA_LATENCY_CTRL]
+ ldr r2, [r0, #L2X0_R_PREFETCH_CTRL]
+ str r2, [r1, #L2X0_PREFETCH_CTRL]
+ ldr r2, [r0, #L2X0_R_PWR_CTRL]
+ str r2, [r1, #L2X0_POWER_CTRL]
+ mov r2, #1
+ str r2, [r1, #L2X0_CTRL]
+resume_l2on:
+#endif
b cpu_resume
+ENDPROC(s3c_cpu_resume)
+#ifdef CONFIG_CACHE_L2X0
+ .globl l2x0_regs_phys
+l2x0_regs_phys:
+ .long 0
+#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH V4 4/5] ARM: exynos: remove useless code to save/restore L2
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
` (2 preceding siblings ...)
2011-12-05 11:06 ` [PATCH V4 3/5] ARM: s5p: add L2 early resume code Amit Daniel Kachhap
@ 2011-12-05 11:06 ` Amit Daniel Kachhap
2011-12-05 11:06 ` [PATCH V4 5/5] ARM: exynos: Enable l2 configuration through device tree Amit Daniel Kachhap
2012-01-03 6:22 ` [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state amit kachhap
5 siblings, 0 replies; 9+ messages in thread
From: Amit Daniel Kachhap @ 2011-12-05 11:06 UTC (permalink / raw)
To: linux-arm-kernel
Following the merge of CPU PM notifiers and L2 resume code, this patch
removes useless code to save and restore L2 registers.
This is now automatically covered by suspend calls which integrated
CPU PM notifiers and new sleep code that allows to resume L2 before MMU
is turned on.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
---
arch/arm/mach-exynos/pm.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 4093fea..1883cc9 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -155,13 +155,6 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_SROM_BC3),
};
-static struct sleep_save exynos4_l2cc_save[] = {
- SAVE_ITEM(S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL),
- SAVE_ITEM(S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL),
- SAVE_ITEM(S5P_VA_L2CC + L2X0_PREFETCH_CTRL),
- SAVE_ITEM(S5P_VA_L2CC + L2X0_POWER_CTRL),
- SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL),
-};
/* For Cortex-A9 Diagnostic and Power control register */
static unsigned int save_arm_register[2];
@@ -182,7 +175,6 @@ static void exynos4_pm_prepare(void)
u32 tmp;
s3c_pm_do_save(exynos4_core_save, ARRAY_SIZE(exynos4_core_save));
- s3c_pm_do_save(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save));
s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save));
@@ -384,13 +376,6 @@ static void exynos4_pm_resume(void)
scu_enable(S5P_VA_SCU);
-#ifdef CONFIG_CACHE_L2X0
- s3c_pm_do_restore_core(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
- outer_inv_all();
- /* enable L2X0*/
- writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL);
-#endif
-
early_wakeup:
return;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH V4 5/5] ARM: exynos: Enable l2 configuration through device tree
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
` (3 preceding siblings ...)
2011-12-05 11:06 ` [PATCH V4 4/5] ARM: exynos: remove useless code to save/restore L2 Amit Daniel Kachhap
@ 2011-12-05 11:06 ` Amit Daniel Kachhap
2012-01-03 6:22 ` [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state amit kachhap
5 siblings, 0 replies; 9+ messages in thread
From: Amit Daniel Kachhap @ 2011-12-05 11:06 UTC (permalink / raw)
To: linux-arm-kernel
This patch enables calling generic l2 setup functions if device tree is used.
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
---
arch/arm/mach-exynos/cpu.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c
index 252e346..b62a90f 100644
--- a/arch/arm/mach-exynos/cpu.c
+++ b/arch/arm/mach-exynos/cpu.c
@@ -37,6 +37,9 @@
#include <mach/regs-pmu.h>
#include <mach/pmu.h>
+#define L2_AUX_VAL 0x7C470001
+#define L2_AUX_MASK 0xC200ffff
+
unsigned int gic_bank_offset __read_mostly;
extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
@@ -299,6 +302,7 @@ core_initcall(exynos4_core_init);
#ifdef CONFIG_CACHE_L2X0
static int __init exynos4_l2x0_cache_init(void)
{
+#ifndef CONFIG_OF
if (!(__raw_readl(S5P_VA_L2CC + L2X0_CTRL) & 0x1)) {
l2x0_saved_regs.phy_base = EXYNOS4_PA_L2CC;
/* TAG, Data Latency Control: 2 cycles */
@@ -332,8 +336,12 @@ static int __init exynos4_l2x0_cache_init(void)
clean_dcache_area(&l2x0_saved_regs, sizeof(struct l2x0_regs));
}
- l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff);
-
+ l2x0_init(S5P_VA_L2CC, L2_AUX_VAL, L2_AUX_MASK);
+#else
+ l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK);
+ l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs);
+ clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long));
+#endif
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state
2011-12-05 11:06 [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state Amit Daniel Kachhap
` (4 preceding siblings ...)
2011-12-05 11:06 ` [PATCH V4 5/5] ARM: exynos: Enable l2 configuration through device tree Amit Daniel Kachhap
@ 2012-01-03 6:22 ` amit kachhap
2012-01-03 13:22 ` Kukjin Kim
5 siblings, 1 reply; 9+ messages in thread
From: amit kachhap @ 2012-01-03 6:22 UTC (permalink / raw)
To: linux-arm-kernel
Hi Mr kim,
All the comments have been addressed for the Exynos cpu idle patchset.
The updated patchset was posted about one month back and there have
been no further comments on the patchset since then.
As this patchset seems to be stable now, do you think these these
patches can merged in this 3.3 merge window? Kindly let me know your
opinion.
Thanks,
Amit Daniel
On Mon, Dec 5, 2011 at 4:36 PM, Amit Daniel Kachhap
<amit.kachhap@linaro.org> wrote:
> Changes since V3:
> *Implemented Russell feedback and moved sleep magic 4byte memory before
> s3c_cpu_resume to data section.
>
> Changes since V2:
> *Implemented the suggestion of MyungJoo Ham and used INFORM0/1
> registers for resume for some board versions.
> *Added back save/restore through CPU PM notifiers as suggested by
> Lorenzo Pieralisi. This is useful to restore vfp state.
> *some patch modularization (s5p/exynos) and proper commit logs.
>
> Changes since V1:
> *rebased the whole patch against 3.2-rc1 tree
> *removed GIC save/restore in AFTR cpuidle state as it is external
> to cpu powerdomain
> *Added L2 setup code through device tree
> *Removed only l2 save/restore registers in sleep
>
> This Patch series adds support for AFTR mode cpuidle state based on
> patch (http://www.spinics.net/lists/arm-kernel/msg132243.html) earlier
> submitted by Jaecheol Lee <jc.lee@samsung.com>.
>
> This patch uses CPU PM notifiers , common l2 save/restore and
> new cpu_suspend/resume interfaces and is based on the tip of
> for-next branch of samsung tree.
> (git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git for-next).
>
> Amit Daniel Kachhap (5):
> ?ARM: exynos: Add support AFTR mode on EXYNOS4210
> ?ARM: exynos: save L2 settings during bootup
> ?ARM: s5p: add L2 early resume code
> ?ARM: exynos: remove useless code to save/restore L2
> ?ARM: exynos: Enable l2 configuration through device tree
>
> ?arch/arm/mach-exynos/cpu.c ? ? ? ? ? ? ?| ? 60 +++++++++---
> ?arch/arm/mach-exynos/cpuidle.c ? ? ? ? ?| ?152 ++++++++++++++++++++++++++++++-
> ?arch/arm/mach-exynos/include/mach/pmu.h | ? ?2 +
> ?arch/arm/mach-exynos/pm.c ? ? ? ? ? ? ? | ? 15 ---
> ?arch/arm/plat-s5p/sleep.S ? ? ? ? ? ? ? | ? 44 ++++++++-
> ?5 files changed, 233 insertions(+), 40 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state
2012-01-03 6:22 ` [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state amit kachhap
@ 2012-01-03 13:22 ` Kukjin Kim
2012-01-05 4:26 ` Amit Kachhap
0 siblings, 1 reply; 9+ messages in thread
From: Kukjin Kim @ 2012-01-03 13:22 UTC (permalink / raw)
To: linux-arm-kernel
amit kachhap wrote:
>
> Hi Mr kim,
>
> All the comments have been addressed for the Exynos cpu idle patchset.
> The updated patchset was posted about one month back and there have
> been no further comments on the patchset since then.
>
> As this patchset seems to be stable now, do you think these these
> patches can merged in this 3.3 merge window? Kindly let me know your
> opinion.
>
This conflicts with local common.[ch] working for ARM restart. Please wait
until after the merge window for this patches.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V4 0/5] ARM: exynos: Add l2 retention mode cpuidle state
2012-01-03 13:22 ` Kukjin Kim
@ 2012-01-05 4:26 ` Amit Kachhap
0 siblings, 0 replies; 9+ messages in thread
From: Amit Kachhap @ 2012-01-05 4:26 UTC (permalink / raw)
To: linux-arm-kernel
On 3 January 2012 18:52, Kukjin Kim <kgene.kim@samsung.com> wrote:
> amit kachhap wrote:
>>
>> Hi Mr kim,
>>
>> All the comments have been addressed for the Exynos cpu idle patchset.
>> The updated patchset was posted about one month back and there have
>> been no further comments on the patchset since then.
>>
>> As this patchset seems to be stable now, do you think these these
>> patches can merged in this 3.3 merge window? Kindly let me know your
>> opinion.
>>
>
> This conflicts with local common.[ch] working for ARM restart. Please wait
> until after the merge window for this patches.
>
Thanks for the update.
Actually I have fixed the merging issue in common.[ch] files so
sending the V5 series of the patchset shortly. If possible add in this
merge window or next merge window is also fine.
Regards,
Amit daniel
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
^ permalink raw reply [flat|nested] 9+ messages in thread