ARM: EXYNOS4: Add support AFTR mode on EXYNOS4210
Subsystems (3)
PATCH 1/1 ARM: EXYNOS4: Add support AFTR mode on EXYNOS4210
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 | 139 ++++++++++++++++++++++++++++++++++++++- arch/arm/mach-exynos4/idle.S | 112 +++++++++++++++++++++++++++++++ 3 files changed, 251 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-exynos4/idle.S
arch/arm/mach-exynos4/Makefile +1 -1
@@ -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 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 +138 -1
185 lines not on this page · raw message
arch/arm/mach-exynos4/idle.S new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 1/1 ARM: EXYNOS4: Add support AFTR mode on EXYNOS4210
Quoted 2 lines · Jaecheol Lee
This patch adds support AFTR(ARM OFF TOP RUNNING) mode in cpuidle driver. L2 cache keeps their data in this mode.
This conflicts with my suspend branch. Please wait until after the merge window for this patch.
Quoted 1 line
+void
exynos4_cpu_lp(unsigned long arg)
Should be 'static int' now.
arch/arm/mach-exynos4/cpuidle.c static int exynos4_enter_idle(struct cpuidle_device *dev, · line 163
Quoted 7 lines
arch/arm/mach-exynos4/cpuidle.c +7
-0+static int exynos4_enter_lowpower (struct cpuidle_device *dev, +struct cpuidle_state *state) +{ +struct cpuidle_state *new_state = state; + +/* This mode only can be entered when Core1 is offline */ +if (cpu_online (1 )) {
What if you had a four code exynos4 tomorrow?
Presumably you actually mean: "can only be entered when other CPUs are offline" so that should be:
if (num_cpus_online() != 1) {arch/arm/mach-exynos4/cpuidle.c static int __init exynos4_init_cpuidle(void) · line 220
Quoted 10 lines
arch/arm/mach-exynos4/cpuidle.c +10
-0+ + l2cc_save[0 ] =__raw_readl (S5P_VA_L2CC +L2X0_PREFETCH_CTRL ); + l2cc_save[1 ] =__raw_readl (S5P_VA_L2CC +L2X0_POWER_CTRL ); + l2cc_save[2 ] =__raw_readl (S5P_VA_L2CC +L2X0_TAG_LATENCY_CTRL ); + l2cc_save[3 ] =__raw_readl (S5P_VA_L2CC +L2X0_DATA_LATENCY_CTRL ); + l2cc_save[4 ] =__raw_readl (S5P_VA_L2CC +L2X0_AUX_CTRL ); + +clean_dcache_area (&l2cc_save[0 ],5 *sizeof (unsigned long )); +outer_clean_range (virt_to_phys (&l2cc_save[0 ]), +virt_to_phys (&l2cc_save[4 ] +sizeof (unsigned long )));
Erm, this is bad news, using internal APIs for this, especially 'clean_dcache_area' which may well become a no-op on systems with TLBs which can read out of L1 cache...
PATCH 1/1 ARM: EXYNOS4: Add support AFTR mode on EXYNOS4210
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Jaecheol Lee
This patch adds support AFTR(ARM OFF TOP RUNNING) mode in cpuidle driver. L2 cache keeps their data in this mode.
Hi Russell,
I received Jaecheol Lee's reply internally. Now his mail client has some problem so I'm sending his comments...
Quoted 3 lines
This conflicts with my suspend branch. Please wait until after the merge window for this patch.
OK, will check your patch in mainline after merging.
Quoted 4 lines
Quoted 1 line
+void
exynos4_cpu_lp(unsigned long arg)Should be 'static int' now.
OK.
Quoted 10 lines
arch/arm/mach-exynos4/cpuidle.c static int exynos4_enter_idle(struct cpuidle_device *dev, · line 163
Quoted 7 lines
arch/arm/mach-exynos4/cpuidle.c +7
-0+static int exynos4_enter_lowpower (struct cpuidle_device *dev, +struct cpuidle_state *state) +{ +struct cpuidle_state *new_state = state; + +/* This mode only can be entered when Core1 is offline */ +if (cpu_online (1 )) {What if you had a four code exynos4 tomorrow?
four core?
Quoted 4 lines
Presumably you actually mean: "can only be entered when other CPUs are offline" so that should be:
if (num_cpus_online() != 1) {
OK, will address comments from you :)
Quoted 11 lines
arch/arm/mach-exynos4/cpuidle.c static int __init exynos4_init_cpuidle(void)
Quoted 5 lines
arch/arm/mach-exynos4/cpuidle.c +5
-0+ + l2cc_save[0 ] =__raw_readl (S5P_VA_L2CC +L2X0_PREFETCH_CTRL ); + l2cc_save[1 ] =__raw_readl (S5P_VA_L2CC +L2X0_POWER_CTRL ); + l2cc_save[2 ] =__raw_readl (S5P_VA_L2CC +L2X0_TAG_LATENCY_CTRL ); + l2cc_save[3] = __raw_readl(S5P_VA_L2CC +
L2X0_DATA_LATENCY_CTRL);arch/arm/mach-exynos4/cpuidle.c static int __init exynos4_init_cpuidle(void)
Quoted 5 lines
arch/arm/mach-exynos4/cpuidle.c +5
-0+ l2cc_save[4 ] =__raw_readl (S5P_VA_L2CC +L2X0_AUX_CTRL ); + +clean_dcache_area (&l2cc_save[0 ],5 *sizeof (unsigned long )); + outer_clean_range(virt_to_phys(&l2cc_save[0]), + virt_to_phys(&l2cc_save[4] + sizeof(unsigned
long)));
Quoted 4 lines
Erm, this is bad news, using internal APIs for this, especially '
clean_dcache_area' which may well become a no-op on systems with TLBs which can read out of L1 cache...
Let me think about it again.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.