Commit 90a6646bf6a1ca821f32d5510e935855612904df
1 parent
8935dced54
Exists in
master
and in
7 other branches
[SPARC64]: Fix system type in /proc/cpuinfo and remove bogus OBP check.
Report 'sun4v' when appropriate in /proc/cpuinfo Remove all the verifications of the OBP version string. Just make sure it's there, and report it raw in the bootup logs and via /proc/cpuinfo. Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 4 changed files with 12 additions and 90 deletions Side-by-side Diff
arch/sparc64/kernel/setup.c
... | ... | @@ -442,9 +442,8 @@ |
442 | 442 | seq_printf(m, |
443 | 443 | "cpu\t\t: %s\n" |
444 | 444 | "fpu\t\t: %s\n" |
445 | - "promlib\t\t: Version 3 Revision %d\n" | |
446 | - "prom\t\t: %d.%d.%d\n" | |
447 | - "type\t\t: sun4u\n" | |
445 | + "prom\t\t: %s\n" | |
446 | + "type\t\t: %s\n" | |
448 | 447 | "ncpus probed\t: %d\n" |
449 | 448 | "ncpus active\t: %d\n" |
450 | 449 | "D$ parity tl1\t: %u\n" |
... | ... | @@ -456,10 +455,10 @@ |
456 | 455 | , |
457 | 456 | sparc_cpu_type, |
458 | 457 | sparc_fpu_type, |
459 | - prom_rev, | |
460 | - prom_prev >> 16, | |
461 | - (prom_prev >> 8) & 0xff, | |
462 | - prom_prev & 0xff, | |
458 | + prom_version, | |
459 | + ((tlb_type == hypervisor) ? | |
460 | + "sun4v" : | |
461 | + "sun4u"), | |
463 | 462 | ncpus_probed, |
464 | 463 | num_online_cpus(), |
465 | 464 | dcache_parity_tl1_occurred, |
arch/sparc64/prom/init.c
... | ... | @@ -14,8 +14,8 @@ |
14 | 14 | #include <asm/openprom.h> |
15 | 15 | #include <asm/oplib.h> |
16 | 16 | |
17 | -enum prom_major_version prom_vers; | |
18 | -unsigned int prom_rev, prom_prev; | |
17 | +/* OBP version string. */ | |
18 | +char prom_version[80]; | |
19 | 19 | |
20 | 20 | /* The root node of the prom device tree. */ |
21 | 21 | int prom_stdin, prom_stdout; |
22 | 22 | |
23 | 23 | |
... | ... | @@ -30,14 +30,8 @@ |
30 | 30 | |
31 | 31 | void __init prom_init(void *cif_handler, void *cif_stack) |
32 | 32 | { |
33 | - char buffer[80], *p; | |
34 | - int ints[3]; | |
35 | 33 | int node; |
36 | - int i = 0; | |
37 | - int bufadjust; | |
38 | 34 | |
39 | - prom_vers = PROM_P1275; | |
40 | - | |
41 | 35 | prom_cif_init(cif_handler, cif_stack); |
42 | 36 | |
43 | 37 | prom_chosen_node = prom_finddevice(prom_chosen_path); |
44 | 38 | |
45 | 39 | |
... | ... | @@ -51,45 +45,11 @@ |
51 | 45 | if (!node || node == -1) |
52 | 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 | 50 | prom_printf("\n"); |
57 | 51 | |
58 | - if (strncmp(buffer, "OBP ", 4)) | |
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); | |
52 | + printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version); | |
86 | 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 | } |
arch/sparc64/prom/misc.c
... | ... | @@ -112,24 +112,6 @@ |
112 | 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 | 115 | /* Install Linux trap table so PROM uses that instead of its own. */ |
134 | 116 | void prom_set_trap_table(unsigned long tba) |
135 | 117 | { |
include/asm-sparc64/oplib.h
... | ... | @@ -12,19 +12,9 @@ |
12 | 12 | #include <linux/config.h> |
13 | 13 | #include <asm/openprom.h> |
14 | 14 | |
15 | -/* Enumeration to describe the prom major version we have detected. */ | |
16 | -enum prom_major_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 | -}; | |
15 | +/* OBP version string. */ | |
16 | +extern char prom_version[]; | |
23 | 17 | |
24 | -extern enum prom_major_version prom_vers; | |
25 | -/* Revision, and firmware revision. */ | |
26 | -extern unsigned int prom_rev, prom_prev; | |
27 | - | |
28 | 18 | /* Root node of the prom device tree, this stays constant after |
29 | 19 | * initialization is complete. |
30 | 20 | */ |
... | ... | @@ -132,15 +122,6 @@ |
132 | 122 | * is the format type of this idprom or 0xff on error. |
133 | 123 | */ |
134 | 124 | extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); |
135 | - | |
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 | 125 | |
145 | 126 | /* Character operations to/from the console.... */ |
146 | 127 |