diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2014-05-16 17:25:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-18 22:01:29 -0400 |
commit | 77e39a79f36ece60769787a33fe5ae0b8b4621ba (patch) | |
tree | 5f8e5b4d75d2613ddd1b9726129cf3ff729c1acc /arch/sparc | |
parent | 8e9f0935e00e73508fe1505e176b42f24f0b8a1b (diff) |
sparc32: drop tadpole specific code
tadpole.c assigned cpu_pwr_save based on the current configuration.
The rest of the tadpole.c file was only used if cpu_pwr_save was
dereferenced.
But this variable was never dereferenced - and I went back to a 2.6.12
kernel to check (from June 2005) - and not even then was it used.
Drop this code as it has not been in use for ~10 years.
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 | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/devices.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/kernel.h | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/tadpole.c | 130 |
4 files changed, 0 insertions, 135 deletions
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index d15cc1794b0e..7cf9c6ea3f1f 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
@@ -42,7 +42,6 @@ obj-y += time_$(BITS).o | |||
42 | obj-$(CONFIG_SPARC32) += windows.o | 42 | obj-$(CONFIG_SPARC32) += windows.o |
43 | obj-y += cpu.o | 43 | obj-y += cpu.o |
44 | obj-$(CONFIG_SPARC32) += devices.o | 44 | obj-$(CONFIG_SPARC32) += devices.o |
45 | obj-$(CONFIG_SPARC32) += tadpole.o | ||
46 | obj-y += ptrace_$(BITS).o | 45 | obj-y += ptrace_$(BITS).o |
47 | obj-y += unaligned_$(BITS).o | 46 | obj-y += unaligned_$(BITS).o |
48 | obj-y += una_asm_$(BITS).o | 47 | obj-y += una_asm_$(BITS).o |
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c index 6f39916dc6e8..8d5d09f09caf 100644 --- a/arch/sparc/kernel/devices.c +++ b/arch/sparc/kernel/devices.c | |||
@@ -134,5 +134,4 @@ void __init device_scan(void) | |||
134 | 134 | ||
135 | auxio_probe(); | 135 | auxio_probe(); |
136 | auxio_power_probe(); | 136 | auxio_power_probe(); |
137 | clock_stop_probe(); | ||
138 | } | 137 | } |
diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index 4a8d0db680f5..beaba3a3860c 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h | |||
@@ -133,9 +133,6 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); | |||
133 | /* windows.c */ | 133 | /* windows.c */ |
134 | void try_to_clear_window_buffer(struct pt_regs *regs, int who); | 134 | void try_to_clear_window_buffer(struct pt_regs *regs, int who); |
135 | 135 | ||
136 | /* tadpole.c */ | ||
137 | void __init clock_stop_probe(void); | ||
138 | |||
139 | /* auxio_32.c */ | 136 | /* auxio_32.c */ |
140 | void __init auxio_probe(void); | 137 | void __init auxio_probe(void); |
141 | void __init auxio_power_probe(void); | 138 | void __init auxio_power_probe(void); |
diff --git a/arch/sparc/kernel/tadpole.c b/arch/sparc/kernel/tadpole.c deleted file mode 100644 index 4bbfe4e2676d..000000000000 --- a/arch/sparc/kernel/tadpole.c +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | /* tadpole.c: Probing for the tadpole clock stopping h/w at boot time. | ||
2 | * | ||
3 | * Copyright (C) 1996 David Redman (djhr@tadpole.co.uk) | ||
4 | */ | ||
5 | |||
6 | #include <linux/string.h> | ||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/sched.h> | ||
9 | #include <linux/init.h> | ||
10 | |||
11 | #include <asm/asi.h> | ||
12 | #include <asm/oplib.h> | ||
13 | #include <asm/io.h> | ||
14 | |||
15 | #include "kernel.h" | ||
16 | |||
17 | #define MACIO_SCSI_CSR_ADDR 0x78400000 | ||
18 | #define MACIO_EN_DMA 0x00000200 | ||
19 | #define CLOCK_INIT_DONE 1 | ||
20 | |||
21 | static int clk_state; | ||
22 | static volatile unsigned char *clk_ctrl; | ||
23 | |||
24 | /* TODO - cpu_pwr_save is only assigned - cleanup potential. */ | ||
25 | static void (*cpu_pwr_save)(void); | ||
26 | |||
27 | static inline unsigned int ldphys(unsigned int addr) | ||
28 | { | ||
29 | unsigned long data; | ||
30 | |||
31 | __asm__ __volatile__("\n\tlda [%1] %2, %0\n\t" : | ||
32 | "=r" (data) : | ||
33 | "r" (addr), "i" (ASI_M_BYPASS)); | ||
34 | return data; | ||
35 | } | ||
36 | |||
37 | static void clk_init(void) | ||
38 | { | ||
39 | __asm__ __volatile__("mov 0x6c, %%g1\n\t" | ||
40 | "mov 0x4c, %%g2\n\t" | ||
41 | "mov 0xdf, %%g3\n\t" | ||
42 | "stb %%g1, [%0+3]\n\t" | ||
43 | "stb %%g2, [%0+3]\n\t" | ||
44 | "stb %%g3, [%0+3]\n\t" : : | ||
45 | "r" (clk_ctrl) : | ||
46 | "g1", "g2", "g3"); | ||
47 | } | ||
48 | |||
49 | static void clk_slow(void) | ||
50 | { | ||
51 | __asm__ __volatile__("mov 0xcc, %%g2\n\t" | ||
52 | "mov 0x4c, %%g3\n\t" | ||
53 | "mov 0xcf, %%g4\n\t" | ||
54 | "mov 0xdf, %%g5\n\t" | ||
55 | "stb %%g2, [%0+3]\n\t" | ||
56 | "stb %%g3, [%0+3]\n\t" | ||
57 | "stb %%g4, [%0+3]\n\t" | ||
58 | "stb %%g5, [%0+3]\n\t" : : | ||
59 | "r" (clk_ctrl) : | ||
60 | "g2", "g3", "g4", "g5"); | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * Tadpole is guaranteed to be UP, using local_irq_save. | ||
65 | */ | ||
66 | static void tsu_clockstop(void) | ||
67 | { | ||
68 | unsigned int mcsr; | ||
69 | unsigned long flags; | ||
70 | |||
71 | if (!clk_ctrl) | ||
72 | return; | ||
73 | if (!(clk_state & CLOCK_INIT_DONE)) { | ||
74 | local_irq_save(flags); | ||
75 | clk_init(); | ||
76 | clk_state |= CLOCK_INIT_DONE; /* all done */ | ||
77 | local_irq_restore(flags); | ||
78 | return; | ||
79 | } | ||
80 | if (!(clk_ctrl[2] & 1)) | ||
81 | return; /* no speed up yet */ | ||
82 | |||
83 | local_irq_save(flags); | ||
84 | |||
85 | /* if SCSI DMA in progress, don't slow clock */ | ||
86 | mcsr = ldphys(MACIO_SCSI_CSR_ADDR); | ||
87 | if ((mcsr&MACIO_EN_DMA) != 0) { | ||
88 | local_irq_restore(flags); | ||
89 | return; | ||
90 | } | ||
91 | /* TODO... the minimum clock setting ought to increase the | ||
92 | * memory refresh interval.. | ||
93 | */ | ||
94 | clk_slow(); | ||
95 | local_irq_restore(flags); | ||
96 | } | ||
97 | |||
98 | static void swift_clockstop(void) | ||
99 | { | ||
100 | if (!clk_ctrl) | ||
101 | return; | ||
102 | clk_ctrl[0] = 0; | ||
103 | } | ||
104 | |||
105 | void __init clock_stop_probe(void) | ||
106 | { | ||
107 | phandle node, clk_nd; | ||
108 | char name[20]; | ||
109 | |||
110 | prom_getstring(prom_root_node, "name", name, sizeof(name)); | ||
111 | if (strncmp(name, "Tadpole", 7)) | ||
112 | return; | ||
113 | node = prom_getchild(prom_root_node); | ||
114 | node = prom_searchsiblings(node, "obio"); | ||
115 | node = prom_getchild(node); | ||
116 | clk_nd = prom_searchsiblings(node, "clk-ctrl"); | ||
117 | if (!clk_nd) | ||
118 | return; | ||
119 | printk("Clock Stopping h/w detected... "); | ||
120 | clk_ctrl = (char *) prom_getint(clk_nd, "address"); | ||
121 | clk_state = 0; | ||
122 | if (name[10] == '\0') { | ||
123 | cpu_pwr_save = tsu_clockstop; | ||
124 | printk("enabled (S3)\n"); | ||
125 | } else if ((name[10] == 'X') || (name[10] == 'G')) { | ||
126 | cpu_pwr_save = swift_clockstop; | ||
127 | printk("enabled (%s)\n",name+7); | ||
128 | } else | ||
129 | printk("disabled %s\n",name+7); | ||
130 | } | ||