Commit 25330c60 authored by Tom Rini's avatar Tom Rini

PPC32: Allow Motorola machines with PPCBUG to get their boot args from NVRAM.

parent 4872eacc
...@@ -366,6 +366,10 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then ...@@ -366,6 +366,10 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then
bool 'Support for RTAS (RunTime Abstraction Services) in /proc' CONFIG_PPC_RTAS bool 'Support for RTAS (RunTime Abstraction Services) in /proc' CONFIG_PPC_RTAS
bool 'Support for PReP Residual Data' CONFIG_PREP_RESIDUAL bool 'Support for PReP Residual Data' CONFIG_PREP_RESIDUAL
dep_bool ' Support for reading of PReP Residual Data in /proc' CONFIG_PROC_PREPRESIDUAL $CONFIG_PREP_RESIDUAL dep_bool ' Support for reading of PReP Residual Data in /proc' CONFIG_PROC_PREPRESIDUAL $CONFIG_PREP_RESIDUAL
define_bool CONFIG_PPCBUG_NVRAM y
fi
if [ "$CONFIG_PPLUS" = "y" -o "$CONFIG_LOPEC" = "y" ]; then
bool 'Enable reading PPCBUG NVRAM during boot' CONFIG_PPCBUG_NVRAM
fi fi
bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL
......
...@@ -35,6 +35,7 @@ obj-$(CONFIG_PCI) += pci.o ...@@ -35,6 +35,7 @@ obj-$(CONFIG_PCI) += pci.o
ifneq ($(CONFIG_PPC_ISERIES),y) ifneq ($(CONFIG_PPC_ISERIES),y)
obj-$(CONFIG_PCI) += pci-dma.o obj-$(CONFIG_PCI) += pci-dma.o
endif endif
obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
obj-$(CONFIG_KGDB) += ppc-stub.o obj-$(CONFIG_KGDB) += ppc-stub.o
obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_TAU) += temp.o obj-$(CONFIG_TAU) += temp.o
......
...@@ -2,9 +2,14 @@ ...@@ -2,9 +2,14 @@
* BK Id: %F% %I% %G% %U% %#% * BK Id: %F% %I% %G% %U% %#%
*/ */
/* /*
* arch/ppc/platforms/prep_nvram.c * arch/ppc/kernel/prep_nvram.c
* *
* Copyright (C) 1998 Corey Minyard * Copyright (C) 1998 Corey Minyard
*
* This reads the NvRAM on PReP compliant machines (generally from IBM or
* Motorola). Motorola kept the format of NvRAM in their ROM, PPCBUG, the
* same, long after they had stopped producing PReP compliant machines. So
* this code is useful in those cases as well.
* *
*/ */
#include <linux/init.h> #include <linux/init.h>
......
...@@ -32,7 +32,7 @@ endif ...@@ -32,7 +32,7 @@ endif
obj-$(CONFIG_ALL_PPC) += pmac_pic.o pmac_setup.o pmac_time.o \ obj-$(CONFIG_ALL_PPC) += pmac_pic.o pmac_setup.o pmac_time.o \
pmac_feature.o pmac_pci.o chrp_setup.o\ pmac_feature.o pmac_pci.o chrp_setup.o\
chrp_time.o chrp_pci.o prep_pci.o \ chrp_time.o chrp_pci.o prep_pci.o \
prep_time.o prep_nvram.o prep_setup.o prep_time.o prep_setup.o
ifeq ($(CONFIG_ALL_PPC),y) ifeq ($(CONFIG_ALL_PPC),y)
obj-$(CONFIG_NVRAM) += pmac_nvram.o obj-$(CONFIG_NVRAM) += pmac_nvram.o
endif endif
...@@ -50,7 +50,7 @@ obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o ...@@ -50,7 +50,7 @@ obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o
obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o
obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o
obj-$(CONFIG_POWERPMC250) += powerpmc250.o obj-$(CONFIG_POWERPMC250) += powerpmc250.o
obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o prep_nvram.o obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
obj-$(CONFIG_PRPMC750) += prpmc750_setup.o prpmc750_pci.o obj-$(CONFIG_PRPMC750) += prpmc750_setup.o prpmc750_pci.o
obj-$(CONFIG_PRPMC800) += prpmc800_setup.o prpmc800_pci.o obj-$(CONFIG_PRPMC800) += prpmc800_setup.o prpmc800_pci.o
obj-$(CONFIG_SANDPOINT) += sandpoint_setup.o sandpoint_pci.o obj-$(CONFIG_SANDPOINT) += sandpoint_setup.o sandpoint_pci.o
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/mpc10x.h> #include <asm/mpc10x.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <asm/prep_nvram.h>
extern char saved_command_line[];
extern void lopec_find_bridges(void); extern void lopec_find_bridges(void);
/* /*
...@@ -333,6 +335,21 @@ lopec_setup_arch(void) ...@@ -333,6 +335,21 @@ lopec_setup_arch(void)
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con; conswitchp = &dummy_con;
#endif #endif
#ifdef CONFIG_PPCBUG_NVRAM
/* Read in NVRAM data */
init_prep_nvram();
/* if no bootargs, look in NVRAM */
if ( cmd_line[0] == '\0' ) {
char *bootargs;
bootargs = prep_nvram_get_var("bootargs");
if (bootargs != NULL) {
strcpy(cmd_line, bootargs);
/* again.. */
strcpy(saved_command_line, cmd_line);
}
}
#endif
} }
void __init void __init
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Cort Dougan, Johnnie Peters, Matt Porter, and * Cort Dougan, Johnnie Peters, Matt Porter, and
* Troy Benjegerdes. * Troy Benjegerdes.
* *
* Copyright 2001 MontaVista Software Inc. * Copyright 2001-2002 MontaVista Software Inc.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of the GNU General Public License as published by the
...@@ -77,8 +77,9 @@ ...@@ -77,8 +77,9 @@
TODC_ALLOC(); TODC_ALLOC();
extern void pplus_setup_hose(void); extern char saved_command_line[];
extern void pplus_setup_hose(void);
extern void pplus_set_VIA_IDE_native(void); extern void pplus_set_VIA_IDE_native(void);
extern unsigned long loops_per_jiffy; extern unsigned long loops_per_jiffy;
...@@ -132,7 +133,8 @@ pplus_setup_arch(void) ...@@ -132,7 +133,8 @@ pplus_setup_arch(void)
ROOT_DEV = Root_SDA2; ROOT_DEV = Root_SDA2;
#endif #endif
printk("PowerPlus port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n"); printk(KERN_INFO "Motorola PowerPlus Platform\n");
printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
if ( ppc_md.progress ) if ( ppc_md.progress )
ppc_md.progress("pplus_setup_arch: raven_init\n", 0); ppc_md.progress("pplus_setup_arch: raven_init\n", 0);
...@@ -145,6 +147,21 @@ pplus_setup_arch(void) ...@@ -145,6 +147,21 @@ pplus_setup_arch(void)
conswitchp = &vga_con; conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE) #elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con; conswitchp = &dummy_con;
#endif
#ifdef CONFIG_PPCBUG_NVRAM
/* Read in NVRAM data */
init_prep_nvram();
/* if no bootargs, look in NVRAM */
if ( cmd_line[0] == '\0' ) {
char *bootargs;
bootargs = prep_nvram_get_var("bootargs");
if (bootargs != NULL) {
strcpy(cmd_line, bootargs);
/* again.. */
strcpy(saved_command_line, cmd_line);
}
}
#endif #endif
if ( ppc_md.progress ) if ( ppc_md.progress )
ppc_md.progress("pplus_setup_arch: exit\n", 0); ppc_md.progress("pplus_setup_arch: exit\n", 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment