diff options
-rw-r--r-- | arch/sparc64/kernel/setup.c | 13 | ||||
-rw-r--r-- | arch/sparc64/prom/init.c | 48 | ||||
-rw-r--r-- | arch/sparc64/prom/misc.c | 18 | ||||
-rw-r--r-- | include/asm-sparc64/oplib.h | 23 |
4 files changed, 12 insertions, 90 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 2a2a8a6cd17d..7ae4027a9192 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c | |||
@@ -442,9 +442,8 @@ static int show_cpuinfo(struct seq_file *m, void *__unused) | |||
442 | seq_printf(m, | 442 | seq_printf(m, |
443 | "cpu\t\t: %s\n" | 443 | "cpu\t\t: %s\n" |
444 | "fpu\t\t: %s\n" | 444 | "fpu\t\t: %s\n" |
445 | "promlib\t\t: Version 3 Revision %d\n" | 445 | "prom\t\t: %s\n" |
446 | "prom\t\t: %d.%d.%d\n" | 446 | "type\t\t: %s\n" |
447 | "type\t\t: sun4u\n" | ||
448 | "ncpus probed\t: %d\n" | 447 | "ncpus probed\t: %d\n" |
449 | "ncpus active\t: %d\n" | 448 | "ncpus active\t: %d\n" |
450 | "D$ parity tl1\t: %u\n" | 449 | "D$ parity tl1\t: %u\n" |
@@ -456,10 +455,10 @@ static int show_cpuinfo(struct seq_file *m, void *__unused) | |||
456 | , | 455 | , |
457 | sparc_cpu_type, | 456 | sparc_cpu_type, |
458 | sparc_fpu_type, | 457 | sparc_fpu_type, |
459 | prom_rev, | 458 | prom_version, |
460 | prom_prev >> 16, | 459 | ((tlb_type == hypervisor) ? |
461 | (prom_prev >> 8) & 0xff, | 460 | "sun4v" : |
462 | prom_prev & 0xff, | 461 | "sun4u"), |
463 | ncpus_probed, | 462 | ncpus_probed, |
464 | num_online_cpus(), | 463 | num_online_cpus(), |
465 | dcache_parity_tl1_occurred, | 464 | dcache_parity_tl1_occurred, |
diff --git a/arch/sparc64/prom/init.c b/arch/sparc64/prom/init.c index 095755e428a6..1c0db842a6f4 100644 --- a/arch/sparc64/prom/init.c +++ b/arch/sparc64/prom/init.c | |||
@@ -14,8 +14,8 @@ | |||
14 | #include <asm/openprom.h> | 14 | #include <asm/openprom.h> |
15 | #include <asm/oplib.h> | 15 | #include <asm/oplib.h> |
16 | 16 | ||
17 | enum prom_major_version prom_vers; | 17 | /* OBP version string. */ |
18 | unsigned int prom_rev, prom_prev; | 18 | char prom_version[80]; |
19 | 19 | ||
20 | /* The root node of the prom device tree. */ | 20 | /* The root node of the prom device tree. */ |
21 | int prom_stdin, prom_stdout; | 21 | int prom_stdin, prom_stdout; |
@@ -30,13 +30,7 @@ extern void prom_cif_init(void *, void *); | |||
30 | 30 | ||
31 | void __init prom_init(void *cif_handler, void *cif_stack) | 31 | void __init prom_init(void *cif_handler, void *cif_stack) |
32 | { | 32 | { |
33 | char buffer[80], *p; | ||
34 | int ints[3]; | ||
35 | int node; | 33 | int node; |
36 | int i = 0; | ||
37 | int bufadjust; | ||
38 | |||
39 | prom_vers = PROM_P1275; | ||
40 | 34 | ||
41 | prom_cif_init(cif_handler, cif_stack); | 35 | prom_cif_init(cif_handler, cif_stack); |
42 | 36 | ||
@@ -51,44 +45,10 @@ void __init prom_init(void *cif_handler, void *cif_stack) | |||
51 | if (!node || node == -1) | 45 | if (!node || node == -1) |
52 | prom_halt(); | 46 | prom_halt(); |
53 | 47 | ||
54 | prom_getstring(node, "version", buffer, sizeof (buffer)); | 48 | prom_getstring(node, "version", prom_version, sizeof(prom_version)); |
55 | 49 | ||
56 | prom_printf("\n"); | 50 | prom_printf("\n"); |
57 | 51 | ||
58 | if (strncmp(buffer, "OBP ", 4)) | 52 | printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version); |
59 | goto strange_version; | ||
60 | |||
61 | /* | ||
62 | * Version field is expected to be 'OBP xx.yy.zz date...' | ||
63 | * However, Sun can't stick to this format very well, so | ||
64 | * we need to check for 'OBP xx.yy.zz date...' and adjust | ||
65 | * accordingly. -spot | ||
66 | */ | ||
67 | |||
68 | if (strncmp(buffer, "OBP ", 5)) | ||
69 | bufadjust = 4; | ||
70 | else | ||
71 | bufadjust = 5; | ||
72 | |||
73 | p = buffer + bufadjust; | ||
74 | while (p && isdigit(*p) && i < 3) { | ||
75 | ints[i++] = simple_strtoul(p, NULL, 0); | ||
76 | if ((p = strchr(p, '.')) != NULL) | ||
77 | p++; | ||
78 | } | ||
79 | if (i != 3) | ||
80 | goto strange_version; | ||
81 | |||
82 | prom_rev = ints[1]; | ||
83 | prom_prev = (ints[0] << 16) | (ints[1] << 8) | ints[2]; | ||
84 | |||
85 | printk("PROMLIB: Sun IEEE Boot Prom %s\n", buffer + bufadjust); | ||
86 | printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible); | 53 | printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible); |
87 | |||
88 | /* Initialization successful. */ | ||
89 | return; | ||
90 | |||
91 | strange_version: | ||
92 | prom_printf ("Strange OBP version `%s'.\n", buffer); | ||
93 | prom_halt (); | ||
94 | } | 54 | } |
diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c index 90df42141b19..577bde8b6647 100644 --- a/arch/sparc64/prom/misc.c +++ b/arch/sparc64/prom/misc.c | |||
@@ -112,24 +112,6 @@ unsigned char prom_get_idprom(char *idbuf, int num_bytes) | |||
112 | return 0xff; | 112 | return 0xff; |
113 | } | 113 | } |
114 | 114 | ||
115 | /* Get the major prom version number. */ | ||
116 | int prom_version(void) | ||
117 | { | ||
118 | return PROM_P1275; | ||
119 | } | ||
120 | |||
121 | /* Get the prom plugin-revision. */ | ||
122 | int prom_getrev(void) | ||
123 | { | ||
124 | return prom_rev; | ||
125 | } | ||
126 | |||
127 | /* Get the prom firmware print revision. */ | ||
128 | int prom_getprev(void) | ||
129 | { | ||
130 | return prom_prev; | ||
131 | } | ||
132 | |||
133 | /* Install Linux trap table so PROM uses that instead of its own. */ | 115 | /* Install Linux trap table so PROM uses that instead of its own. */ |
134 | void prom_set_trap_table(unsigned long tba) | 116 | void prom_set_trap_table(unsigned long tba) |
135 | { | 117 | { |
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index 84618f8a9e6e..c754676e13ef 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h | |||
@@ -12,18 +12,8 @@ | |||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <asm/openprom.h> | 13 | #include <asm/openprom.h> |
14 | 14 | ||
15 | /* Enumeration to describe the prom major version we have detected. */ | 15 | /* OBP version string. */ |
16 | enum prom_major_version { | 16 | extern char prom_version[]; |
17 | PROM_V0, /* Original sun4c V0 prom */ | ||
18 | PROM_V2, /* sun4c and early sun4m V2 prom */ | ||
19 | PROM_V3, /* sun4m and later, up to sun4d/sun4e machines V3 */ | ||
20 | PROM_P1275, /* IEEE compliant ISA based Sun PROM, only sun4u */ | ||
21 | PROM_AP1000, /* actually no prom at all */ | ||
22 | }; | ||
23 | |||
24 | extern enum prom_major_version prom_vers; | ||
25 | /* Revision, and firmware revision. */ | ||
26 | extern unsigned int prom_rev, prom_prev; | ||
27 | 17 | ||
28 | /* Root node of the prom device tree, this stays constant after | 18 | /* Root node of the prom device tree, this stays constant after |
29 | * initialization is complete. | 19 | * initialization is complete. |
@@ -133,15 +123,6 @@ extern void prom_setcallback(callback_func_t func_ptr); | |||
133 | */ | 123 | */ |
134 | extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); | 124 | extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); |
135 | 125 | ||
136 | /* Get the prom major version. */ | ||
137 | extern int prom_version(void); | ||
138 | |||
139 | /* Get the prom plugin revision. */ | ||
140 | extern int prom_getrev(void); | ||
141 | |||
142 | /* Get the prom firmware revision. */ | ||
143 | extern int prom_getprev(void); | ||
144 | |||
145 | /* Character operations to/from the console.... */ | 126 | /* Character operations to/from the console.... */ |
146 | 127 | ||
147 | /* Non-blocking get character from console. */ | 128 | /* Non-blocking get character from console. */ |