linux-mips
[Top] [All Lists]

[PATCH 22/35] MIPS: Netlogic: Cleanup firmware support for the XLR platf

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 22/35] MIPS: Netlogic: Cleanup firmware support for the XLR platform.
From: "Steven J. Hill" <sjhill@mips.com>
Date: Tue, 5 Jun 2012 16:19:26 -0500
Cc: "Steven J. Hill" <sjhill@mips.com>
In-reply-to: <1338931179-9611-1-git-send-email-sjhill@mips.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>
References: <1338931179-9611-1-git-send-email-sjhill@mips.com>
Sender: linux-mips-bounce@linux-mips.org
From: "Steven J. Hill" <sjhill@mips.com>

Signed-off-by: Steven J. Hill <sjhill@mips.com>
---
 arch/mips/netlogic/xlr/setup.c |   47 +++++++++-------------------------------
 1 file changed, 10 insertions(+), 37 deletions(-)

diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c
index c9d066d..113a402 100644
--- a/arch/mips/netlogic/xlr/setup.c
+++ b/arch/mips/netlogic/xlr/setup.c
@@ -38,7 +38,7 @@
 
 #include <asm/reboot.h>
 #include <asm/time.h>
-#include <asm/bootinfo.h>
+#include <asm/fw/fw.h>
 
 #include <asm/netlogic/interrupt.h>
 #include <asm/netlogic/psb-bootinfo.h>
@@ -113,45 +113,21 @@ void __init prom_free_prom_memory(void)
        /* Nothing yet */
 }
 
-static void __init build_arcs_cmdline(int *argv)
+static void __init build_arcs_cmdline(void)
 {
-       int i, remain, len;
-       char *arg;
-
-       remain = sizeof(arcs_cmdline) - 1;
-       arcs_cmdline[0] = '\0';
-       for (i = 0; argv[i] != 0; i++) {
-               arg = (char *)(long)argv[i];
-               len = strlen(arg);
-               if (len + 1 > remain)
-                       break;
-               strcat(arcs_cmdline, arg);
-               strcat(arcs_cmdline, " ");
-               remain -=  len + 1;
-       }
+       fw_init_cmdline();
 
        /* Add the default options here */
-       if ((strstr(arcs_cmdline, "console=")) == NULL) {
-               arg = "console=ttyS0,38400 ";
-               len = strlen(arg);
-               if (len > remain)
-                       goto fail;
-               strcat(arcs_cmdline, arg);
-               remain -= len;
+       if ((strstr(fw_getcmdline(), "console=")) == NULL) {
+               strlcat(fw_getcmdline(), "console=ttyS0,38400 ",
+                       COMMAND_LINE_SIZE);
        }
 #ifdef CONFIG_BLK_DEV_INITRD
-       if ((strstr(arcs_cmdline, "rdinit=")) == NULL) {
-               arg = "rdinit=/sbin/init ";
-               len = strlen(arg);
-               if (len > remain)
-                       goto fail;
-               strcat(arcs_cmdline, arg);
-               remain -= len;
+       if ((strstr(fw_getcmdline(), "rdinit=")) == NULL) {
+               strlcat(fw_getcmdline(), "rdinit=/sbin/init ",
+                       COMMAND_LINE_SIZE);
        }
 #endif
-       return;
-fail:
-       panic("Cannot add %s, command line too big!", arg);
 }
 
 static void prom_add_memory(void)
@@ -178,19 +154,16 @@ static void prom_add_memory(void)
 
 void __init prom_init(void)
 {
-       int *argv, *envp;               /* passed as 32 bit ptrs */
        struct psb_info *prom_infop;
 
        /* truncate to 32 bit and sign extend all args */
-       argv = (int *)(long)(int)fw_arg1;
-       envp = (int *)(long)(int)fw_arg2;
        prom_infop = (struct psb_info *)(long)(int)fw_arg3;
 
        nlm_prom_info = *prom_infop;
        nlm_pic_base = nlm_mmio_base(NETLOGIC_IO_PIC_OFFSET);
 
        nlm_early_serial_setup();
-       build_arcs_cmdline(argv);
+       build_arcs_cmdline();
        nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
        prom_add_memory();
 
-- 
1.7.10.3


<Prev in Thread] Current Thread [Next in Thread>