--- zzzz-none-000/linux-2.4.17/init/main.c 2001-12-21 17:42:04.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/init/main.c 2004-11-24 13:22:10.000000000 +0000 @@ -69,6 +69,13 @@ #include #endif + +#if defined(CONFIG_MIPS_AVALANCHE_ADAM2) || defined (CONFIG_MIPS_AVALANCHE_PSPBOOT) +#include +#endif + + + /* * Versions of gcc older than that listed below may actually compile * and link okay, but the end product can have subtle run time bugs. @@ -107,6 +114,8 @@ extern void ipc_init(void); #endif + + /* * Boot command-line arguments */ @@ -116,6 +125,10 @@ extern void time_init(void); extern void softirq_init(void); +#ifdef CONFIG_CPU_XSCALE +extern int xscale_locking_init(void); +#endif + int rows, cols; #ifdef CONFIG_BLK_DEV_INITRD @@ -195,6 +208,7 @@ { "scd", 0x0b00 }, { "mcd", 0x1700 }, { "cdu535", 0x1800 }, + { "gdrom", 0xFA00 }, { "sonycd", 0x1800 }, { "aztcd", 0x1d00 }, { "cm206cd", 0x2000 }, @@ -539,6 +553,9 @@ * Activate the first processor. */ +#if defined(CONFIG_MIPS) && defined(CONFIG_NEW_TIME_C) +extern void calibrate_mips_counter(void); +#endif asmlinkage void __init start_kernel(void) { char * command_line; @@ -551,6 +568,7 @@ lock_kernel(); printk(linux_banner); setup_arch(&command_line); + printk("Kernel command line: %s\n", saved_command_line); parse_options(command_line); trap_init(); @@ -581,6 +599,9 @@ kmem_cache_init(); sti(); calibrate_delay(); +#if defined(CONFIG_MIPS) && defined(CONFIG_NEW_TIME_C) + calibrate_mips_counter(); +#endif #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start && !initrd_below_start_ok && initrd_start < min_low_pfn << PAGE_SHIFT) { @@ -593,6 +614,14 @@ kmem_cache_sizes_init(); pgtable_cache_init(); + /* + * This is called early on so that all drivers/subsystems + * can do cache/tlb + */ +#ifdef CONFIG_CPU_XSCALE + xscale_locking_init(); +#endif + mempages = num_physpages; fork_init(mempages); @@ -725,6 +754,7 @@ tc_init(); #endif + /* Networking initialization needs a process context */ sock_init(); @@ -740,8 +770,14 @@ #endif } + +#ifdef CONFIG_BLK_DEV_RAM extern void rd_load(void); +#endif /* CONFIG_BLK_DEV_RAM */ + +#ifdef CONFIG_BLK_DEV_INITRD extern void initrd_load(void); +#endif /* CONFIG_BLK_DEV_INITRD */ /* * Prepare the namespace - decide what/where to mount, load ramdisks, etc. @@ -766,6 +802,11 @@ rd_load(); #endif + +#if defined(CONFIG_MIPS_AVALANCHE_SOC) + ROOT_DEV = name_to_kdev_t("/dev/mtdblock/0"); +#endif + /* Mount the root filesystem.. */ mount_root(); @@ -796,6 +837,7 @@ #endif } + static int init(void * unused) { lock_kernel(); @@ -830,5 +872,8 @@ execve("/etc/init",argv_init,envp_init); execve("/bin/init",argv_init,envp_init); execve("/bin/sh",argv_init,envp_init); +#if defined(CONFIG_MIPS_AVALANCHE_ADAM2) || defined(CONFIG_MIPS_AVALANCHE_PSPBOOT) + adam2_env_set_variable("crash", ""); +#endif panic("No init found. Try passing init= option to kernel."); }