diff options
Diffstat (limited to 'arch/sparc/kernel/idprom.c')
-rw-r--r-- | arch/sparc/kernel/idprom.c | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c index 223a6582e1e2..c16135e0c151 100644 --- a/arch/sparc/kernel/idprom.c +++ b/arch/sparc/kernel/idprom.c | |||
@@ -11,35 +11,37 @@ | |||
11 | 11 | ||
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/idprom.h> | 13 | #include <asm/idprom.h> |
14 | #include <asm/machines.h> /* Fun with Sun released architectures. */ | ||
15 | 14 | ||
16 | struct idprom *idprom; | 15 | struct idprom *idprom; |
17 | static struct idprom idprom_buffer; | 16 | static struct idprom idprom_buffer; |
18 | 17 | ||
18 | #ifdef CONFIG_SPARC32 | ||
19 | #include <asm/machines.h> /* Fun with Sun released architectures. */ | ||
20 | |||
19 | /* Here is the master table of Sun machines which use some implementation | 21 | /* Here is the master table of Sun machines which use some implementation |
20 | * of the Sparc CPU and have a meaningful IDPROM machtype value that we | 22 | * of the Sparc CPU and have a meaningful IDPROM machtype value that we |
21 | * know about. See asm-sparc/machines.h for empirical constants. | 23 | * know about. See asm-sparc/machines.h for empirical constants. |
22 | */ | 24 | */ |
23 | static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = { | 25 | static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = { |
24 | /* First, Sun4's */ | 26 | /* First, Sun4's */ |
25 | { "Sun 4/100 Series", (SM_SUN4 | SM_4_110) }, | 27 | { .name = "Sun 4/100 Series", .id_machtype = (SM_SUN4 | SM_4_110) }, |
26 | { "Sun 4/200 Series", (SM_SUN4 | SM_4_260) }, | 28 | { .name = "Sun 4/200 Series", .id_machtype = (SM_SUN4 | SM_4_260) }, |
27 | { "Sun 4/300 Series", (SM_SUN4 | SM_4_330) }, | 29 | { .name = "Sun 4/300 Series", .id_machtype = (SM_SUN4 | SM_4_330) }, |
28 | { "Sun 4/400 Series", (SM_SUN4 | SM_4_470) }, | 30 | { .name = "Sun 4/400 Series", .id_machtype = (SM_SUN4 | SM_4_470) }, |
29 | /* Now, Sun4c's */ | 31 | /* Now, Sun4c's */ |
30 | { "Sun4c SparcStation 1", (SM_SUN4C | SM_4C_SS1) }, | 32 | { .name = "Sun4c SparcStation 1", .id_machtype = (SM_SUN4C | SM_4C_SS1) }, |
31 | { "Sun4c SparcStation IPC", (SM_SUN4C | SM_4C_IPC) }, | 33 | { .name = "Sun4c SparcStation IPC", .id_machtype = (SM_SUN4C | SM_4C_IPC) }, |
32 | { "Sun4c SparcStation 1+", (SM_SUN4C | SM_4C_SS1PLUS) }, | 34 | { .name = "Sun4c SparcStation 1+", .id_machtype = (SM_SUN4C | SM_4C_SS1PLUS) }, |
33 | { "Sun4c SparcStation SLC", (SM_SUN4C | SM_4C_SLC) }, | 35 | { .name = "Sun4c SparcStation SLC", .id_machtype = (SM_SUN4C | SM_4C_SLC) }, |
34 | { "Sun4c SparcStation 2", (SM_SUN4C | SM_4C_SS2) }, | 36 | { .name = "Sun4c SparcStation 2", .id_machtype = (SM_SUN4C | SM_4C_SS2) }, |
35 | { "Sun4c SparcStation ELC", (SM_SUN4C | SM_4C_ELC) }, | 37 | { .name = "Sun4c SparcStation ELC", .id_machtype = (SM_SUN4C | SM_4C_ELC) }, |
36 | { "Sun4c SparcStation IPX", (SM_SUN4C | SM_4C_IPX) }, | 38 | { .name = "Sun4c SparcStation IPX", .id_machtype = (SM_SUN4C | SM_4C_IPX) }, |
37 | /* Finally, early Sun4m's */ | 39 | /* Finally, early Sun4m's */ |
38 | { "Sun4m SparcSystem600", (SM_SUN4M | SM_4M_SS60) }, | 40 | { .name = "Sun4m SparcSystem600", .id_machtype = (SM_SUN4M | SM_4M_SS60) }, |
39 | { "Sun4m SparcStation10/20", (SM_SUN4M | SM_4M_SS50) }, | 41 | { .name = "Sun4m SparcStation10/20", .id_machtype = (SM_SUN4M | SM_4M_SS50) }, |
40 | { "Sun4m SparcStation5", (SM_SUN4M | SM_4M_SS40) }, | 42 | { .name = "Sun4m SparcStation5", .id_machtype = (SM_SUN4M | SM_4M_SS40) }, |
41 | /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */ | 43 | /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */ |
42 | { "Sun4M OBP based system", (SM_SUN4M_OBP | 0x0) } }; | 44 | { .name = "Sun4M OBP based system", .id_machtype = (SM_SUN4M_OBP | 0x0) } }; |
43 | 45 | ||
44 | static void __init display_system_type(unsigned char machtype) | 46 | static void __init display_system_type(unsigned char machtype) |
45 | { | 47 | { |
@@ -47,21 +49,25 @@ static void __init display_system_type(unsigned char machtype) | |||
47 | register int i; | 49 | register int i; |
48 | 50 | ||
49 | for (i = 0; i < NUM_SUN_MACHINES; i++) { | 51 | for (i = 0; i < NUM_SUN_MACHINES; i++) { |
50 | if(Sun_Machines[i].id_machtype == machtype) { | 52 | if (Sun_Machines[i].id_machtype == machtype) { |
51 | if (machtype != (SM_SUN4M_OBP | 0x00) || | 53 | if (machtype != (SM_SUN4M_OBP | 0x00) || |
52 | prom_getproperty(prom_root_node, "banner-name", | 54 | prom_getproperty(prom_root_node, "banner-name", |
53 | sysname, sizeof(sysname)) <= 0) | 55 | sysname, sizeof(sysname)) <= 0) |
54 | printk("TYPE: %s\n", Sun_Machines[i].name); | 56 | printk(KERN_WARNING "TYPE: %s\n", |
57 | Sun_Machines[i].name); | ||
55 | else | 58 | else |
56 | printk("TYPE: %s\n", sysname); | 59 | printk(KERN_WARNING "TYPE: %s\n", sysname); |
57 | return; | 60 | return; |
58 | } | 61 | } |
59 | } | 62 | } |
60 | 63 | ||
61 | prom_printf("IDPROM: Bogus id_machtype value, 0x%x\n", machtype); | 64 | prom_printf("IDPROM: Warning, bogus id_machtype value, 0x%x\n", machtype); |
62 | prom_halt(); | ||
63 | } | 65 | } |
64 | 66 | #else | |
67 | static void __init display_system_type(unsigned char machtype) | ||
68 | { | ||
69 | } | ||
70 | #endif | ||
65 | /* Calculate the IDPROM checksum (xor of the data bytes). */ | 71 | /* Calculate the IDPROM checksum (xor of the data bytes). */ |
66 | static unsigned char __init calc_idprom_cksum(struct idprom *idprom) | 72 | static unsigned char __init calc_idprom_cksum(struct idprom *idprom) |
67 | { | 73 | { |
@@ -80,21 +86,14 @@ void __init idprom_init(void) | |||
80 | 86 | ||
81 | idprom = &idprom_buffer; | 87 | idprom = &idprom_buffer; |
82 | 88 | ||
83 | if (idprom->id_format != 0x01) { | 89 | if (idprom->id_format != 0x01) |
84 | prom_printf("IDPROM: Unknown format type!\n"); | 90 | prom_printf("IDPROM: Warning, unknown format type!\n"); |
85 | prom_halt(); | ||
86 | } | ||
87 | 91 | ||
88 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) { | 92 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) |
89 | prom_printf("IDPROM: Checksum failure (nvram=%x, calc=%x)!\n", | 93 | prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n", |
90 | idprom->id_cksum, calc_idprom_cksum(idprom)); | 94 | idprom->id_cksum, calc_idprom_cksum(idprom)); |
91 | prom_halt(); | ||
92 | } | ||
93 | 95 | ||
94 | display_system_type(idprom->id_machtype); | 96 | display_system_type(idprom->id_machtype); |
95 | 97 | ||
96 | printk("Ethernet address: %x:%x:%x:%x:%x:%x\n", | 98 | printk(KERN_WARNING "Ethernet address: %pM\n", idprom->id_ethaddr); |
97 | idprom->id_ethaddr[0], idprom->id_ethaddr[1], | ||
98 | idprom->id_ethaddr[2], idprom->id_ethaddr[3], | ||
99 | idprom->id_ethaddr[4], idprom->id_ethaddr[5]); | ||
100 | } | 99 | } |