aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/prom/init.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-03-08 20:18:19 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:14:25 -0500
commit90a6646bf6a1ca821f32d5510e935855612904df (patch)
tree035420e4ab615cb837b1246fc26c55e0b8d233b4 /arch/sparc64/prom/init.c
parent8935dced547afbf37d0fcfcac9a3556494e53104 (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/init.c')
-rw-r--r--arch/sparc64/prom/init.c48
1 files changed, 4 insertions, 44 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
17enum prom_major_version prom_vers; 17/* OBP version string. */
18unsigned int prom_rev, prom_prev; 18char prom_version[80];
19 19
20/* The root node of the prom device tree. */ 20/* The root node of the prom device tree. */
21int prom_stdin, prom_stdout; 21int prom_stdin, prom_stdout;
@@ -30,13 +30,7 @@ extern void prom_cif_init(void *, void *);
30 30
31void __init prom_init(void *cif_handler, void *cif_stack) 31void __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
91strange_version:
92 prom_printf ("Strange OBP version `%s'.\n", buffer);
93 prom_halt ();
94} 54}