diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-07 03:50:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-07 03:50:29 -0500 |
commit | 680e58f809fee29cb81b15ec44fedc09aabaa698 (patch) | |
tree | 19083c554364fce2063645bf369f75d304d25972 /arch/sparc | |
parent | 7d3a70012005a9bcaebb5f44d5546376b9c6daa9 (diff) |
sparc: unify kernel/idprom.c
o in sparc32 variant removed prom_halt in warning situations
o ifdef out sparc32 specific code
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/idprom.c (renamed from arch/sparc/kernel/idprom_32.c) | 16 | ||||
-rw-r--r-- | arch/sparc/kernel/idprom_64.c | 49 |
3 files changed, 9 insertions, 58 deletions
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index 0ba314b7f111..59aab6a81e89 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
@@ -22,7 +22,7 @@ obj-y += process_$(BITS).o | |||
22 | obj-y += signal_$(BITS).o | 22 | obj-y += signal_$(BITS).o |
23 | obj-$(CONFIG_SPARC32) += ioport.o | 23 | obj-$(CONFIG_SPARC32) += ioport.o |
24 | obj-y += setup_$(BITS).o | 24 | obj-y += setup_$(BITS).o |
25 | obj-y += idprom_$(BITS).o | 25 | obj-y += idprom.o |
26 | obj-y += sys_sparc_$(BITS).o | 26 | obj-y += sys_sparc_$(BITS).o |
27 | obj-$(CONFIG_SPARC32) += systbls_32.o | 27 | obj-$(CONFIG_SPARC32) += systbls_32.o |
28 | obj-y += time_$(BITS).o | 28 | obj-y += time_$(BITS).o |
diff --git a/arch/sparc/kernel/idprom_32.c b/arch/sparc/kernel/idprom.c index 3e2fe0972428..1b0bd9120c1c 100644 --- a/arch/sparc/kernel/idprom_32.c +++ b/arch/sparc/kernel/idprom.c | |||
@@ -15,6 +15,7 @@ | |||
15 | struct idprom *idprom; | 15 | struct idprom *idprom; |
16 | static struct idprom idprom_buffer; | 16 | static struct idprom idprom_buffer; |
17 | 17 | ||
18 | #ifdef CONFIG_SPARC32 | ||
18 | #include <asm/machines.h> /* Fun with Sun released architectures. */ | 19 | #include <asm/machines.h> /* Fun with Sun released architectures. */ |
19 | 20 | ||
20 | /* 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 |
@@ -61,9 +62,12 @@ static void __init display_system_type(unsigned char machtype) | |||
61 | } | 62 | } |
62 | 63 | ||
63 | prom_printf("IDPROM: Warning, bogus id_machtype value, 0x%x\n", machtype); | 64 | prom_printf("IDPROM: Warning, bogus id_machtype value, 0x%x\n", machtype); |
64 | prom_halt(); | ||
65 | } | 65 | } |
66 | 66 | #else | |
67 | static void __init display_system_type(unsigned char machtype) | ||
68 | { | ||
69 | } | ||
70 | #endif | ||
67 | /* Calculate the IDPROM checksum (xor of the data bytes). */ | 71 | /* Calculate the IDPROM checksum (xor of the data bytes). */ |
68 | static unsigned char __init calc_idprom_cksum(struct idprom *idprom) | 72 | static unsigned char __init calc_idprom_cksum(struct idprom *idprom) |
69 | { | 73 | { |
@@ -82,16 +86,12 @@ void __init idprom_init(void) | |||
82 | 86 | ||
83 | idprom = &idprom_buffer; | 87 | idprom = &idprom_buffer; |
84 | 88 | ||
85 | if (idprom->id_format != 0x01) { | 89 | if (idprom->id_format != 0x01) |
86 | prom_printf("IDPROM: Warning, unknown format type!\n"); | 90 | prom_printf("IDPROM: Warning, unknown format type!\n"); |
87 | prom_halt(); | ||
88 | } | ||
89 | 91 | ||
90 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) { | 92 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) |
91 | prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n", | 93 | prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n", |
92 | idprom->id_cksum, calc_idprom_cksum(idprom)); | 94 | idprom->id_cksum, calc_idprom_cksum(idprom)); |
93 | prom_halt(); | ||
94 | } | ||
95 | 95 | ||
96 | display_system_type(idprom->id_machtype); | 96 | display_system_type(idprom->id_machtype); |
97 | 97 | ||
diff --git a/arch/sparc/kernel/idprom_64.c b/arch/sparc/kernel/idprom_64.c deleted file mode 100644 index 5b45a808c621..000000000000 --- a/arch/sparc/kernel/idprom_64.c +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * idprom.c: Routines to load the idprom into kernel addresses and | ||
3 | * interpret the data contained within. | ||
4 | * | ||
5 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | ||
6 | */ | ||
7 | |||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/types.h> | ||
10 | #include <linux/init.h> | ||
11 | |||
12 | #include <asm/oplib.h> | ||
13 | #include <asm/idprom.h> | ||
14 | |||
15 | struct idprom *idprom; | ||
16 | static struct idprom idprom_buffer; | ||
17 | |||
18 | /* Calculate the IDPROM checksum (xor of the data bytes). */ | ||
19 | static unsigned char __init calc_idprom_cksum(struct idprom *idprom) | ||
20 | { | ||
21 | unsigned char cksum, i, *ptr = (unsigned char *)idprom; | ||
22 | |||
23 | for (i = cksum = 0; i <= 0x0E; i++) | ||
24 | cksum ^= *ptr++; | ||
25 | |||
26 | return cksum; | ||
27 | } | ||
28 | |||
29 | /* Create a local IDPROM copy and verify integrity. */ | ||
30 | void __init idprom_init(void) | ||
31 | { | ||
32 | prom_get_idprom((char *) &idprom_buffer, sizeof(idprom_buffer)); | ||
33 | |||
34 | idprom = &idprom_buffer; | ||
35 | |||
36 | if (idprom->id_format != 0x01) { | ||
37 | prom_printf("IDPROM: Warning, unknown format type!\n"); | ||
38 | } | ||
39 | |||
40 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) { | ||
41 | prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n", | ||
42 | idprom->id_cksum, calc_idprom_cksum(idprom)); | ||
43 | } | ||
44 | |||
45 | printk("Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", | ||
46 | idprom->id_ethaddr[0], idprom->id_ethaddr[1], | ||
47 | idprom->id_ethaddr[2], idprom->id_ethaddr[3], | ||
48 | idprom->id_ethaddr[4], idprom->id_ethaddr[5]); | ||
49 | } | ||