aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
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/kernel
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/kernel')
-rw-r--r--arch/sparc/kernel/Makefile1
-rw-r--r--arch/sparc/kernel/devices.c2
-rw-r--r--arch/sparc/kernel/entry.S54
-rw-r--r--arch/sparc/kernel/head.S28
-rw-r--r--arch/sparc/kernel/idprom.c7
-rw-r--r--arch/sparc/kernel/process.c2
-rw-r--r--arch/sparc/kernel/prom.c1
-rw-r--r--arch/sparc/kernel/setup.c8
-rw-r--r--arch/sparc/kernel/sun4c_irq.c58
-rw-r--r--arch/sparc/kernel/sun4setup.c75
-rw-r--r--arch/sparc/kernel/sys_sparc.c8
-rw-r--r--arch/sparc/kernel/time.c162
12 files changed, 27 insertions, 379 deletions
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index a430231647e6..2d6582095099 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -18,7 +18,6 @@ obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
18devres-y = ../../../kernel/irq/devres.o 18devres-y = ../../../kernel/irq/devres.o
19 19
20obj-$(CONFIG_PCI) += pcic.o 20obj-$(CONFIG_PCI) += pcic.o
21obj-$(CONFIG_SUN4) += sun4setup.o
22obj-$(CONFIG_SMP) += trampoline.o smp.o sun4m_smp.o sun4d_smp.o 21obj-$(CONFIG_SMP) += trampoline.o smp.o sun4m_smp.o sun4d_smp.o
23obj-$(CONFIG_SUN_AUXIO) += auxio.o 22obj-$(CONFIG_SUN_AUXIO) += auxio.o
24obj-$(CONFIG_SUN_PM) += apc.o pmc.o 23obj-$(CONFIG_SUN_PM) += apc.o pmc.o
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index b240b8863fd0..ad656b044b8c 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -143,7 +143,7 @@ void __init device_scan(void)
143#endif 143#endif
144 clock_stop_probe(); 144 clock_stop_probe();
145 145
146 if (ARCH_SUN4C_SUN4) 146 if (ARCH_SUN4C)
147 sun4c_probe_memerr_reg(); 147 sun4c_probe_memerr_reg();
148 148
149 return; 149 return;
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index e8cdf715a546..68689facaaae 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -20,11 +20,7 @@
20#include <asm/memreg.h> 20#include <asm/memreg.h>
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/pgtable.h> 22#include <asm/pgtable.h>
23#ifdef CONFIG_SUN4
24#include <asm/pgtsun4.h>
25#else
26#include <asm/pgtsun4c.h> 23#include <asm/pgtsun4c.h>
27#endif
28#include <asm/winmacro.h> 24#include <asm/winmacro.h>
29#include <asm/signal.h> 25#include <asm/signal.h>
30#include <asm/obio.h> 26#include <asm/obio.h>
@@ -775,11 +771,7 @@ vac_linesize_patch_32: subcc %l7, 32, %l7
775 * Ugly, but we cant use hardware flushing on the sun4 and we'd require 771 * Ugly, but we cant use hardware flushing on the sun4 and we'd require
776 * two instructions (Anton) 772 * two instructions (Anton)
777 */ 773 */
778#ifdef CONFIG_SUN4
779vac_hwflush_patch1_on: nop
780#else
781vac_hwflush_patch1_on: addcc %l7, -PAGE_SIZE, %l7 774vac_hwflush_patch1_on: addcc %l7, -PAGE_SIZE, %l7
782#endif
783 775
784vac_hwflush_patch2_on: sta %g0, [%l3 + %l7] ASI_HWFLUSHSEG 776vac_hwflush_patch2_on: sta %g0, [%l3 + %l7] ASI_HWFLUSHSEG
785 777
@@ -798,42 +790,10 @@ vac_hwflush_patch2_on: sta %g0, [%l3 + %l7] ASI_HWFLUSHSEG
798! %l7 = 1 for textfault 790! %l7 = 1 for textfault
799! We want error in %l5, vaddr in %l6 791! We want error in %l5, vaddr in %l6
800sun4c_fault: 792sun4c_fault:
801#ifdef CONFIG_SUN4
802 sethi %hi(sun4c_memerr_reg), %l4
803 ld [%l4+%lo(sun4c_memerr_reg)], %l4 ! memerr ctrl reg addr
804 ld [%l4], %l6 ! memerr ctrl reg
805 ld [%l4 + 4], %l5 ! memerr vaddr reg
806 andcc %l6, 0x80, %g0 ! check for error type
807 st %g0, [%l4 + 4] ! clear the error
808 be 0f ! normal error
809 sethi %hi(AC_BUS_ERROR), %l4 ! bus err reg addr
810
811 call prom_halt ! something weird happened
812 ! what exactly did happen?
813 ! what should we do here?
814
8150: or %l4, %lo(AC_BUS_ERROR), %l4 ! bus err reg addr
816 lduba [%l4] ASI_CONTROL, %l6 ! bus err reg
817
818 cmp %l7, 1 ! text fault?
819 be 1f ! yes
820 nop
821
822 ld [%l1], %l4 ! load instruction that caused fault
823 srl %l4, 21, %l4
824 andcc %l4, 1, %g0 ! store instruction?
825
826 be 1f ! no
827 sethi %hi(SUN4C_SYNC_BADWRITE), %l4 ! yep
828 ! %lo(SUN4C_SYNC_BADWRITE) = 0
829 or %l4, %l6, %l6 ! set write bit to emulate sun4c
8301:
831#else
832 sethi %hi(AC_SYNC_ERR), %l4 793 sethi %hi(AC_SYNC_ERR), %l4
833 add %l4, 0x4, %l6 ! AC_SYNC_VA in %l6 794 add %l4, 0x4, %l6 ! AC_SYNC_VA in %l6
834 lda [%l6] ASI_CONTROL, %l5 ! Address 795 lda [%l6] ASI_CONTROL, %l5 ! Address
835 lda [%l4] ASI_CONTROL, %l6 ! Error, retained for a bit 796 lda [%l4] ASI_CONTROL, %l6 ! Error, retained for a bit
836#endif
837 797
838 andn %l5, 0xfff, %l5 ! Encode all info into l7 798 andn %l5, 0xfff, %l5 ! Encode all info into l7
839 srl %l6, 14, %l4 799 srl %l6, 14, %l4
@@ -880,12 +840,7 @@ sun4c_fault:
880 or %l4, %lo(swapper_pg_dir), %l4 840 or %l4, %lo(swapper_pg_dir), %l4
881 sll %l6, 2, %l6 841 sll %l6, 2, %l6
882 ld [%l4 + %l6], %l4 842 ld [%l4 + %l6], %l4
883#ifdef CONFIG_SUN4
884 sethi %hi(PAGE_MASK), %l6
885 andcc %l4, %l6, %g0
886#else
887 andcc %l4, PAGE_MASK, %g0 843 andcc %l4, PAGE_MASK, %g0
888#endif
889 be sun4c_fault_fromuser 844 be sun4c_fault_fromuser
890 lduXa [%l5] ASI_SEGMAP, %l4 845 lduXa [%l5] ASI_SEGMAP, %l4
891 846
@@ -937,11 +892,7 @@ invalid_segment_patch1:
937 ld [%l6 + 0x08], %l3 ! tmp = entry->vaddr 892 ld [%l6 + 0x08], %l3 ! tmp = entry->vaddr
938 893
939 ! Flush segment from the cache. 894 ! Flush segment from the cache.
940#ifdef CONFIG_SUN4
941 sethi %hi((128 * 1024)), %l7
942#else
943 sethi %hi((64 * 1024)), %l7 895 sethi %hi((64 * 1024)), %l7
944#endif
9459: 8969:
946vac_hwflush_patch1: 897vac_hwflush_patch1:
947vac_linesize_patch: 898vac_linesize_patch:
@@ -1029,12 +980,7 @@ invalid_segment_patch2:
1029 or %l4, %lo(swapper_pg_dir), %l4 980 or %l4, %lo(swapper_pg_dir), %l4
1030 sll %l3, 2, %l3 981 sll %l3, 2, %l3
1031 ld [%l4 + %l3], %l4 982 ld [%l4 + %l3], %l4
1032#ifndef CONFIG_SUN4
1033 and %l4, PAGE_MASK, %l4 983 and %l4, PAGE_MASK, %l4
1034#else
1035 sethi %hi(PAGE_MASK), %l6
1036 and %l4, %l6, %l4
1037#endif
1038 984
1039 srl %l5, (PAGE_SHIFT - 2), %l6 985 srl %l5, (PAGE_SHIFT - 2), %l6
1040 and %l6, ((SUN4C_PTRS_PER_PTE - 1) << 2), %l6 986 and %l6, ((SUN4C_PTRS_PER_PTE - 1) << 2), %l6
diff --git a/arch/sparc/kernel/head.S b/arch/sparc/kernel/head.S
index 50d9a16af795..2d325fd84579 100644
--- a/arch/sparc/kernel/head.S
+++ b/arch/sparc/kernel/head.S
@@ -63,15 +63,9 @@ cputypvar_sun4m:
63 63
64 .align 4 64 .align 4
65 65
66#ifndef CONFIG_SUN4
67sun4_notsup: 66sun4_notsup:
68 .asciz "Sparc-Linux sun4 needs a specially compiled kernel, turn CONFIG_SUN4 on.\n\n" 67 .asciz "Sparc-Linux sun4 support does no longer exist.\n\n"
69 .align 4 68 .align 4
70#else
71sun4cdm_notsup:
72 .asciz "Kernel compiled with CONFIG_SUN4 cannot run on SUN4C/SUN4M/SUN4D\nTurn CONFIG_SUN4 off.\n\n"
73 .align 4
74#endif
75 69
76sun4e_notsup: 70sun4e_notsup:
77 .asciz "Sparc-Linux sun4e support does not exist\n\n" 71 .asciz "Sparc-Linux sun4e support does not exist\n\n"
@@ -780,15 +774,6 @@ execute_in_high_mem:
780 nop 774 nop
781 775
782found_version: 776found_version:
783#ifdef CONFIG_SUN4
784/* For people who try sun4 kernels, even if Configure.help advises them. */
785 ld [%g7 + 0x68], %o1
786 set sun4cdm_notsup, %o0
787 call %o1
788 nop
789 b halt_me
790 nop
791#endif
792/* Get the machine type via the mysterious romvec node operations. */ 777/* Get the machine type via the mysterious romvec node operations. */
793 778
794 add %g7, 0x1c, %l1 779 add %g7, 0x1c, %l1
@@ -1150,15 +1135,6 @@ sun4c_continue_boot:
1150 nop 1135 nop
1151 1136
1152sun4_init: 1137sun4_init:
1153#ifdef CONFIG_SUN4
1154/* There, happy now Adrian? */
1155 set cputypval, %o2 ! Let everyone know we
1156 set ' ', %o0 ! are a "sun4 " architecture
1157 stb %o0, [%o2 + 0x4]
1158
1159 b got_prop
1160 nop
1161#else
1162 sethi %hi(SUN4_PROM_VECTOR+0x84), %o1 1138 sethi %hi(SUN4_PROM_VECTOR+0x84), %o1
1163 ld [%o1 + %lo(SUN4_PROM_VECTOR+0x84)], %o1 1139 ld [%o1 + %lo(SUN4_PROM_VECTOR+0x84)], %o1
1164 set sun4_notsup, %o0 1140 set sun4_notsup, %o0
@@ -1170,7 +1146,7 @@ sun4_init:
1170 nop 1146 nop
11711: ba 1b ! Cannot exit into KMON 11471: ba 1b ! Cannot exit into KMON
1172 nop 1148 nop
1173#endif 1149
1174no_sun4e_here: 1150no_sun4e_here:
1175 ld [%g7 + 0x68], %o1 1151 ld [%g7 + 0x68], %o1
1176 set sun4e_notsup, %o0 1152 set sun4e_notsup, %o0
diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c
index fc511f3c4c18..223a6582e1e2 100644
--- a/arch/sparc/kernel/idprom.c
+++ b/arch/sparc/kernel/idprom.c
@@ -12,10 +12,6 @@
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. */ 14#include <asm/machines.h> /* Fun with Sun released architectures. */
15#ifdef CONFIG_SUN4
16#include <asm/sun4paddr.h>
17extern void sun4setup(void);
18#endif
19 15
20struct idprom *idprom; 16struct idprom *idprom;
21static struct idprom idprom_buffer; 17static struct idprom idprom_buffer;
@@ -101,7 +97,4 @@ void __init idprom_init(void)
101 idprom->id_ethaddr[0], idprom->id_ethaddr[1], 97 idprom->id_ethaddr[0], idprom->id_ethaddr[1],
102 idprom->id_ethaddr[2], idprom->id_ethaddr[3], 98 idprom->id_ethaddr[2], idprom->id_ethaddr[3],
103 idprom->id_ethaddr[4], idprom->id_ethaddr[5]); 99 idprom->id_ethaddr[4], idprom->id_ethaddr[5]);
104#ifdef CONFIG_SUN4
105 sun4setup();
106#endif
107} 100}
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 4bb430940a61..e8c43ffe317e 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -75,7 +75,7 @@ void cpu_idle(void)
75{ 75{
76 /* endless idle loop with no priority at all */ 76 /* endless idle loop with no priority at all */
77 for (;;) { 77 for (;;) {
78 if (ARCH_SUN4C_SUN4) { 78 if (ARCH_SUN4C) {
79 static int count = HZ; 79 static int count = HZ;
80 static unsigned long last_jiffies; 80 static unsigned long last_jiffies;
81 static unsigned long last_faults; 81 static unsigned long last_faults;
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 43e862406822..eee5efcfe50e 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -442,7 +442,6 @@ static void __init of_console_init(void)
442 442
443 switch (prom_vers) { 443 switch (prom_vers) {
444 case PROM_V0: 444 case PROM_V0:
445 case PROM_SUN4:
446 skip = 0; 445 skip = 0;
447 switch (*romvec->pv_stdout) { 446 switch (*romvec->pv_stdout) {
448 case PROMDEV_SCREEN: 447 case PROMDEV_SCREEN:
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 9e451b21202e..8d5fbce1635b 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -224,12 +224,6 @@ void __init setup_arch(char **cmdline_p)
224 if(!strcmp(&cputypval,"sun4e")) { sparc_cpu_model=sun4e; } 224 if(!strcmp(&cputypval,"sun4e")) { sparc_cpu_model=sun4e; }
225 if(!strcmp(&cputypval,"sun4u")) { sparc_cpu_model=sun4u; } 225 if(!strcmp(&cputypval,"sun4u")) { sparc_cpu_model=sun4u; }
226 226
227#ifdef CONFIG_SUN4
228 if (sparc_cpu_model != sun4) {
229 prom_printf("This kernel is for Sun4 architecture only.\n");
230 prom_halt();
231 }
232#endif
233 printk("ARCH: "); 227 printk("ARCH: ");
234 switch(sparc_cpu_model) { 228 switch(sparc_cpu_model) {
235 case sun4: 229 case sun4:
@@ -263,7 +257,7 @@ void __init setup_arch(char **cmdline_p)
263 boot_flags_init(*cmdline_p); 257 boot_flags_init(*cmdline_p);
264 258
265 idprom_init(); 259 idprom_init();
266 if (ARCH_SUN4C_SUN4) 260 if (ARCH_SUN4C)
267 sun4c_probe_vac(); 261 sun4c_probe_vac();
268 load_mmu(); 262 load_mmu();
269 263
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c
index a74582455cce..722d2516f284 100644
--- a/arch/sparc/kernel/sun4c_irq.c
+++ b/arch/sparc/kernel/sun4c_irq.c
@@ -33,7 +33,6 @@
33#include <asm/traps.h> 33#include <asm/traps.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/sun4paddr.h>
37#include <asm/idprom.h> 36#include <asm/idprom.h>
38#include <asm/machines.h> 37#include <asm/machines.h>
39 38
@@ -130,22 +129,10 @@ static void sun4c_enable_irq(unsigned int irq_nr)
130 129
131volatile struct sun4c_timer_info *sun4c_timers; 130volatile struct sun4c_timer_info *sun4c_timers;
132 131
133#ifdef CONFIG_SUN4
134/* This is an ugly hack to work around the
135 current timer code, and make it work with
136 the sun4/260 intersil
137 */
138volatile struct sun4c_timer_info sun4_timer;
139#endif
140
141static void sun4c_clear_clock_irq(void) 132static void sun4c_clear_clock_irq(void)
142{ 133{
143 volatile unsigned int clear_intr; 134 volatile unsigned int clear_intr;
144#ifdef CONFIG_SUN4 135
145 if (idprom->id_machtype == (SM_SUN4 | SM_4_260))
146 clear_intr = sun4_timer.timer_limit10;
147 else
148#endif
149 clear_intr = sun4c_timers->timer_limit10; 136 clear_intr = sun4c_timers->timer_limit10;
150} 137}
151 138
@@ -166,11 +153,6 @@ static void __init sun4c_init_timers(irq_handler_t counter_fn)
166 /* Map the Timer chip, this is implemented in hardware inside 153 /* Map the Timer chip, this is implemented in hardware inside
167 * the cache chip on the sun4c. 154 * the cache chip on the sun4c.
168 */ 155 */
169#ifdef CONFIG_SUN4
170 if (idprom->id_machtype == (SM_SUN4 | SM_4_260))
171 sun4c_timers = &sun4_timer;
172 else
173#endif
174 sun4c_timers = ioremap(SUN_TIMER_PHYSADDR, 156 sun4c_timers = ioremap(SUN_TIMER_PHYSADDR,
175 sizeof(struct sun4c_timer_info)); 157 sizeof(struct sun4c_timer_info));
176 158
@@ -206,28 +188,22 @@ void __init sun4c_init_IRQ(void)
206{ 188{
207 struct linux_prom_registers int_regs[2]; 189 struct linux_prom_registers int_regs[2];
208 int ie_node; 190 int ie_node;
209 191 struct resource phyres;
210 if (ARCH_SUN4) { 192
211 interrupt_enable = (char *) 193 ie_node = prom_searchsiblings (prom_getchild(prom_root_node),
212 ioremap(sun4_ie_physaddr, PAGE_SIZE); 194 "interrupt-enable");
213 } else { 195 if(ie_node == 0)
214 struct resource phyres; 196 panic("Cannot find /interrupt-enable node");
215 197
216 ie_node = prom_searchsiblings (prom_getchild(prom_root_node), 198 /* Depending on the "address" property is bad news... */
217 "interrupt-enable"); 199 interrupt_enable = NULL;
218 if(ie_node == 0) 200 if (prom_getproperty(ie_node, "reg", (char *) int_regs,
219 panic("Cannot find /interrupt-enable node"); 201 sizeof(int_regs)) != -1) {
220 202 memset(&phyres, 0, sizeof(struct resource));
221 /* Depending on the "address" property is bad news... */ 203 phyres.flags = int_regs[0].which_io;
222 interrupt_enable = NULL; 204 phyres.start = int_regs[0].phys_addr;
223 if (prom_getproperty(ie_node, "reg", (char *) int_regs, 205 interrupt_enable = (char *) of_ioremap(&phyres, 0,
224 sizeof(int_regs)) != -1) { 206 int_regs[0].reg_size, "sun4c_intr");
225 memset(&phyres, 0, sizeof(struct resource));
226 phyres.flags = int_regs[0].which_io;
227 phyres.start = int_regs[0].phys_addr;
228 interrupt_enable = (char *) of_ioremap(&phyres, 0,
229 int_regs[0].reg_size, "sun4c_intr");
230 }
231 } 207 }
232 if (!interrupt_enable) 208 if (!interrupt_enable)
233 panic("Cannot map interrupt_enable"); 209 panic("Cannot map interrupt_enable");
diff --git a/arch/sparc/kernel/sun4setup.c b/arch/sparc/kernel/sun4setup.c
deleted file mode 100644
index 229a52f55f16..000000000000
--- a/arch/sparc/kernel/sun4setup.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/* sun4setup.c: Setup the hardware address of various items in the sun4
2 * architecture. Called from idprom_init
3 *
4 * Copyright (C) 1998 Chris G. Davis (cdavis@cois.on.ca)
5 */
6
7#include <asm/page.h>
8#include <asm/oplib.h>
9#include <asm/idprom.h>
10#include <asm/sun4paddr.h>
11#include <asm/machines.h>
12
13int sun4_memreg_physaddr;
14int sun4_ie_physaddr;
15int sun4_clock_physaddr;
16int sun4_timer_physaddr;
17int sun4_eth_physaddr;
18int sun4_si_physaddr;
19int sun4_bwtwo_physaddr;
20int sun4_zs0_physaddr;
21int sun4_zs1_physaddr;
22int sun4_dma_physaddr;
23int sun4_esp_physaddr;
24int sun4_ie_physaddr;
25
26void __init sun4setup(void)
27{
28 printk("Sun4 Hardware Setup v1.0 18/May/98 Chris Davis (cdavis@cois.on.ca). ");
29 /*
30 setup standard sun4 info
31 */
32 sun4_ie_physaddr=SUN4_IE_PHYSADDR;
33
34 /*
35 setup model specific info
36 */
37 switch(idprom->id_machtype) {
38 case (SM_SUN4 | SM_4_260 ):
39 printk("Setup for a SUN4/260\n");
40 sun4_memreg_physaddr=SUN4_200_MEMREG_PHYSADDR;
41 sun4_clock_physaddr=SUN4_200_CLOCK_PHYSADDR;
42 sun4_timer_physaddr=SUN4_UNUSED_PHYSADDR;
43 sun4_eth_physaddr=SUN4_200_ETH_PHYSADDR;
44 sun4_si_physaddr=SUN4_200_SI_PHYSADDR;
45 sun4_bwtwo_physaddr=SUN4_200_BWTWO_PHYSADDR;
46 sun4_dma_physaddr=SUN4_UNUSED_PHYSADDR;
47 sun4_esp_physaddr=SUN4_UNUSED_PHYSADDR;
48 break;
49 case (SM_SUN4 | SM_4_330 ):
50 printk("Setup for a SUN4/330\n");
51 sun4_memreg_physaddr=SUN4_300_MEMREG_PHYSADDR;
52 sun4_clock_physaddr=SUN4_300_CLOCK_PHYSADDR;
53 sun4_timer_physaddr=SUN4_300_TIMER_PHYSADDR;
54 sun4_eth_physaddr=SUN4_300_ETH_PHYSADDR;
55 sun4_si_physaddr=SUN4_UNUSED_PHYSADDR;
56 sun4_bwtwo_physaddr=SUN4_300_BWTWO_PHYSADDR;
57 sun4_dma_physaddr=SUN4_300_DMA_PHYSADDR;
58 sun4_esp_physaddr=SUN4_300_ESP_PHYSADDR;
59 break;
60 case (SM_SUN4 | SM_4_470 ):
61 printk("Setup for a SUN4/470\n");
62 sun4_memreg_physaddr=SUN4_400_MEMREG_PHYSADDR;
63 sun4_clock_physaddr=SUN4_400_CLOCK_PHYSADDR;
64 sun4_timer_physaddr=SUN4_400_TIMER_PHYSADDR;
65 sun4_eth_physaddr=SUN4_400_ETH_PHYSADDR;
66 sun4_si_physaddr=SUN4_UNUSED_PHYSADDR;
67 sun4_bwtwo_physaddr=SUN4_400_BWTWO_PHYSADDR;
68 sun4_dma_physaddr=SUN4_400_DMA_PHYSADDR;
69 sun4_esp_physaddr=SUN4_400_ESP_PHYSADDR;
70 break;
71 default:
72 ;
73 }
74}
75
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 4d73421559c3..03035c852a43 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -53,7 +53,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
53 /* See asm-sparc/uaccess.h */ 53 /* See asm-sparc/uaccess.h */
54 if (len > TASK_SIZE - PAGE_SIZE) 54 if (len > TASK_SIZE - PAGE_SIZE)
55 return -ENOMEM; 55 return -ENOMEM;
56 if (ARCH_SUN4C_SUN4 && len > 0x20000000) 56 if (ARCH_SUN4C && len > 0x20000000)
57 return -ENOMEM; 57 return -ENOMEM;
58 if (!addr) 58 if (!addr)
59 addr = TASK_UNMAPPED_BASE; 59 addr = TASK_UNMAPPED_BASE;
@@ -65,7 +65,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
65 65
66 for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { 66 for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
67 /* At this point: (!vmm || addr < vmm->vm_end). */ 67 /* At this point: (!vmm || addr < vmm->vm_end). */
68 if (ARCH_SUN4C_SUN4 && addr < 0xe0000000 && 0x20000000 - len < addr) { 68 if (ARCH_SUN4C && addr < 0xe0000000 && 0x20000000 - len < addr) {
69 addr = PAGE_OFFSET; 69 addr = PAGE_OFFSET;
70 vmm = find_vma(current->mm, PAGE_OFFSET); 70 vmm = find_vma(current->mm, PAGE_OFFSET);
71 } 71 }
@@ -81,7 +81,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
81 81
82asmlinkage unsigned long sparc_brk(unsigned long brk) 82asmlinkage unsigned long sparc_brk(unsigned long brk)
83{ 83{
84 if(ARCH_SUN4C_SUN4) { 84 if(ARCH_SUN4C) {
85 if ((brk & 0xe0000000) != (current->mm->brk & 0xe0000000)) 85 if ((brk & 0xe0000000) != (current->mm->brk & 0xe0000000))
86 return current->mm->brk; 86 return current->mm->brk;
87 } 87 }
@@ -221,7 +221,7 @@ out:
221 221
222int sparc_mmap_check(unsigned long addr, unsigned long len) 222int sparc_mmap_check(unsigned long addr, unsigned long len)
223{ 223{
224 if (ARCH_SUN4C_SUN4 && 224 if (ARCH_SUN4C &&
225 (len > 0x20000000 || 225 (len > 0x20000000 ||
226 (addr < 0xe0000000 && addr + len > 0x20000000))) 226 (addr < 0xe0000000 && addr + len > 0x20000000)))
227 return -EINVAL; 227 return -EINVAL;
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 339c4762fbcf..f0a2874b04e9 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -39,7 +39,6 @@
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/idprom.h> 40#include <asm/idprom.h>
41#include <asm/machines.h> 41#include <asm/machines.h>
42#include <asm/sun4paddr.h>
43#include <asm/page.h> 42#include <asm/page.h>
44#include <asm/pcic.h> 43#include <asm/pcic.h>
45#include <asm/irq_regs.h> 44#include <asm/irq_regs.h>
@@ -54,27 +53,6 @@ static struct mostek48t08 __iomem *mstk48t08_regs = NULL;
54static int set_rtc_mmss(unsigned long); 53static int set_rtc_mmss(unsigned long);
55static int sbus_do_settimeofday(struct timespec *tv); 54static int sbus_do_settimeofday(struct timespec *tv);
56 55
57#ifdef CONFIG_SUN4
58struct intersil *intersil_clock;
59#define intersil_cmd(intersil_reg, intsil_cmd) intersil_reg->int_cmd_reg = \
60 (intsil_cmd)
61
62#define intersil_intr(intersil_reg, intsil_cmd) intersil_reg->int_intr_reg = \
63 (intsil_cmd)
64
65#define intersil_start(intersil_reg) intersil_cmd(intersil_reg, \
66 ( INTERSIL_START | INTERSIL_32K | INTERSIL_NORMAL | INTERSIL_24H |\
67 INTERSIL_INTR_ENABLE))
68
69#define intersil_stop(intersil_reg) intersil_cmd(intersil_reg, \
70 ( INTERSIL_STOP | INTERSIL_32K | INTERSIL_NORMAL | INTERSIL_24H |\
71 INTERSIL_INTR_ENABLE))
72
73#define intersil_read_intr(intersil_reg, towhere) towhere = \
74 intersil_reg->int_intr_reg
75
76#endif
77
78unsigned long profile_pc(struct pt_regs *regs) 56unsigned long profile_pc(struct pt_regs *regs)
79{ 57{
80 extern char __copy_user_begin[], __copy_user_end[]; 58 extern char __copy_user_begin[], __copy_user_end[];
@@ -117,15 +95,7 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id)
117 95
118 /* Protect counter clear so that do_gettimeoffset works */ 96 /* Protect counter clear so that do_gettimeoffset works */
119 write_seqlock(&xtime_lock); 97 write_seqlock(&xtime_lock);
120#ifdef CONFIG_SUN4 98
121 if((idprom->id_machtype == (SM_SUN4 | SM_4_260)) ||
122 (idprom->id_machtype == (SM_SUN4 | SM_4_110))) {
123 int temp;
124 intersil_read_intr(intersil_clock, temp);
125 /* re-enable the irq */
126 enable_pil_irq(10);
127 }
128#endif
129 clear_clock_irq(); 99 clear_clock_irq();
130 100
131 do_timer(1); 101 do_timer(1);
@@ -250,55 +220,6 @@ static void __devinit mostek_set_system_time(void)
250 spin_unlock_irq(&mostek_lock); 220 spin_unlock_irq(&mostek_lock);
251} 221}
252 222
253/* Probe for the real time clock chip on Sun4 */
254static inline void sun4_clock_probe(void)
255{
256#ifdef CONFIG_SUN4
257 int temp;
258 struct resource r;
259
260 memset(&r, 0, sizeof(r));
261 if( idprom->id_machtype == (SM_SUN4 | SM_4_330) ) {
262 sp_clock_typ = MSTK48T02;
263 r.start = sun4_clock_physaddr;
264 mstk48t02_regs = of_ioremap(&r, 0,
265 sizeof(struct mostek48t02), NULL);
266 mstk48t08_regs = NULL; /* To catch weirdness */
267 intersil_clock = NULL; /* just in case */
268
269 /* Kick start the clock if it is completely stopped. */
270 if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
271 kick_start_clock();
272 } else if( idprom->id_machtype == (SM_SUN4 | SM_4_260)) {
273 /* intersil setup code */
274 printk("Clock: INTERSIL at %8x ",sun4_clock_physaddr);
275 sp_clock_typ = INTERSIL;
276 r.start = sun4_clock_physaddr;
277 intersil_clock = (struct intersil *)
278 of_ioremap(&r, 0, sizeof(*intersil_clock), "intersil");
279 mstk48t02_regs = 0; /* just be sure */
280 mstk48t08_regs = NULL; /* ditto */
281 /* initialise the clock */
282
283 intersil_intr(intersil_clock,INTERSIL_INT_100HZ);
284
285 intersil_start(intersil_clock);
286
287 intersil_read_intr(intersil_clock, temp);
288 while (!(temp & 0x80))
289 intersil_read_intr(intersil_clock, temp);
290
291 intersil_read_intr(intersil_clock, temp);
292 while (!(temp & 0x80))
293 intersil_read_intr(intersil_clock, temp);
294
295 intersil_stop(intersil_clock);
296
297 }
298#endif
299}
300
301#ifndef CONFIG_SUN4
302static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) 223static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
303{ 224{
304 struct device_node *dp = op->node; 225 struct device_node *dp = op->node;
@@ -365,7 +286,6 @@ static int __init clock_init(void)
365 * need to see the clock registers. 286 * need to see the clock registers.
366 */ 287 */
367fs_initcall(clock_init); 288fs_initcall(clock_init);
368#endif /* !CONFIG_SUN4 */
369 289
370static void __init sbus_time_init(void) 290static void __init sbus_time_init(void)
371{ 291{
@@ -373,51 +293,8 @@ static void __init sbus_time_init(void)
373 BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM); 293 BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
374 btfixup(); 294 btfixup();
375 295
376 if (ARCH_SUN4)
377 sun4_clock_probe();
378
379 sparc_init_timers(timer_interrupt); 296 sparc_init_timers(timer_interrupt);
380 297
381#ifdef CONFIG_SUN4
382 if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
383 mostek_set_system_time();
384 } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
385 /* initialise the intersil on sun4 */
386 unsigned int year, mon, day, hour, min, sec;
387 int temp;
388 struct intersil *iregs;
389
390 iregs=intersil_clock;
391 if(!iregs) {
392 prom_printf("Something wrong, clock regs not mapped yet.\n");
393 prom_halt();
394 }
395
396 intersil_intr(intersil_clock,INTERSIL_INT_100HZ);
397 disable_pil_irq(10);
398 intersil_stop(iregs);
399 intersil_read_intr(intersil_clock, temp);
400
401 temp = iregs->clk.int_csec;
402
403 sec = iregs->clk.int_sec;
404 min = iregs->clk.int_min;
405 hour = iregs->clk.int_hour;
406 day = iregs->clk.int_day;
407 mon = iregs->clk.int_month;
408 year = MSTK_CVT_YEAR(iregs->clk.int_year);
409
410 enable_pil_irq(10);
411 intersil_start(iregs);
412
413 xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
414 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
415 set_normalized_timespec(&wall_to_monotonic,
416 -xtime.tv_sec, -xtime.tv_nsec);
417 printk("%u/%u/%u %u:%u:%u\n",day,mon,year,hour,min,sec);
418 }
419#endif
420
421 /* Now that OBP ticker has been silenced, it is safe to enable IRQ. */ 298 /* Now that OBP ticker has been silenced, it is safe to enable IRQ. */
422 local_irq_enable(); 299 local_irq_enable();
423} 300}
@@ -532,43 +409,6 @@ static int set_rtc_mmss(unsigned long nowtime)
532 int real_seconds, real_minutes, mostek_minutes; 409 int real_seconds, real_minutes, mostek_minutes;
533 struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs; 410 struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs;
534 unsigned long flags; 411 unsigned long flags;
535#ifdef CONFIG_SUN4
536 struct intersil *iregs = intersil_clock;
537 int temp;
538#endif
539
540 /* Not having a register set can lead to trouble. */
541 if (!regs) {
542#ifdef CONFIG_SUN4
543 if(!iregs)
544 return -1;
545 else {
546 temp = iregs->clk.int_csec;
547
548 mostek_minutes = iregs->clk.int_min;
549
550 real_seconds = nowtime % 60;
551 real_minutes = nowtime / 60;
552 if (((abs(real_minutes - mostek_minutes) + 15)/30) & 1)
553 real_minutes += 30; /* correct for half hour time zone */
554 real_minutes %= 60;
555
556 if (abs(real_minutes - mostek_minutes) < 30) {
557 intersil_stop(iregs);
558 iregs->clk.int_sec=real_seconds;
559 iregs->clk.int_min=real_minutes;
560 intersil_start(iregs);
561 } else {
562 printk(KERN_WARNING
563 "set_rtc_mmss: can't update from %d to %d\n",
564 mostek_minutes, real_minutes);
565 return -1;
566 }
567
568 return 0;
569 }
570#endif
571 }
572 412
573 spin_lock_irqsave(&mostek_lock, flags); 413 spin_lock_irqsave(&mostek_lock, flags);
574 /* Read the current RTC minutes. */ 414 /* Read the current RTC minutes. */