All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: linux@arm.linux.org.uk, ben-linux@fluff.org,
	kgene.kim@samsung.com, t.figa@samsung.com, arnd@arndb.de,
	olof@lixom.net, marc.zyngier@arm.com, thomas.abraham@linaro.org,
	kyungmin.park@samsung.com, cw00.choi@samsung.com,
	sw0312.kim@samsung.com, hyunhee.kim@samsung.com,
	yj44.cho@samsung.com, chanho61.park@samsung.com,
	sajjan.linux@gmail.com, tushar.behera@linaro.org,
	sachin.kamat@linaro.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: [PATCHv3 4/7] ARM: EXYNOS: Enter a15 lowpower mode for Exynos3250 based on Cortex-a7
Date: Fri, 18 Apr 2014 10:15:25 +0900	[thread overview]
Message-ID: <1397783728-6193-5-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1397783728-6193-1-git-send-email-cw00.choi@samsung.com>

This patch decide proper lowpower mode of either a15 or a9 according to own ID
from Main ID register.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Marc Zynigier <marc.zyngier@arm.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-exynos/hotplug.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 5eead53..acf3119 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -135,16 +135,21 @@ void __ref exynos_cpu_die(unsigned int cpu)
 	int primary_part = 0;
 
 	/*
-	 * we're ready for shutdown now, so do it.
-	 * Exynos4 is A9 based while Exynos5 is A15; check the CPU part
-	 * number by reading the Main ID register and then perform the
-	 * appropriate sequence for entering low power.
+	 * Prepare the CPU for shutting down. The required sequence of
+	 * operations depends on core type. CPUID part number can be used to
+	 * determine the right way.
 	 */
-	asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc");
-	if ((primary_part & 0xfff0) == 0xc0f0)
+	primary_part = read_cpuid_part_number();
+
+	switch (primary_part) {
+	case ARM_CPU_PART_CORTEX_A7:
+	case ARM_CPU_PART_CORTEX_A15:
 		cpu_enter_lowpower_a15();
-	else
+		break;
+	default:
 		cpu_enter_lowpower_a9();
+		break;
+	}
 
 	platform_do_lowpower(cpu, &spurious);
 
-- 
1.8.0


WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3 4/7] ARM: EXYNOS: Enter a15 lowpower mode for Exynos3250 based on Cortex-a7
Date: Fri, 18 Apr 2014 10:15:25 +0900	[thread overview]
Message-ID: <1397783728-6193-5-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1397783728-6193-1-git-send-email-cw00.choi@samsung.com>

This patch decide proper lowpower mode of either a15 or a9 according to own ID
from Main ID register.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Marc Zynigier <marc.zyngier@arm.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-exynos/hotplug.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 5eead53..acf3119 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -135,16 +135,21 @@ void __ref exynos_cpu_die(unsigned int cpu)
 	int primary_part = 0;
 
 	/*
-	 * we're ready for shutdown now, so do it.
-	 * Exynos4 is A9 based while Exynos5 is A15; check the CPU part
-	 * number by reading the Main ID register and then perform the
-	 * appropriate sequence for entering low power.
+	 * Prepare the CPU for shutting down. The required sequence of
+	 * operations depends on core type. CPUID part number can be used to
+	 * determine the right way.
 	 */
-	asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc");
-	if ((primary_part & 0xfff0) == 0xc0f0)
+	primary_part = read_cpuid_part_number();
+
+	switch (primary_part) {
+	case ARM_CPU_PART_CORTEX_A7:
+	case ARM_CPU_PART_CORTEX_A15:
 		cpu_enter_lowpower_a15();
-	else
+		break;
+	default:
 		cpu_enter_lowpower_a9();
+		break;
+	}
 
 	platform_do_lowpower(cpu, &spurious);
 
-- 
1.8.0

  parent reply	other threads:[~2014-04-18  1:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18  1:15 [PATCHv3 0/7] Support new Exynos3250 SoC based on Cortex-A7 dual core Chanwoo Choi
2014-04-18  1:15 ` Chanwoo Choi
2014-04-18  1:15 ` Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 1/7] ARM: EXYNOS: Add Exynos3250 SoC ID Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 2/7] ARM: EXYNOS: Support secondary CPU boot of Exynos4212 Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 3/7] ARM: EXYNOS: Support secondary CPU boot of Exynos3250 Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15 ` Chanwoo Choi [this message]
2014-04-18  1:15   ` [PATCHv3 4/7] ARM: EXYNOS: Enter a15 lowpower mode for Exynos3250 based on Cortex-a7 Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 5/7] clk: samsung: exynos3250: Add clocks using common clock framework Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 6/7] dt-bindings: add documentation for Exynos3250 clock controller Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15 ` [PATCHv3 7/7] ARM: dts: Add device tree sources for Exynos3250 Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-18  1:15   ` Chanwoo Choi
2014-04-21  1:10 ` [PATCHv3 0/7] Support new Exynos3250 SoC based on Cortex-A7 dual core Chanwoo Choi
2014-04-21  1:10   ` Chanwoo Choi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397783728-6193-5-git-send-email-cw00.choi@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=arnd@arndb.de \
    --cc=ben-linux@fluff.org \
    --cc=chanho61.park@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hyunhee.kim@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=olof@lixom.net \
    --cc=sachin.kamat@linaro.org \
    --cc=sajjan.linux@gmail.com \
    --cc=sw0312.kim@samsung.com \
    --cc=t.figa@samsung.com \
    --cc=thomas.abraham@linaro.org \
    --cc=tushar.behera@linaro.org \
    --cc=yj44.cho@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.