From: Tom Rini From: Paul Mackerras Tom's patches to add early_param also added some code to read the command line from nvram in setup_arch on PReP boxes. This broke powermacs, though, since init_prep_nvram() calls the ppc_md.nvram_read_val pointer, which is initialized later on powermac. In any case we don't want to call the prep nvram code on powermacs, but do want to call it if we aren't on PPC_MULTIARCH (tested here with PPC_PREP, as this code specific to the PREP subportion of PPC_MULTIARCH). This patch fixes it, and also eliminates a compile warning about early_adb_sync. --- 25-akpm/arch/ppc/kernel/setup.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff -puN arch/ppc/kernel/setup.c~early-param-ppc-fixes-2 arch/ppc/kernel/setup.c --- 25/arch/ppc/kernel/setup.c~early-param-ppc-fixes-2 Wed Mar 31 14:10:35 2004 +++ 25-akpm/arch/ppc/kernel/setup.c Wed Mar 31 14:10:35 2004 @@ -470,10 +470,11 @@ platform_init(unsigned long r3, unsigned #ifdef CONFIG_ADB /* Allow us to say that ADB probing will be done synchronously. */ -static void __init early_adb_sync(char **ign) +static int __init early_adb_sync(char *ign) { extern int __adb_probe_sync; __adb_probe_sync = 1; + return 0; } __early_param("adb_sync", early_adb_sync); #endif /* CONFIG_ADB */ @@ -663,13 +664,18 @@ void __init setup_arch(char **cmdline_p) /* See if we need to grab the command line params from PPCBUG. */ #ifdef CONFIG_PPCBUG_NVRAM - /* Read in NVRAM data */ - init_prep_nvram(); - - if (cmd_line[0] == '\0') { - char *bootargs = prep_nvram_get_var("bootargs"); - if (bootargs != NULL) - strlcpy(cmd_line, bootargs, sizeof(cmd_line)); +#ifdef CONFIG_PPC_PREP + if (_machine == _MACH_prep) +#endif + { + /* Read in NVRAM data */ + init_prep_nvram(); + + if (cmd_line[0] == '\0') { + char *bootargs = prep_nvram_get_var("bootargs"); + if (bootargs != NULL) + strlcpy(cmd_line, bootargs, sizeof(cmd_line)); + } } #endif _