8 #include <linux/errno.h>
9 #include <linux/sched.h>
10 #include <linux/kernel.h>
12 #include <linux/stddef.h>
14 #include <linux/ptrace.h>
15 #include <linux/slab.h>
19 #include <linux/screen_info.h>
24 #include <linux/kdev_t.h>
26 #include <linux/string.h>
34 #include <linux/export.h>
38 #include <asm/processor.h>
39 #include <asm/oplib.h>
41 #include <asm/pgtable.h>
42 #include <asm/traps.h>
45 #include <asm/idprom.h>
47 #include <asm/setup.h>
48 #include <asm/cacheflush.h>
49 #include <asm/sections.h>
74 static void prom_sync_me(
void)
76 unsigned long prom_tbr,
flags;
80 __asm__ __volatile__(
"rd %%tbr, %0\n\t" :
"=r" (prom_tbr));
81 __asm__ __volatile__(
"wr %0, 0x0, %%tbr\n\t"
84 "nop\n\t" : :
"r" (&trapbase));
95 __asm__ __volatile__(
"wr %0, 0x0, %%tbr\n\t"
98 "nop\n\t" : :
"r" (prom_tbr));
102 static unsigned int boot_flags
__initdata = 0;
103 #define BOOTME_DEBUG 0x1
112 prom_console_write(
struct console *
con,
const char *
s,
unsigned n)
117 static struct console prom_early_console = {
119 .write = prom_console_write,
128 static void __init process_switch(
char c)
144 printk(
"Unknown boot switch (-%c)\n", c);
153 while (*commands && *commands ==
' ')
157 if (*commands ==
'\0')
159 if (*commands ==
'-') {
161 while (*commands && *commands !=
' ')
162 process_switch(*commands++);
165 if (!
strncmp(commands,
"mem=", 4)) {
172 if (*commands ==
'K' || *commands ==
'k') {
175 }
else if (*commands==
'M' || *commands==
'm') {
180 while (*commands && *commands !=
' ')
188 #define RAMDISK_IMAGE_START_MASK 0x07FF
189 #define RAMDISK_PROMPT_FLAG 0x8000
190 #define RAMDISK_LOAD_FLAG 0x4000
215 while (p < &__cpuid_patch_end) {
221 insns = &p->
sun4d[0];
231 *(
unsigned int *) (addr + 0) = insns[0];
233 *(
unsigned int *) (addr + 4) = insns[1];
235 *(
unsigned int *) (addr + 8) = insns[2];
250 static __init void leon_patch(
void)
259 while (start < end) {
260 unsigned long addr = start->
addr;
262 *(
unsigned int *)(addr) = start->
insn;
281 if (!
strcmp(&cputypval[0],
"sun4m"))
282 sparc_cpu_model =
sun4m;
283 if (!
strcmp(&cputypval[0],
"sun4s"))
284 sparc_cpu_model =
sun4m;
285 if (!
strcmp(&cputypval[0],
"sun4d"))
286 sparc_cpu_model =
sun4d;
287 if (!
strcmp(&cputypval[0],
"sun4e"))
288 sparc_cpu_model =
sun4e;
289 if (!
strcmp(&cputypval[0],
"sun4u"))
290 sparc_cpu_model =
sun4u;
291 if (!
strncmp(&cputypval[0],
"leon" , 4))
301 unsigned long highest_paddr;
310 boot_flags_init(*cmdline_p);
315 switch(sparc_cpu_model) {
336 #ifdef CONFIG_DUMMY_CONSOLE
345 for (i = 0;
sp_banks[
i].num_bytes != 0; i++) {
352 if (highest_paddr < top)
359 ROOT_DEV = old_decode_dev(root_dev);
360 #ifdef CONFIG_BLK_DEV_RAM
370 printk(
"Booted under KADB. Syncing trap table.\n");
398 int stop_a_enabled = 1;
400 static int __init topology_init(
void)