Skip to contentSkip to conversation

ARM: EXYNOS4: Use cpuidle common save/restore framework code

RFC PATCH New Amit Daniel Kachhap 5 participants 11 messages Aug 19, 2011 – Aug 26, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: EXYNOS4: Use cpuidle common save/restore framework code

These patch adds support for samsung exynos4 platform cpuidle driver to use the common cpuidle framework submitted earlier by Lorenzo Pieralisi. Basically a single interface cpu_enter_idle takes care of saving and restoring single cpu or whole cluster information. The link to the framework patchset is,
http://www.spinics.net/lists/arm-kernel/msg132044.html

Description of patches in this list:
1)Patch (ARM: kernel: Some fixes in save/restore common code) adds some essential fixes for the common save/restore to work on exynos4 platform.

2)Patch (ARM: EXYNOS4: Fix to work with origen boards) adds a fix for extracting chip revision number.

3)Patch (ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210) rebases the L2 retention C state cpuidle driver submitted earlier by Jaecheol Lee.

4)Patch (Modify cpuidle code to adapt to save/restore common code) uses the generic infrastructure to enter and exit from the retention idle state.

All these codes have been tested on Samsung ORIGEN board against the tree
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git for-next.

Amit Daniel Kachhap (4):
ARM: kernel: Some fixes in save/restore common code.
ARM: EXYNOS4: Fix to work with origen boards.
ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210
ARM: EXYNOS4: Modify cpuidle code to adapt to save/restore common
code

 arch/arm/Kconfig                         |    1 +
 arch/arm/common/gic.c                    |    1 -
 arch/arm/kernel/sr_helpers.h             |    2 +-
 arch/arm/mach-exynos4/cpu.c              |   10 ++
 arch/arm/mach-exynos4/cpuidle.c          |  150 +++++++++++++++++++++++++++++-
 arch/arm/mach-exynos4/include/mach/pmu.h |    1 -
 arch/arm/mm/cache-l2x0.c                 |   10 ++-
 arch/arm/plat-s5p/include/plat/exynos4.h |    1 +
 8 files changed, 169 insertions(+), 7 deletions(-)
#1 lore raw

RFC PATCH 1/4 ARM: kernel: Small fixes in save/restore common code.

These changes are necessary to make the retention cpuidle state work. This adds support for saving more L2 registers.

---
 arch/arm/common/gic.c        |    1 -
 arch/arm/kernel/sr_helpers.h |    2 +-
 arch/arm/mm/cache-l2x0.c     |   10 +++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/common/gic.c +0 -1
index d845b75..124e122 100644
@@ -385,7 +385,6 @@ static void gic_dist_save(unsigned int gic_nr)
 		gic_data[gic_nr].saved_spi_enable[i] =
 			readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
 
-	writel_relaxed(0, dist_base + GIC_DIST_CTRL);
 }
 
 /*
arch/arm/kernel/sr_helpers.h +1 -1
index 1ae3a9a..5a30461 100644
@@ -44,7 +44,7 @@ static inline void exit_coherency(void)
 		"mcr	p15, 0, %0, c1, c0, 1\n"
 		 : "=&r" (v)
 		 : "Ir" (0x40)
-		 : );
+		 : "cc");
 }
 #else
 static inline void exit_coherency(void) { }
arch/arm/mm/cache-l2x0.c +9 -1
index 4c99d41..f23696b 100644
@@ -285,7 +285,11 @@ static void l2x0_save_context(void *data, bool dormant, unsigned long end)
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_TAG_LATENCY_CTRL);
 	l2x0_regs++;
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_DATA_LATENCY_CTRL);
-
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_POWER_CTRL);
+	dormant = 0;
 	if (!dormant) {
 		/* clean entire L2 before disabling it*/
 		writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY);
@@ -325,6 +329,10 @@ static void l2x0_restore_context(void *data, bool dormant)
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_TAG_LATENCY_CTRL);
 		l2x0_regs++;
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_DATA_LATENCY_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_PREFETCH_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_POWER_CTRL);
 		/*
 		 * If L2 is retained do not invalidate
 		 */
Signature · 1 line
1.7.1
#2 lore raw

RFC PATCH 1/4 ARM: kernel: Small fixes in save/restore common code.

This patch is redundant with Lorenzo's new series[1]. Adding him to cc. I suggest you rebase on top of his latest series.

Quoted 15 lines · Amit Daniel Kachhap

These changes are necessary to make the retention cpuidle state work. This adds support for saving more L2 registers.

---
 arch/arm/common/gic.c        |    1 -
 arch/arm/kernel/sr_helpers.h |    2 +-
 arch/arm/mm/cache-l2x0.c     |   10 +++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/common/gic.c +0 -0
index d845b75..124e122 100644

arch/arm/common/gic.c static void gic_dist_save(unsigned int gic_nr) · line 388

Quoted 5 lines
arch/arm/common/gic.c +0 -1
@@ -385,7 +385,6 @@ static void gic_dist_save(unsigned int gic_nr)
 		gic_data[gic_nr].saved_spi_enable[i] =
 			readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
 
-	writel_relaxed(0, dist_base + GIC_DIST_CTRL);
 }

He already has this bit in his tree[1]

arch/arm/kernel/sr_helpers.h static inline void exit_coherency(void) · line 47

Quoted 11 lines
arch/arm/common/gic.c +0 -0
 /*
arch/arm/kernel/sr_helpers.h +1 -1
index 1ae3a9a..5a30461 100644
@@ -44,7 +44,7 @@ static inline void exit_coherency(void)
 		"mcr	p15, 0, %0, c1, c0, 1\n"
 		 : "=&r" (v)
 		 : "Ir" (0x40)
-		 : );
+		 : "cc");

He has a different fix for this.

Quoted 33 lines
arch/arm/kernel/sr_helpers.h +0 -0
 }
 #else
 static inline void exit_coherency(void) { }
arch/arm/mm/cache-l2x0.c +9 -1
index 4c99d41..f23696b 100644
@@ -285,7 +285,11 @@ static void l2x0_save_context(void *data, bool dormant, unsigned long end)
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_TAG_LATENCY_CTRL);
 	l2x0_regs++;
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_DATA_LATENCY_CTRL);
-
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_POWER_CTRL);
+	dormant = 0;
 	if (!dormant) {
 		/* clean entire L2 before disabling it*/
 		writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY);
@@ -325,6 +329,10 @@ static void l2x0_restore_context(void *data, bool dormant)
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_TAG_LATENCY_CTRL);
 		l2x0_regs++;
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_DATA_LATENCY_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_PREFETCH_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_POWER_CTRL);
 		/*
 		 * If L2 is retained do not invalidate
 		 */
Signature · 1 line
1.7.1

Already fixed in his tree.

[1] git://linux-arm.org/linux-2.6-lp.git sr-test-for-linaro

#3 lore raw

RFC PATCH 1/4 ARM: kernel: Small fixes in save/restore common code.

Quoted 3 lines · Amit Kucheria

This patch is redundant with Lorenzo's new series[1]. Adding him to cc. I suggest you rebase on top of his latest series.

Yes, thanks for pointing that out.

Quoted 24 lines · Amit Daniel Kachhap
Quoted 15 lines

These changes are necessary to make the retention cpuidle state work. This adds support for saving more L2 registers.

---
 arch/arm/common/gic.c        |    1 -
 arch/arm/kernel/sr_helpers.h |    2 +-
 arch/arm/mm/cache-l2x0.c     |   10 +++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/common/gic.c +0 -0
index d845b75..124e122 100644

arch/arm/common/gic.c static void gic_dist_save(unsigned int gic_nr) · line 388

Quoted 5 lines
arch/arm/common/gic.c +0 -1
@@ -385,7 +385,6 @@ static void gic_dist_save(unsigned int gic_nr)
 		gic_data[gic_nr].saved_spi_enable[i] =
 			readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
 
-	writel_relaxed(0, dist_base + GIC_DIST_CTRL);
 }

He already has this bit in his tree[1]

Quoted 14 lines

arch/arm/kernel/sr_helpers.h static inline void exit_coherency(void) · line 47

Quoted 11 lines
arch/arm/common/gic.c +0 -0
 /*
arch/arm/kernel/sr_helpers.h +1 -1
index 1ae3a9a..5a30461 100644
@@ -44,7 +44,7 @@ static inline void exit_coherency(void)
 		"mcr	p15, 0, %0, c1, c0, 1\n"
 		 : "=&r" (v)
 		 : "Ir" (0x40)
-		 : );
+		 : "cc");

He has a different fix for this.

We have to rework it anyway it since it does not belong in generic code.

Quoted 9 lines
Quoted 9 lines
arch/arm/kernel/sr_helpers.h +0 -0
 }
 #else
 static inline void exit_coherency(void) { }
arch/arm/mm/cache-l2x0.c +0 -0
index 4c99d41..f23696b 100644
@@ -285,7 +285,11 @@ static void l2x0_save_context(void *data, bool dormant, unsigned long end)
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_TAG_LATENCY_CTRL);
Quoted 8 lines

arch/arm/mm/cache-l2x0.c static void l2x0_save_context(void *data, bool dormant, unsigned long end) · line 292

Quoted 8 lines
arch/arm/mm/cache-l2x0.c +5 -1
 	l2x0_regs++;
 	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_DATA_LATENCY_CTRL);
-
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
+	l2x0_regs++;
+	*l2x0_regs =  readl_relaxed(l2x0_base + L2X0_POWER_CTRL);
+	dormant = 0;

This is not right, dormant mode depends on cluster state and L2 retention capabilities, it must not be forced. I fixed L2 stack cleaning when L2 is in retention, please fetch [1] below.

Quoted 19 lines
Quoted 16 lines
arch/arm/mm/cache-l2x0.c +4 -0
 	if (!dormant) {
 		/* clean entire L2 before disabling it*/
 		writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY);
@@ -325,6 +329,10 @@ static void l2x0_restore_context(void *data, bool dormant)
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_TAG_LATENCY_CTRL);
 		l2x0_regs++;
 		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_DATA_LATENCY_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_PREFETCH_CTRL);
+		l2x0_regs++;
+		writel_relaxed(*l2x0_regs, l2x0_base + L2X0_POWER_CTRL);
 		/*
 		 * If L2 is retained do not invalidate
 		 */
Signature · 1 line
1.7.1

Already fixed in his tree.

Quoted 1 line

[1] git://linux-arm.org/linux-2.6-lp.git sr-test-for-linaro

Thanks,
Lorenzo

Quoted 1 line
#4 lore raw

RFC PATCH 2/4 ARM: EXYNOS4: Fix to work with origen boards.

In reply to Amit Daniel Kachhap

This adds a function to get the revision id.

---
 arch/arm/mach-exynos4/cpu.c              |   10 ++++++++++
 arch/arm/plat-s5p/include/plat/exynos4.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-exynos4/cpu.c +10 -0
index 2d8a40c..8b106b8 100644
@@ -234,6 +234,16 @@ static int __init exynos4_l2x0_cache_init(void)
 early_initcall(exynos4_l2x0_cache_init);
 #endif
 
+int exynos4_subrev(void)
+{
+	static int subrev = -1;
+
+	if (unlikely(subrev < 0))
+		subrev = readl(S5P_VA_CHIPID) & 0xf;
+
+	return subrev;
+}
+
 int __init exynos4_init(void)
 {
 	printk(KERN_INFO "EXYNOS4: Initializing architecture\n");
arch/arm/plat-s5p/include/plat/exynos4.h +1 -0
index 907caab..d62f7f7 100644
@@ -15,6 +15,7 @@
 extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 extern void exynos4_register_clocks(void);
 extern void exynos4_setup_clocks(void);
+extern int exynos4_subrev(void);
 
 #ifdef CONFIG_CPU_EXYNOS4210
 
Signature · 1 line
1.7.1
#5 lore raw

RFC PATCH 2/4 ARM: EXYNOS4: Fix to work with origen boards.

Quoted 17 lines · Amit Daniel Kachhap

This adds a function to get the revision id.

---
?arch/arm/mach-exynos4/cpu.c ? ? ? ? ? ? ?| ? 10 ++++++++++ ?arch/arm/plat-s5p/include/plat/exynos4.h | ? ?1 + ?2 files changed, 11 insertions(+), 0 deletions(-)

arch/arm/mach-exynos4/cpu.c +0 -0
index 2d8a40c..8b106b8 100644
@@ -234,6 +234,16 @@ static int __init exynos4_l2x0_cache_init(void)
 ?early_initcall(exynos4_l2x0_cache_init);

?#endif

arch/arm/mach-exynos4/cpu.c static int __init exynos4_l2x0_cache_init(void)

Quoted 6 lines
arch/arm/mach-exynos4/cpu.c +6 -0
+int exynos4_subrev(void)
+{
+ ? ? ? static int subrev = -1;
+
+ ? ? ? if (unlikely(subrev < 0))
+ ? ? ? ? ? ? ? subrev = readl(S5P_VA_CHIPID) & 0xf;

How about to add the clock control here?
1. Register chipid clk
2. Get the chipid clk
3. Read CHPIID,
4. Put tht chipid clk.

Then you can save some power.

Thank you,
Kyungmin Park

Quoted 27 lines
arch/arm/mach-exynos4/cpu.c +4 -0
+
+ ? ? ? return subrev;
+}
+

?int __init exynos4_init(void)
?{
? ? ? ?printk(KERN_INFO "EXYNOS4: Initializing architecture\n");

arch/arm/plat-s5p/include/plat/exynos4.h +1 -0
index 907caab..d62f7f7 100644
@@ -15,6 +15,7 @@
 ?extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 ?extern void exynos4_register_clocks(void);
 ?extern void exynos4_setup_clocks(void);
+extern int exynos4_subrev(void);
 

?#ifdef CONFIG_CPU_EXYNOS4210

--
1.7.1

--
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

#6 lore raw

RFC PATCH 2/4 ARM: EXYNOS4: Fix to work with origen boards.

Quoted 19 lines · Kyungmin Park
Quoted 17 lines · Amit Daniel Kachhap

This adds a function to get the revision id.

---
?arch/arm/mach-exynos4/cpu.c ? ? ? ? ? ? ?| ? 10 ++++++++++ ?arch/arm/plat-s5p/include/plat/exynos4.h | ? ?1 + ?2 files changed, 11 insertions(+), 0 deletions(-)

arch/arm/mach-exynos4/cpu.c +0 -0
index 2d8a40c..8b106b8 100644
@@ -234,6 +234,16 @@ static int __init exynos4_l2x0_cache_init(void)
 ?early_initcall(exynos4_l2x0_cache_init);

?#endif

Quoted 11 lines

arch/arm/mach-exynos4/cpu.c static int __init exynos4_l2x0_cache_init(void)

Quoted 6 lines
arch/arm/mach-exynos4/cpu.c +6 -0
+int exynos4_subrev(void)
+{
+ ? ? ? static int subrev = -1;
+
+ ? ? ? if (unlikely(subrev < 0))
+ ? ? ? ? ? ? ? subrev = readl(S5P_VA_CHIPID) & 0xf;

How about to add the clock control here?
1. Register chipid clk
2. Get the chipid clk
3. Read CHPIID,
4. Put tht chipid clk.

Nice suggestion. Will do it in the next patch version. Actually the main focus of this
patch series was to have a proof of concept of the new cpuidle common code.

Thanks,
Amit Daniel

Quoted 33 lines

Then you can save some power.

Thank you,
Kyungmin Park

Quoted 27 lines
arch/arm/mach-exynos4/cpu.c +4 -0
+
+ ? ? ? return subrev;
+}
+

?int __init exynos4_init(void)
?{
? ? ? ?printk(KERN_INFO "EXYNOS4: Initializing architecture\n");

arch/arm/plat-s5p/include/plat/exynos4.h +1 -0
index 907caab..d62f7f7 100644
@@ -15,6 +15,7 @@
 ?extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 ?extern void exynos4_register_clocks(void);
 ?extern void exynos4_setup_clocks(void);
+extern int exynos4_subrev(void);
 

?#ifdef CONFIG_CPU_EXYNOS4210

--
1.7.1

--
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

#7 lore raw

RFC PATCH 3/4 ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210

In reply to Amit Daniel Kachhap

This patch adds support AFTR(ARM OFF TOP RUNNING) mode in cpuidle driver. L2 cache keeps their data in this mode.

---
 arch/arm/mach-exynos4/Makefile           |    2 +-
 arch/arm/mach-exynos4/cpuidle.c          |  131 +++++++++++++++++++++++-
 arch/arm/mach-exynos4/idle.S             |  165 ++++++++++++++++++++++++++++++
 arch/arm/mach-exynos4/include/mach/pmu.h |    5 +-
 4 files changed, 300 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/idle.S
arch/arm/mach-exynos4/Makefile +1 -1
index 2e3a407..12568b0 100644
@@ -16,7 +16,7 @@ obj-$(CONFIG_CPU_EXYNOS4210)	+= cpu.o init.o clock.o irq-combiner.o
 obj-$(CONFIG_CPU_EXYNOS4210)	+= setup-i2c0.o irq-eint.o dma.o pmu.o
 obj-$(CONFIG_PM)		+= pm.o sleep.o
 obj-$(CONFIG_CPU_FREQ)		+= cpufreq.o
-obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
+obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o idle.o
 
 obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
 
arch/arm/mach-exynos4/cpuidle.c +130 -1

179 lines not on this page · raw message

arch/arm/mach-exynos4/idle.S new file +165 -0

165 lines not on this page · raw message

arch/arm/mach-exynos4/include/mach/pmu.h +4 -1
index a952904..960456f 100644
@@ -21,5 +21,8 @@ enum sys_powerdown {
 };
 
 extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode);
-
+extern void exynos4_idle_resume(void);
+extern void exynos4_enter_lp(unsigned long arg, long offset);
+/* Keep following save sequence prefetch, power, tag, data, aux */
+extern unsigned long l2cc_save[5];
 #endif /* __ASM_ARCH_PMU_H */
Signature · 1 line
1.7.1
#8 lore raw

RFC PATCH 3/4 ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210

Quoted 14 lines · Amit Daniel Kachhap
arch/arm/mach-exynos4/idle.S new file +14 -0
+ENTRY(exynos4_enter_lp)
+	stmfd	sp!, { r3 - r12, lr }
+
+	adr	r0, sleep_save_misc
+
+	mrc	p15, 0, r2, c15, c0, 0	@ read power control register
+	str	r2, [r0], #4
+
+	mrc	p15, 0, r2, c15, c0, 1	@ read diagnostic register
+	str	r2, [r0], #4
+
+	ldr	r3, =resume_with_mmu
+	bl	cpu_suspend
+

arch/arm/mach-exynos4/idle.S line 53

Quoted 10 lines
arch/arm/mach-exynos4/idle.S new file +10 -0
+	mov	r0, sp
+	bl	exynos4_cpu_lp
+
+	/* Restore original sp */
+	mov	r0, sp
+	add	r0, r0, #4
+	ldr	sp, [r0]
+
+	mov	r0, #0
+	b	early_wakeup

This is based upon old kernel code. Clearly hasn't been tested with anything later than 3.0.

#9 lore raw

RFC PATCH 3/4 ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210

Quoted 20 lines · Russell King - ARM Linux
Quoted 19 lines · Amit Daniel Kachhap
(quoted diff) +19 -0
+ENTRY(exynos4_enter_lp)
+ ? ? stmfd ? sp!, { r3 - r12, lr }
+
+ ? ? adr ? ? r0, sleep_save_misc
+
+ ? ? mrc ? ? p15, 0, r2, c15, c0, 0 ?@ read power control register
+ ? ? str ? ? r2, [r0], #4
+
+ ? ? mrc ? ? p15, 0, r2, c15, c0, 1 ?@ read diagnostic register
+ ? ? str ? ? r2, [r0], #4
+
+ ? ? ldr ? ? r3, =resume_with_mmu
+ ? ? bl ? ? ?cpu_suspend
+
+ ? ? mov ? ? r0, sp
+ ? ? bl ? ? ?exynos4_cpu_lp
+
+ ? ? /* Restore original sp */
+ ? ? mov ? ? r0, sp
Quoted 9 lines
Quoted 5 lines

+ ? ? add ? ? r0, r0, #4
+ ? ? ldr ? ? sp, [r0]
+
+ ? ? mov ? ? r0, #0
+ ? ? b ? ? ? early_wakeup

This is based upon old kernel code. ?Clearly hasn't been tested with anything later than 3.0.

You are right. I will rebase it to the latest tree in the next version. The main intention of the patch series (mostly patch 4) is to collect information or issues on samsung platform with the new common cpuidle framework.

#10 lore raw

RFC PATCH 4/4 ARM: EXYNOS4: Modify cpuidle code to adapt to save/restore common code

In reply to Amit Daniel Kachhap

The L2 retention cpuidle state is modified to use the interfaces exposed by the lorenzo's cpuidle consolidation code. As can be seen lot of code is reduced in the machine directory.

---
 arch/arm/Kconfig                         |    1 +
 arch/arm/mach-exynos4/Makefile           |    2 +-
 arch/arm/mach-exynos4/cpuidle.c          |   85 +++++++++-------
 arch/arm/mach-exynos4/idle.S             |  165 ------------------------------
 arch/arm/mach-exynos4/include/mach/pmu.h |    4 -
 5 files changed, 52 insertions(+), 205 deletions(-)
 delete mode 100644 arch/arm/mach-exynos4/idle.S
arch/arm/Kconfig +1 -0
index a4435d6..4f97bb5 100644
@@ -786,6 +786,7 @@ config ARCH_EXYNOS4
 	select CLKDEV_LOOKUP
 	select ARCH_HAS_CPUFREQ
 	select GENERIC_CLOCKEVENTS
+	select ARCH_USES_CPU_PM
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
arch/arm/mach-exynos4/Makefile +1 -1
index 12568b0..2e3a407 100644
@@ -16,7 +16,7 @@ obj-$(CONFIG_CPU_EXYNOS4210)	+= cpu.o init.o clock.o irq-combiner.o
 obj-$(CONFIG_CPU_EXYNOS4210)	+= setup-i2c0.o irq-eint.o dma.o pmu.o
 obj-$(CONFIG_PM)		+= pm.o sleep.o
 obj-$(CONFIG_CPU_FREQ)		+= cpufreq.o
-obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o idle.o
+obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
 
 obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
 
arch/arm/mach-exynos4/cpuidle.c +50 -35

149 lines not on this page · raw message

arch/arm/mach-exynos4/idle.S deleted +0 -165

165 lines not on this page · raw message

arch/arm/mach-exynos4/include/mach/pmu.h +0 -4
index 960456f..d23194d 100644
@@ -21,8 +21,4 @@ enum sys_powerdown {
 };
 
 extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode);
-extern void exynos4_idle_resume(void);
-extern void exynos4_enter_lp(unsigned long arg, long offset);
-/* Keep following save sequence prefetch, power, tag, data, aux */
-extern unsigned long l2cc_save[5];
 #endif /* __ASM_ARCH_PMU_H */
Signature · 1 line
1.7.1