mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
MIPS: PowerTV: simplify prom_init_cmdline() and merge into prom_init()
Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org> Patchwork: http://patchwork.linux-mips.org/patch/801/ Reviewed-by: David VomLehn <dvomlehn@cisco.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
0eb99a9354
commit
7e326d687d
4 changed files with 10 additions and 56 deletions
|
@ -23,6 +23,6 @@
|
||||||
# under Linux.
|
# under Linux.
|
||||||
#
|
#
|
||||||
|
|
||||||
obj-y += cmdline.o init.o memory.o reset.o time.o powertv_setup.o asic/ pci/
|
obj-y += init.o memory.o reset.o time.o powertv_setup.o asic/ pci/
|
||||||
|
|
||||||
EXTRA_CFLAGS += -Wall -Werror
|
EXTRA_CFLAGS += -Wall -Werror
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*
|
|
||||||
* Carsten Langgaard, carstenl@mips.com
|
|
||||||
* Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
|
|
||||||
* Portions copyright (C) 2009 Cisco Systems, Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can distribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License (Version 2) as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
|
||||||
*
|
|
||||||
* Kernel command line creation using the prom monitor (YAMON) argc/argv.
|
|
||||||
*/
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/string.h>
|
|
||||||
|
|
||||||
#include <asm/bootinfo.h>
|
|
||||||
|
|
||||||
#include "init.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
|
|
||||||
* This macro take care of sign extension.
|
|
||||||
*/
|
|
||||||
#define prom_argv(index) ((char *)(long)_prom_argv[(index)])
|
|
||||||
|
|
||||||
void __init prom_init_cmdline(void)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
|
|
||||||
if (prom_argc != 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
len = strlen(arcs_cmdline);
|
|
||||||
|
|
||||||
arcs_cmdline[len] = ' ';
|
|
||||||
|
|
||||||
strlcpy(arcs_cmdline + len + 1, (char *)_prom_argv,
|
|
||||||
COMMAND_LINE_SIZE - len - 1);
|
|
||||||
}
|
|
|
@ -34,10 +34,7 @@
|
||||||
#include <asm/mips-boards/generic.h>
|
#include <asm/mips-boards/generic.h>
|
||||||
#include <asm/mach-powertv/asic.h>
|
#include <asm/mach-powertv/asic.h>
|
||||||
|
|
||||||
#include "init.h"
|
static int *_prom_envp;
|
||||||
|
|
||||||
int prom_argc;
|
|
||||||
int *_prom_argv, *_prom_envp;
|
|
||||||
unsigned long _prom_memsize;
|
unsigned long _prom_memsize;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -109,8 +106,11 @@ static void __init mips_ejtag_setup(void)
|
||||||
|
|
||||||
void __init prom_init(void)
|
void __init prom_init(void)
|
||||||
{
|
{
|
||||||
|
int prom_argc;
|
||||||
|
char *prom_argv;
|
||||||
|
|
||||||
prom_argc = fw_arg0;
|
prom_argc = fw_arg0;
|
||||||
_prom_argv = (int *) fw_arg1;
|
prom_argv = (char *) fw_arg1;
|
||||||
_prom_envp = (int *) fw_arg2;
|
_prom_envp = (int *) fw_arg2;
|
||||||
_prom_memsize = (unsigned long) fw_arg3;
|
_prom_memsize = (unsigned long) fw_arg3;
|
||||||
|
|
||||||
|
@ -118,7 +118,10 @@ void __init prom_init(void)
|
||||||
board_ejtag_handler_setup = mips_ejtag_setup;
|
board_ejtag_handler_setup = mips_ejtag_setup;
|
||||||
|
|
||||||
pr_info("\nLINUX started...\n");
|
pr_info("\nLINUX started...\n");
|
||||||
prom_init_cmdline();
|
|
||||||
|
if (prom_argc == 1)
|
||||||
|
strlcat(arcs_cmdline, prom_argv, COMMAND_LINE_SIZE);
|
||||||
|
|
||||||
configure_platform();
|
configure_platform();
|
||||||
prom_meminit();
|
prom_meminit();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,5 @@
|
||||||
|
|
||||||
#ifndef _POWERTV_INIT_H
|
#ifndef _POWERTV_INIT_H
|
||||||
#define _POWERTV_INIT_H
|
#define _POWERTV_INIT_H
|
||||||
extern int prom_argc;
|
|
||||||
extern int *_prom_argv;
|
|
||||||
extern unsigned long _prom_memsize;
|
extern unsigned long _prom_memsize;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue