linux-mips
[Top] [All Lists]

[PATCH] MIPS: malta: pass fw arguments on kexec

To: Ralf Baechle <ralf@linux-mips.org>, Paul Burton <paul.burton@imgtec.com>, linux-mips@linux-mips.org
Subject: [PATCH] MIPS: malta: pass fw arguments on kexec
From: Aaro Koskinen <aaro.koskinen@nokia.com>
Date: Wed, 25 Feb 2015 17:21:05 +0200
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Pass fw arguments on kexec to the new kernel.

Tested with MIPS64 QEMU. Without the patch the new kernel will default to
(likely) incorrect default memory and console setup, making kexec pretty
much useless.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/mips/mti-malta/malta-reset.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/mips/mti-malta/malta-reset.c 
b/arch/mips/mti-malta/malta-reset.c
index 2fd2cc2..f218ba8 100644
--- a/arch/mips/mti-malta/malta-reset.c
+++ b/arch/mips/mti-malta/malta-reset.c
@@ -8,8 +8,10 @@
  */
 #include <linux/io.h>
 #include <linux/pm.h>
+#include <linux/kexec.h>
 
 #include <asm/reboot.h>
+#include <asm/bootinfo.h>
 #include <asm/mach-malta/malta-pm.h>
 
 #define SOFTRES_REG    0x1f000500
@@ -36,8 +38,19 @@ static void mips_machine_power_off(void)
        mips_machine_restart(NULL);
 }
 
+static int mips_kexec_prepare(struct kimage *image)
+{
+       kexec_args[0] = fw_arg0;
+       kexec_args[1] = fw_arg1;
+       kexec_args[2] = fw_arg2;
+       kexec_args[3] = fw_arg3;
+
+       return 0;
+}
+
 static int __init mips_reboot_setup(void)
 {
+       _machine_kexec_prepare = mips_kexec_prepare;
        _machine_restart = mips_machine_restart;
        _machine_halt = mips_machine_halt;
        pm_power_off = mips_machine_power_off;
-- 
2.1.2


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: malta: pass fw arguments on kexec, Aaro Koskinen <=