--- zzzz-none-000/linux-2.6.13.1/init/main.c 2005-09-10 02:42:58.000000000 +0000 +++ ohio-7170-487/linux-2.6.13.1/init/main.c 2006-11-06 16:02:03.000000000 +0000 @@ -53,6 +53,10 @@ #include #include +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) +#include +#endif + /* * This is one of the first .c files built. Error out early * if we have compiler trouble.. @@ -437,6 +441,9 @@ */ lock_kernel(); page_address_init(); +# if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + avm_pre_init(); +# endif /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ printk(KERN_NOTICE); printk(linux_banner); setup_arch(&command_line); @@ -533,7 +540,7 @@ rest_init(); } -static int __initdata initcall_debug; +static int __initdata initcall_debug = 1; /* M.Pommerenke TODO changes for debug */ static int __init initcall_debug_setup(char *str) { @@ -696,7 +703,11 @@ numa_default_policy(); if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - printk(KERN_WARNING "Warning: unable to open an initial console.\n"); + printk(KERN_WARNING "Warning: unable to open an initial console.\n"); + +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + avm_led_load_config(); /* HACK! Find a better point to start it! */ +#endif /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ (void) sys_dup(0); (void) sys_dup(0); @@ -708,6 +719,19 @@ * trying to recover a really broken machine. */ +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + { + int envs = 0; + while (envs < MAX_INIT_ARGS && envp_init[envs]) envs++; + if (envs < MAX_INIT_ARGS) { + static char reset_status[] = "reset_status=0"; + reset_status[13] = avm_reset_status() + 0x30; + envp_init[envs] = reset_status; + envp_init[envs+1] = NULL; + } + } +#endif /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ + if (execute_command) run_init_process(execute_command);