From: "Steven J. Hill" <sjhill@xxxxxxxx> Signed-off-by: Steven J. Hill <sjhill@xxxxxxxx> --- arch/mips/netlogic/xlr/setup.c | 48 +++++++++------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c index c9d066d..54ca3fc 100644 --- a/arch/mips/netlogic/xlr/setup.c +++ b/arch/mips/netlogic/xlr/setup.c @@ -31,14 +31,13 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include <linux/kernel.h> #include <linux/serial_8250.h> #include <linux/pm.h> #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 +112,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 +153,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