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/sparc64/prom | |
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/sparc64/prom')
-rw-r--r-- | arch/sparc64/prom/init.c | 48 | ||||
-rw-r--r-- | arch/sparc64/prom/misc.c | 18 |
2 files changed, 4 insertions, 62 deletions
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 | { |