Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638564 > unrolled thread

[PATCH] socfpga_a10: fix a kexec boot issue

Started by<yanjiang.jin@windriver.com>
First post2017-05-10 07:20 +0200
Last post2017-05-10 07:20 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] socfpga_a10: fix a kexec boot issue <yanjiang.jin@windriver.com> - 2017-05-10 07:20 +0200
    [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill() <yanjiang.jin@windriver.com> - 2017-05-10 07:20 +0200

#1638564 — [PATCH] socfpga_a10: fix a kexec boot issue

From<yanjiang.jin@windriver.com>
Date2017-05-10 07:20 +0200
Subject[PATCH] socfpga_a10: fix a kexec boot issue
Message-ID<tFscx-4VM-1@gated-at.bofh.it>
From: Yanjiang Jin <yanjiang.jin@windriver.com>

I guess socfpga's other boards may need this patch, but I have Arria10
board only. 
So add a new function socfpga_a10_cpu_kill(), keep the old function
socfpga_cpu_kill() for other boards.
I also verified CPU_HOTPLUG after applying this patch, everything seems well.

Test steps:

1. Enable kexec and build a SOCFPGA kernel;
2. Use zImage as 1st and 2nd kernel;
3. kexec -l /root/zImage --append="`cat /proc/cmdline`" 
4. kexec -e

Test env:

U-Boot 2014.10 (Jan 13 2016 - 11:07:09)

CPU   : Altera SOCFPGA Arria 10 Platform
BOARD : Altera SOCFPGA Arria 10 Dev Kit

-- 
1.9.1

[toc] | [next] | [standalone]


#1638565 — [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill()

From<yanjiang.jin@windriver.com>
Date2017-05-10 07:20 +0200
Subject[PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill()
Message-ID<tFscx-4VM-5@gated-at.bofh.it>
In reply to#1638564
From: Yanjiang Jin <yanjiang.jin@windriver.com>

Kexec's second kernel would hang if CPU1 isn't reset.

Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
---
 arch/arm/mach-socfpga/platsmp.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 0ee7677..db3940e 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -117,6 +117,16 @@ static int socfpga_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
+
+static int socfpga_a10_cpu_kill(unsigned int cpu)
+{
+	/* This will put CPU #1 into reset. */
+	if (socfpga_cpu1start_addr)
+		writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr +
+			SOCFPGA_A10_RSTMGR_MODMPURST);
+
+	return 1;
+}
 #endif
 
 static const struct smp_operations socfpga_smp_ops __initconst = {
@@ -133,7 +143,7 @@ static int socfpga_cpu_kill(unsigned int cpu)
 	.smp_boot_secondary	= socfpga_a10_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
 	.cpu_die		= socfpga_cpu_die,
-	.cpu_kill		= socfpga_cpu_kill,
+	.cpu_kill		= socfpga_a10_cpu_kill,
 #endif
 };
 
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web