From: Michael Ellerman <michael@ellerman•id.au>
To: Paul Mackerras <paulus@samba•org>
Cc: linuxppc-dev@ozlabs•org, Kumar Gala <kumar.gala@freescale•com>
Subject: [PATCH 2/5] powerpc: Parse early parameters early, rather than sorta early
Date: Wed, 17 May 2006 18:00:45 +1000 [thread overview]
Message-ID: <20060517080044.A2214679EF@ozlabs.org> (raw)
In-Reply-To: <1147852841.148164.91320074069.qpush@concordia>
Currently we have call parse_early_param() earliyish, but not really very
early. In particular, it's not early enough to do things like mem=x or
crashkernel=blah, which is annoying.
So do it earlier. I've checked all the early param handlers, and none of them
look like they should have any trouble with this. I haven't tested the
booke_wdt ones though.
On 32-bit we were doing the CONFIG_CMDLINE logic twice, so don't.
Signed-off-by: Michael Ellerman <michael@ellerman•id.au>
---
arch/powerpc/kernel/prom.c | 5 +++++
arch/powerpc/kernel/setup_32.c | 14 ++------------
arch/powerpc/kernel/setup_64.c | 5 -----
3 files changed, 7 insertions(+), 17 deletions(-)
Index: to-merge/arch/powerpc/kernel/prom.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/prom.c
+++ to-merge/arch/powerpc/kernel/prom.c
@@ -1292,6 +1292,11 @@ void __init early_init_devtree(void *par
lmb_init();
of_scan_flat_dt(early_init_dt_scan_root, NULL);
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+
+ /* Save command line for /proc/cmdline and then parse parameters */
+ strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
+ parse_early_param();
+
lmb_enforce_memory_limit(memory_limit);
lmb_analyze();
Index: to-merge/arch/powerpc/kernel/setup_32.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup_32.c
+++ to-merge/arch/powerpc/kernel/setup_32.c
@@ -131,12 +131,6 @@ void __init machine_init(unsigned long d
/* Do some early initialization based on the flat device tree */
early_init_devtree(__va(dt_ptr));
- /* Check default command line */
-#ifdef CONFIG_CMDLINE
- if (cmd_line[0] == 0)
- strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
-#endif /* CONFIG_CMDLINE */
-
probe_machine();
#ifdef CONFIG_6xx
@@ -237,6 +231,8 @@ void __init setup_arch(char **cmdline_p)
{
extern void do_init_bootmem(void);
+ *cmdline_p = cmd_line;
+
/* so udelay does something sensible, assume <= 1000 bogomips */
loops_per_jiffy = 500000000 / HZ;
@@ -290,12 +286,6 @@ void __init setup_arch(char **cmdline_p)
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = klimit;
- /* Save unparsed command line copy for /proc/cmdline */
- strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
- *cmdline_p = cmd_line;
-
- parse_early_param();
-
if (do_early_xmon)
debugger(NULL);
Index: to-merge/arch/powerpc/kernel/setup_64.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup_64.c
+++ to-merge/arch/powerpc/kernel/setup_64.c
@@ -420,11 +420,6 @@ void __init setup_system(void)
*/
register_early_udbg_console();
- /* Save unparsed command line copy for /proc/cmdline */
- strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
-
- parse_early_param();
-
if (do_early_xmon)
debugger(NULL);
next prev parent reply other threads:[~2006-05-17 8:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-17 8:00 [PATCH 1/5] powerpc: Make early xmon logic immune to location of early parsing Michael Ellerman
2006-05-17 8:00 ` Michael Ellerman [this message]
2006-05-17 8:00 ` [PATCH 3/5] powerpc: Unify mem= handling Michael Ellerman
2006-05-17 8:00 ` [PATCH 4/5] powerpc: Kdump header cleanup Michael Ellerman
2006-05-17 8:00 ` [PATCH 5/5] powerpc: Move crashkernel= handling into the kernel Michael Ellerman
2006-05-18 1:16 ` [PATCH] " Michael Ellerman
2006-05-17 21:29 ` [PATCH 1/5] powerpc: Make early xmon logic immune to location of early parsing Tom Rini
2006-05-18 0:03 ` Michael Ellerman
2006-05-18 1:08 ` Tom Rini
2006-05-22 7:03 ` Michael Ellerman
2006-05-22 14:26 ` Tom Rini
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=20060517080044.A2214679EF@ozlabs.org \
--to=michael@ellerman$(echo .)id.au \
--cc=kumar.gala@freescale$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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