diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-03-08 20:18:19 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:14:25 -0500 |
commit | 90a6646bf6a1ca821f32d5510e935855612904df (patch) | |
tree | 035420e4ab615cb837b1246fc26c55e0b8d233b4 /arch | |
parent | 8935dced547afbf37d0fcfcac9a3556494e53104 (diff) |
[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>
Diffstat (limited to 'arch')
-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 |
3 files changed, 10 insertions, 69 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 | { |