aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-08-31 23:59:37 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-31 23:59:37 -0400
commit5110bd21b8af4199b8332c0ab0b23367556653d3 (patch)
treefcd655bb454ee7b0382aa200d9a2e160465ac6ae /arch/sparc/prom
parentb69416b51be0757c82f1c5a0a3f0995a4484dab4 (diff)
sparc: remove CONFIG_SUN4
While doing some easy cleanups on the sparc code I noticed that the CONFIG_SUN4 code seems to be worse than the rest - there were some "I don't know how it should work, but the current code definitely cannot work." places. And while I have seen people running Linux on machines like a SPARCstation 5 a few years ago I don't recall having seen sun4 machines, even less ones running Linux. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/prom')
-rw-r--r--arch/sparc/prom/Makefile2
-rw-r--r--arch/sparc/prom/bootstr.c4
-rw-r--r--arch/sparc/prom/console.c3
-rw-r--r--arch/sparc/prom/init.c12
-rw-r--r--arch/sparc/prom/memory.c14
-rw-r--r--arch/sparc/prom/sun4prom.c161
6 files changed, 0 insertions, 196 deletions
diff --git a/arch/sparc/prom/Makefile b/arch/sparc/prom/Makefile
index 7f5eacfcfbcf..8f7e18546c97 100644
--- a/arch/sparc/prom/Makefile
+++ b/arch/sparc/prom/Makefile
@@ -4,5 +4,3 @@
4 4
5lib-y := bootstr.o devmap.o devops.o init.o memory.o misc.o mp.o \ 5lib-y := bootstr.o devmap.o devops.o init.o memory.o misc.o mp.o \
6 palloc.o ranges.o segment.o console.o printf.o tree.o 6 palloc.o ranges.o segment.o console.o printf.o tree.o
7
8lib-$(CONFIG_SUN4) += sun4prom.o
diff --git a/arch/sparc/prom/bootstr.c b/arch/sparc/prom/bootstr.c
index 5a35c768ff7c..916831da7e67 100644
--- a/arch/sparc/prom/bootstr.c
+++ b/arch/sparc/prom/bootstr.c
@@ -6,15 +6,12 @@
6 6
7#include <linux/string.h> 7#include <linux/string.h>
8#include <asm/oplib.h> 8#include <asm/oplib.h>
9#include <asm/sun4prom.h>
10#include <linux/init.h> 9#include <linux/init.h>
11 10
12#define BARG_LEN 256 11#define BARG_LEN 256
13static char barg_buf[BARG_LEN] = { 0 }; 12static char barg_buf[BARG_LEN] = { 0 };
14static char fetched __initdata = 0; 13static char fetched __initdata = 0;
15 14
16extern linux_sun4_romvec *sun4_romvec;
17
18char * __init 15char * __init
19prom_getbootargs(void) 16prom_getbootargs(void)
20{ 17{
@@ -28,7 +25,6 @@ prom_getbootargs(void)
28 25
29 switch(prom_vers) { 26 switch(prom_vers) {
30 case PROM_V0: 27 case PROM_V0:
31 case PROM_SUN4:
32 cp = barg_buf; 28 cp = barg_buf;
33 /* Start from 1 and go over fd(0,0,0)kernel */ 29 /* Start from 1 and go over fd(0,0,0)kernel */
34 for(iter = 1; iter < 8; iter++) { 30 for(iter = 1; iter < 8; iter++) {
diff --git a/arch/sparc/prom/console.c b/arch/sparc/prom/console.c
index 790057a34616..b3075d73fc19 100644
--- a/arch/sparc/prom/console.c
+++ b/arch/sparc/prom/console.c
@@ -10,7 +10,6 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <asm/openprom.h> 12#include <asm/openprom.h>
13#include <asm/sun4prom.h>
14#include <asm/oplib.h> 13#include <asm/oplib.h>
15#include <asm/system.h> 14#include <asm/system.h>
16#include <linux/string.h> 15#include <linux/string.h>
@@ -30,7 +29,6 @@ prom_nbgetchar(void)
30 spin_lock_irqsave(&prom_lock, flags); 29 spin_lock_irqsave(&prom_lock, flags);
31 switch(prom_vers) { 30 switch(prom_vers) {
32 case PROM_V0: 31 case PROM_V0:
33 case PROM_SUN4:
34 i = (*(romvec->pv_nbgetchar))(); 32 i = (*(romvec->pv_nbgetchar))();
35 break; 33 break;
36 case PROM_V2: 34 case PROM_V2:
@@ -63,7 +61,6 @@ prom_nbputchar(char c)
63 spin_lock_irqsave(&prom_lock, flags); 61 spin_lock_irqsave(&prom_lock, flags);
64 switch(prom_vers) { 62 switch(prom_vers) {
65 case PROM_V0: 63 case PROM_V0:
66 case PROM_SUN4:
67 i = (*(romvec->pv_nbputchar))(c); 64 i = (*(romvec->pv_nbputchar))(c);
68 break; 65 break;
69 case PROM_V2: 66 case PROM_V2:
diff --git a/arch/sparc/prom/init.c b/arch/sparc/prom/init.c
index 729f87066945..873217c6d823 100644
--- a/arch/sparc/prom/init.c
+++ b/arch/sparc/prom/init.c
@@ -11,12 +11,10 @@
11 11
12#include <asm/openprom.h> 12#include <asm/openprom.h>
13#include <asm/oplib.h> 13#include <asm/oplib.h>
14#include <asm/sun4prom.h>
15 14
16struct linux_romvec *romvec; 15struct linux_romvec *romvec;
17enum prom_major_version prom_vers; 16enum prom_major_version prom_vers;
18unsigned int prom_rev, prom_prev; 17unsigned int prom_rev, prom_prev;
19linux_sun4_romvec *sun4_romvec;
20 18
21/* The root node of the prom device tree. */ 19/* The root node of the prom device tree. */
22int prom_root_node; 20int prom_root_node;
@@ -34,10 +32,6 @@ extern void prom_ranges_init(void);
34 32
35void __init prom_init(struct linux_romvec *rp) 33void __init prom_init(struct linux_romvec *rp)
36{ 34{
37#ifdef CONFIG_SUN4
38 extern struct linux_romvec *sun4_prom_init(void);
39 rp = sun4_prom_init();
40#endif
41 romvec = rp; 35 romvec = rp;
42 36
43 switch(romvec->pv_romvers) { 37 switch(romvec->pv_romvers) {
@@ -50,9 +44,6 @@ void __init prom_init(struct linux_romvec *rp)
50 case 3: 44 case 3:
51 prom_vers = PROM_V3; 45 prom_vers = PROM_V3;
52 break; 46 break;
53 case 40:
54 prom_vers = PROM_SUN4;
55 break;
56 default: 47 default:
57 prom_printf("PROMLIB: Bad PROM version %d\n", 48 prom_printf("PROMLIB: Bad PROM version %d\n",
58 romvec->pv_romvers); 49 romvec->pv_romvers);
@@ -76,11 +67,8 @@ void __init prom_init(struct linux_romvec *rp)
76 67
77 prom_ranges_init(); 68 prom_ranges_init();
78 69
79#ifndef CONFIG_SUN4
80 /* SUN4 prints this in sun4_prom_init */
81 printk("PROMLIB: Sun Boot Prom Version %d Revision %d\n", 70 printk("PROMLIB: Sun Boot Prom Version %d Revision %d\n",
82 romvec->pv_romvers, prom_rev); 71 romvec->pv_romvers, prom_rev);
83#endif
84 72
85 /* Initialization successful. */ 73 /* Initialization successful. */
86 return; 74 return;
diff --git a/arch/sparc/prom/memory.c b/arch/sparc/prom/memory.c
index 947f047dc95a..fac7899a29c3 100644
--- a/arch/sparc/prom/memory.c
+++ b/arch/sparc/prom/memory.c
@@ -10,7 +10,6 @@
10#include <linux/init.h> 10#include <linux/init.h>
11 11
12#include <asm/openprom.h> 12#include <asm/openprom.h>
13#include <asm/sun4prom.h>
14#include <asm/oplib.h> 13#include <asm/oplib.h>
15#include <asm/page.h> 14#include <asm/page.h>
16 15
@@ -46,15 +45,6 @@ static int __init prom_meminit_v2(void)
46 return num_ents; 45 return num_ents;
47} 46}
48 47
49static int __init prom_meminit_sun4(void)
50{
51#ifdef CONFIG_SUN4
52 sp_banks[0].base_addr = 0;
53 sp_banks[0].num_bytes = *(sun4_romvec->memoryavail);
54#endif
55 return 1;
56}
57
58static int sp_banks_cmp(const void *a, const void *b) 48static int sp_banks_cmp(const void *a, const void *b)
59{ 49{
60 const struct sparc_phys_banks *x = a, *y = b; 50 const struct sparc_phys_banks *x = a, *y = b;
@@ -81,10 +71,6 @@ void __init prom_meminit(void)
81 num_ents = prom_meminit_v2(); 71 num_ents = prom_meminit_v2();
82 break; 72 break;
83 73
84 case PROM_SUN4:
85 num_ents = prom_meminit_sun4();
86 break;
87
88 default: 74 default:
89 break; 75 break;
90 } 76 }
diff --git a/arch/sparc/prom/sun4prom.c b/arch/sparc/prom/sun4prom.c
deleted file mode 100644
index 00390a2652aa..000000000000
--- a/arch/sparc/prom/sun4prom.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * Copyright (C) 1996 The Australian National University.
3 * Copyright (C) 1996 Fujitsu Laboratories Limited
4 * Copyright (C) 1997 Michael A. Griffith (grif@acm.org)
5 * Copyright (C) 1997 Sun Weenie (ko@ko.reno.nv.us)
6 * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
7 *
8 * This software may be distributed under the terms of the Gnu
9 * Public License version 2 or later
10 *
11 * fake a really simple Sun prom for the SUN4
12 */
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <asm/oplib.h>
17#include <asm/idprom.h>
18#include <asm/machines.h>
19#include <asm/sun4prom.h>
20#include <asm/asi.h>
21#include <asm/contregs.h>
22#include <linux/init.h>
23
24static struct linux_romvec sun4romvec;
25static struct idprom sun4_idprom;
26
27struct property {
28 char *name;
29 char *value;
30 int length;
31};
32
33struct node {
34 int level;
35 struct property *properties;
36};
37
38struct property null_properties = { NULL, NULL, -1 };
39
40struct property root_properties[] = {
41 {"device_type", "cpu", 4},
42 {"idprom", (char *)&sun4_idprom, sizeof(struct idprom)},
43 {NULL, NULL, -1}
44};
45
46struct node nodes[] = {
47 { 0, &null_properties },
48 { 0, root_properties },
49 { -1,&null_properties }
50};
51
52
53static int no_nextnode(int node)
54{
55 if (nodes[node].level == nodes[node+1].level)
56 return node+1;
57 return -1;
58}
59
60static int no_child(int node)
61{
62 if (nodes[node].level == nodes[node+1].level-1)
63 return node+1;
64 return -1;
65}
66
67static struct property *find_property(int node,char *name)
68{
69 struct property *prop = &nodes[node].properties[0];
70 while (prop && prop->name) {
71 if (strcmp(prop->name,name) == 0) return prop;
72 prop++;
73 }
74 return NULL;
75}
76
77static int no_proplen(int node,char *name)
78{
79 struct property *prop = find_property(node,name);
80 if (prop) return prop->length;
81 return -1;
82}
83
84static int no_getprop(int node,char *name,char *value)
85{
86 struct property *prop = find_property(node,name);
87 if (prop) {
88 memcpy(value,prop->value,prop->length);
89 return 1;
90 }
91 return -1;
92}
93
94static int no_setprop(int node,char *name,char *value,int len)
95{
96 return -1;
97}
98
99static char *no_nextprop(int node,char *name)
100{
101 struct property *prop = find_property(node,name);
102 if (prop) return prop[1].name;
103 return NULL;
104}
105
106static struct linux_nodeops sun4_nodeops = {
107 no_nextnode,
108 no_child,
109 no_proplen,
110 no_getprop,
111 no_setprop,
112 no_nextprop
113};
114
115static int synch_hook;
116
117struct linux_romvec * __init sun4_prom_init(void)
118{
119 int i;
120 unsigned char x;
121 char *p;
122
123 p = (char *)&sun4_idprom;
124 for (i = 0; i < sizeof(sun4_idprom); i++) {
125 __asm__ __volatile__ ("lduba [%1] %2, %0" : "=r" (x) :
126 "r" (AC_IDPROM + i), "i" (ASI_CONTROL));
127 *p++ = x;
128 }
129
130 memset(&sun4romvec,0,sizeof(sun4romvec));
131
132 sun4_romvec = (linux_sun4_romvec *) SUN4_PROM_VECTOR;
133
134 sun4romvec.pv_romvers = 40;
135 sun4romvec.pv_nodeops = &sun4_nodeops;
136 sun4romvec.pv_reboot = sun4_romvec->reboot;
137 sun4romvec.pv_abort = sun4_romvec->abortentry;
138 sun4romvec.pv_halt = sun4_romvec->exittomon;
139 sun4romvec.pv_synchook = (void (**)(void))&synch_hook;
140 sun4romvec.pv_setctxt = sun4_romvec->setcxsegmap;
141 sun4romvec.pv_v0bootargs = sun4_romvec->bootParam;
142 sun4romvec.pv_nbgetchar = sun4_romvec->mayget;
143 sun4romvec.pv_nbputchar = sun4_romvec->mayput;
144 sun4romvec.pv_stdin = sun4_romvec->insource;
145 sun4romvec.pv_stdout = sun4_romvec->outsink;
146
147 /*
148 * We turn on the LEDs to let folks without monitors or
149 * terminals know we booted. Nothing too fancy now. They
150 * are all on, except for LED 5, which blinks. When we
151 * have more time, we can teach the penguin to say "By your
152 * command" or "Activating turbo boost, Michael". :-)
153 */
154 sun4_romvec->setLEDs(NULL);
155
156 printk("PROMLIB: Old Sun4 boot PROM monitor %s, romvec version %d\n",
157 sun4_romvec->monid,
158 sun4_romvec->romvecversion);
159
160 return &sun4romvec;
161}