mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: rusty@rustcorp.com.au
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] [PATCH] param: Adapt FRV to the new parameter handling regime
Date: Wed, 03 Dec 2008 16:32:17 +0000	[thread overview]
Message-ID: <20081203163217.13965.77996.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20081203163207.13965.56517.stgit@warthog.procyon.org.uk>

Make FRV use the new core parameter code.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/frv/kernel/setup.c |   43 ++++++++++++++-----------------------------
 1 files changed, 14 insertions(+), 29 deletions(-)


diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index 9548961..2f1506d 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -718,36 +718,25 @@ void __cpuinit calibrate_delay(void)
 
 } /* end calibrate_delay() */
 
-/*****************************************************************************/
 /*
- * look through the command line for some things we need to know immediately
- * FIXME: Use core_param or early_param.
+ * handle a specific memory limit handed over the kernel command line
  */
-static void __init parse_cmdline_early(char *cmdline)
+static int __init mem_parameter(char *data)
 {
-	if (!cmdline)
-		return;
-
-	while (*cmdline) {
-		if (*cmdline == ' ')
-			cmdline++;
-
-		/* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked
-		 * out from the SDRAM controller mask register
-		 */
-		if (!memcmp(cmdline, "mem=", 4)) {
-			unsigned long long mem_size;
-
-			mem_size = memparse(cmdline + 4, &cmdline);
-			memory_end = memory_start + mem_size;
-		}
-
-		while (*cmdline && *cmdline != ' ')
-			cmdline++;
-	}
+	unsigned long long mem_size;
 
-} /* end parse_cmdline_early() */
+	if (!data || !*data)
+		return 0;
+	mem_size = memparse(data, NULL);
+	memory_end = memory_start + mem_size;
+	return 0;
+}
+early_param("mem", mem_parameter);
 
+/*
+ * retrieve the boot command line from RedBoot and stash it somewhere more
+ * appropriate
+ */
 void __init arch_get_boot_command_line(void)
 {
 	memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE);
@@ -796,10 +785,6 @@ void __init setup_arch(void)
 #endif
 #endif
 
-	/* deal with the command line - RedBoot may have passed one to the kernel */
-	memcpy(command_line, boot_command_line, sizeof(command_line));
-	parse_cmdline_early(command_line);
-
 	/* set up the memory description
 	 * - by now the stack is part of the init task */
 	printk("Memory %08lx-%08lx\n", memory_start, memory_end);


  parent reply	other threads:[~2008-12-03 16:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 16:32 [PATCH 1/3] param: Adapt MN10300 " David Howells
2008-12-03 16:32 ` [PATCH 2/3] [PATCH] param: Stop gcc from inlining empty weak functions David Howells
2008-12-05  8:28   ` Rusty Russell
2008-12-05 12:02   ` David Howells
2008-12-03 16:32 ` David Howells [this message]
2008-12-05  8:25 ` [PATCH 1/3] param: Adapt MN10300 to the new parameter handling regime Rusty Russell
2008-12-05 11:58 ` David Howells
2008-12-05 12:55   ` Rusty Russell
2008-12-07  9:21     ` Rusty Russell
2008-12-10 10:39     ` David Howells
2008-12-05 13:07   ` David Howells

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=20081203163217.13965.77996.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®