linux-mips
[Top] [All Lists]

[PATCH 30/35] MIPS: RB532: Cleanup firmware support for RB532 platform.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 30/35] MIPS: RB532: Cleanup firmware support for RB532 platform.
From: "Steven J. Hill" <sjhill@mips.com>
Date: Tue, 5 Jun 2012 16:19:34 -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/rb532/prom.c |   29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/mips/rb532/prom.c b/arch/mips/rb532/prom.c
index d7c26d0..54f5399 100644
--- a/arch/mips/rb532/prom.c
+++ b/arch/mips/rb532/prom.c
@@ -33,7 +33,7 @@
 #include <linux/ioport.h>
 #include <linux/blkdev.h>
 
-#include <asm/bootinfo.h>
+#include <asm/fw/fw.h>
 #include <asm/mach-rc32434/ddr.h>
 #include <asm/mach-rc32434/prom.h>
 
@@ -62,41 +62,40 @@ static inline int match_tag(char *arg, const char *tag)
 static inline unsigned long tag2ul(char *arg, const char *tag)
 {
        char *num;
+       long val;
+       int tmp;
 
        num = arg + strlen(tag);
-       return simple_strtoul(num, 0, 10);
+       tmp = kstrtol(num, 0, &val);
+       return (unsigned long)val;
 }
 
 void __init prom_setup_cmdline(void)
 {
        static char cmd_line[COMMAND_LINE_SIZE] __initdata;
        char *cp, *board;
-       int prom_argc;
-       char **prom_argv, **prom_envp;
        int i;
 
-       prom_argc = fw_arg0;
-       prom_argv = (char **) fw_arg1;
-       prom_envp = (char **) fw_arg2;
+       fw_init_cmdline();
 
        cp = cmd_line;
                /* Note: it is common that parameters start
                 * at argv[1] and not argv[0],
                 * however, our elf loader starts at [0] */
-       for (i = 0; i < prom_argc; i++) {
-               if (match_tag(prom_argv[i], FREQ_TAG)) {
-                       idt_cpu_freq = tag2ul(prom_argv[i], FREQ_TAG);
+       for (i = 0; i < fw_argc; i++) {
+               if (match_tag(fw_argv(i), FREQ_TAG)) {
+                       idt_cpu_freq = tag2ul(fw_argv(i), FREQ_TAG);
                        continue;
                }
 #ifdef IGNORE_CMDLINE_MEM
                /* parses out the "mem=xx" arg */
-               if (match_tag(prom_argv[i], MEM_TAG))
+               if (match_tag(fw_argv(i), MEM_TAG))
                        continue;
 #endif
                if (i > 0)
                        *(cp++) = ' ';
-               if (match_tag(prom_argv[i], BOARD_TAG)) {
-                       board = prom_argv[i] + strlen(BOARD_TAG);
+               if (match_tag(fw_argv(i), BOARD_TAG)) {
+                       board = fw_argv(i) + strlen(BOARD_TAG);
 
                        if (match_tag(board, BOARD_RB532A))
                                mips_machtype = MACH_MIKROTIK_RB532A;
@@ -104,8 +103,8 @@ void __init prom_setup_cmdline(void)
                                mips_machtype = MACH_MIKROTIK_RB532;
                }
 
-               strcpy(cp, prom_argv[i]);
-               cp += strlen(prom_argv[i]);
+               strcpy(cp, fw_argv(i));
+               cp += strlen(fw_argv(i));
        }
        *(cp++) = ' ';
 
-- 
1.7.10.3


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