diff options
Diffstat (limited to 'arch/sparc/kernel/setup_32.c')
| -rw-r--r-- | arch/sparc/kernel/setup_32.c | 62 | 
1 files changed, 49 insertions, 13 deletions
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index c052313f4dc..efe3e64bba3 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -32,6 +32,7 @@  #include <linux/cpu.h>  #include <linux/kdebug.h>  #include <linux/export.h> +#include <linux/start_kernel.h>  #include <asm/io.h>  #include <asm/processor.h> @@ -45,6 +46,7 @@  #include <asm/cpudata.h>  #include <asm/setup.h>  #include <asm/cacheflush.h> +#include <asm/sections.h>  #include "kernel.h" @@ -237,28 +239,42 @@ static void __init per_cpu_patch(void)  	}  } +struct leon_1insn_patch_entry { +	unsigned int addr; +	unsigned int insn; +}; +  enum sparc_cpu sparc_cpu_model;  EXPORT_SYMBOL(sparc_cpu_model); -struct tt_entry *sparc_ttable; +static __init void leon_patch(void) +{ +	struct leon_1insn_patch_entry *start = (void *)__leon_1insn_patch; +	struct leon_1insn_patch_entry *end = (void *)__leon_1insn_patch_end; -struct pt_regs fake_swapper_regs; +	/* Default instruction is leon - no patching */ +	if (sparc_cpu_model == sparc_leon) +		return; -void __init setup_arch(char **cmdline_p) -{ -	int i; -	unsigned long highest_paddr; +	while (start < end) { +		unsigned long addr = start->addr; -	sparc_ttable = (struct tt_entry *) &trapbase; +		*(unsigned int *)(addr) = start->insn; +		flushi(addr); -	/* Initialize PROM console and command line. */ -	*cmdline_p = prom_getbootargs(); -	strcpy(boot_command_line, *cmdline_p); -	parse_early_param(); +		start++; +	} +} -	boot_flags_init(*cmdline_p); +struct tt_entry *sparc_ttable; +struct pt_regs fake_swapper_regs; -	register_console(&prom_early_console); +/* Called from head_32.S - before we have setup anything + * in the kernel. Be very careful with what you do here. + */ +void __init sparc32_start_kernel(struct linux_romvec *rp) +{ +	prom_init(rp);  	/* Set sparc_cpu_model */  	sparc_cpu_model = sun_unknown; @@ -275,6 +291,26 @@ void __init setup_arch(char **cmdline_p)  	if (!strncmp(&cputypval[0], "leon" , 4))  		sparc_cpu_model = sparc_leon; +	leon_patch(); +	start_kernel(); +} + +void __init setup_arch(char **cmdline_p) +{ +	int i; +	unsigned long highest_paddr; + +	sparc_ttable = (struct tt_entry *) &trapbase; + +	/* Initialize PROM console and command line. */ +	*cmdline_p = prom_getbootargs(); +	strcpy(boot_command_line, *cmdline_p); +	parse_early_param(); + +	boot_flags_init(*cmdline_p); + +	register_console(&prom_early_console); +  	printk("ARCH: ");  	switch(sparc_cpu_model) {  	case sun4m:  |