All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: S5PV310: Update S5PV310 CPU hotplug implementation
@ 2010-09-17  5:13 ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux

This patch updates S5PV310 CPU hotplug implementation to reduce power consumption.

[PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
[PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/2] ARM: S5PV310: Update S5PV310 CPU hotplug implementation
@ 2010-09-17  5:13 ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel

This patch updates S5PV310 CPU hotplug implementation to reduce power consumption.

[PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
[PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
  2010-09-17  5:13 ` Kukjin Kim
@ 2010-09-17  5:13   ` Kukjin Kim
  -1 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Changhwan Youn

From: Changhwan Youn <chaos.youn@samsung.com>

This patch adds PMU(Power Management Unit) for S5PV310/S5PC210 hotplug.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
---
 arch/arm/mach-s5pv310/cpu.c                   |    5 +++++
 arch/arm/mach-s5pv310/include/mach/map.h      |    2 ++
 arch/arm/mach-s5pv310/include/mach/regs-pmu.h |   25 +++++++++++++++++++++++++
 arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
 4 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-pmu.h

diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index 4add398..3a3f90a 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -41,6 +41,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
 		.length		= SZ_128K,
 		.type		= MT_DEVICE,
 	}, {
+		.virtual	= (unsigned long)S5P_VA_PMU,
+		.pfn		= __phys_to_pfn(S5PV310_PA_PMU),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
 		.virtual	= (unsigned long)S5P_VA_COMBINER_BASE,
 		.pfn		= __phys_to_pfn(S5PV310_PA_COMBINER),
 		.length		= SZ_4K,
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
index aff6d23..c953c94 100644
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ b/arch/arm/mach-s5pv310/include/mach/map.h
@@ -37,6 +37,8 @@
 #define S5PV310_PA_SYSCON		(0x10010000)
 #define S5P_PA_SYSCON			S5PV310_PA_SYSCON
 
+#define S5PV310_PA_PMU			(0x10020000)
+
 #define S5PV310_PA_CMU			(0x10030000)
 
 #define S5PV310_PA_WATCHDOG		(0x10060000)
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
new file mode 100644
index 0000000..bb15a40
--- /dev/null
+++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
@@ -0,0 +1,25 @@
+/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * S5PV310 - Power management unit definition
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_PMU_H
+#define __ASM_ARCH_REGS_PMU_H __FILE__
+
+#include <mach/map.h>
+
+#define S5PV310_PMU(x)			(S5P_VA_PMU + (x))
+
+#define S5PV310_ARM_CORE1_CONF		S5P_PMU(0x2080)
+#define S5PV310_ARM_CORE1_STAT		S5P_PMU(0x2084)
+
+#define S5PV310_CORE_PWR_EN		0x3
+
+#endif /* __ASM_ARCH_REGS_PMU_H */
diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-s5p/include/plat/map-s5p.h
index c4ff88b..bee029e 100644
--- a/arch/arm/plat-s5p/include/plat/map-s5p.h
+++ b/arch/arm/plat-s5p/include/plat/map-s5p.h
@@ -31,6 +31,7 @@
 
 #define S5P_VA_L2CC		S3C_ADDR(0x00900000)
 #define S5P_VA_CMU		S3C_ADDR(0x00920000)
+#define S5P_VA_PMU		S3C_ADDR(0x00940000)
 
 #define S5P_VA_UART(x)		(S3C_VA_UART + ((x) * S3C_UART_OFFSET))
 #define S5P_VA_UART0		S5P_VA_UART(0)
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
@ 2010-09-17  5:13   ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel

From: Changhwan Youn <chaos.youn@samsung.com>

This patch adds PMU(Power Management Unit) for S5PV310/S5PC210 hotplug.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
---
 arch/arm/mach-s5pv310/cpu.c                   |    5 +++++
 arch/arm/mach-s5pv310/include/mach/map.h      |    2 ++
 arch/arm/mach-s5pv310/include/mach/regs-pmu.h |   25 +++++++++++++++++++++++++
 arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
 4 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-pmu.h

diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index 4add398..3a3f90a 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -41,6 +41,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
 		.length		= SZ_128K,
 		.type		= MT_DEVICE,
 	}, {
+		.virtual	= (unsigned long)S5P_VA_PMU,
+		.pfn		= __phys_to_pfn(S5PV310_PA_PMU),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
 		.virtual	= (unsigned long)S5P_VA_COMBINER_BASE,
 		.pfn		= __phys_to_pfn(S5PV310_PA_COMBINER),
 		.length		= SZ_4K,
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
index aff6d23..c953c94 100644
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ b/arch/arm/mach-s5pv310/include/mach/map.h
@@ -37,6 +37,8 @@
 #define S5PV310_PA_SYSCON		(0x10010000)
 #define S5P_PA_SYSCON			S5PV310_PA_SYSCON
 
+#define S5PV310_PA_PMU			(0x10020000)
+
 #define S5PV310_PA_CMU			(0x10030000)
 
 #define S5PV310_PA_WATCHDOG		(0x10060000)
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
new file mode 100644
index 0000000..bb15a40
--- /dev/null
+++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
@@ -0,0 +1,25 @@
+/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * S5PV310 - Power management unit definition
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_PMU_H
+#define __ASM_ARCH_REGS_PMU_H __FILE__
+
+#include <mach/map.h>
+
+#define S5PV310_PMU(x)			(S5P_VA_PMU + (x))
+
+#define S5PV310_ARM_CORE1_CONF		S5P_PMU(0x2080)
+#define S5PV310_ARM_CORE1_STAT		S5P_PMU(0x2084)
+
+#define S5PV310_CORE_PWR_EN		0x3
+
+#endif /* __ASM_ARCH_REGS_PMU_H */
diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-s5p/include/plat/map-s5p.h
index c4ff88b..bee029e 100644
--- a/arch/arm/plat-s5p/include/plat/map-s5p.h
+++ b/arch/arm/plat-s5p/include/plat/map-s5p.h
@@ -31,6 +31,7 @@
 
 #define S5P_VA_L2CC		S3C_ADDR(0x00900000)
 #define S5P_VA_CMU		S3C_ADDR(0x00920000)
+#define S5P_VA_PMU		S3C_ADDR(0x00940000)
 
 #define S5P_VA_UART(x)		(S3C_VA_UART + ((x) * S3C_UART_OFFSET))
 #define S5P_VA_UART0		S5P_VA_UART(0)
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
  2010-09-17  5:13 ` Kukjin Kim
@ 2010-09-17  5:13   ` Kukjin Kim
  -1 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc
  Cc: ben-linux, Changhwan Youn, Kukjin Kim, Russell King

From: Changhwan Youn <chaos.youn@samsung.com>

This patch updates CPU hotplug implementation to reduce CPU power consumption
and will turn off the CPU power when CPU1 is unplugged while previous CPU hotplug
used CPU idle.
This patch removes init memory freeing code to use CPU boot code when CPU1 is
plugged-in again and adds vfp_enable() call to allow to access CP10 and CP11.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <rmk@arm.linux.org.uk>
---
 arch/arm/mach-s5pv310/hotplug.c |   12 +++++++-----
 arch/arm/mach-s5pv310/platsmp.c |   34 ++++++++++++++++++++++++++++++++++
 arch/arm/mm/init.c              |    2 ++
 arch/arm/vfp/vfpmodule.c        |    2 +-
 4 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-s5pv310/hotplug.c
index 03652c3..0e188fe 100644
--- a/arch/arm/mach-s5pv310/hotplug.c
+++ b/arch/arm/mach-s5pv310/hotplug.c
@@ -14,9 +14,12 @@
 #include <linux/errno.h>
 #include <linux/smp.h>
 #include <linux/completion.h>
+#include <linux/io.h>
 
 #include <asm/cacheflush.h>
 
+#include <mach/regs-pmu.h>
+
 extern volatile int pen_release;
 
 static DECLARE_COMPLETION(cpu_killed);
@@ -61,12 +64,11 @@ static inline void cpu_leave_lowpower(void)
 
 static inline void platform_do_lowpower(unsigned int cpu)
 {
-	/*
-	 * there is no power-control hardware on this platform, so all
-	 * we can do is put the core into WFI; this is safe as the calling
-	 * code will have already disabled interrupts
-	 */
 	for (;;) {
+		/* make cpu1 to be turned off at next WFI command */
+		if (cpu == 1)
+			__raw_writel(0, S5PV310_ARM_CORE1_CONF);
+
 		/*
 		 * here's the WFI
 		 */
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-s5pv310/platsmp.c
index d357c19..d10c4ad 100644
--- a/arch/arm/mach-s5pv310/platsmp.c
+++ b/arch/arm/mach-s5pv310/platsmp.c
@@ -28,8 +28,10 @@
 
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
+#include <mach/regs-pmu.h>
 
 extern void s5pv310_secondary_startup(void);
+extern void vfp_enable(void *unused);
 
 /*
  * control for which core is the next to come out of the secondary
@@ -47,6 +49,10 @@ static DEFINE_SPINLOCK(boot_lock);
 
 void __cpuinit platform_secondary_init(unsigned int cpu)
 {
+#ifdef CONFIG_VFP
+	vfp_enable(NULL);
+#endif
+
 	trace_hardirqs_off();
 
 	/*
@@ -92,6 +98,27 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
 	outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
 
+	if (!(__raw_readl(S5PV310_ARM_CORE1_STAT) & S5PV310_CORE_PWR_EN)) {
+		__raw_writel(S5PV310_CORE_PWR_EN,
+			     S5PV310_ARM_CORE1_CONF);
+
+		timeout = 10;
+
+		/* wait max 10 ms until cpu1 is on */
+		while ((__raw_readl(S5PV310_ARM_CORE1_STAT)
+			& S5PV310_CORE_PWR_EN) != S5PV310_CORE_PWR_EN) {
+			if (timeout-- == 0)
+				break;
+
+			mdelay(1);
+		}
+
+		if (timeout == 0) {
+			printk(KERN_ERR "cpu1 power-up failed");
+			return -ETIMEDOUT;
+		}
+	}
+
 	/*
 	 * Send the secondary CPU a soft interrupt, thereby causing
 	 * the boot monitor to read the system wide flags register,
@@ -102,6 +129,13 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	timeout = jiffies + (1 * HZ);
 	while (time_before(jiffies, timeout)) {
 		smp_rmb();
+
+		if (!__raw_readl(S5P_VA_SYSRAM)) {
+			__raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)),
+				     S5P_VA_SYSRAM);
+			smp_cross_call(cpumask_of(cpu));
+		}
+
 		if (pen_release == -1)
 			break;
 
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 7185b00..57c4c5c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -589,10 +589,12 @@ void free_initmem(void)
 				    "TCM link");
 #endif
 
+#ifndef CONFIG_HOTPLUG_CPU
 	if (!machine_is_integrator() && !machine_is_cintegrator())
 		totalram_pages += free_area(__phys_to_pfn(__pa(__init_begin)),
 					    __phys_to_pfn(__pa(__init_end)),
 					    "init");
+#endif
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 8063a32..eee8f67 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -364,7 +364,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
 	preempt_enable();
 }
 
-static void vfp_enable(void *unused)
+void vfp_enable(void *unused)
 {
 	u32 access = get_copro_access();
 
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
@ 2010-09-17  5:13   ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  5:13 UTC (permalink / raw)
  To: linux-arm-kernel

From: Changhwan Youn <chaos.youn@samsung.com>

This patch updates CPU hotplug implementation to reduce CPU power consumption
and will turn off the CPU power when CPU1 is unplugged while previous CPU hotplug
used CPU idle.
This patch removes init memory freeing code to use CPU boot code when CPU1 is
plugged-in again and adds vfp_enable() call to allow to access CP10 and CP11.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <rmk@arm.linux.org.uk>
---
 arch/arm/mach-s5pv310/hotplug.c |   12 +++++++-----
 arch/arm/mach-s5pv310/platsmp.c |   34 ++++++++++++++++++++++++++++++++++
 arch/arm/mm/init.c              |    2 ++
 arch/arm/vfp/vfpmodule.c        |    2 +-
 4 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-s5pv310/hotplug.c
index 03652c3..0e188fe 100644
--- a/arch/arm/mach-s5pv310/hotplug.c
+++ b/arch/arm/mach-s5pv310/hotplug.c
@@ -14,9 +14,12 @@
 #include <linux/errno.h>
 #include <linux/smp.h>
 #include <linux/completion.h>
+#include <linux/io.h>
 
 #include <asm/cacheflush.h>
 
+#include <mach/regs-pmu.h>
+
 extern volatile int pen_release;
 
 static DECLARE_COMPLETION(cpu_killed);
@@ -61,12 +64,11 @@ static inline void cpu_leave_lowpower(void)
 
 static inline void platform_do_lowpower(unsigned int cpu)
 {
-	/*
-	 * there is no power-control hardware on this platform, so all
-	 * we can do is put the core into WFI; this is safe as the calling
-	 * code will have already disabled interrupts
-	 */
 	for (;;) {
+		/* make cpu1 to be turned off at next WFI command */
+		if (cpu == 1)
+			__raw_writel(0, S5PV310_ARM_CORE1_CONF);
+
 		/*
 		 * here's the WFI
 		 */
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-s5pv310/platsmp.c
index d357c19..d10c4ad 100644
--- a/arch/arm/mach-s5pv310/platsmp.c
+++ b/arch/arm/mach-s5pv310/platsmp.c
@@ -28,8 +28,10 @@
 
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
+#include <mach/regs-pmu.h>
 
 extern void s5pv310_secondary_startup(void);
+extern void vfp_enable(void *unused);
 
 /*
  * control for which core is the next to come out of the secondary
@@ -47,6 +49,10 @@ static DEFINE_SPINLOCK(boot_lock);
 
 void __cpuinit platform_secondary_init(unsigned int cpu)
 {
+#ifdef CONFIG_VFP
+	vfp_enable(NULL);
+#endif
+
 	trace_hardirqs_off();
 
 	/*
@@ -92,6 +98,27 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
 	outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
 
+	if (!(__raw_readl(S5PV310_ARM_CORE1_STAT) & S5PV310_CORE_PWR_EN)) {
+		__raw_writel(S5PV310_CORE_PWR_EN,
+			     S5PV310_ARM_CORE1_CONF);
+
+		timeout = 10;
+
+		/* wait max 10 ms until cpu1 is on */
+		while ((__raw_readl(S5PV310_ARM_CORE1_STAT)
+			& S5PV310_CORE_PWR_EN) != S5PV310_CORE_PWR_EN) {
+			if (timeout-- == 0)
+				break;
+
+			mdelay(1);
+		}
+
+		if (timeout == 0) {
+			printk(KERN_ERR "cpu1 power-up failed");
+			return -ETIMEDOUT;
+		}
+	}
+
 	/*
 	 * Send the secondary CPU a soft interrupt, thereby causing
 	 * the boot monitor to read the system wide flags register,
@@ -102,6 +129,13 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	timeout = jiffies + (1 * HZ);
 	while (time_before(jiffies, timeout)) {
 		smp_rmb();
+
+		if (!__raw_readl(S5P_VA_SYSRAM)) {
+			__raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)),
+				     S5P_VA_SYSRAM);
+			smp_cross_call(cpumask_of(cpu));
+		}
+
 		if (pen_release == -1)
 			break;
 
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 7185b00..57c4c5c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -589,10 +589,12 @@ void free_initmem(void)
 				    "TCM link");
 #endif
 
+#ifndef CONFIG_HOTPLUG_CPU
 	if (!machine_is_integrator() && !machine_is_cintegrator())
 		totalram_pages += free_area(__phys_to_pfn(__pa(__init_begin)),
 					    __phys_to_pfn(__pa(__init_end)),
 					    "init");
+#endif
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 8063a32..eee8f67 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -364,7 +364,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
 	preempt_enable();
 }
 
-static void vfp_enable(void *unused)
+void vfp_enable(void *unused)
 {
 	u32 access = get_copro_access();
 
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
  2010-09-17  5:13   ` Kukjin Kim
@ 2010-09-17  7:58     ` Kukjin Kim
  -1 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  7:58 UTC (permalink / raw)
  To: 'Kukjin Kim', linux-arm-kernel, linux-samsung-soc
  Cc: 'Changhwan Youn', ben-linux

Kukjin Kim wrote:
> 
> From: Changhwan Youn <chaos.youn@samsung.com>
> 
> This patch adds PMU(Power Management Unit) for S5PV310/S5PC210 hotplug.
> 
> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>

missed...when submitted...
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

> ---
>  arch/arm/mach-s5pv310/cpu.c                   |    5 +++++
>  arch/arm/mach-s5pv310/include/mach/map.h      |    2 ++
>  arch/arm/mach-s5pv310/include/mach/regs-pmu.h |   25
> +++++++++++++++++++++++++
>  arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
>  4 files changed, 33 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> 
> diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> index 4add398..3a3f90a 100644
> --- a/arch/arm/mach-s5pv310/cpu.c
> +++ b/arch/arm/mach-s5pv310/cpu.c
> @@ -41,6 +41,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
>  		.length		= SZ_128K,
>  		.type		= MT_DEVICE,
>  	}, {
> +		.virtual	= (unsigned long)S5P_VA_PMU,
> +		.pfn		= __phys_to_pfn(S5PV310_PA_PMU),
> +		.length		= SZ_16K,
> +		.type		= MT_DEVICE,
> +	}, {
>  		.virtual	= (unsigned long)S5P_VA_COMBINER_BASE,
>  		.pfn		= __phys_to_pfn(S5PV310_PA_COMBINER),
>  		.length		= SZ_4K,
> diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-
> s5pv310/include/mach/map.h
> index aff6d23..c953c94 100644
> --- a/arch/arm/mach-s5pv310/include/mach/map.h
> +++ b/arch/arm/mach-s5pv310/include/mach/map.h
> @@ -37,6 +37,8 @@
>  #define S5PV310_PA_SYSCON		(0x10010000)
>  #define S5P_PA_SYSCON			S5PV310_PA_SYSCON
> 
> +#define S5PV310_PA_PMU			(0x10020000)
> +
>  #define S5PV310_PA_CMU			(0x10030000)
> 
>  #define S5PV310_PA_WATCHDOG		(0x10060000)
> diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
b/arch/arm/mach-
> s5pv310/include/mach/regs-pmu.h
> new file mode 100644
> index 0000000..bb15a40
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> @@ -0,0 +1,25 @@
> +/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *		http://www.samsung.com
> + *
> + * S5PV310 - Power management unit definition
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#ifndef __ASM_ARCH_REGS_PMU_H
> +#define __ASM_ARCH_REGS_PMU_H __FILE__
> +
> +#include <mach/map.h>
> +
> +#define S5PV310_PMU(x)			(S5P_VA_PMU + (x))
> +
> +#define S5PV310_ARM_CORE1_CONF		S5P_PMU(0x2080)
> +#define S5PV310_ARM_CORE1_STAT		S5P_PMU(0x2084)
> +
> +#define S5PV310_CORE_PWR_EN		0x3
> +
> +#endif /* __ASM_ARCH_REGS_PMU_H */
> diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-
> s5p/include/plat/map-s5p.h
> index c4ff88b..bee029e 100644
> --- a/arch/arm/plat-s5p/include/plat/map-s5p.h
> +++ b/arch/arm/plat-s5p/include/plat/map-s5p.h
> @@ -31,6 +31,7 @@
> 
>  #define S5P_VA_L2CC		S3C_ADDR(0x00900000)
>  #define S5P_VA_CMU		S3C_ADDR(0x00920000)
> +#define S5P_VA_PMU		S3C_ADDR(0x00940000)
> 
>  #define S5P_VA_UART(x)		(S3C_VA_UART + ((x) *
> S3C_UART_OFFSET))
>  #define S5P_VA_UART0		S5P_VA_UART(0)
> --


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] 14+ messages in thread

* [PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug
@ 2010-09-17  7:58     ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-17  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Kukjin Kim wrote:
> 
> From: Changhwan Youn <chaos.youn@samsung.com>
> 
> This patch adds PMU(Power Management Unit) for S5PV310/S5PC210 hotplug.
> 
> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>

missed...when submitted...
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

> ---
>  arch/arm/mach-s5pv310/cpu.c                   |    5 +++++
>  arch/arm/mach-s5pv310/include/mach/map.h      |    2 ++
>  arch/arm/mach-s5pv310/include/mach/regs-pmu.h |   25
> +++++++++++++++++++++++++
>  arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
>  4 files changed, 33 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> 
> diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
> index 4add398..3a3f90a 100644
> --- a/arch/arm/mach-s5pv310/cpu.c
> +++ b/arch/arm/mach-s5pv310/cpu.c
> @@ -41,6 +41,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
>  		.length		= SZ_128K,
>  		.type		= MT_DEVICE,
>  	}, {
> +		.virtual	= (unsigned long)S5P_VA_PMU,
> +		.pfn		= __phys_to_pfn(S5PV310_PA_PMU),
> +		.length		= SZ_16K,
> +		.type		= MT_DEVICE,
> +	}, {
>  		.virtual	= (unsigned long)S5P_VA_COMBINER_BASE,
>  		.pfn		= __phys_to_pfn(S5PV310_PA_COMBINER),
>  		.length		= SZ_4K,
> diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-
> s5pv310/include/mach/map.h
> index aff6d23..c953c94 100644
> --- a/arch/arm/mach-s5pv310/include/mach/map.h
> +++ b/arch/arm/mach-s5pv310/include/mach/map.h
> @@ -37,6 +37,8 @@
>  #define S5PV310_PA_SYSCON		(0x10010000)
>  #define S5P_PA_SYSCON			S5PV310_PA_SYSCON
> 
> +#define S5PV310_PA_PMU			(0x10020000)
> +
>  #define S5PV310_PA_CMU			(0x10030000)
> 
>  #define S5PV310_PA_WATCHDOG		(0x10060000)
> diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
b/arch/arm/mach-
> s5pv310/include/mach/regs-pmu.h
> new file mode 100644
> index 0000000..bb15a40
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> @@ -0,0 +1,25 @@
> +/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *		http://www.samsung.com
> + *
> + * S5PV310 - Power management unit definition
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#ifndef __ASM_ARCH_REGS_PMU_H
> +#define __ASM_ARCH_REGS_PMU_H __FILE__
> +
> +#include <mach/map.h>
> +
> +#define S5PV310_PMU(x)			(S5P_VA_PMU + (x))
> +
> +#define S5PV310_ARM_CORE1_CONF		S5P_PMU(0x2080)
> +#define S5PV310_ARM_CORE1_STAT		S5P_PMU(0x2084)
> +
> +#define S5PV310_CORE_PWR_EN		0x3
> +
> +#endif /* __ASM_ARCH_REGS_PMU_H */
> diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-
> s5p/include/plat/map-s5p.h
> index c4ff88b..bee029e 100644
> --- a/arch/arm/plat-s5p/include/plat/map-s5p.h
> +++ b/arch/arm/plat-s5p/include/plat/map-s5p.h
> @@ -31,6 +31,7 @@
> 
>  #define S5P_VA_L2CC		S3C_ADDR(0x00900000)
>  #define S5P_VA_CMU		S3C_ADDR(0x00920000)
> +#define S5P_VA_PMU		S3C_ADDR(0x00940000)
> 
>  #define S5P_VA_UART(x)		(S3C_VA_UART + ((x) *
> S3C_UART_OFFSET))
>  #define S5P_VA_UART0		S5P_VA_UART(0)
> --


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] 14+ messages in thread

* RE: [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
  2010-09-17  5:13   ` Kukjin Kim
@ 2010-09-29 11:58     ` Kukjin Kim
  -1 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-29 11:58 UTC (permalink / raw)
  To: 'Kukjin Kim', linux-arm-kernel, linux-samsung-soc
  Cc: ben-linux, 'Changhwan Youn', 'Russell King',
	'Tony Lindgren', 'Colin Cross',
	'Erik Gilling', 'Olof Johansson'

Kukjin Kim wrote:
> 
> From: Changhwan Youn <chaos.youn@samsung.com>
> 
> This patch updates CPU hotplug implementation to reduce CPU power
> consumption
> and will turn off the CPU power when CPU1 is unplugged while previous CPU
> hotplug
> used CPU idle.
> This patch removes init memory freeing code to use CPU boot code when CPU1
is
> plugged-in again and adds vfp_enable() call to allow to access CP10 and
CP11.
> 
> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Olof Johansson <olof@lixom.net>

Hi all,

Please check changing of arch/arm/mm/init.c and arch/arm/vfp/vfpmodule.c.
- Removed init memory freeing code to use CPU boot code when CPU1 is
plugged-in again.
- Added vfp_enable() call to allow to access CP10 and CP11.

> ---
>  arch/arm/mach-s5pv310/hotplug.c |   12 +++++++-----
>  arch/arm/mach-s5pv310/platsmp.c |   34
> ++++++++++++++++++++++++++++++++++
>  arch/arm/mm/init.c              |    2 ++
>  arch/arm/vfp/vfpmodule.c        |    2 +-
>  4 files changed, 44 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pv310/hotplug.c
b/arch/arm/mach-s5pv310/hotplug.c
> index 03652c3..0e188fe 100644
> --- a/arch/arm/mach-s5pv310/hotplug.c
> +++ b/arch/arm/mach-s5pv310/hotplug.c
> @@ -14,9 +14,12 @@
>  #include <linux/errno.h>
>  #include <linux/smp.h>
>  #include <linux/completion.h>
> +#include <linux/io.h>
> 
>  #include <asm/cacheflush.h>
> 
> +#include <mach/regs-pmu.h>
> +
>  extern volatile int pen_release;
> 
>  static DECLARE_COMPLETION(cpu_killed);
> @@ -61,12 +64,11 @@ static inline void cpu_leave_lowpower(void)
> 
>  static inline void platform_do_lowpower(unsigned int cpu)
>  {
> -	/*
> -	 * there is no power-control hardware on this platform, so all
> -	 * we can do is put the core into WFI; this is safe as the calling
> -	 * code will have already disabled interrupts
> -	 */
>  	for (;;) {
> +		/* make cpu1 to be turned off at next WFI command */
> +		if (cpu == 1)
> +			__raw_writel(0, S5PV310_ARM_CORE1_CONF);
> +
>  		/*
>  		 * here's the WFI
>  		 */
> diff --git a/arch/arm/mach-s5pv310/platsmp.c
b/arch/arm/mach-s5pv310/platsmp.c
> index d357c19..d10c4ad 100644
> --- a/arch/arm/mach-s5pv310/platsmp.c
> +++ b/arch/arm/mach-s5pv310/platsmp.c
> @@ -28,8 +28,10 @@
> 
>  #include <mach/hardware.h>
>  #include <mach/regs-clock.h>
> +#include <mach/regs-pmu.h>
> 
>  extern void s5pv310_secondary_startup(void);
> +extern void vfp_enable(void *unused);
> 
>  /*
>   * control for which core is the next to come out of the secondary
> @@ -47,6 +49,10 @@ static DEFINE_SPINLOCK(boot_lock);
> 
>  void __cpuinit platform_secondary_init(unsigned int cpu)
>  {
> +#ifdef CONFIG_VFP
> +	vfp_enable(NULL);
> +#endif
> +
>  	trace_hardirqs_off();
> 
>  	/*
> @@ -92,6 +98,27 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>  	__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
>  	outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
> 
> +	if (!(__raw_readl(S5PV310_ARM_CORE1_STAT) &
> S5PV310_CORE_PWR_EN)) {
> +		__raw_writel(S5PV310_CORE_PWR_EN,
> +			     S5PV310_ARM_CORE1_CONF);
> +
> +		timeout = 10;
> +
> +		/* wait max 10 ms until cpu1 is on */
> +		while ((__raw_readl(S5PV310_ARM_CORE1_STAT)
> +			& S5PV310_CORE_PWR_EN) !=
> S5PV310_CORE_PWR_EN) {
> +			if (timeout-- == 0)
> +				break;
> +
> +			mdelay(1);
> +		}
> +
> +		if (timeout == 0) {
> +			printk(KERN_ERR "cpu1 power-up failed");
> +			return -ETIMEDOUT;
> +		}
> +	}
> +
>  	/*
>  	 * Send the secondary CPU a soft interrupt, thereby causing
>  	 * the boot monitor to read the system wide flags register,
> @@ -102,6 +129,13 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>  	timeout = jiffies + (1 * HZ);
>  	while (time_before(jiffies, timeout)) {
>  		smp_rmb();
> +
> +		if (!__raw_readl(S5P_VA_SYSRAM)) {
> +
> 	__raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)),
> +				     S5P_VA_SYSRAM);
> +			smp_cross_call(cpumask_of(cpu));
> +		}
> +
>  		if (pen_release == -1)
>  			break;
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 7185b00..57c4c5c 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -589,10 +589,12 @@ void free_initmem(void)
>  				    "TCM link");
>  #endif
> 
> +#ifndef CONFIG_HOTPLUG_CPU
>  	if (!machine_is_integrator() && !machine_is_cintegrator())
>  		totalram_pages +=
free_area(__phys_to_pfn(__pa(__init_begin)),
>  					    __phys_to_pfn(__pa(__init_end)),
>  					    "init");
> +#endif
>  }
> 
>  #ifdef CONFIG_BLK_DEV_INITRD
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 8063a32..eee8f67 100644
> --- a/arch/arm/vfp/vfpmodule.c
> +++ b/arch/arm/vfp/vfpmodule.c
> @@ -364,7 +364,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs
> *regs)
>  	preempt_enable();
>  }
> 
> -static void vfp_enable(void *unused)
> +void vfp_enable(void *unused)
>  {
>  	u32 access = get_copro_access();
> 
> --


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] 14+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
@ 2010-09-29 11:58     ` Kukjin Kim
  0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-09-29 11:58 UTC (permalink / raw)
  To: linux-arm-kernel

Kukjin Kim wrote:
> 
> From: Changhwan Youn <chaos.youn@samsung.com>
> 
> This patch updates CPU hotplug implementation to reduce CPU power
> consumption
> and will turn off the CPU power when CPU1 is unplugged while previous CPU
> hotplug
> used CPU idle.
> This patch removes init memory freeing code to use CPU boot code when CPU1
is
> plugged-in again and adds vfp_enable() call to allow to access CP10 and
CP11.
> 
> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Olof Johansson <olof@lixom.net>

Hi all,

Please check changing of arch/arm/mm/init.c and arch/arm/vfp/vfpmodule.c.
- Removed init memory freeing code to use CPU boot code when CPU1 is
plugged-in again.
- Added vfp_enable() call to allow to access CP10 and CP11.

> ---
>  arch/arm/mach-s5pv310/hotplug.c |   12 +++++++-----
>  arch/arm/mach-s5pv310/platsmp.c |   34
> ++++++++++++++++++++++++++++++++++
>  arch/arm/mm/init.c              |    2 ++
>  arch/arm/vfp/vfpmodule.c        |    2 +-
>  4 files changed, 44 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pv310/hotplug.c
b/arch/arm/mach-s5pv310/hotplug.c
> index 03652c3..0e188fe 100644
> --- a/arch/arm/mach-s5pv310/hotplug.c
> +++ b/arch/arm/mach-s5pv310/hotplug.c
> @@ -14,9 +14,12 @@
>  #include <linux/errno.h>
>  #include <linux/smp.h>
>  #include <linux/completion.h>
> +#include <linux/io.h>
> 
>  #include <asm/cacheflush.h>
> 
> +#include <mach/regs-pmu.h>
> +
>  extern volatile int pen_release;
> 
>  static DECLARE_COMPLETION(cpu_killed);
> @@ -61,12 +64,11 @@ static inline void cpu_leave_lowpower(void)
> 
>  static inline void platform_do_lowpower(unsigned int cpu)
>  {
> -	/*
> -	 * there is no power-control hardware on this platform, so all
> -	 * we can do is put the core into WFI; this is safe as the calling
> -	 * code will have already disabled interrupts
> -	 */
>  	for (;;) {
> +		/* make cpu1 to be turned off at next WFI command */
> +		if (cpu == 1)
> +			__raw_writel(0, S5PV310_ARM_CORE1_CONF);
> +
>  		/*
>  		 * here's the WFI
>  		 */
> diff --git a/arch/arm/mach-s5pv310/platsmp.c
b/arch/arm/mach-s5pv310/platsmp.c
> index d357c19..d10c4ad 100644
> --- a/arch/arm/mach-s5pv310/platsmp.c
> +++ b/arch/arm/mach-s5pv310/platsmp.c
> @@ -28,8 +28,10 @@
> 
>  #include <mach/hardware.h>
>  #include <mach/regs-clock.h>
> +#include <mach/regs-pmu.h>
> 
>  extern void s5pv310_secondary_startup(void);
> +extern void vfp_enable(void *unused);
> 
>  /*
>   * control for which core is the next to come out of the secondary
> @@ -47,6 +49,10 @@ static DEFINE_SPINLOCK(boot_lock);
> 
>  void __cpuinit platform_secondary_init(unsigned int cpu)
>  {
> +#ifdef CONFIG_VFP
> +	vfp_enable(NULL);
> +#endif
> +
>  	trace_hardirqs_off();
> 
>  	/*
> @@ -92,6 +98,27 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>  	__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
>  	outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
> 
> +	if (!(__raw_readl(S5PV310_ARM_CORE1_STAT) &
> S5PV310_CORE_PWR_EN)) {
> +		__raw_writel(S5PV310_CORE_PWR_EN,
> +			     S5PV310_ARM_CORE1_CONF);
> +
> +		timeout = 10;
> +
> +		/* wait max 10 ms until cpu1 is on */
> +		while ((__raw_readl(S5PV310_ARM_CORE1_STAT)
> +			& S5PV310_CORE_PWR_EN) !=
> S5PV310_CORE_PWR_EN) {
> +			if (timeout-- == 0)
> +				break;
> +
> +			mdelay(1);
> +		}
> +
> +		if (timeout == 0) {
> +			printk(KERN_ERR "cpu1 power-up failed");
> +			return -ETIMEDOUT;
> +		}
> +	}
> +
>  	/*
>  	 * Send the secondary CPU a soft interrupt, thereby causing
>  	 * the boot monitor to read the system wide flags register,
> @@ -102,6 +129,13 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>  	timeout = jiffies + (1 * HZ);
>  	while (time_before(jiffies, timeout)) {
>  		smp_rmb();
> +
> +		if (!__raw_readl(S5P_VA_SYSRAM)) {
> +
> 	__raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)),
> +				     S5P_VA_SYSRAM);
> +			smp_cross_call(cpumask_of(cpu));
> +		}
> +
>  		if (pen_release == -1)
>  			break;
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 7185b00..57c4c5c 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -589,10 +589,12 @@ void free_initmem(void)
>  				    "TCM link");
>  #endif
> 
> +#ifndef CONFIG_HOTPLUG_CPU
>  	if (!machine_is_integrator() && !machine_is_cintegrator())
>  		totalram_pages +=
free_area(__phys_to_pfn(__pa(__init_begin)),
>  					    __phys_to_pfn(__pa(__init_end)),
>  					    "init");
> +#endif
>  }
> 
>  #ifdef CONFIG_BLK_DEV_INITRD
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 8063a32..eee8f67 100644
> --- a/arch/arm/vfp/vfpmodule.c
> +++ b/arch/arm/vfp/vfpmodule.c
> @@ -364,7 +364,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs
> *regs)
>  	preempt_enable();
>  }
> 
> -static void vfp_enable(void *unused)
> +void vfp_enable(void *unused)
>  {
>  	u32 access = get_copro_access();
> 
> --


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] 14+ messages in thread

* Re: [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
  2010-09-29 11:58     ` Kukjin Kim
@ 2010-09-30 17:02       ` Colin Cross
  -1 siblings, 0 replies; 14+ messages in thread
From: Colin Cross @ 2010-09-30 17:02 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: linux-arm-kernel, linux-samsung-soc, ben-linux, Changhwan Youn,
	Russell King, Tony Lindgren, Erik Gilling, Olof Johansson

On Wed, Sep 29, 2010 at 4:58 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Kukjin Kim wrote:
>>
>> From: Changhwan Youn <chaos.youn@samsung.com>
>>
>> This patch updates CPU hotplug implementation to reduce CPU power
>> consumption
>> and will turn off the CPU power when CPU1 is unplugged while previous CPU
>> hotplug
>> used CPU idle.
>> This patch removes init memory freeing code to use CPU boot code when CPU1
> is
>> plugged-in again and adds vfp_enable() call to allow to access CP10 and
> CP11.
>>
>> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
>> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Russell King <rmk@arm.linux.org.uk>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Colin Cross <ccross@android.com>
> Cc: Erik Gilling <konkers@android.com>
> Cc: Olof Johansson <olof@lixom.net>
>

snip

>> +#ifndef CONFIG_HOTPLUG_CPU
>>       if (!machine_is_integrator() && !machine_is_cintegrator())
>>               totalram_pages +=
> free_area(__phys_to_pfn(__pa(__init_begin)),
>>                                           __phys_to_pfn(__pa(__init_end)),
>>                                           "init");
>> +#endif
>>  }
>>
>>  #ifdef CONFIG_BLK_DEV_INITRD

I don't think this is necessary.  Any symbol that is necessary for CPU
hotplug should be marked with __cpuinit instead of __init.  The linker
script will put __cpuinit symbols outside the __init_begin -
__init_end section if CONFIG_HOTPLUG_CPU is enabled.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
@ 2010-09-30 17:02       ` Colin Cross
  0 siblings, 0 replies; 14+ messages in thread
From: Colin Cross @ 2010-09-30 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 29, 2010 at 4:58 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Kukjin Kim wrote:
>>
>> From: Changhwan Youn <chaos.youn@samsung.com>
>>
>> This patch updates CPU hotplug implementation to reduce CPU power
>> consumption
>> and will turn off the CPU power when CPU1 is unplugged while previous CPU
>> hotplug
>> used CPU idle.
>> This patch removes init memory freeing code to use CPU boot code when CPU1
> is
>> plugged-in again and adds vfp_enable() call to allow to access CP10 and
> CP11.
>>
>> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
>> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Russell King <rmk@arm.linux.org.uk>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Colin Cross <ccross@android.com>
> Cc: Erik Gilling <konkers@android.com>
> Cc: Olof Johansson <olof@lixom.net>
>

snip

>> +#ifndef CONFIG_HOTPLUG_CPU
>> ? ? ? if (!machine_is_integrator() && !machine_is_cintegrator())
>> ? ? ? ? ? ? ? totalram_pages +=
> free_area(__phys_to_pfn(__pa(__init_begin)),
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __phys_to_pfn(__pa(__init_end)),
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "init");
>> +#endif
>> ?}
>>
>> ?#ifdef CONFIG_BLK_DEV_INITRD

I don't think this is necessary.  Any symbol that is necessary for CPU
hotplug should be marked with __cpuinit instead of __init.  The linker
script will put __cpuinit symbols outside the __init_begin -
__init_end section if CONFIG_HOTPLUG_CPU is enabled.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
  2010-09-30 17:02       ` Colin Cross
@ 2010-09-30 21:21         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2010-09-30 21:21 UTC (permalink / raw)
  To: Colin Cross
  Cc: Kukjin Kim, linux-arm-kernel, linux-samsung-soc, ben-linux,
	Changhwan Youn, Tony Lindgren, Erik Gilling, Olof Johansson

On Thu, Sep 30, 2010 at 10:02:37AM -0700, Colin Cross wrote:
> On Wed, Sep 29, 2010 at 4:58 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > Kukjin Kim wrote:
> >>
> >> From: Changhwan Youn <chaos.youn@samsung.com>
> >>
> >> This patch updates CPU hotplug implementation to reduce CPU power
> >> consumption
> >> and will turn off the CPU power when CPU1 is unplugged while previous CPU
> >> hotplug
> >> used CPU idle.
> >> This patch removes init memory freeing code to use CPU boot code when CPU1
> > is
> >> plugged-in again and adds vfp_enable() call to allow to access CP10 and
> > CP11.
> >>
> >> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> >> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> >> Cc: Russell King <rmk@arm.linux.org.uk>
> > Cc: Tony Lindgren <tony@atomide.com>
> > Cc: Colin Cross <ccross@android.com>
> > Cc: Erik Gilling <konkers@android.com>
> > Cc: Olof Johansson <olof@lixom.net>
> >
> 
> snip
> 
> >> +#ifndef CONFIG_HOTPLUG_CPU
> >>       if (!machine_is_integrator() && !machine_is_cintegrator())
> >>               totalram_pages +=
> > free_area(__phys_to_pfn(__pa(__init_begin)),
> >>                                           __phys_to_pfn(__pa(__init_end)),
> >>                                           "init");
> >> +#endif
> >>  }
> >>
> >>  #ifdef CONFIG_BLK_DEV_INITRD
> 
> I don't think this is necessary.  Any symbol that is necessary for CPU
> hotplug should be marked with __cpuinit instead of __init.  The linker
> script will put __cpuinit symbols outside the __init_begin -
> __init_end section if CONFIG_HOTPLUG_CPU is enabled.

That's the theory, but not everything required for a complete restart of
a secondary CPU (iow, if it's powered off) is in the right section yet.
I'll have patches hopefully tomorrow to address this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation
@ 2010-09-30 21:21         ` Russell King - ARM Linux
  0 siblings, 0 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2010-09-30 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 30, 2010 at 10:02:37AM -0700, Colin Cross wrote:
> On Wed, Sep 29, 2010 at 4:58 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > Kukjin Kim wrote:
> >>
> >> From: Changhwan Youn <chaos.youn@samsung.com>
> >>
> >> This patch updates CPU hotplug implementation to reduce CPU power
> >> consumption
> >> and will turn off the CPU power when CPU1 is unplugged while previous CPU
> >> hotplug
> >> used CPU idle.
> >> This patch removes init memory freeing code to use CPU boot code when CPU1
> > is
> >> plugged-in again and adds vfp_enable() call to allow to access CP10 and
> > CP11.
> >>
> >> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> >> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> >> Cc: Russell King <rmk@arm.linux.org.uk>
> > Cc: Tony Lindgren <tony@atomide.com>
> > Cc: Colin Cross <ccross@android.com>
> > Cc: Erik Gilling <konkers@android.com>
> > Cc: Olof Johansson <olof@lixom.net>
> >
> 
> snip
> 
> >> +#ifndef CONFIG_HOTPLUG_CPU
> >> ? ? ? if (!machine_is_integrator() && !machine_is_cintegrator())
> >> ? ? ? ? ? ? ? totalram_pages +=
> > free_area(__phys_to_pfn(__pa(__init_begin)),
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __phys_to_pfn(__pa(__init_end)),
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "init");
> >> +#endif
> >> ?}
> >>
> >> ?#ifdef CONFIG_BLK_DEV_INITRD
> 
> I don't think this is necessary.  Any symbol that is necessary for CPU
> hotplug should be marked with __cpuinit instead of __init.  The linker
> script will put __cpuinit symbols outside the __init_begin -
> __init_end section if CONFIG_HOTPLUG_CPU is enabled.

That's the theory, but not everything required for a complete restart of
a secondary CPU (iow, if it's powered off) is in the right section yet.
I'll have patches hopefully tomorrow to address this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-09-30 21:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-17  5:13 [PATCH 0/2] ARM: S5PV310: Update S5PV310 CPU hotplug implementation Kukjin Kim
2010-09-17  5:13 ` Kukjin Kim
2010-09-17  5:13 ` [PATCH 1/2] ARM: S5PV310: Add PMU for S5PV310 hotplug Kukjin Kim
2010-09-17  5:13   ` Kukjin Kim
2010-09-17  7:58   ` Kukjin Kim
2010-09-17  7:58     ` Kukjin Kim
2010-09-17  5:13 ` [PATCH 2/2] ARM: S5PV310: Update CPU hotplug implementation Kukjin Kim
2010-09-17  5:13   ` Kukjin Kim
2010-09-29 11:58   ` Kukjin Kim
2010-09-29 11:58     ` Kukjin Kim
2010-09-30 17:02     ` Colin Cross
2010-09-30 17:02       ` Colin Cross
2010-09-30 21:21       ` Russell King - ARM Linux
2010-09-30 21:21         ` Russell King - ARM Linux

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.