2007-06-06 02:52:38 -04:00
|
|
|
/*
|
|
|
|
* Based on Ocelot Linux port, which is
|
|
|
|
* Copyright 2001 MontaVista Software Inc.
|
|
|
|
* Author: jsun@mvista.com or jsun@junsun.net
|
|
|
|
*
|
|
|
|
* Copyright 2003 ICT CAS
|
|
|
|
* Author: Michael Guo <guoyi@ict.ac.cn>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
|
|
|
|
* Author: Fuxin Zhang, zhangfx@lemote.com
|
|
|
|
*
|
2009-11-06 05:35:33 -05:00
|
|
|
* Copyright (C) 2009 Lemote Inc.
|
2010-01-04 04:16:51 -05:00
|
|
|
* Author: Wu Zhangjin, wuzhangjin@gmail.com
|
2009-07-02 11:22:36 -04:00
|
|
|
*
|
2007-06-06 02:52:38 -04:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
2009-07-02 11:22:36 -04:00
|
|
|
#include <asm/bootinfo.h>
|
2007-06-06 02:52:38 -04:00
|
|
|
|
2009-07-02 11:23:03 -04:00
|
|
|
#include <loongson.h>
|
|
|
|
|
2007-06-06 02:52:38 -04:00
|
|
|
void __init prom_init_cmdline(void)
|
|
|
|
{
|
2010-01-04 04:16:47 -05:00
|
|
|
int prom_argc;
|
|
|
|
/* pmon passes arguments in 32bit pointers */
|
|
|
|
int *_prom_argv;
|
2007-06-06 02:52:38 -04:00
|
|
|
int i;
|
|
|
|
long l;
|
|
|
|
|
2009-07-02 11:22:36 -04:00
|
|
|
/* firmware arguments are initialized in head.S */
|
|
|
|
prom_argc = fw_arg0;
|
|
|
|
_prom_argv = (int *)fw_arg1;
|
|
|
|
|
2007-06-06 02:52:38 -04:00
|
|
|
/* arg[0] is "g", the rest is boot parameters */
|
|
|
|
arcs_cmdline[0] = '\0';
|
2009-07-02 11:22:36 -04:00
|
|
|
for (i = 1; i < prom_argc; i++) {
|
|
|
|
l = (long)_prom_argv[i];
|
2007-06-06 02:52:38 -04:00
|
|
|
if (strlen(arcs_cmdline) + strlen(((char *)l) + 1)
|
|
|
|
>= sizeof(arcs_cmdline))
|
|
|
|
break;
|
|
|
|
strcat(arcs_cmdline, ((char *)l));
|
|
|
|
strcat(arcs_cmdline, " ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((strstr(arcs_cmdline, "console=")) == NULL)
|
|
|
|
strcat(arcs_cmdline, " console=ttyS0,115200");
|
|
|
|
if ((strstr(arcs_cmdline, "root=")) == NULL)
|
|
|
|
strcat(arcs_cmdline, " root=/dev/hda1");
|
2009-11-06 05:35:33 -05:00
|
|
|
|
|
|
|
prom_init_machtype();
|
2007-06-06 02:52:38 -04:00
|
|
|
}
|