diff options
| -rw-r--r-- | arch/ppc/config.in | 4 | ||||
| -rw-r--r-- | arch/ppc/kernel/Makefile | 1 | ||||
| -rw-r--r-- | arch/ppc/kernel/prep_nvram.c (renamed from arch/ppc/platforms/prep_nvram.c) | 9 | ||||
| -rw-r--r-- | arch/ppc/platforms/Makefile | 4 | ||||
| -rw-r--r-- | arch/ppc/platforms/lopec_setup.c | 17 | ||||
| -rw-r--r-- | arch/ppc/platforms/pplus_setup.c | 23 |
6 files changed, 51 insertions, 7 deletions
diff --git a/arch/ppc/config.in b/arch/ppc/config.in index 47d44bbd3fc2..d86294256d0c 100644 --- a/arch/ppc/config.in +++ b/arch/ppc/config.in @@ -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 PReP Residual Data' 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 bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 3a8e5d1930b7..0c92373f434f 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_PCI) += pci.o ifneq ($(CONFIG_PPC_ISERIES),y) obj-$(CONFIG_PCI) += pci-dma.o endif +obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o obj-$(CONFIG_KGDB) += ppc-stub.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_TAU) += temp.o diff --git a/arch/ppc/platforms/prep_nvram.c b/arch/ppc/kernel/prep_nvram.c index dad7771bdb2b..7d8c7e7e91e1 100644 --- a/arch/ppc/platforms/prep_nvram.c +++ b/arch/ppc/kernel/prep_nvram.c @@ -2,9 +2,14 @@ * 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> diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile index f188e157199a..9fd72e4dfcea 100644 --- a/arch/ppc/platforms/Makefile +++ b/arch/ppc/platforms/Makefile @@ -32,7 +32,7 @@ endif obj-$(CONFIG_ALL_PPC) += pmac_pic.o pmac_setup.o pmac_time.o \ pmac_feature.o pmac_pci.o chrp_setup.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) obj-$(CONFIG_NVRAM) += pmac_nvram.o endif @@ -50,7 +50,7 @@ obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.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_PRPMC800) += prpmc800_setup.o prpmc800_pci.o obj-$(CONFIG_SANDPOINT) += sandpoint_setup.o sandpoint_pci.o diff --git a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c index 2c63c6f8ad5c..8985f7b7e8b1 100644 --- a/arch/ppc/platforms/lopec_setup.c +++ b/arch/ppc/platforms/lopec_setup.c @@ -33,7 +33,9 @@ #include <asm/bootinfo.h> #include <asm/mpc10x.h> #include <asm/hw_irq.h> +#include <asm/prep_nvram.h> +extern char saved_command_line[]; extern void lopec_find_bridges(void); /* @@ -333,6 +335,21 @@ lopec_setup_arch(void) #ifdef CONFIG_DUMMY_CONSOLE 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 } void __init diff --git a/arch/ppc/platforms/pplus_setup.c b/arch/ppc/platforms/pplus_setup.c index 74d2aac096bd..993d59c6d2ed 100644 --- a/arch/ppc/platforms/pplus_setup.c +++ b/arch/ppc/platforms/pplus_setup.c @@ -9,7 +9,7 @@ * Cort Dougan, Johnnie Peters, Matt Porter, and * 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 * under the terms of the GNU General Public License as published by the @@ -77,8 +77,9 @@ 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 unsigned long loops_per_jiffy; @@ -132,7 +133,8 @@ pplus_setup_arch(void) ROOT_DEV = Root_SDA2; #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 ) ppc_md.progress("pplus_setup_arch: raven_init\n", 0); @@ -146,6 +148,21 @@ pplus_setup_arch(void) #elif defined(CONFIG_DUMMY_CONSOLE) 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 if ( ppc_md.progress ) ppc_md.progress("pplus_setup_arch: exit\n", 0); } |
