Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Paul Burton <paul.burton@imgtec.com>, linux-mips@linux-mips.org
Subject: Re: [PATCH] MIPS: malta: pass fw arguments on kexec
Date: Tue, 31 Mar 2015 16:19:06 +0200	[thread overview]
Message-ID: <20150331141906.GF28951@linux-mips.org> (raw)
In-Reply-To: <20150331125614.GN24448@ak-desktop.emea.nsn-net.net>

On Tue, Mar 31, 2015 at 03:56:14PM +0300, Aaro Koskinen wrote:

> On Tue, Mar 31, 2015 at 01:13:00PM +0200, Ralf Baechle wrote:
> > On Wed, Feb 25, 2015 at 05:21:05PM +0200, Aaro Koskinen wrote:
> > >  #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;
> > > +}
> > 
> > This makes arguments coming from the firmware non-overridable default?
> 
> Yes, the new kernel will boot with the same arguments as the old kernel...
> 
> I guess the kernel command line at least should be taken from kexec,
> OCTEON seems to have some code for that.

The old command line can be obtained from /proc/cmdline.  As per
documentation some boot formats but not all support the options
--command-line=string or --reuse-cmdline which I think is how it should
be done.

Sorry but cmdline manipulation in the kernel is just bad for my blood
pressure.  Among the issues:

Many MIPS platforms are manipulating the cmdline so what you eventually
find in /proc/cmdline may not what the firmware originally fed to the
kernel.  That's another tradition which should end - for sanity and
kexec's sake.

A few platfroms even hardcode the entire cmdline and that was done without
considering something like kexec.

And more.

  Ralf

      reply	other threads:[~2015-03-31 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 15:21 [PATCH] MIPS: malta: pass fw arguments on kexec Aaro Koskinen
2015-03-31 11:13 ` Ralf Baechle
2015-03-31 12:56   ` Aaro Koskinen
2015-03-31 14:19     ` Ralf Baechle [this message]

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=20150331141906.GF28951@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=aaro.koskinen@nokia.com \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@imgtec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox