aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ppc/Kconfig148
-rw-r--r--arch/ppc/Makefile1
-rw-r--r--arch/ppc/amiga/Makefile8
-rw-r--r--arch/ppc/amiga/amiga_ksyms.c1
-rw-r--r--arch/ppc/amiga/amiints.c322
-rw-r--r--arch/ppc/amiga/amisound.c1
-rw-r--r--arch/ppc/amiga/bootinfo.c78
-rw-r--r--arch/ppc/amiga/chipram.c1
-rw-r--r--arch/ppc/amiga/cia.c176
-rw-r--r--arch/ppc/amiga/config.c953
-rw-r--r--arch/ppc/amiga/ints.c158
-rw-r--r--arch/ppc/amiga/pcmcia.c1
-rw-r--r--arch/ppc/amiga/time.c57
-rw-r--r--arch/ppc/configs/apus_defconfig920
-rw-r--r--arch/ppc/kernel/head.S117
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c3
-rw-r--r--arch/ppc/kernel/setup.c1
-rw-r--r--arch/ppc/mm/pgtable.c38
-rw-r--r--arch/ppc/platforms/Makefile4
-rw-r--r--arch/ppc/platforms/apus_pci.c207
-rw-r--r--arch/ppc/platforms/apus_pci.h34
-rw-r--r--arch/ppc/platforms/apus_setup.c798
-rw-r--r--include/asm-powerpc/ide.h2
-rw-r--r--include/asm-powerpc/reg.h4
-rw-r--r--include/asm-ppc/amigahw.h16
-rw-r--r--include/asm-ppc/amigaints.h133
-rw-r--r--include/asm-ppc/amigappc.h85
-rw-r--r--include/asm-ppc/bootinfo.h5
-rw-r--r--include/asm-ppc/io.h48
-rw-r--r--include/asm-ppc/machdep.h4
-rw-r--r--include/asm-ppc/page.h44
-rw-r--r--include/asm-ppc/pgtable.h8
32 files changed, 12 insertions, 4364 deletions
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 6bdeeb70b157..c1b34eb383cf 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -573,24 +573,9 @@ choice
573 573
574 Select PReP if configuring for a PReP machine. 574 Select PReP if configuring for a PReP machine.
575 575
576 Select Gemini if configuring for a Synergy Microsystems' Gemini
577 series Single Board Computer. More information is available at:
578 <http://www.synergymicro.com/PressRel/97_10_15.html>.
579
580 Select APUS if configuring for a PowerUP Amiga. More information is
581 available at: <http://linux-apus.sourceforge.net/>.
582
583config PPC_PREP 576config PPC_PREP
584 bool "PReP" 577 bool "PReP"
585 578
586config APUS
587 bool "Amiga-APUS"
588 depends on BROKEN
589 help
590 Select APUS if configuring for a PowerUP Amiga.
591 More information is available at:
592 <http://linux-apus.sourceforge.net/>.
593
594config KATANA 579config KATANA
595 bool "Artesyn-Katana" 580 bool "Artesyn-Katana"
596 help 581 help
@@ -1027,132 +1012,6 @@ config CMDLINE
1027 some command-line options at build time by entering them here. In 1012 some command-line options at build time by entering them here. In
1028 most cases you will need to specify the root device here. 1013 most cases you will need to specify the root device here.
1029 1014
1030config AMIGA
1031 bool
1032 depends on APUS
1033 default y
1034 help
1035 This option enables support for the Amiga series of computers.
1036
1037config ZORRO
1038 bool
1039 depends on APUS
1040 default y
1041 help
1042 This enables support for the Zorro bus in the Amiga. If you have
1043 expansion cards in your Amiga that conform to the Amiga
1044 AutoConfig(tm) specification, say Y, otherwise N. Note that even
1045 expansion cards that do not fit in the Zorro slots but fit in e.g.
1046 the CPU slot may fall in this category, so you have to say Y to let
1047 Linux use these.
1048
1049config ABSTRACT_CONSOLE
1050 bool
1051 depends on APUS
1052 default y
1053
1054config APUS_FAST_EXCEPT
1055 bool
1056 depends on APUS
1057 default y
1058
1059config AMIGA_PCMCIA
1060 bool "Amiga 1200/600 PCMCIA support"
1061 depends on APUS && EXPERIMENTAL
1062 help
1063 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
1064 600. If you intend to use pcmcia cards say Y; otherwise say N.
1065
1066config AMIGA_BUILTIN_SERIAL
1067 tristate "Amiga builtin serial support"
1068 depends on APUS
1069 help
1070 If you want to use your Amiga's built-in serial port in Linux,
1071 answer Y.
1072
1073 To compile this driver as a module, choose M here.
1074
1075config GVPIOEXT
1076 tristate "GVP IO-Extender support"
1077 depends on APUS
1078 help
1079 If you want to use a GVP IO-Extender serial card in Linux, say Y.
1080 Otherwise, say N.
1081
1082config GVPIOEXT_LP
1083 tristate "GVP IO-Extender parallel printer support"
1084 depends on GVPIOEXT
1085 help
1086 Say Y to enable driving a printer from the parallel port on your
1087 GVP IO-Extender card, N otherwise.
1088
1089config GVPIOEXT_PLIP
1090 tristate "GVP IO-Extender PLIP support"
1091 depends on GVPIOEXT
1092 help
1093 Say Y to enable doing IP over the parallel port on your GVP
1094 IO-Extender card, N otherwise.
1095
1096config MULTIFACE_III_TTY
1097 tristate "Multiface Card III serial support"
1098 depends on APUS
1099 help
1100 If you want to use a Multiface III card's serial port in Linux,
1101 answer Y.
1102
1103 To compile this driver as a module, choose M here.
1104
1105config A2232
1106 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
1107 depends on EXPERIMENTAL && APUS
1108 ---help---
1109 This option supports the 2232 7-port serial card shipped with the
1110 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
1111 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
1112 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
1113 ports were connected with 8 pin DIN connectors on the card bracket,
1114 for which 8 pin to DB25 adapters were supplied. The card also had
1115 jumpers internally to toggle various pinning configurations.
1116
1117 This driver can be built as a module; but then "generic_serial"
1118 will also be built as a module. This has to be loaded before
1119 "ser_a2232". If you want to do this, answer M here.
1120
1121config WHIPPET_SERIAL
1122 tristate "Hisoft Whippet PCMCIA serial support"
1123 depends on AMIGA_PCMCIA
1124 help
1125 HiSoft has a web page at <http://www.hisoft.co.uk/>, but there
1126 is no listing for the Whippet in their Amiga section.
1127
1128config APNE
1129 tristate "PCMCIA NE2000 support"
1130 depends on AMIGA_PCMCIA
1131 help
1132 If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
1133 say N.
1134
1135 To compile this driver as a module, choose M here: the
1136 module will be called apne.
1137
1138config SERIAL_CONSOLE
1139 bool "Support for serial port console"
1140 depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)
1141
1142config HEARTBEAT
1143 bool "Use power LED as a heartbeat"
1144 depends on APUS
1145 help
1146 Use the power-on LED on your machine as a load meter. The exact
1147 behavior is platform-dependent, but normally the flash frequency is
1148 a hyperbolic function of the 5-minute load average.
1149
1150config PROC_HARDWARE
1151 bool "/proc/hardware support"
1152 depends on APUS
1153
1154source "drivers/zorro/Kconfig"
1155
1156if !44x || BROKEN 1015if !44x || BROKEN
1157source kernel/power/Kconfig 1016source kernel/power/Kconfig
1158endif 1017endif
@@ -1227,8 +1086,7 @@ config MCA
1227 1086
1228config PCI 1087config PCI
1229 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx 1088 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx
1230 default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx 1089 default y if !40x && !CPM2 && !8xx && !83xx && !85xx
1231 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
1232 default PCI_QSPAN if !4xx && !CPM2 && 8xx 1090 default PCI_QSPAN if !4xx && !CPM2 && 8xx
1233 help 1091 help
1234 Find out whether your system includes a PCI bus. PCI is the name of 1092 Find out whether your system includes a PCI bus. PCI is the name of
@@ -1284,10 +1142,6 @@ config 8260_PCI9_IDMA4
1284 1142
1285endchoice 1143endchoice
1286 1144
1287config PCI_PERMEDIA
1288 bool "PCI for Permedia2"
1289 depends on !4xx && !8xx && APUS
1290
1291source "drivers/pci/Kconfig" 1145source "drivers/pci/Kconfig"
1292 1146
1293source "drivers/pcmcia/Kconfig" 1147source "drivers/pcmcia/Kconfig"
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 0db66dcf0723..eee6264e8a04 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -69,7 +69,6 @@ core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/ 70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
71core-$(CONFIG_XMON) += arch/ppc/xmon/ 71core-$(CONFIG_XMON) += arch/ppc/xmon/
72core-$(CONFIG_APUS) += arch/ppc/amiga/
73drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ 72drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
74drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ 73drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
75drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ 74drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
diff --git a/arch/ppc/amiga/Makefile b/arch/ppc/amiga/Makefile
deleted file mode 100644
index 59fec0a3ac8e..000000000000
--- a/arch/ppc/amiga/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for Linux arch/m68k/amiga source directory
3#
4
5obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \
6 chipram.o amiga_ksyms.o
7
8obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
diff --git a/arch/ppc/amiga/amiga_ksyms.c b/arch/ppc/amiga/amiga_ksyms.c
deleted file mode 100644
index ec74e5b7a1ce..000000000000
--- a/arch/ppc/amiga/amiga_ksyms.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amiga_ksyms.c"
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
deleted file mode 100644
index 265fcd3c6ab2..000000000000
--- a/arch/ppc/amiga/amiints.c
+++ /dev/null
@@ -1,322 +0,0 @@
1/*
2 * Amiga Linux interrupt handling code
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 *
8 * 11/07/96: rewritten interrupt handling, irq lists are exists now only for
9 * this sources where it makes sense (VERTB/PORTS/EXTER) and you must
10 * be careful that dev_id for this sources is unique since this the
11 * only possibility to distinguish between different handlers for
12 * free_irq. irq lists also have different irq flags:
13 * - IRQ_FLG_FAST: handler is inserted at top of list (after other
14 * fast handlers)
15 * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
16 * they're executed irq level is set to the previous
17 * one, but handlers don't need to be reentrant, if
18 * reentrance occurred, slow handlers will be just
19 * called again.
20 * The whole interrupt handling for CIAs is moved to cia.c
21 * /Roman Zippel
22 *
23 * 07/08/99: rewamp of the interrupt handling - we now have two types of
24 * interrupts, normal and fast handlers, fast handlers being
25 * marked with SA_INTERRUPT and runs with all other interrupts
26 * disabled. Normal interrupts disable their own source but
27 * run with all other interrupt sources enabled.
28 * PORTS and EXTER interrupts are always shared even if the
29 * drivers do not explicitly mark this when calling
30 * request_irq which they really should do.
31 * This is similar to the way interrupts are handled on all
32 * other architectures and makes a ton of sense besides
33 * having the advantage of making it easier to share
34 * drivers.
35 * /Jes
36 */
37
38#include <linux/types.h>
39#include <linux/kernel.h>
40#include <linux/sched.h>
41#include <linux/interrupt.h>
42#include <linux/irq.h>
43#include <linux/kernel_stat.h>
44#include <linux/init.h>
45
46#include <asm/system.h>
47#include <asm/irq.h>
48#include <asm/traps.h>
49#include <asm/amigahw.h>
50#include <asm/amigaints.h>
51#include <asm/amipcmcia.h>
52
53#ifdef CONFIG_APUS
54#include <asm/amigappc.h>
55#endif
56
57extern void cia_init_IRQ(struct ciabase *base);
58
59unsigned short ami_intena_vals[AMI_STD_IRQS] = {
60 IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT,
61 IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_SOFT, IF_PORTS, IF_EXTER
62};
63static const unsigned char ami_servers[AMI_STD_IRQS] = {
64 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
65};
66
67static short ami_ablecount[AMI_IRQS];
68
69static void ami_badint(int irq, void *dev_id, struct pt_regs *fp)
70{
71/* num_spurious += 1;*/
72}
73
74/*
75 * void amiga_init_IRQ(void)
76 *
77 * Parameters: None
78 *
79 * Returns: Nothing
80 *
81 * This function should be called during kernel startup to initialize
82 * the amiga IRQ handling routines.
83 */
84
85__init
86void amiga_init_IRQ(void)
87{
88 int i;
89
90 for (i = 0; i < AMI_IRQS; i++)
91 ami_ablecount[i] = 0;
92
93 /* turn off PCMCIA interrupts */
94 if (AMIGAHW_PRESENT(PCMCIA))
95 gayle.inten = GAYLE_IRQ_IDE;
96
97 /* turn off all interrupts... */
98 amiga_custom.intena = 0x7fff;
99 amiga_custom.intreq = 0x7fff;
100
101#ifdef CONFIG_APUS
102 /* Clear any inter-CPU interrupt requests. Circumvents bug in
103 Blizzard IPL emulation HW (or so it appears). */
104 APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);
105
106 /* Init IPL emulation. */
107 APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
108 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
109 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
110#endif
111 /* ... and enable the master interrupt bit */
112 amiga_custom.intena = IF_SETCLR | IF_INTEN;
113
114 cia_init_IRQ(&ciaa_base);
115 cia_init_IRQ(&ciab_base);
116}
117
118/*
119 * Enable/disable a particular machine specific interrupt source.
120 * Note that this may affect other interrupts in case of a shared interrupt.
121 * This function should only be called for a _very_ short time to change some
122 * internal data, that may not be changed by the interrupt at the same time.
123 * ami_(enable|disable)_irq calls may also be nested.
124 */
125
126void amiga_enable_irq(unsigned int irq)
127{
128 if (irq >= AMI_IRQS) {
129 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
130 return;
131 }
132
133 ami_ablecount[irq]--;
134 if (ami_ablecount[irq]<0)
135 ami_ablecount[irq]=0;
136 else if (ami_ablecount[irq])
137 return;
138
139 /* No action for auto-vector interrupts */
140 if (irq >= IRQ_AMIGA_AUTO){
141 printk("%s: Trying to enable auto-vector IRQ %i\n",
142 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
143 return;
144 }
145
146 if (irq >= IRQ_AMIGA_CIAA) {
147 cia_set_irq(irq, 0);
148 cia_able_irq(irq, 1);
149 return;
150 }
151
152 /* enable the interrupt */
153 amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq];
154}
155
156void amiga_disable_irq(unsigned int irq)
157{
158 if (irq >= AMI_IRQS) {
159 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
160 return;
161 }
162
163 if (ami_ablecount[irq]++)
164 return;
165
166 /* No action for auto-vector interrupts */
167 if (irq >= IRQ_AMIGA_AUTO) {
168 printk("%s: Trying to disable auto-vector IRQ %i\n",
169 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
170 return;
171 }
172
173 if (irq >= IRQ_AMIGA_CIAA) {
174 cia_able_irq(irq, 0);
175 return;
176 }
177
178 /* disable the interrupt */
179 amiga_custom.intena = ami_intena_vals[irq];
180}
181
182inline void amiga_do_irq(int irq, struct pt_regs *fp)
183{
184 irq_desc_t *desc = irq_desc + irq;
185 struct irqaction *action = desc->action;
186
187 kstat_cpu(0).irqs[irq]++;
188 action->handler(irq, action->dev_id, fp);
189}
190
191void amiga_do_irq_list(int irq, struct pt_regs *fp)
192{
193 irq_desc_t *desc = irq_desc + irq;
194 struct irqaction *action;
195
196 kstat_cpu(0).irqs[irq]++;
197
198 amiga_custom.intreq = ami_intena_vals[irq];
199
200 for (action = desc->action; action; action = action->next)
201 action->handler(irq, action->dev_id, fp);
202}
203
204/*
205 * The builtin Amiga hardware interrupt handlers.
206 */
207
208static void ami_int1(int irq, void *dev_id, struct pt_regs *fp)
209{
210 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
211
212 /* if serial transmit buffer empty, interrupt */
213 if (ints & IF_TBE) {
214 amiga_custom.intreq = IF_TBE;
215 amiga_do_irq(IRQ_AMIGA_TBE, fp);
216 }
217
218 /* if floppy disk transfer complete, interrupt */
219 if (ints & IF_DSKBLK) {
220 amiga_custom.intreq = IF_DSKBLK;
221 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp);
222 }
223
224 /* if software interrupt set, interrupt */
225 if (ints & IF_SOFT) {
226 amiga_custom.intreq = IF_SOFT;
227 amiga_do_irq(IRQ_AMIGA_SOFT, fp);
228 }
229}
230
231static void ami_int3(int irq, void *dev_id, struct pt_regs *fp)
232{
233 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
234
235 /* if a blitter interrupt */
236 if (ints & IF_BLIT) {
237 amiga_custom.intreq = IF_BLIT;
238 amiga_do_irq(IRQ_AMIGA_BLIT, fp);
239 }
240
241 /* if a copper interrupt */
242 if (ints & IF_COPER) {
243 amiga_custom.intreq = IF_COPER;
244 amiga_do_irq(IRQ_AMIGA_COPPER, fp);
245 }
246
247 /* if a vertical blank interrupt */
248 if (ints & IF_VERTB)
249 amiga_do_irq_list(IRQ_AMIGA_VERTB, fp);
250}
251
252static void ami_int4(int irq, void *dev_id, struct pt_regs *fp)
253{
254 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
255
256 /* if audio 0 interrupt */
257 if (ints & IF_AUD0) {
258 amiga_custom.intreq = IF_AUD0;
259 amiga_do_irq(IRQ_AMIGA_AUD0, fp);
260 }
261
262 /* if audio 1 interrupt */
263 if (ints & IF_AUD1) {
264 amiga_custom.intreq = IF_AUD1;
265 amiga_do_irq(IRQ_AMIGA_AUD1, fp);
266 }
267
268 /* if audio 2 interrupt */
269 if (ints & IF_AUD2) {
270 amiga_custom.intreq = IF_AUD2;
271 amiga_do_irq(IRQ_AMIGA_AUD2, fp);
272 }
273
274 /* if audio 3 interrupt */
275 if (ints & IF_AUD3) {
276 amiga_custom.intreq = IF_AUD3;
277 amiga_do_irq(IRQ_AMIGA_AUD3, fp);
278 }
279}
280
281static void ami_int5(int irq, void *dev_id, struct pt_regs *fp)
282{
283 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
284
285 /* if serial receive buffer full interrupt */
286 if (ints & IF_RBF) {
287 /* acknowledge of IF_RBF must be done by the serial interrupt */
288 amiga_do_irq(IRQ_AMIGA_RBF, fp);
289 }
290
291 /* if a disk sync interrupt */
292 if (ints & IF_DSKSYN) {
293 amiga_custom.intreq = IF_DSKSYN;
294 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp);
295 }
296}
297
298static void ami_int7(int irq, void *dev_id, struct pt_regs *fp)
299{
300 panic ("level 7 interrupt received\n");
301}
302
303#ifdef CONFIG_APUS
304/* The PPC irq handling links all handlers requested on the same vector
305 and executes them in a loop. Having ami_badint at the end of the chain
306 is a bad idea. */
307struct irqaction amiga_sys_irqaction[AUTO_IRQS] = {
308 { .handler = ami_badint, .name = "spurious int" },
309 { .handler = ami_int1, .name = "int1 handler" },
310 { 0, /* CIAA */ },
311 { .handler = ami_int3, .name = "int3 handler" },
312 { .handler = ami_int4, .name = "int4 handler" },
313 { .handler = ami_int5, .name = "int5 handler" },
314 { 0, /* CIAB */ },
315 { .handler = ami_int7, .name = "int7 handler" },
316};
317#else
318void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
319 ami_badint, ami_int1, ami_badint, ami_int3,
320 ami_int4, ami_int5, ami_badint, ami_int7
321};
322#endif
diff --git a/arch/ppc/amiga/amisound.c b/arch/ppc/amiga/amisound.c
deleted file mode 100644
index 2b86cbef79f6..000000000000
--- a/arch/ppc/amiga/amisound.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amisound.c"
diff --git a/arch/ppc/amiga/bootinfo.c b/arch/ppc/amiga/bootinfo.c
deleted file mode 100644
index efd869a3ed9b..000000000000
--- a/arch/ppc/amiga/bootinfo.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Extracted from arch/m68k/kernel/setup.c.
3 * Should be properly generalized and put somewhere else.
4 * Jesper
5 */
6
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/string.h>
10#include <linux/init.h>
11
12#include <asm/setup.h>
13#include <asm/bootinfo.h>
14
15extern char cmd_line[CL_SIZE];
16
17extern int num_memory;
18extern int m68k_realnum_memory;
19extern struct mem_info memory[NUM_MEMINFO];
20extern struct mem_info m68k_memory[NUM_MEMINFO];
21extern struct mem_info ramdisk;
22
23extern int amiga_parse_bootinfo(const struct bi_record *);
24extern int atari_parse_bootinfo(const struct bi_record *);
25extern int mac_parse_bootinfo(const struct bi_record *);
26
27void __init parse_bootinfo(const struct bi_record *record)
28{
29 while (record->tag != BI_LAST) {
30 int unknown = 0;
31 const u_long *data = record->data;
32 switch (record->tag) {
33 case BI_MACHTYPE:
34 case BI_CPUTYPE:
35 case BI_FPUTYPE:
36 case BI_MMUTYPE:
37 /* Already set up by head.S */
38 break;
39
40 case BI_MEMCHUNK:
41 if (num_memory < NUM_MEMINFO) {
42 memory[num_memory].addr = data[0];
43 memory[num_memory].size = data[1];
44 num_memory++;
45
46 /* FIXME: duplicate for m68k drivers. */
47 m68k_memory[m68k_realnum_memory].addr = data[0];
48 m68k_memory[m68k_realnum_memory].size = data[1];
49 m68k_realnum_memory++;
50 } else
51 printk("parse_bootinfo: too many memory chunks\n");
52 break;
53
54 case BI_RAMDISK:
55 ramdisk.addr = data[0];
56 ramdisk.size = data[1];
57 break;
58
59 case BI_COMMAND_LINE:
60 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
61 break;
62
63 default:
64 if (MACH_IS_AMIGA)
65 unknown = amiga_parse_bootinfo(record);
66 else if (MACH_IS_ATARI)
67 unknown = atari_parse_bootinfo(record);
68 else if (MACH_IS_MAC)
69 unknown = mac_parse_bootinfo(record);
70 else
71 unknown = 1;
72 }
73 if (unknown)
74 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
75 record->tag);
76 record = (struct bi_record *)((u_long)record+record->size);
77 }
78}
diff --git a/arch/ppc/amiga/chipram.c b/arch/ppc/amiga/chipram.c
deleted file mode 100644
index e6ab3c6b223c..000000000000
--- a/arch/ppc/amiga/chipram.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/chipram.c"
diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c
deleted file mode 100644
index 9558f2f40e64..000000000000
--- a/arch/ppc/amiga/cia.c
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * Copyright (C) 1996 Roman Zippel
3 *
4 * The concept of some functions bases on the original Amiga OS function
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/types.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/kernel_stat.h>
17#include <linux/init.h>
18
19#include <asm/irq.h>
20#include <asm/amigahw.h>
21#include <asm/amigaints.h>
22
23struct ciabase {
24 volatile struct CIA *cia;
25 u_char icr_mask, icr_data;
26 u_short int_mask;
27 int handler_irq, cia_irq, server_irq;
28 char *name;
29} ciaa_base = {
30 &ciaa, 0, 0, IF_PORTS,
31 IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA,
32 IRQ_AMIGA_PORTS,
33 "CIAA handler"
34}, ciab_base = {
35 &ciab, 0, 0, IF_EXTER,
36 IRQ_AMIGA_AUTO_6, IRQ_AMIGA_CIAB,
37 IRQ_AMIGA_EXTER,
38 "CIAB handler"
39};
40
41#define CIA_SET_BASE_ADJUST_IRQ(base, irq) \
42do { \
43 if (irq >= IRQ_AMIGA_CIAB) { \
44 base = &ciab_base; \
45 irq -= IRQ_AMIGA_CIAB; \
46 } else { \
47 base = &ciaa_base; \
48 irq -= IRQ_AMIGA_CIAA; \
49 } \
50} while (0)
51
52/*
53 * Cause or clear CIA interrupts, return old interrupt status.
54 */
55
56static unsigned char cia_set_irq_private(struct ciabase *base,
57 unsigned char mask)
58{
59 u_char old;
60
61 old = (base->icr_data |= base->cia->icr);
62 if (mask & CIA_ICR_SETCLR)
63 base->icr_data |= mask;
64 else
65 base->icr_data &= ~mask;
66 if (base->icr_data & base->icr_mask)
67 amiga_custom.intreq = IF_SETCLR | base->int_mask;
68 return old & base->icr_mask;
69}
70
71unsigned char cia_set_irq(unsigned int irq, int set)
72{
73 struct ciabase *base;
74 unsigned char mask;
75
76 if (irq >= IRQ_AMIGA_CIAB)
77 mask = (1 << (irq - IRQ_AMIGA_CIAB));
78 else
79 mask = (1 << (irq - IRQ_AMIGA_CIAA));
80 mask |= (set) ? CIA_ICR_SETCLR : 0;
81
82 CIA_SET_BASE_ADJUST_IRQ(base, irq);
83
84 return cia_set_irq_private(base, mask);
85}
86
87unsigned char cia_get_irq_mask(unsigned int irq)
88{
89 struct ciabase *base;
90
91 CIA_SET_BASE_ADJUST_IRQ(base, irq);
92
93 return base->cia->icr;
94}
95
96/*
97 * Enable or disable CIA interrupts, return old interrupt mask.
98 */
99
100static unsigned char cia_able_irq_private(struct ciabase *base,
101 unsigned char mask)
102{
103 u_char old;
104
105 old = base->icr_mask;
106 base->icr_data |= base->cia->icr;
107 base->cia->icr = mask;
108 if (mask & CIA_ICR_SETCLR)
109 base->icr_mask |= mask;
110 else
111 base->icr_mask &= ~mask;
112 base->icr_mask &= CIA_ICR_ALL;
113
114 if (base->icr_data & base->icr_mask)
115 amiga_custom.intreq = IF_SETCLR | base->int_mask;
116 return old;
117}
118
119unsigned char cia_able_irq(unsigned int irq, int enable)
120{
121 struct ciabase *base;
122 unsigned char mask;
123
124 if (irq >= IRQ_AMIGA_CIAB)
125 mask = (1 << (irq - IRQ_AMIGA_CIAB));
126 else
127 mask = (1 << (irq - IRQ_AMIGA_CIAA));
128 mask |= (enable) ? CIA_ICR_SETCLR : 0;
129
130 CIA_SET_BASE_ADJUST_IRQ(base, irq);
131
132 return cia_able_irq_private(base, mask);
133}
134
135static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
136{
137 struct ciabase *base = (struct ciabase *)dev_id;
138 irq_desc_t *desc;
139 struct irqaction *action;
140 int i;
141 unsigned char ints;
142
143 irq = base->cia_irq;
144 desc = irq_desc + irq;
145 ints = cia_set_irq_private(base, CIA_ICR_ALL);
146 amiga_custom.intreq = base->int_mask;
147 for (i = 0; i < CIA_IRQS; i++, irq++) {
148 if (ints & 1) {
149 kstat_cpu(0).irqs[irq]++;
150 action = desc->action;
151 action->handler(irq, action->dev_id, fp);
152 }
153 ints >>= 1;
154 desc++;
155 }
156 amiga_do_irq_list(base->server_irq, fp);
157}
158
159void __init cia_init_IRQ(struct ciabase *base)
160{
161 extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
162 struct irqaction *action;
163
164 /* clear any pending interrupt and turn off all interrupts */
165 cia_set_irq_private(base, CIA_ICR_ALL);
166 cia_able_irq_private(base, CIA_ICR_ALL);
167
168 /* install CIA handler */
169 action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO];
170 action->handler = cia_handler;
171 action->dev_id = base;
172 action->name = base->name;
173 setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]);
174
175 amiga_custom.intena = IF_SETCLR | base->int_mask;
176}
diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c
deleted file mode 100644
index bc50ed11957d..000000000000
--- a/arch/ppc/amiga/config.c
+++ /dev/null
@@ -1,953 +0,0 @@
1#define m68k_debug_device debug_device
2
3/*
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * Miscellaneous Amiga stuff
13 */
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/kd.h>
19#include <linux/tty.h>
20#include <linux/console.h>
21#include <linux/init.h>
22#ifdef CONFIG_ZORRO
23#include <linux/zorro.h>
24#endif
25
26#include <asm/bootinfo.h>
27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/pgtable.h>
30#include <asm/amigahw.h>
31#include <asm/amigaints.h>
32#include <asm/irq.h>
33#include <asm/machdep.h>
34#include <asm/io.h>
35
36unsigned long powerup_PCI_present;
37unsigned long powerup_BPPCPLUS_present;
38unsigned long amiga_model;
39unsigned long amiga_eclock;
40unsigned long amiga_masterclock;
41unsigned long amiga_colorclock;
42unsigned long amiga_chipset;
43unsigned char amiga_vblank;
44unsigned char amiga_psfreq;
45struct amiga_hw_present amiga_hw_present;
46
47static char s_a500[] __initdata = "A500";
48static char s_a500p[] __initdata = "A500+";
49static char s_a600[] __initdata = "A600";
50static char s_a1000[] __initdata = "A1000";
51static char s_a1200[] __initdata = "A1200";
52static char s_a2000[] __initdata = "A2000";
53static char s_a2500[] __initdata = "A2500";
54static char s_a3000[] __initdata = "A3000";
55static char s_a3000t[] __initdata = "A3000T";
56static char s_a3000p[] __initdata = "A3000+";
57static char s_a4000[] __initdata = "A4000";
58static char s_a4000t[] __initdata = "A4000T";
59static char s_cdtv[] __initdata = "CDTV";
60static char s_cd32[] __initdata = "CD32";
61static char s_draco[] __initdata = "Draco";
62static char *amiga_models[] __initdata = {
63 s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000,
64 s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco,
65};
66
67static char amiga_model_name[13] = "Amiga ";
68
69extern char m68k_debug_device[];
70
71static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
72/* amiga specific irq functions */
73extern void amiga_init_IRQ (void);
74extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
75extern int amiga_request_irq (unsigned int irq,
76 void (*handler)(int, void *, struct pt_regs *),
77 unsigned long flags, const char *devname,
78 void *dev_id);
79extern void amiga_free_irq (unsigned int irq, void *dev_id);
80extern void amiga_enable_irq (unsigned int);
81extern void amiga_disable_irq (unsigned int);
82static void amiga_get_model(char *model);
83static int amiga_get_hardware_list(char *buffer);
84/* amiga specific timer functions */
85static unsigned long amiga_gettimeoffset (void);
86static void a3000_gettod (int *, int *, int *, int *, int *, int *);
87static void a2000_gettod (int *, int *, int *, int *, int *, int *);
88static int amiga_hwclk (int, struct hwclk_time *);
89static int amiga_set_clock_mmss (unsigned long);
90static void amiga_reset (void);
91extern void amiga_init_sound(void);
92static void amiga_savekmsg_init(void);
93static void amiga_mem_console_write(struct console *co, const char *b,
94 unsigned int count);
95void amiga_serial_console_write(struct console *co, const char *s,
96 unsigned int count);
97static void amiga_debug_init(void);
98#ifdef CONFIG_HEARTBEAT
99static void amiga_heartbeat(int on);
100#endif
101
102static struct console amiga_console_driver = {
103 .name = "debug",
104 .flags = CON_PRINTBUFFER,
105 .index = -1,
106};
107
108
109 /*
110 * Motherboard Resources present in all Amiga models
111 */
112
113static struct {
114 struct resource _ciab, _ciaa, _custom, _kickstart;
115} mb_resources = {
116// { "Ranger Memory", 0x00c00000, 0x00c7ffff },
117 ._ciab = { "CIA B", 0x00bfd000, 0x00bfdfff },
118 ._ciaa = { "CIA A", 0x00bfe000, 0x00bfefff },
119 ._custom = { "Custom I/O", 0x00dff000, 0x00dfffff },
120 ._kickstart = { "Kickstart ROM", 0x00f80000, 0x00ffffff }
121};
122
123static struct resource rtc_resource = {
124 NULL, 0x00dc0000, 0x00dcffff
125};
126
127static struct resource ram_resource[NUM_MEMINFO];
128
129
130 /*
131 * Parse an Amiga-specific record in the bootinfo
132 */
133
134int amiga_parse_bootinfo(const struct bi_record *record)
135{
136 int unknown = 0;
137 const unsigned long *data = record->data;
138
139 switch (record->tag) {
140 case BI_AMIGA_MODEL:
141 {
142 unsigned long d = *data;
143
144 powerup_PCI_present = d & 0x100;
145 amiga_model = d & 0xff;
146 }
147 break;
148
149 case BI_AMIGA_ECLOCK:
150 amiga_eclock = *data;
151 break;
152
153 case BI_AMIGA_CHIPSET:
154 amiga_chipset = *data;
155 break;
156
157 case BI_AMIGA_CHIP_SIZE:
158 amiga_chip_size = *(const int *)data;
159 break;
160
161 case BI_AMIGA_VBLANK:
162 amiga_vblank = *(const unsigned char *)data;
163 break;
164
165 case BI_AMIGA_PSFREQ:
166 amiga_psfreq = *(const unsigned char *)data;
167 break;
168
169 case BI_AMIGA_AUTOCON:
170#ifdef CONFIG_ZORRO
171 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
172 const struct ConfigDev *cd = (struct ConfigDev *)data;
173 struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++];
174 dev->rom = cd->cd_Rom;
175 dev->slotaddr = cd->cd_SlotAddr;
176 dev->slotsize = cd->cd_SlotSize;
177 dev->resource.start = (unsigned long)cd->cd_BoardAddr;
178 dev->resource.end = dev->resource.start+cd->cd_BoardSize-1;
179 } else
180 printk("amiga_parse_bootinfo: too many AutoConfig devices\n");
181#endif /* CONFIG_ZORRO */
182 break;
183
184 case BI_AMIGA_SERPER:
185 /* serial port period: ignored here */
186 break;
187
188 case BI_AMIGA_PUP_BRIDGE:
189 powerup_PCI_present = *(const unsigned short *)data;
190 break;
191
192 case BI_AMIGA_BPPC_SCSI:
193 powerup_BPPCPLUS_present = *(const unsigned short *)data;
194 break;
195
196 default:
197 unknown = 1;
198 }
199 return(unknown);
200}
201
202 /*
203 * Identify builtin hardware
204 */
205
206static void __init amiga_identify(void)
207{
208 /* Fill in some default values, if necessary */
209 if (amiga_eclock == 0)
210 amiga_eclock = 709379;
211
212 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
213
214 printk("Amiga hardware found: ");
215 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
216 printk("[%s] ", amiga_models[amiga_model-AMI_500]);
217 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
218 }
219
220 switch(amiga_model) {
221 case AMI_UNKNOWN:
222 goto Generic;
223
224 case AMI_600:
225 case AMI_1200:
226 AMIGAHW_SET(A1200_IDE);
227 AMIGAHW_SET(PCMCIA);
228 case AMI_500:
229 case AMI_500PLUS:
230 case AMI_1000:
231 case AMI_2000:
232 case AMI_2500:
233 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
234 goto Generic;
235
236 case AMI_3000:
237 case AMI_3000T:
238 AMIGAHW_SET(AMBER_FF);
239 AMIGAHW_SET(MAGIC_REKICK);
240 /* fall through */
241 case AMI_3000PLUS:
242 AMIGAHW_SET(A3000_SCSI);
243 AMIGAHW_SET(A3000_CLK);
244 AMIGAHW_SET(ZORRO3);
245 goto Generic;
246
247 case AMI_4000T:
248 AMIGAHW_SET(A4000_SCSI);
249 /* fall through */
250 case AMI_4000:
251 AMIGAHW_SET(A4000_IDE);
252 AMIGAHW_SET(A3000_CLK);
253 AMIGAHW_SET(ZORRO3);
254 goto Generic;
255
256 case AMI_CDTV:
257 case AMI_CD32:
258 AMIGAHW_SET(CD_ROM);
259 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
260 goto Generic;
261
262 Generic:
263 AMIGAHW_SET(AMI_VIDEO);
264 AMIGAHW_SET(AMI_BLITTER);
265 AMIGAHW_SET(AMI_AUDIO);
266 AMIGAHW_SET(AMI_FLOPPY);
267 AMIGAHW_SET(AMI_KEYBOARD);
268 AMIGAHW_SET(AMI_MOUSE);
269 AMIGAHW_SET(AMI_SERIAL);
270 AMIGAHW_SET(AMI_PARALLEL);
271 AMIGAHW_SET(CHIP_RAM);
272 AMIGAHW_SET(PAULA);
273
274 switch(amiga_chipset) {
275 case CS_OCS:
276 case CS_ECS:
277 case CS_AGA:
278 switch (amiga_custom.deniseid & 0xf) {
279 case 0x0c:
280 AMIGAHW_SET(DENISE_HR);
281 break;
282 case 0x08:
283 AMIGAHW_SET(LISA);
284 break;
285 }
286 break;
287 default:
288 AMIGAHW_SET(DENISE);
289 break;
290 }
291 switch ((amiga_custom.vposr>>8) & 0x7f) {
292 case 0x00:
293 AMIGAHW_SET(AGNUS_PAL);
294 break;
295 case 0x10:
296 AMIGAHW_SET(AGNUS_NTSC);
297 break;
298 case 0x20:
299 case 0x21:
300 AMIGAHW_SET(AGNUS_HR_PAL);
301 break;
302 case 0x30:
303 case 0x31:
304 AMIGAHW_SET(AGNUS_HR_NTSC);
305 break;
306 case 0x22:
307 case 0x23:
308 AMIGAHW_SET(ALICE_PAL);
309 break;
310 case 0x32:
311 case 0x33:
312 AMIGAHW_SET(ALICE_NTSC);
313 break;
314 }
315 AMIGAHW_SET(ZORRO);
316 break;
317
318 case AMI_DRACO:
319 panic("No support for Draco yet");
320
321 default:
322 panic("Unknown Amiga Model");
323 }
324
325#define AMIGAHW_ANNOUNCE(name, str) \
326 if (AMIGAHW_PRESENT(name)) \
327 printk(str)
328
329 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
330 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
331 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
332 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
333 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
334 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
335 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
336 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
337 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
338 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
339 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
340 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
341 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
342 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
343 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
344 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
345 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
346 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
347 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
348 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
349 AMIGAHW_ANNOUNCE(LISA, "LISA ");
350 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
351 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
352 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
353 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
354 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
355 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
356 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
357 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
358 if (AMIGAHW_PRESENT(ZORRO))
359 printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
360 printk("\n");
361
362#undef AMIGAHW_ANNOUNCE
363}
364
365 /*
366 * Setup the Amiga configuration info
367 */
368
369void __init config_amiga(void)
370{
371 int i;
372
373 amiga_debug_init();
374 amiga_identify();
375
376 /* Some APUS boxes may have PCI memory, but ... */
377 iomem_resource.name = "Memory";
378 for (i = 0; i < 4; i++)
379 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
380
381 mach_sched_init = amiga_sched_init;
382 mach_init_IRQ = amiga_init_IRQ;
383#ifndef CONFIG_APUS
384 mach_default_handler = &amiga_default_handler;
385 mach_request_irq = amiga_request_irq;
386 mach_free_irq = amiga_free_irq;
387 enable_irq = amiga_enable_irq;
388 disable_irq = amiga_disable_irq;
389#endif
390 mach_get_model = amiga_get_model;
391 mach_get_hardware_list = amiga_get_hardware_list;
392 mach_gettimeoffset = amiga_gettimeoffset;
393 if (AMIGAHW_PRESENT(A3000_CLK)){
394 mach_gettod = a3000_gettod;
395 rtc_resource.name = "A3000 RTC";
396 request_resource(&iomem_resource, &rtc_resource);
397 }
398 else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */
399 mach_gettod = a2000_gettod;
400 rtc_resource.name = "A2000 RTC";
401 request_resource(&iomem_resource, &rtc_resource);
402 }
403
404 mach_max_dma_address = 0xffffffff; /*
405 * default MAX_DMA=0xffffffff
406 * on all machines. If we don't
407 * do so, the SCSI code will not
408 * be able to allocate any mem
409 * for transfers, unless we are
410 * dealing with a Z2 mem only
411 * system. /Jes
412 */
413
414 mach_hwclk = amiga_hwclk;
415 mach_set_clock_mmss = amiga_set_clock_mmss;
416 mach_reset = amiga_reset;
417#ifdef CONFIG_HEARTBEAT
418 mach_heartbeat = amiga_heartbeat;
419#endif
420
421 /* Fill in the clock values (based on the 700 kHz E-Clock) */
422 amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
423 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
424
425 /* clear all DMA bits */
426 amiga_custom.dmacon = DMAF_ALL;
427 /* ensure that the DMA master bit is set */
428 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
429
430 /* request all RAM */
431 for (i = 0; i < m68k_num_memory; i++) {
432 ram_resource[i].name =
433 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
434 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
435 "16-bit Slow RAM";
436 ram_resource[i].start = m68k_memory[i].addr;
437 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
438 request_resource(&iomem_resource, &ram_resource[i]);
439 }
440
441 /* initialize chipram allocator */
442 amiga_chip_init ();
443
444 /* debugging using chipram */
445 if (!strcmp( m68k_debug_device, "mem" )){
446 if (!AMIGAHW_PRESENT(CHIP_RAM))
447 printk("Warning: no chipram present for debugging\n");
448 else {
449 amiga_savekmsg_init();
450 amiga_console_driver.write = amiga_mem_console_write;
451 register_console(&amiga_console_driver);
452 }
453 }
454
455 /* our beloved beeper */
456 if (AMIGAHW_PRESENT(AMI_AUDIO))
457 amiga_init_sound();
458
459 /*
460 * if it is an A3000, set the magic bit that forces
461 * a hard rekick
462 */
463 if (AMIGAHW_PRESENT(MAGIC_REKICK))
464 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
465}
466
467static unsigned short jiffy_ticks;
468
469static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *,
470 struct pt_regs *))
471{
472 static struct resource sched_res = {
473 "timer", 0x00bfd400, 0x00bfd5ff,
474 };
475 jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
476
477 if (request_resource(&mb_resources._ciab, &sched_res))
478 printk("Cannot allocate ciab.ta{lo,hi}\n");
479 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
480 ciab.talo = jiffy_ticks % 256;
481 ciab.tahi = jiffy_ticks / 256;
482
483 /* install interrupt service routine for CIAB Timer A
484 *
485 * Please don't change this to use ciaa, as it interferes with the
486 * SCSI code. We'll have to take a look at this later
487 */
488 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL);
489 /* start timer */
490 ciab.cra |= 0x11;
491}
492
493#define TICK_SIZE 10000
494
495extern unsigned char cia_get_irq_mask(unsigned int irq);
496
497/* This is always executed with interrupts disabled. */
498static unsigned long amiga_gettimeoffset (void)
499{
500 unsigned short hi, lo, hi2;
501 unsigned long ticks, offset = 0;
502
503 /* read CIA B timer A current value */
504 hi = ciab.tahi;
505 lo = ciab.talo;
506 hi2 = ciab.tahi;
507
508 if (hi != hi2) {
509 lo = ciab.talo;
510 hi = hi2;
511 }
512
513 ticks = hi << 8 | lo;
514
515 if (ticks > jiffy_ticks / 2)
516 /* check for pending interrupt */
517 if (cia_get_irq_mask(IRQ_AMIGA_CIAB) & CIA_ICR_TA)
518 offset = 10000;
519
520 ticks = jiffy_ticks - ticks;
521 ticks = (10000 * ticks) / jiffy_ticks;
522
523 return ticks + offset;
524}
525
526static void a3000_gettod (int *yearp, int *monp, int *dayp,
527 int *hourp, int *minp, int *secp)
528{
529 volatile struct tod3000 *tod = TOD_3000;
530
531 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
532
533 *secp = tod->second1 * 10 + tod->second2;
534 *minp = tod->minute1 * 10 + tod->minute2;
535 *hourp = tod->hour1 * 10 + tod->hour2;
536 *dayp = tod->day1 * 10 + tod->day2;
537 *monp = tod->month1 * 10 + tod->month2;
538 *yearp = tod->year1 * 10 + tod->year2;
539
540 tod->cntrl1 = TOD3000_CNTRL1_FREE;
541}
542
543static void a2000_gettod (int *yearp, int *monp, int *dayp,
544 int *hourp, int *minp, int *secp)
545{
546 volatile struct tod2000 *tod = TOD_2000;
547
548 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
549
550 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
551 ;
552
553 *secp = tod->second1 * 10 + tod->second2;
554 *minp = tod->minute1 * 10 + tod->minute2;
555 *hourp = (tod->hour1 & 3) * 10 + tod->hour2;
556 *dayp = tod->day1 * 10 + tod->day2;
557 *monp = tod->month1 * 10 + tod->month2;
558 *yearp = tod->year1 * 10 + tod->year2;
559
560 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
561 if (!(tod->hour1 & TOD2000_HOUR1_PM) && *hourp == 12)
562 *hourp = 0;
563 else if ((tod->hour1 & TOD2000_HOUR1_PM) && *hourp != 12)
564 *hourp += 12;
565 }
566
567 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
568}
569
570static int amiga_hwclk(int op, struct hwclk_time *t)
571{
572 if (AMIGAHW_PRESENT(A3000_CLK)) {
573 volatile struct tod3000 *tod = TOD_3000;
574
575 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
576
577 if (!op) { /* read */
578 t->sec = tod->second1 * 10 + tod->second2;
579 t->min = tod->minute1 * 10 + tod->minute2;
580 t->hour = tod->hour1 * 10 + tod->hour2;
581 t->day = tod->day1 * 10 + tod->day2;
582 t->wday = tod->weekday;
583 t->mon = tod->month1 * 10 + tod->month2 - 1;
584 t->year = tod->year1 * 10 + tod->year2;
585 if (t->year <= 69)
586 t->year += 100;
587 } else {
588 tod->second1 = t->sec / 10;
589 tod->second2 = t->sec % 10;
590 tod->minute1 = t->min / 10;
591 tod->minute2 = t->min % 10;
592 tod->hour1 = t->hour / 10;
593 tod->hour2 = t->hour % 10;
594 tod->day1 = t->day / 10;
595 tod->day2 = t->day % 10;
596 if (t->wday != -1)
597 tod->weekday = t->wday;
598 tod->month1 = (t->mon + 1) / 10;
599 tod->month2 = (t->mon + 1) % 10;
600 if (t->year >= 100)
601 t->year -= 100;
602 tod->year1 = t->year / 10;
603 tod->year2 = t->year % 10;
604 }
605
606 tod->cntrl1 = TOD3000_CNTRL1_FREE;
607 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
608 volatile struct tod2000 *tod = TOD_2000;
609
610 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
611
612 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
613 ;
614
615 if (!op) { /* read */
616 t->sec = tod->second1 * 10 + tod->second2;
617 t->min = tod->minute1 * 10 + tod->minute2;
618 t->hour = (tod->hour1 & 3) * 10 + tod->hour2;
619 t->day = tod->day1 * 10 + tod->day2;
620 t->wday = tod->weekday;
621 t->mon = tod->month1 * 10 + tod->month2 - 1;
622 t->year = tod->year1 * 10 + tod->year2;
623 if (t->year <= 69)
624 t->year += 100;
625
626 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
627 if (!(tod->hour1 & TOD2000_HOUR1_PM) && t->hour == 12)
628 t->hour = 0;
629 else if ((tod->hour1 & TOD2000_HOUR1_PM) && t->hour != 12)
630 t->hour += 12;
631 }
632 } else {
633 tod->second1 = t->sec / 10;
634 tod->second2 = t->sec % 10;
635 tod->minute1 = t->min / 10;
636 tod->minute2 = t->min % 10;
637 if (tod->cntrl3 & TOD2000_CNTRL3_24HMODE)
638 tod->hour1 = t->hour / 10;
639 else if (t->hour >= 12)
640 tod->hour1 = TOD2000_HOUR1_PM +
641 (t->hour - 12) / 10;
642 else
643 tod->hour1 = t->hour / 10;
644 tod->hour2 = t->hour % 10;
645 tod->day1 = t->day / 10;
646 tod->day2 = t->day % 10;
647 if (t->wday != -1)
648 tod->weekday = t->wday;
649 tod->month1 = (t->mon + 1) / 10;
650 tod->month2 = (t->mon + 1) % 10;
651 if (t->year >= 100)
652 t->year -= 100;
653 tod->year1 = t->year / 10;
654 tod->year2 = t->year % 10;
655 }
656
657 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
658 }
659
660 return 0;
661}
662
663static int amiga_set_clock_mmss (unsigned long nowtime)
664{
665 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
666
667 if (AMIGAHW_PRESENT(A3000_CLK)) {
668 volatile struct tod3000 *tod = TOD_3000;
669
670 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
671
672 tod->second1 = real_seconds / 10;
673 tod->second2 = real_seconds % 10;
674 tod->minute1 = real_minutes / 10;
675 tod->minute2 = real_minutes % 10;
676
677 tod->cntrl1 = TOD3000_CNTRL1_FREE;
678 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
679 volatile struct tod2000 *tod = TOD_2000;
680
681 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
682
683 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
684 ;
685
686 tod->second1 = real_seconds / 10;
687 tod->second2 = real_seconds % 10;
688 tod->minute1 = real_minutes / 10;
689 tod->minute2 = real_minutes % 10;
690
691 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
692 }
693
694 return 0;
695}
696
697static NORET_TYPE void amiga_reset( void )
698 ATTRIB_NORET;
699
700static void amiga_reset (void)
701{
702 for (;;);
703}
704
705
706 /*
707 * Debugging
708 */
709
710#define SAVEKMSG_MAXMEM 128*1024
711
712#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
713#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
714
715struct savekmsg {
716 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
717 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
718 unsigned long magicptr; /* address of magic1 */
719 unsigned long size;
720 char data[0];
721};
722
723static struct savekmsg *savekmsg = NULL;
724
725static void amiga_mem_console_write(struct console *co, const char *s,
726 unsigned int count)
727{
728 if (savekmsg->size+count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
729 memcpy(savekmsg->data+savekmsg->size, s, count);
730 savekmsg->size += count;
731 }
732}
733
734static void amiga_savekmsg_init(void)
735{
736 static struct resource debug_res = { "Debug" };
737
738 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
739 savekmsg->magic1 = SAVEKMSG_MAGIC1;
740 savekmsg->magic2 = SAVEKMSG_MAGIC2;
741 savekmsg->magicptr = virt_to_phys(savekmsg);
742 savekmsg->size = 0;
743}
744
745static void amiga_serial_putc(char c)
746{
747 amiga_custom.serdat = (unsigned char)c | 0x100;
748 mb();
749 while (!(amiga_custom.serdatr & 0x2000))
750 ;
751}
752
753void amiga_serial_console_write(struct console *co, const char *s,
754 unsigned int count)
755{
756#if 0 /* def CONFIG_KGDB */
757 /* FIXME:APUS GDB doesn't seem to like O-packages before it is
758 properly connected with the target. */
759 __gdb_output_string (s, count);
760#else
761 while (count--) {
762 if (*s == '\n')
763 amiga_serial_putc('\r');
764 amiga_serial_putc(*s++);
765 }
766#endif
767}
768
769#ifdef CONFIG_SERIAL_CONSOLE
770void amiga_serial_puts(const char *s)
771{
772 amiga_serial_console_write(NULL, s, strlen(s));
773}
774
775int amiga_serial_console_wait_key(struct console *co)
776{
777 int ch;
778
779 while (!(amiga_custom.intreqr & IF_RBF))
780 barrier();
781 ch = amiga_custom.serdatr & 0xff;
782 /* clear the interrupt, so that another character can be read */
783 amiga_custom.intreq = IF_RBF;
784 return ch;
785}
786
787void amiga_serial_gets(struct console *co, char *s, int len)
788{
789 int ch, cnt = 0;
790
791 while (1) {
792 ch = amiga_serial_console_wait_key(co);
793
794 /* Check for backspace. */
795 if (ch == 8 || ch == 127) {
796 if (cnt == 0) {
797 amiga_serial_putc('\007');
798 continue;
799 }
800 cnt--;
801 amiga_serial_puts("\010 \010");
802 continue;
803 }
804
805 /* Check for enter. */
806 if (ch == 10 || ch == 13)
807 break;
808
809 /* See if line is too long. */
810 if (cnt >= len + 1) {
811 amiga_serial_putc(7);
812 cnt--;
813 continue;
814 }
815
816 /* Store and echo character. */
817 s[cnt++] = ch;
818 amiga_serial_putc(ch);
819 }
820 /* Print enter. */
821 amiga_serial_puts("\r\n");
822 s[cnt] = 0;
823}
824#endif
825
826static void __init amiga_debug_init(void)
827{
828 if (!strcmp( m68k_debug_device, "ser" )) {
829 /* no initialization required (?) */
830 amiga_console_driver.write = amiga_serial_console_write;
831 register_console(&amiga_console_driver);
832 }
833}
834
835#ifdef CONFIG_HEARTBEAT
836static void amiga_heartbeat(int on)
837{
838 if (on)
839 ciaa.pra &= ~2;
840 else
841 ciaa.pra |= 2;
842}
843#endif
844
845 /*
846 * Amiga specific parts of /proc
847 */
848
849static void amiga_get_model(char *model)
850{
851 strcpy(model, amiga_model_name);
852}
853
854
855static int amiga_get_hardware_list(char *buffer)
856{
857 int len = 0;
858
859 if (AMIGAHW_PRESENT(CHIP_RAM))
860 len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
861 len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
862 amiga_psfreq, amiga_eclock);
863 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
864 char *type;
865 switch(amiga_chipset) {
866 case CS_OCS:
867 type = "OCS";
868 break;
869 case CS_ECS:
870 type = "ECS";
871 break;
872 case CS_AGA:
873 type = "AGA";
874 break;
875 default:
876 type = "Old or Unknown";
877 break;
878 }
879 len += sprintf(buffer+len, "Graphics:\t%s\n", type);
880 }
881
882#define AMIGAHW_ANNOUNCE(name, str) \
883 if (AMIGAHW_PRESENT(name)) \
884 len += sprintf (buffer+len, "\t%s\n", str)
885
886 len += sprintf (buffer + len, "Detected hardware:\n");
887
888 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
889 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
890 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
891 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
892 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
893 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
894 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
895 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
896 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
897 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
898 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
899 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
900 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
901 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
902 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
903 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
904 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
905 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
906 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
907 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
908 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
909 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
910 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
911 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
912 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
913 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
914 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
915 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
916 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
917 if (AMIGAHW_PRESENT(ZORRO))
918 len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion "
919 "Device%s\n",
920 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
921 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
922
923#undef AMIGAHW_ANNOUNCE
924
925 return(len);
926}
927
928#ifdef CONFIG_APUS
929int get_hardware_list(char *buffer)
930{
931 extern int get_cpuinfo(char *buffer);
932 int len = 0;
933 char model[80];
934 u_long mem;
935 int i;
936
937 if (mach_get_model)
938 mach_get_model(model);
939 else
940 strcpy(model, "Unknown PowerPC");
941
942 len += sprintf(buffer+len, "Model:\t\t%s\n", model);
943 len += get_cpuinfo(buffer+len);
944 for (mem = 0, i = 0; i < m68k_realnum_memory; i++)
945 mem += m68k_memory[i].size;
946 len += sprintf(buffer+len, "System Memory:\t%ldK\n", mem>>10);
947
948 if (mach_get_hardware_list)
949 len += mach_get_hardware_list(buffer+len);
950
951 return(len);
952}
953#endif
diff --git a/arch/ppc/amiga/ints.c b/arch/ppc/amiga/ints.c
deleted file mode 100644
index 083a17462190..000000000000
--- a/arch/ppc/amiga/ints.c
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c
3 * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards.
4 */
5
6#include <linux/types.h>
7#include <linux/sched.h>
8#include <linux/kernel_stat.h>
9#include <linux/errno.h>
10#include <linux/init.h>
11#include <linux/seq_file.h>
12
13#include <asm/setup.h>
14#include <asm/system.h>
15#include <asm/irq.h>
16#include <asm/traps.h>
17#include <asm/page.h>
18#include <asm/machdep.h>
19
20/* table for system interrupt handlers */
21static irq_handler_t irq_list[SYS_IRQS];
22
23static const char *default_names[SYS_IRQS] = {
24 "spurious int", "int1 handler", "int2 handler", "int3 handler",
25 "int4 handler", "int5 handler", "int6 handler", "int7 handler"
26};
27
28/* The number of spurious interrupts */
29volatile unsigned int num_spurious;
30
31#define NUM_IRQ_NODES 100
32static irq_node_t nodes[NUM_IRQ_NODES];
33
34
35/*
36 * void init_IRQ(void)
37 *
38 * Parameters: None
39 *
40 * Returns: Nothing
41 *
42 * This function should be called during kernel startup to initialize
43 * the IRQ handling routines.
44 */
45
46__init
47void m68k_init_IRQ(void)
48{
49 int i;
50
51 for (i = 0; i < SYS_IRQS; i++) {
52 if (mach_default_handler)
53 irq_list[i].handler = (*mach_default_handler)[i];
54 irq_list[i].flags = 0;
55 irq_list[i].dev_id = NULL;
56 irq_list[i].devname = default_names[i];
57 }
58
59 for (i = 0; i < NUM_IRQ_NODES; i++)
60 nodes[i].handler = NULL;
61
62 mach_init_IRQ ();
63}
64
65irq_node_t *new_irq_node(void)
66{
67 irq_node_t *node;
68 short i;
69
70 for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--)
71 if (!node->handler)
72 return node;
73
74 printk ("new_irq_node: out of nodes\n");
75 return NULL;
76}
77
78int sys_request_irq(unsigned int irq,
79 void (*handler)(int, void *, struct pt_regs *),
80 unsigned long flags, const char *devname, void *dev_id)
81{
82 if (irq < IRQ1 || irq > IRQ7) {
83 printk("%s: Incorrect IRQ %d from %s\n",
84 __FUNCTION__, irq, devname);
85 return -ENXIO;
86 }
87
88#if 0
89 if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
90 if (irq_list[irq].flags & IRQ_FLG_LOCK) {
91 printk("%s: IRQ %d from %s is not replaceable\n",
92 __FUNCTION__, irq, irq_list[irq].devname);
93 return -EBUSY;
94 }
95 if (!(flags & IRQ_FLG_REPLACE)) {
96 printk("%s: %s can't replace IRQ %d from %s\n",
97 __FUNCTION__, devname, irq, irq_list[irq].devname);
98 return -EBUSY;
99 }
100 }
101#endif
102
103 irq_list[irq].handler = handler;
104 irq_list[irq].flags = flags;
105 irq_list[irq].dev_id = dev_id;
106 irq_list[irq].devname = devname;
107 return 0;
108}
109
110void sys_free_irq(unsigned int irq, void *dev_id)
111{
112 if (irq < IRQ1 || irq > IRQ7) {
113 printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
114 return;
115 }
116
117 if (irq_list[irq].dev_id != dev_id)
118 printk("%s: Removing probably wrong IRQ %d from %s\n",
119 __FUNCTION__, irq, irq_list[irq].devname);
120
121 irq_list[irq].handler = (*mach_default_handler)[irq];
122 irq_list[irq].flags = 0;
123 irq_list[irq].dev_id = NULL;
124 irq_list[irq].devname = default_names[irq];
125}
126
127asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
128{
129 if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
130 vec -= VEC_SPUR;
131 kstat_cpu(0).irqs[vec]++;
132 irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
133 } else {
134 if (mach_process_int)
135 mach_process_int(vec, fp);
136 else
137 panic("Can't process interrupt vector %ld\n", vec);
138 return;
139 }
140}
141
142int m68k_get_irq_list(struct seq_file *p, void *v)
143{
144 int i;
145
146 /* autovector interrupts */
147 if (mach_default_handler) {
148 for (i = 0; i < SYS_IRQS; i++) {
149 seq_printf(p, "auto %2d: %10u ", i,
150 i ? kstat_cpu(0).irqs[i] : num_spurious);
151 seq_puts(p, " ");
152 seq_printf(p, "%s\n", irq_list[i].devname);
153 }
154 }
155
156 mach_get_irq_list(p, v);
157 return 0;
158}
diff --git a/arch/ppc/amiga/pcmcia.c b/arch/ppc/amiga/pcmcia.c
deleted file mode 100644
index 5d29dc65093c..000000000000
--- a/arch/ppc/amiga/pcmcia.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/pcmcia.c"
diff --git a/arch/ppc/amiga/time.c b/arch/ppc/amiga/time.c
deleted file mode 100644
index 8c880c0ca380..000000000000
--- a/arch/ppc/amiga/time.c
+++ /dev/null
@@ -1,57 +0,0 @@
1#include <linux/errno.h>
2#include <linux/sched.h>
3#include <linux/kernel.h>
4#include <linux/param.h>
5#include <linux/string.h>
6#include <linux/mm.h>
7
8#include <asm/machdep.h>
9#include <asm/io.h>
10
11#include <linux/timex.h>
12
13unsigned long m68k_get_rtc_time(void)
14{
15 unsigned int year, mon, day, hour, min, sec;
16
17 extern void arch_gettod(int *year, int *mon, int *day, int *hour,
18 int *min, int *sec);
19
20 arch_gettod (&year, &mon, &day, &hour, &min, &sec);
21
22 if ((year += 1900) < 1970)
23 year += 100;
24
25 return mktime(year, mon, day, hour, min, sec);
26}
27
28int m68k_set_rtc_time(unsigned long nowtime)
29{
30 if (mach_set_clock_mmss)
31 return mach_set_clock_mmss (nowtime);
32 return -1;
33}
34
35void apus_heartbeat (void)
36{
37#ifdef CONFIG_HEARTBEAT
38 static unsigned cnt = 0, period = 0, dist = 0;
39
40 if (cnt == 0 || cnt == dist)
41 mach_heartbeat( 1 );
42 else if (cnt == 7 || cnt == dist+7)
43 mach_heartbeat( 0 );
44
45 if (++cnt > period) {
46 cnt = 0;
47 /* The hyperbolic function below modifies the heartbeat period
48 * length in dependency of the current (5min) load. It goes
49 * through the points f(0)=126, f(1)=86, f(5)=51,
50 * f(inf)->30. */
51 period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
52 dist = period / 4;
53 }
54#endif
55 /* should be made smarter */
56 ppc_md.heartbeat_count = 1;
57}
diff --git a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig
deleted file mode 100644
index e2245252d31f..000000000000
--- a/arch/ppc/configs/apus_defconfig
+++ /dev/null
@@ -1,920 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21# CONFIG_EMBEDDED is not set
22CONFIG_FUTEX=y
23CONFIG_EPOLL=y
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30CONFIG_MODULE_FORCE_UNLOAD=y
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48# CONFIG_8260 is not set
49CONFIG_GENERIC_ISA_DMA=y
50CONFIG_PPC_STD_MMU=y
51CONFIG_SERIAL_CONSOLE=y
52# CONFIG_PPC_MULTIPLATFORM is not set
53CONFIG_APUS=y
54# CONFIG_WILLOW_2 is not set
55# CONFIG_PCORE is not set
56# CONFIG_POWERPMC250 is not set
57# CONFIG_EV64260 is not set
58# CONFIG_SPRUCE is not set
59# CONFIG_LOPEC is not set
60# CONFIG_MCPN765 is not set
61# CONFIG_MVME5100 is not set
62# CONFIG_PPLUS is not set
63# CONFIG_PRPMC750 is not set
64# CONFIG_PRPMC800 is not set
65# CONFIG_SANDPOINT is not set
66# CONFIG_ADIR is not set
67# CONFIG_K2 is not set
68# CONFIG_PAL4 is not set
69# CONFIG_GEMINI is not set
70# CONFIG_SMP is not set
71# CONFIG_PREEMPT is not set
72# CONFIG_ALTIVEC is not set
73# CONFIG_TAU is not set
74# CONFIG_CPU_FREQ is not set
75
76#
77# General setup
78#
79# CONFIG_HIGHMEM is not set
80CONFIG_PCI=y
81CONFIG_PCI_DOMAINS=y
82CONFIG_PCI_PERMEDIA=y
83CONFIG_KCORE_ELF=y
84CONFIG_BINFMT_ELF=y
85CONFIG_KERNEL_ELF=y
86CONFIG_BINFMT_MISC=m
87CONFIG_PCI_LEGACY_PROC=y
88CONFIG_PCI_NAMES=y
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94CONFIG_PARPORT=m
95# CONFIG_PARPORT_PC is not set
96CONFIG_PARPORT_AMIGA=m
97# CONFIG_PARPORT_MFC3 is not set
98# CONFIG_PARPORT_OTHER is not set
99# CONFIG_PARPORT_1284 is not set
100CONFIG_PPC601_SYNC_FIX=y
101# CONFIG_CMDLINE_BOOL is not set
102CONFIG_AMIGA=y
103CONFIG_ZORRO=y
104CONFIG_ABSTRACT_CONSOLE=y
105CONFIG_APUS_FAST_EXCEPT=y
106CONFIG_AMIGA_PCMCIA=y
107CONFIG_AMIGA_BUILTIN_SERIAL=y
108CONFIG_GVPIOEXT=y
109CONFIG_GVPIOEXT_LP=m
110CONFIG_GVPIOEXT_PLIP=m
111CONFIG_MULTIFACE_III_TTY=y
112CONFIG_A2232=y
113CONFIG_WHIPPET_SERIAL=y
114CONFIG_APNE=y
115CONFIG_HEARTBEAT=y
116CONFIG_PROC_HARDWARE=y
117CONFIG_ZORRO_NAMES=y
118
119#
120# Advanced setup
121#
122# CONFIG_ADVANCED_OPTIONS is not set
123
124#
125# Default settings for advanced configuration options are used
126#
127CONFIG_HIGHMEM_START=0xfe000000
128CONFIG_LOWMEM_SIZE=0x30000000
129CONFIG_KERNEL_START=0xc0000000
130CONFIG_TASK_SIZE=0x80000000
131CONFIG_BOOT_LOAD=0x00800000
132
133#
134# Memory Technology Devices (MTD)
135#
136# CONFIG_MTD is not set
137
138#
139# Plug and Play support
140#
141# CONFIG_PNP is not set
142
143#
144# Block devices
145#
146# CONFIG_BLK_DEV_FD is not set
147CONFIG_AMIGA_FLOPPY=y
148CONFIG_AMIGA_Z2RAM=m
149# CONFIG_PARIDE is not set
150# CONFIG_BLK_CPQ_DA is not set
151# CONFIG_BLK_CPQ_CISS_DA is not set
152# CONFIG_BLK_DEV_DAC960 is not set
153# CONFIG_BLK_DEV_UMEM is not set
154CONFIG_BLK_DEV_LOOP=y
155CONFIG_BLK_DEV_NBD=m
156CONFIG_BLK_DEV_RAM=y
157CONFIG_BLK_DEV_RAM_SIZE=4096
158CONFIG_BLK_DEV_INITRD=y
159
160#
161# Multi-device support (RAID and LVM)
162#
163CONFIG_MD=y
164CONFIG_BLK_DEV_MD=m
165CONFIG_MD_LINEAR=m
166CONFIG_MD_RAID0=m
167CONFIG_MD_RAID1=m
168CONFIG_MD_RAID5=m
169# CONFIG_MD_MULTIPATH is not set
170CONFIG_BLK_DEV_DM=m
171
172#
173# ATA/IDE/MFM/RLL support
174#
175CONFIG_IDE=y
176
177#
178# IDE, ATA and ATAPI Block devices
179#
180CONFIG_BLK_DEV_IDE=y
181
182#
183# Please see Documentation/ide.txt for help/info on IDE drives
184#
185# CONFIG_BLK_DEV_HD is not set
186CONFIG_BLK_DEV_IDEDISK=y
187# CONFIG_IDEDISK_MULTI_MODE is not set
188# CONFIG_IDEDISK_STROKE is not set
189CONFIG_BLK_DEV_IDECD=y
190CONFIG_BLK_DEV_IDEFLOPPY=y
191CONFIG_BLK_DEV_IDESCSI=m
192# CONFIG_IDE_TASK_IOCTL is not set
193
194#
195# IDE chipset support/bugfixes
196#
197# CONFIG_BLK_DEV_IDEPCI is not set
198CONFIG_BLK_DEV_GAYLE=y
199CONFIG_BLK_DEV_IDEDOUBLER=y
200CONFIG_BLK_DEV_BUDDHA=y
201
202#
203# SCSI support
204#
205CONFIG_SCSI=y
206
207#
208# SCSI support type (disk, tape, CD-ROM)
209#
210CONFIG_BLK_DEV_SD=y
211CONFIG_CHR_DEV_ST=m
212CONFIG_CHR_DEV_OSST=m
213CONFIG_BLK_DEV_SR=y
214CONFIG_BLK_DEV_SR_VENDOR=y
215CONFIG_CHR_DEV_SG=m
216
217#
218# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
219#
220# CONFIG_SCSI_MULTI_LUN is not set
221# CONFIG_SCSI_REPORT_LUNS is not set
222CONFIG_SCSI_CONSTANTS=y
223CONFIG_SCSI_LOGGING=y
224
225#
226# SCSI low-level drivers
227#
228# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
229# CONFIG_SCSI_ACARD is not set
230# CONFIG_SCSI_AACRAID is not set
231# CONFIG_SCSI_AIC7XXX is not set
232# CONFIG_SCSI_AIC7XXX_OLD is not set
233# CONFIG_SCSI_AIC79XX is not set
234# CONFIG_SCSI_DPT_I2O is not set
235# CONFIG_SCSI_ADVANSYS is not set
236# CONFIG_SCSI_IN2000 is not set
237# CONFIG_SCSI_AM53C974 is not set
238# CONFIG_SCSI_MEGARAID is not set
239# CONFIG_SCSI_BUSLOGIC is not set
240# CONFIG_SCSI_CPQFCTS is not set
241# CONFIG_SCSI_DMX3191D is not set
242# CONFIG_SCSI_EATA is not set
243# CONFIG_SCSI_EATA_PIO is not set
244# CONFIG_SCSI_FUTURE_DOMAIN is not set
245# CONFIG_SCSI_GDTH is not set
246# CONFIG_SCSI_GENERIC_NCR5380 is not set
247# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
248# CONFIG_SCSI_INITIO is not set
249# CONFIG_SCSI_INIA100 is not set
250# CONFIG_SCSI_PPA is not set
251# CONFIG_SCSI_IMM is not set
252# CONFIG_SCSI_NCR53C7xx is not set
253# CONFIG_SCSI_SYM53C8XX_2 is not set
254# CONFIG_SCSI_NCR53C8XX is not set
255# CONFIG_SCSI_SYM53C8XX is not set
256# CONFIG_SCSI_PCI2000 is not set
257# CONFIG_SCSI_PCI2220I is not set
258# CONFIG_SCSI_QLOGIC_ISP is not set
259# CONFIG_SCSI_QLOGIC_FC is not set
260# CONFIG_SCSI_QLOGIC_1280 is not set
261# CONFIG_SCSI_DC395x is not set
262# CONFIG_SCSI_DC390T is not set
263# CONFIG_SCSI_U14_34F is not set
264# CONFIG_SCSI_NSP32 is not set
265# CONFIG_SCSI_DEBUG is not set
266CONFIG_A3000_SCSI=y
267CONFIG_A4000T_SCSI=y
268CONFIG_A2091_SCSI=y
269CONFIG_GVP11_SCSI=y
270CONFIG_CYBERSTORM_SCSI=y
271CONFIG_CYBERSTORMII_SCSI=y
272CONFIG_BLZ2060_SCSI=y
273CONFIG_BLZ1230_SCSI=y
274CONFIG_FASTLANE_SCSI=y
275CONFIG_A4091_SCSI=y
276CONFIG_WARPENGINE_SCSI=y
277CONFIG_BLZ603EPLUS_SCSI=y
278CONFIG_OKTAGON_SCSI=y
279
280#
281# Fusion MPT device support
282#
283# CONFIG_FUSION is not set
284
285#
286# IEEE 1394 (FireWire) support (EXPERIMENTAL)
287#
288# CONFIG_IEEE1394 is not set
289
290#
291# I2O device support
292#
293# CONFIG_I2O is not set
294
295#
296# Networking support
297#
298CONFIG_NET=y
299
300#
301# Networking options
302#
303CONFIG_PACKET=m
304CONFIG_PACKET_MMAP=y
305CONFIG_NETLINK_DEV=m
306CONFIG_NETFILTER=y
307# CONFIG_NETFILTER_DEBUG is not set
308CONFIG_UNIX=y
309# CONFIG_NET_KEY is not set
310CONFIG_INET=y
311# CONFIG_IP_MULTICAST is not set
312# CONFIG_IP_ADVANCED_ROUTER is not set
313# CONFIG_IP_PNP is not set
314# CONFIG_NET_IPIP is not set
315# CONFIG_NET_IPGRE is not set
316# CONFIG_ARPD is not set
317# CONFIG_INET_ECN is not set
318CONFIG_SYN_COOKIES=y
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322
323#
324# IP: Netfilter Configuration
325#
326CONFIG_IP_NF_CONNTRACK=m
327CONFIG_IP_NF_FTP=m
328CONFIG_IP_NF_IRC=m
329CONFIG_IP_NF_TFTP=m
330CONFIG_IP_NF_AMANDA=m
331CONFIG_IP_NF_QUEUE=m
332CONFIG_IP_NF_IPTABLES=m
333CONFIG_IP_NF_MATCH_LIMIT=m
334CONFIG_IP_NF_MATCH_MAC=m
335# CONFIG_IP_NF_MATCH_PKTTYPE is not set
336CONFIG_IP_NF_MATCH_MARK=m
337CONFIG_IP_NF_MATCH_MULTIPORT=m
338CONFIG_IP_NF_MATCH_TOS=m
339# CONFIG_IP_NF_MATCH_ECN is not set
340# CONFIG_IP_NF_MATCH_DSCP is not set
341# CONFIG_IP_NF_MATCH_AH_ESP is not set
342CONFIG_IP_NF_MATCH_LENGTH=m
343CONFIG_IP_NF_MATCH_TTL=m
344CONFIG_IP_NF_MATCH_TCPMSS=m
345CONFIG_IP_NF_MATCH_HELPER=m
346CONFIG_IP_NF_MATCH_STATE=m
347CONFIG_IP_NF_MATCH_CONNTRACK=m
348CONFIG_IP_NF_MATCH_UNCLEAN=m
349CONFIG_IP_NF_MATCH_OWNER=m
350CONFIG_IP_NF_FILTER=m
351CONFIG_IP_NF_TARGET_REJECT=m
352CONFIG_IP_NF_TARGET_MIRROR=m
353CONFIG_IP_NF_NAT=m
354CONFIG_IP_NF_NAT_NEEDED=y
355CONFIG_IP_NF_TARGET_MASQUERADE=m
356CONFIG_IP_NF_TARGET_REDIRECT=m
357CONFIG_IP_NF_NAT_SNMP_BASIC=m
358CONFIG_IP_NF_NAT_IRC=m
359CONFIG_IP_NF_NAT_FTP=m
360CONFIG_IP_NF_NAT_TFTP=m
361CONFIG_IP_NF_NAT_AMANDA=m
362CONFIG_IP_NF_MANGLE=m
363CONFIG_IP_NF_TARGET_TOS=m
364CONFIG_IP_NF_TARGET_ECN=m
365CONFIG_IP_NF_TARGET_DSCP=m
366CONFIG_IP_NF_TARGET_MARK=m
367CONFIG_IP_NF_TARGET_LOG=m
368CONFIG_IP_NF_TARGET_ULOG=m
369CONFIG_IP_NF_TARGET_TCPMSS=m
370CONFIG_IP_NF_ARPTABLES=m
371CONFIG_IP_NF_ARPFILTER=m
372CONFIG_IP_NF_COMPAT_IPCHAINS=m
373# CONFIG_IP_NF_COMPAT_IPFWADM is not set
374# CONFIG_IPV6 is not set
375# CONFIG_XFRM_USER is not set
376
377#
378# SCTP Configuration (EXPERIMENTAL)
379#
380CONFIG_IPV6_SCTP__=y
381# CONFIG_IP_SCTP is not set
382# CONFIG_ATM is not set
383# CONFIG_VLAN_8021Q is not set
384# CONFIG_LLC is not set
385# CONFIG_DECNET is not set
386# CONFIG_BRIDGE is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_NET_DIVERT is not set
390# CONFIG_ECONET is not set
391# CONFIG_WAN_ROUTER is not set
392# CONFIG_NET_HW_FLOWCONTROL is not set
393
394#
395# QoS and/or fair queueing
396#
397# CONFIG_NET_SCHED is not set
398
399#
400# Network testing
401#
402# CONFIG_NET_PKTGEN is not set
403CONFIG_NETDEVICES=y
404
405#
406# ARCnet devices
407#
408# CONFIG_ARCNET is not set
409CONFIG_DUMMY=m
410# CONFIG_BONDING is not set
411# CONFIG_EQUALIZER is not set
412CONFIG_TUN=m
413# CONFIG_ETHERTAP is not set
414
415#
416# Ethernet (10 or 100Mbit)
417#
418CONFIG_NET_ETHERNET=y
419# CONFIG_MII is not set
420# CONFIG_OAKNET is not set
421CONFIG_ARIADNE=y
422# CONFIG_ZORRO8390 is not set
423CONFIG_A2065=y
424CONFIG_HYDRA=y
425# CONFIG_HAPPYMEAL is not set
426# CONFIG_SUNGEM is not set
427# CONFIG_NET_VENDOR_3COM is not set
428
429#
430# Tulip family network device support
431#
432# CONFIG_NET_TULIP is not set
433# CONFIG_HP100 is not set
434# CONFIG_NET_PCI is not set
435
436#
437# Ethernet (1000 Mbit)
438#
439# CONFIG_ACENIC is not set
440# CONFIG_DL2K is not set
441# CONFIG_E1000 is not set
442# CONFIG_NS83820 is not set
443# CONFIG_HAMACHI is not set
444# CONFIG_YELLOWFIN is not set
445# CONFIG_R8169 is not set
446# CONFIG_SK98LIN is not set
447# CONFIG_TIGON3 is not set
448
449#
450# Ethernet (10000 Mbit)
451#
452# CONFIG_IXGB is not set
453# CONFIG_FDDI is not set
454# CONFIG_HIPPI is not set
455CONFIG_PLIP=m
456CONFIG_PPP=y
457CONFIG_PPP_MULTILINK=y
458CONFIG_PPP_FILTER=y
459CONFIG_PPP_ASYNC=y
460CONFIG_PPP_SYNC_TTY=y
461CONFIG_PPP_DEFLATE=y
462CONFIG_PPP_BSDCOMP=y
463CONFIG_PPPOE=y
464CONFIG_SLIP=y
465CONFIG_SLIP_COMPRESSED=y
466CONFIG_SLIP_SMART=y
467CONFIG_SLIP_MODE_SLIP6=y
468
469#
470# Wireless LAN (non-hamradio)
471#
472# CONFIG_NET_RADIO is not set
473
474#
475# Token Ring devices (depends on LLC=y)
476#
477# CONFIG_NET_FC is not set
478# CONFIG_RCPCI is not set
479# CONFIG_SHAPER is not set
480
481#
482# Wan interfaces
483#
484# CONFIG_WAN is not set
485
486#
487# Amateur Radio support
488#
489# CONFIG_HAMRADIO is not set
490
491#
492# IrDA (infrared) support
493#
494# CONFIG_IRDA is not set
495
496#
497# ISDN subsystem
498#
499# CONFIG_ISDN_BOOL is not set
500
501#
502# Graphics support
503#
504CONFIG_FB=y
505# CONFIG_FB_CIRRUS is not set
506CONFIG_FB_PM2=y
507# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
508# CONFIG_FB_PM2_PCI is not set
509CONFIG_FB_PM2_CVPPC=y
510CONFIG_FB_CYBER2000=y
511CONFIG_FB_AMIGA=y
512CONFIG_FB_AMIGA_OCS=y
513CONFIG_FB_AMIGA_ECS=y
514CONFIG_FB_AMIGA_AGA=y
515CONFIG_FB_CYBER=y
516CONFIG_FB_VIRGE=y
517CONFIG_FB_RETINAZ3=y
518CONFIG_FB_FM2=y
519# CONFIG_FB_CT65550 is not set
520# CONFIG_FB_IMSTT is not set
521# CONFIG_FB_S3TRIO is not set
522# CONFIG_FB_VGA16 is not set
523# CONFIG_FB_RIVA is not set
524# CONFIG_FB_MATROX is not set
525# CONFIG_FB_RADEON is not set
526# CONFIG_FB_ATY128 is not set
527# CONFIG_FB_ATY is not set
528# CONFIG_FB_SIS is not set
529# CONFIG_FB_NEOMAGIC is not set
530# CONFIG_FB_3DFX is not set
531# CONFIG_FB_VOODOO1 is not set
532# CONFIG_FB_TRIDENT is not set
533# CONFIG_FB_PM3 is not set
534# CONFIG_FB_VIRTUAL is not set
535
536#
537# Logo configuration
538#
539CONFIG_LOGO=y
540CONFIG_LOGO_LINUX_MONO=y
541CONFIG_LOGO_LINUX_VGA16=y
542CONFIG_LOGO_LINUX_CLUT224=y
543
544#
545# Old CD-ROM drivers (not SCSI, not IDE)
546#
547# CONFIG_CD_NO_IDESCSI is not set
548
549#
550# Input device support
551#
552CONFIG_INPUT=m
553
554#
555# Userland interfaces
556#
557CONFIG_INPUT_MOUSEDEV=m
558CONFIG_INPUT_MOUSEDEV_PSAUX=y
559CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
560CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
561CONFIG_INPUT_JOYDEV=m
562# CONFIG_INPUT_TSDEV is not set
563CONFIG_INPUT_EVDEV=m
564CONFIG_INPUT_EVBUG=m
565
566#
567# Input I/O drivers
568#
569# CONFIG_GAMEPORT is not set
570CONFIG_SOUND_GAMEPORT=y
571CONFIG_SERIO=y
572# CONFIG_SERIO_I8042 is not set
573CONFIG_SERIO_SERPORT=y
574# CONFIG_SERIO_CT82C710 is not set
575# CONFIG_SERIO_PARKBD is not set
576
577#
578# Input Device Drivers
579#
580CONFIG_INPUT_KEYBOARD=y
581CONFIG_KEYBOARD_ATKBD=m
582# CONFIG_KEYBOARD_SUNKBD is not set
583# CONFIG_KEYBOARD_XTKBD is not set
584# CONFIG_KEYBOARD_NEWTON is not set
585CONFIG_KEYBOARD_AMIGA=m
586CONFIG_INPUT_MOUSE=y
587CONFIG_MOUSE_PS2=m
588CONFIG_MOUSE_SERIAL=m
589CONFIG_MOUSE_AMIGA=m
590# CONFIG_INPUT_JOYSTICK is not set
591# CONFIG_INPUT_TOUCHSCREEN is not set
592CONFIG_INPUT_MISC=y
593# CONFIG_INPUT_PCSPKR is not set
594CONFIG_INPUT_UINPUT=m
595
596#
597# Macintosh device drivers
598#
599
600#
601# Character devices
602#
603# CONFIG_SERIAL_NONSTANDARD is not set
604
605#
606# Serial drivers
607#
608# CONFIG_SERIAL_8250 is not set
609
610#
611# Non-8250 serial port support
612#
613CONFIG_UNIX98_PTYS=y
614CONFIG_UNIX98_PTY_COUNT=256
615CONFIG_PRINTER=m
616# CONFIG_LP_CONSOLE is not set
617# CONFIG_PPDEV is not set
618# CONFIG_TIPAR is not set
619
620#
621# I2C support
622#
623# CONFIG_I2C is not set
624
625#
626# I2C Hardware Sensors Mainboard support
627#
628
629#
630# I2C Hardware Sensors Chip support
631#
632# CONFIG_I2C_SENSOR is not set
633
634#
635# Mice
636#
637CONFIG_BUSMOUSE=y
638# CONFIG_QIC02_TAPE is not set
639
640#
641# IPMI
642#
643# CONFIG_IPMI_HANDLER is not set
644
645#
646# Watchdog Cards
647#
648# CONFIG_WATCHDOG is not set
649# CONFIG_NVRAM is not set
650CONFIG_GEN_RTC=y
651# CONFIG_GEN_RTC_X is not set
652# CONFIG_DTLK is not set
653# CONFIG_R3964 is not set
654# CONFIG_APPLICOM is not set
655
656#
657# Ftape, the floppy tape device driver
658#
659# CONFIG_FTAPE is not set
660# CONFIG_AGP is not set
661# CONFIG_DRM is not set
662# CONFIG_RAW_DRIVER is not set
663# CONFIG_HANGCHECK_TIMER is not set
664
665#
666# Multimedia devices
667#
668# CONFIG_VIDEO_DEV is not set
669
670#
671# Digital Video Broadcasting Devices
672#
673# CONFIG_DVB is not set
674
675#
676# File systems
677#
678CONFIG_EXT2_FS=y
679# CONFIG_EXT2_FS_XATTR is not set
680CONFIG_EXT3_FS=y
681CONFIG_EXT3_FS_XATTR=y
682# CONFIG_EXT3_FS_POSIX_ACL is not set
683# CONFIG_EXT3_FS_SECURITY is not set
684CONFIG_JBD=y
685# CONFIG_JBD_DEBUG is not set
686CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set
689# CONFIG_XFS_FS is not set
690CONFIG_MINIX_FS=y
691CONFIG_ROMFS_FS=y
692# CONFIG_QUOTA is not set
693CONFIG_AUTOFS_FS=m
694CONFIG_AUTOFS4_FS=m
695
696#
697# CD-ROM/DVD Filesystems
698#
699CONFIG_ISO9660_FS=y
700CONFIG_JOLIET=y
701# CONFIG_ZISOFS is not set
702# CONFIG_UDF_FS is not set
703
704#
705# DOS/FAT/NT Filesystems
706#
707CONFIG_FAT_FS=y
708CONFIG_MSDOS_FS=y
709CONFIG_VFAT_FS=y
710# CONFIG_NTFS_FS is not set
711
712#
713# Pseudo filesystems
714#
715CONFIG_PROC_FS=y
716# CONFIG_DEVFS_FS is not set
717CONFIG_DEVPTS_FS=y
718# CONFIG_DEVPTS_FS_XATTR is not set
719CONFIG_TMPFS=y
720CONFIG_RAMFS=y
721
722#
723# Miscellaneous filesystems
724#
725# CONFIG_ADFS_FS is not set
726CONFIG_AFFS_FS=y
727CONFIG_HFS_FS=y
728# CONFIG_BEFS_FS is not set
729# CONFIG_BFS_FS is not set
730# CONFIG_EFS_FS is not set
731CONFIG_CRAMFS=y
732# CONFIG_VXFS_FS is not set
733# CONFIG_HPFS_FS is not set
734# CONFIG_QNX4FS_FS is not set
735# CONFIG_SYSV_FS is not set
736# CONFIG_UFS_FS is not set
737
738#
739# Network File Systems
740#
741CONFIG_NFS_FS=y
742CONFIG_NFS_V3=y
743# CONFIG_NFS_V4 is not set
744CONFIG_NFSD=m
745CONFIG_NFSD_V3=y
746# CONFIG_NFSD_V4 is not set
747# CONFIG_NFSD_TCP is not set
748CONFIG_LOCKD=y
749CONFIG_LOCKD_V4=y
750CONFIG_EXPORTFS=m
751CONFIG_SUNRPC=y
752# CONFIG_SUNRPC_GSS is not set
753CONFIG_SMB_FS=m
754# CONFIG_SMB_NLS_DEFAULT is not set
755# CONFIG_CIFS is not set
756# CONFIG_NCP_FS is not set
757CONFIG_CODA_FS=m
758# CONFIG_INTERMEZZO_FS is not set
759# CONFIG_AFS_FS is not set
760
761#
762# Partition Types
763#
764CONFIG_PARTITION_ADVANCED=y
765# CONFIG_ACORN_PARTITION is not set
766# CONFIG_OSF_PARTITION is not set
767CONFIG_AMIGA_PARTITION=y
768CONFIG_ATARI_PARTITION=y
769# CONFIG_MAC_PARTITION is not set
770CONFIG_MSDOS_PARTITION=y
771CONFIG_BSD_DISKLABEL=y
772# CONFIG_MINIX_SUBPARTITION is not set
773CONFIG_SOLARIS_X86_PARTITION=y
774CONFIG_UNIXWARE_DISKLABEL=y
775# CONFIG_LDM_PARTITION is not set
776# CONFIG_NEC98_PARTITION is not set
777# CONFIG_SGI_PARTITION is not set
778# CONFIG_ULTRIX_PARTITION is not set
779# CONFIG_SUN_PARTITION is not set
780# CONFIG_EFI_PARTITION is not set
781CONFIG_SMB_NLS=y
782CONFIG_NLS=y
783
784#
785# Native Language Support
786#
787CONFIG_NLS_DEFAULT="iso8859-1"
788CONFIG_NLS_CODEPAGE_437=m
789CONFIG_NLS_CODEPAGE_737=m
790CONFIG_NLS_CODEPAGE_775=m
791CONFIG_NLS_CODEPAGE_850=m
792CONFIG_NLS_CODEPAGE_852=m
793CONFIG_NLS_CODEPAGE_855=m
794CONFIG_NLS_CODEPAGE_857=m
795CONFIG_NLS_CODEPAGE_860=m
796CONFIG_NLS_CODEPAGE_861=m
797CONFIG_NLS_CODEPAGE_862=m
798CONFIG_NLS_CODEPAGE_863=m
799CONFIG_NLS_CODEPAGE_864=m
800CONFIG_NLS_CODEPAGE_865=m
801CONFIG_NLS_CODEPAGE_866=m
802CONFIG_NLS_CODEPAGE_869=m
803CONFIG_NLS_CODEPAGE_936=m
804CONFIG_NLS_CODEPAGE_950=m
805CONFIG_NLS_CODEPAGE_932=m
806CONFIG_NLS_CODEPAGE_949=m
807CONFIG_NLS_CODEPAGE_874=m
808CONFIG_NLS_ISO8859_8=m
809# CONFIG_NLS_CODEPAGE_1250 is not set
810CONFIG_NLS_CODEPAGE_1251=m
811CONFIG_NLS_ISO8859_1=m
812CONFIG_NLS_ISO8859_2=m
813CONFIG_NLS_ISO8859_3=m
814CONFIG_NLS_ISO8859_4=m
815CONFIG_NLS_ISO8859_5=m
816CONFIG_NLS_ISO8859_6=m
817CONFIG_NLS_ISO8859_7=m
818CONFIG_NLS_ISO8859_9=m
819CONFIG_NLS_ISO8859_13=m
820CONFIG_NLS_ISO8859_14=m
821CONFIG_NLS_ISO8859_15=m
822CONFIG_NLS_KOI8_R=m
823CONFIG_NLS_KOI8_U=m
824CONFIG_NLS_UTF8=m
825
826#
827# Sound
828#
829CONFIG_SOUND=y
830CONFIG_DMASOUND_PAULA=m
831CONFIG_DMASOUND=m
832
833#
834# Advanced Linux Sound Architecture
835#
836# CONFIG_SND is not set
837
838#
839# Open Sound System
840#
841CONFIG_SOUND_PRIME=m
842# CONFIG_SOUND_BT878 is not set
843# CONFIG_SOUND_CMPCI is not set
844# CONFIG_SOUND_EMU10K1 is not set
845# CONFIG_SOUND_FUSION is not set
846# CONFIG_SOUND_CS4281 is not set
847# CONFIG_SOUND_ES1370 is not set
848# CONFIG_SOUND_ES1371 is not set
849# CONFIG_SOUND_ESSSOLO1 is not set
850# CONFIG_SOUND_MAESTRO is not set
851# CONFIG_SOUND_MAESTRO3 is not set
852# CONFIG_SOUND_ICH is not set
853# CONFIG_SOUND_RME96XX is not set
854# CONFIG_SOUND_SONICVIBES is not set
855# CONFIG_SOUND_TRIDENT is not set
856# CONFIG_SOUND_MSNDCLAS is not set
857# CONFIG_SOUND_MSNDPIN is not set
858# CONFIG_SOUND_VIA82CXXX is not set
859CONFIG_SOUND_OSS=m
860CONFIG_SOUND_TRACEINIT=y
861CONFIG_SOUND_DMAP=y
862# CONFIG_SOUND_AD1816 is not set
863# CONFIG_SOUND_SGALAXY is not set
864# CONFIG_SOUND_ADLIB is not set
865# CONFIG_SOUND_ACI_MIXER is not set
866# CONFIG_SOUND_CS4232 is not set
867# CONFIG_SOUND_SSCAPE is not set
868# CONFIG_SOUND_GUS is not set
869CONFIG_SOUND_VMIDI=m
870# CONFIG_SOUND_TRIX is not set
871# CONFIG_SOUND_MSS is not set
872# CONFIG_SOUND_MPU401 is not set
873# CONFIG_SOUND_NM256 is not set
874# CONFIG_SOUND_MAD16 is not set
875# CONFIG_SOUND_PAS is not set
876# CONFIG_SOUND_PSS is not set
877# CONFIG_SOUND_SB is not set
878# CONFIG_SOUND_AWE32_SYNTH is not set
879# CONFIG_SOUND_WAVEFRONT is not set
880# CONFIG_SOUND_MAUI is not set
881# CONFIG_SOUND_YM3812 is not set
882# CONFIG_SOUND_OPL3SA1 is not set
883# CONFIG_SOUND_OPL3SA2 is not set
884# CONFIG_SOUND_YMFPCI is not set
885# CONFIG_SOUND_UART6850 is not set
886# CONFIG_SOUND_AEDSP16 is not set
887
888#
889# USB support
890#
891# CONFIG_USB is not set
892# CONFIG_USB_GADGET is not set
893
894#
895# Bluetooth support
896#
897# CONFIG_BT is not set
898
899#
900# Library routines
901#
902# CONFIG_CRC32 is not set
903CONFIG_ZLIB_INFLATE=y
904CONFIG_ZLIB_DEFLATE=y
905
906#
907# Kernel hacking
908#
909# CONFIG_DEBUG_KERNEL is not set
910# CONFIG_KALLSYMS is not set
911
912#
913# Security options
914#
915# CONFIG_SECURITY is not set
916
917#
918# Cryptographic options
919#
920# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index c7cb9d5f24a3..1b0ec7202dd5 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -32,10 +32,6 @@
32#include <asm/ppc_asm.h> 32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
34 34
35#ifdef CONFIG_APUS
36#include <asm/amigappc.h>
37#endif
38
39/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 35/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
40#define LOAD_BAT(n, reg, RA, RB) \ 36#define LOAD_BAT(n, reg, RA, RB) \
41 /* see the comment for clear_bats() -- Cort */ \ 37 /* see the comment for clear_bats() -- Cort */ \
@@ -128,14 +124,6 @@ __start:
128 */ 124 */
129 bl early_init 125 bl early_init
130 126
131#ifdef CONFIG_APUS
132/* On APUS the __va/__pa constants need to be set to the correct
133 * values before continuing.
134 */
135 mr r4,r30
136 bl fix_mem_constants
137#endif /* CONFIG_APUS */
138
139/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains 127/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
140 * the physical address we are running at, returned by early_init() 128 * the physical address we are running at, returned by early_init()
141 */ 129 */
@@ -145,7 +133,7 @@ __after_mmu_off:
145 bl flush_tlbs 133 bl flush_tlbs
146 134
147 bl initial_bats 135 bl initial_bats
148#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 136#ifdef CONFIG_BOOTX_TEXT
149 bl setup_disp_bat 137 bl setup_disp_bat
150#endif 138#endif
151 139
@@ -161,7 +149,6 @@ __after_mmu_off:
161#endif /* CONFIG_6xx */ 149#endif /* CONFIG_6xx */
162 150
163 151
164#ifndef CONFIG_APUS
165/* 152/*
166 * We need to run with _start at physical address 0. 153 * We need to run with _start at physical address 0.
167 * If the MMU is already turned on, we copy stuff to KERNELBASE, 154 * If the MMU is already turned on, we copy stuff to KERNELBASE,
@@ -172,7 +159,7 @@ __after_mmu_off:
172 addis r4,r3,KERNELBASE@h /* current address of _start */ 159 addis r4,r3,KERNELBASE@h /* current address of _start */
173 cmpwi 0,r4,0 /* are we already running at 0? */ 160 cmpwi 0,r4,0 /* are we already running at 0? */
174 bne relocate_kernel 161 bne relocate_kernel
175#endif /* CONFIG_APUS */ 162
176/* 163/*
177 * we now have the 1st 16M of ram mapped with the bats. 164 * we now have the 1st 16M of ram mapped with the bats.
178 * prep needs the mmu to be turned on here, but pmac already has it on. 165 * prep needs the mmu to be turned on here, but pmac already has it on.
@@ -812,85 +799,6 @@ copy_and_flush:
812 addi r6,r6,4 799 addi r6,r6,4
813 blr 800 blr
814 801
815#ifdef CONFIG_APUS
816/*
817 * On APUS the physical base address of the kernel is not known at compile
818 * time, which means the __pa/__va constants used are incorrect. In the
819 * __init section is recorded the virtual addresses of instructions using
820 * these constants, so all that has to be done is fix these before
821 * continuing the kernel boot.
822 *
823 * r4 = The physical address of the kernel base.
824 */
825fix_mem_constants:
826 mr r10,r4
827 addis r10,r10,-KERNELBASE@h /* virt_to_phys constant */
828 neg r11,r10 /* phys_to_virt constant */
829
830 lis r12,__vtop_table_begin@h
831 ori r12,r12,__vtop_table_begin@l
832 add r12,r12,r10 /* table begin phys address */
833 lis r13,__vtop_table_end@h
834 ori r13,r13,__vtop_table_end@l
835 add r13,r13,r10 /* table end phys address */
836 subi r12,r12,4
837 subi r13,r13,4
8381: lwzu r14,4(r12) /* virt address of instruction */
839 add r14,r14,r10 /* phys address of instruction */
840 lwz r15,0(r14) /* instruction, now insert top */
841 rlwimi r15,r10,16,16,31 /* half of vp const in low half */
842 stw r15,0(r14) /* of instruction and restore. */
843 dcbst r0,r14 /* write it to memory */
844 sync
845 icbi r0,r14 /* flush the icache line */
846 cmpw r12,r13
847 bne 1b
848 sync /* additional sync needed on g4 */
849 isync
850
851/*
852 * Map the memory where the exception handlers will
853 * be copied to when hash constants have been patched.
854 */
855#ifdef CONFIG_APUS_FAST_EXCEPT
856 lis r8,0xfff0
857#else
858 lis r8,0
859#endif
860 ori r8,r8,0x2 /* 128KB, supervisor */
861 mtspr SPRN_DBAT3U,r8
862 mtspr SPRN_DBAT3L,r8
863
864 lis r12,__ptov_table_begin@h
865 ori r12,r12,__ptov_table_begin@l
866 add r12,r12,r10 /* table begin phys address */
867 lis r13,__ptov_table_end@h
868 ori r13,r13,__ptov_table_end@l
869 add r13,r13,r10 /* table end phys address */
870 subi r12,r12,4
871 subi r13,r13,4
8721: lwzu r14,4(r12) /* virt address of instruction */
873 add r14,r14,r10 /* phys address of instruction */
874 lwz r15,0(r14) /* instruction, now insert top */
875 rlwimi r15,r11,16,16,31 /* half of pv const in low half*/
876 stw r15,0(r14) /* of instruction and restore. */
877 dcbst r0,r14 /* write it to memory */
878 sync
879 icbi r0,r14 /* flush the icache line */
880 cmpw r12,r13
881 bne 1b
882
883 sync /* additional sync needed on g4 */
884 isync /* No speculative loading until now */
885 blr
886
887/***********************************************************************
888 * Please note that on APUS the exception handlers are located at the
889 * physical address 0xfff0000. For this reason, the exception handlers
890 * cannot use relative branches to access the code below.
891 ***********************************************************************/
892#endif /* CONFIG_APUS */
893
894#ifdef CONFIG_SMP 802#ifdef CONFIG_SMP
895 .globl __secondary_start_pmac_0 803 .globl __secondary_start_pmac_0
896__secondary_start_pmac_0: 804__secondary_start_pmac_0:
@@ -1043,19 +951,6 @@ start_here:
1043 bl machine_init 951 bl machine_init
1044 bl MMU_init 952 bl MMU_init
1045 953
1046#ifdef CONFIG_APUS
1047 /* Copy exception code to exception vector base on APUS. */
1048 lis r4,KERNELBASE@h
1049#ifdef CONFIG_APUS_FAST_EXCEPT
1050 lis r3,0xfff0 /* Copy to 0xfff00000 */
1051#else
1052 lis r3,0 /* Copy to 0x00000000 */
1053#endif
1054 li r5,0x4000 /* # bytes of memory to copy */
1055 li r6,0
1056 bl copy_and_flush /* copy the first 0x4000 bytes */
1057#endif /* CONFIG_APUS */
1058
1059/* 954/*
1060 * Go back to running unmapped so we can load up new values 955 * Go back to running unmapped so we can load up new values
1061 * for SDR1 (hash table pointer) and the segment registers 956 * for SDR1 (hash table pointer) and the segment registers
@@ -1232,11 +1127,7 @@ initial_bats:
1232#else 1127#else
1233 ori r8,r8,2 /* R/W access */ 1128 ori r8,r8,2 /* R/W access */
1234#endif /* CONFIG_SMP */ 1129#endif /* CONFIG_SMP */
1235#ifdef CONFIG_APUS
1236 ori r11,r11,BL_8M<<2|0x2 /* set up 8MB BAT registers for 604 */
1237#else
1238 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1130 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1239#endif /* CONFIG_APUS */
1240 1131
1241 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1132 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1242 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1133 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
@@ -1245,7 +1136,7 @@ initial_bats:
1245 isync 1136 isync
1246 blr 1137 blr
1247 1138
1248#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 1139#ifdef CONFIG_BOOTX_TEXT
1249setup_disp_bat: 1140setup_disp_bat:
1250 /* 1141 /*
1251 * setup the display bat prepared for us in prom.c 1142 * setup the display bat prepared for us in prom.c
@@ -1268,7 +1159,7 @@ setup_disp_bat:
1268 mtspr SPRN_IBAT3U,r11 1159 mtspr SPRN_IBAT3U,r11
1269 blr 1160 blr
1270 1161
1271#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1162#endif /* defined(CONFIG_BOOTX_TEXT) */
1272 1163
1273#ifdef CONFIG_8260 1164#ifdef CONFIG_8260
1274/* Jump into the system reset for the rom. 1165/* Jump into the system reset for the rom.
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 63f0a987139b..22494ec123ea 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -60,8 +60,6 @@ long long __ashrdi3(long long, int);
60long long __ashldi3(long long, int); 60long long __ashldi3(long long, int);
61long long __lshrdi3(long long, int); 61long long __lshrdi3(long long, int);
62 62
63extern unsigned long mm_ptov (unsigned long paddr);
64
65EXPORT_SYMBOL(clear_pages); 63EXPORT_SYMBOL(clear_pages);
66EXPORT_SYMBOL(clear_user_page); 64EXPORT_SYMBOL(clear_user_page);
67EXPORT_SYMBOL(transfer_to_handler); 65EXPORT_SYMBOL(transfer_to_handler);
@@ -118,7 +116,6 @@ EXPORT_SYMBOL(_outsw_ns);
118EXPORT_SYMBOL(_insl_ns); 116EXPORT_SYMBOL(_insl_ns);
119EXPORT_SYMBOL(_outsl_ns); 117EXPORT_SYMBOL(_outsl_ns);
120EXPORT_SYMBOL(iopa); 118EXPORT_SYMBOL(iopa);
121EXPORT_SYMBOL(mm_ptov);
122EXPORT_SYMBOL(ioremap); 119EXPORT_SYMBOL(ioremap);
123#ifdef CONFIG_44x 120#ifdef CONFIG_44x
124EXPORT_SYMBOL(ioremap64); 121EXPORT_SYMBOL(ioremap64);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 967c1ef59a6b..aac88c2f3db9 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -25,7 +25,6 @@
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/amigappc.h>
29#include <asm/smp.h> 28#include <asm/smp.h>
30#include <asm/elf.h> 29#include <asm/elf.h>
31#include <asm/cputable.h> 30#include <asm/cputable.h>
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 35ebb6395ae3..1f51e6c94507 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -426,41 +426,3 @@ unsigned long iopa(unsigned long addr)
426 return(pa); 426 return(pa);
427} 427}
428 428
429/* This is will find the virtual address for a physical one....
430 * Swiped from APUS, could be dangerous :-).
431 * This is only a placeholder until I really find a way to make this
432 * work. -- Dan
433 */
434unsigned long
435mm_ptov (unsigned long paddr)
436{
437 unsigned long ret;
438#if 0
439 if (paddr < 16*1024*1024)
440 ret = ZTWO_VADDR(paddr);
441 else {
442 int i;
443
444 for (i = 0; i < kmap_chunk_count;){
445 unsigned long phys = kmap_chunks[i++];
446 unsigned long size = kmap_chunks[i++];
447 unsigned long virt = kmap_chunks[i++];
448 if (paddr >= phys
449 && paddr < (phys + size)){
450 ret = virt + paddr - phys;
451 goto exit;
452 }
453 }
454
455 ret = (unsigned long) __va(paddr);
456 }
457exit:
458#ifdef DEBUGPV
459 printk ("PTOV(%lx)=%lx\n", paddr, ret);
460#endif
461#else
462 ret = (unsigned long)paddr + KERNELBASE;
463#endif
464 return ret;
465}
466
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index e17fad470621..40f53fbe6d35 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,10 +2,6 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-$(CONFIG_APUS) += apus_setup.o
6ifeq ($(CONFIG_APUS),y)
7obj-$(CONFIG_PCI) += apus_pci.o
8endif
9obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 5obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
10obj-$(CONFIG_PREP_RESIDUAL) += residual.o 6obj-$(CONFIG_PREP_RESIDUAL) += residual.o
11obj-$(CONFIG_PQ2ADS) += pq2ads.o 7obj-$(CONFIG_PQ2ADS) += pq2ads.o
diff --git a/arch/ppc/platforms/apus_pci.c b/arch/ppc/platforms/apus_pci.c
deleted file mode 100644
index dc165f0c8908..000000000000
--- a/arch/ppc/platforms/apus_pci.c
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * Copyright (C) Michel Dänzer <michdaen@iiic.ethz.ch>
3 *
4 * APUS PCI routines.
5 *
6 * Currently, only B/CVisionPPC cards (Permedia2) are supported.
7 *
8 * Thanks to Geert Uytterhoeven for the idea:
9 * Read values from given config space(s) for the first devices, -1 otherwise
10 *
11 */
12
13#ifdef CONFIG_AMIGA
14
15#include <linux/kernel.h>
16#include <linux/pci.h>
17#include <linux/delay.h>
18#include <linux/string.h>
19#include <linux/init.h>
20
21#include <asm/io.h>
22#include <asm/pci-bridge.h>
23#include <asm/machdep.h>
24
25#include "apus_pci.h"
26
27
28/* These definitions are mostly adapted from pm2fb.c */
29
30#undef APUS_PCI_MASTER_DEBUG
31#ifdef APUS_PCI_MASTER_DEBUG
32#define DPRINTK(a,b...) printk(KERN_DEBUG "apus_pci: %s: " a, __FUNCTION__ , ## b)
33#else
34#define DPRINTK(a,b...)
35#endif
36
37/*
38 * The _DEFINITIVE_ memory mapping/unmapping functions.
39 * This is due to the fact that they're changing soooo often...
40 */
41#define DEFW() wmb()
42#define DEFR() rmb()
43#define DEFRW() mb()
44
45#define DEVNO(d) ((d)>>3)
46#define FNNO(d) ((d)&7)
47
48
49extern unsigned long powerup_PCI_present;
50
51static struct pci_controller *apus_hose;
52
53
54void *pci_io_base(unsigned int bus)
55{
56 return 0;
57}
58
59
60int
61apus_pcibios_read_config(struct pci_bus *bus, int devfn, int offset,
62 int len, u32 *val)
63{
64 int fnno = FNNO(devfn);
65 int devno = DEVNO(devfn);
66 volatile unsigned char *cfg_data;
67
68 if (bus->number > 0 || devno != 1) {
69 *val = ~0;
70 return PCIBIOS_DEVICE_NOT_FOUND;
71 }
72 /* base address + function offset + offset ^ endianness conversion */
73 /* XXX the fnno<<5 bit seems wacky -- paulus */
74 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
75 switch (len) {
76 case 1:
77 *val = readb(cfg_data);
78 break;
79 case 2:
80 *val = readw(cfg_data);
81 break;
82 default:
83 *val = readl(cfg_data);
84 break;
85 }
86
87 DPRINTK("read b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
88 bus->number, devfn>>3, devfn&7, offset, len, *val);
89 return PCIBIOS_SUCCESSFUL;
90}
91
92int
93apus_pcibios_write_config(struct pci_bus *bus, int devfn, int offset,
94 int len, u32 *val)
95{
96 int fnno = FNNO(devfn);
97 int devno = DEVNO(devfn);
98 volatile unsigned char *cfg_data;
99
100 if (bus->number > 0 || devno != 1) {
101 return PCIBIOS_DEVICE_NOT_FOUND;
102 }
103 /* base address + function offset + offset ^ endianness conversion */
104 /* XXX the fnno<<5 bit seems wacky -- paulus */
105 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
106 switch (len) {
107 case 1:
108 writeb(val, cfg_data); DEFW();
109 break;
110 case 2:
111 writew(val, cfg_data); DEFW();
112 break;
113 default:
114 writel(val, cfg_data); DEFW();
115 break;
116 }
117
118 DPRINTK("write b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
119 bus->number, devfn>>3, devfn&7, offset, len, val);
120 return PCIBIOS_SUCCESSFUL;
121}
122
123static struct pci_ops apus_pci_ops = {
124 apus_pcibios_read_config,
125 apus_pcibios_write_config
126};
127
128static struct resource pci_mem = { "B/CVisionPPC PCI mem", CVPPC_FB_APERTURE_ONE, CVPPC_PCI_CONFIG, IORESOURCE_MEM };
129
130void __init
131apus_pcibios_fixup(void)
132{
133/* struct pci_dev *dev = pci_find_slot(0, 1<<3);
134 unsigned int reg, val, offset;*/
135
136 /* FIXME: interrupt? */
137 /*dev->interrupt = xxx;*/
138
139 request_resource(&iomem_resource, &pci_mem);
140 printk("%s: PCI mem resource requested\n", __FUNCTION__);
141}
142
143static void __init apus_pcibios_fixup_bus(struct pci_bus *bus)
144{
145 bus->resource[1] = &pci_mem;
146}
147
148
149/*
150 * This is from pm2fb.c again
151 *
152 * Check if PCI (B/CVisionPPC) is available, initialize it and set up
153 * the pcibios_* pointers
154 */
155
156
157void __init
158apus_setup_pci_ptrs(void)
159{
160 if (!powerup_PCI_present) {
161 DPRINTK("no PCI bridge detected\n");
162 return;
163 }
164 DPRINTK("Phase5 B/CVisionPPC PCI bridge detected.\n");
165
166 apus_hose = pcibios_alloc_controller();
167 if (!apus_hose) {
168 printk("apus_pci: Can't allocate PCI controller structure\n");
169 return;
170 }
171
172 if (!(apus_hose->cfg_data = ioremap(CVPPC_PCI_CONFIG, 256))) {
173 printk("apus_pci: unable to map PCI config region\n");
174 return;
175 }
176
177 if (!(apus_hose->cfg_addr = ioremap(CSPPC_PCI_BRIDGE, 256))) {
178 printk("apus_pci: unable to map PCI bridge\n");
179 return;
180 }
181
182 writel(CSPPCF_BRIDGE_BIG_ENDIAN, apus_hose->cfg_addr + CSPPC_BRIDGE_ENDIAN);
183 DEFW();
184
185 writel(CVPPC_REGS_REGION, apus_hose->cfg_data+ PCI_BASE_ADDRESS_0);
186 DEFW();
187 writel(CVPPC_FB_APERTURE_ONE, apus_hose->cfg_data + PCI_BASE_ADDRESS_1);
188 DEFW();
189 writel(CVPPC_FB_APERTURE_TWO, apus_hose->cfg_data + PCI_BASE_ADDRESS_2);
190 DEFW();
191 writel(CVPPC_ROM_ADDRESS, apus_hose->cfg_data + PCI_ROM_ADDRESS);
192 DEFW();
193
194 writel(0xef000000 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
195 PCI_COMMAND_MASTER, apus_hose->cfg_data + PCI_COMMAND);
196 DEFW();
197
198 apus_hose->first_busno = 0;
199 apus_hose->last_busno = 0;
200 apus_hose->ops = &apus_pci_ops;
201 ppc_md.pcibios_fixup = apus_pcibios_fixup;
202 ppc_md.pcibios_fixup_bus = apus_pcibios_fixup_bus;
203
204 return;
205}
206
207#endif /* CONFIG_AMIGA */
diff --git a/arch/ppc/platforms/apus_pci.h b/arch/ppc/platforms/apus_pci.h
deleted file mode 100644
index f15974ae0189..000000000000
--- a/arch/ppc/platforms/apus_pci.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
3 * driver.
4 *
5 * Copyright (c) 1998-1999 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
6 * --------------------------------------------------------------------------
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file README.legal in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef APUS_PCI_H
13#define APUS_PCI_H
14
15
16#define CSPPC_PCI_BRIDGE 0xfffe0000
17#define CSPPC_BRIDGE_ENDIAN 0x0000
18#define CSPPC_BRIDGE_INT 0x0010
19
20#define CVPPC_PCI_CONFIG 0xfffc0000
21#define CVPPC_ROM_ADDRESS 0xe2000001
22#define CVPPC_REGS_REGION 0xef000000
23#define CVPPC_FB_APERTURE_ONE 0xe0000000
24#define CVPPC_FB_APERTURE_TWO 0xe1000000
25#define CVPPC_FB_SIZE 0x00800000
26
27/* CVPPC_BRIDGE_ENDIAN */
28#define CSPPCF_BRIDGE_BIG_ENDIAN 0x02
29
30/* CVPPC_BRIDGE_INT */
31#define CSPPCF_BRIDGE_ACTIVE_INT2 0x01
32
33
34#endif /* APUS_PCI_H */
diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c
deleted file mode 100644
index 063274d2c503..000000000000
--- a/arch/ppc/platforms/apus_setup.c
+++ /dev/null
@@ -1,798 +0,0 @@
1/*
2 * Copyright (C) 1998, 1999 Jesper Skov
3 *
4 * Basically what is needed to replace functionality found in
5 * arch/m68k allowing Amiga drivers to work under APUS.
6 * Bits of code and/or ideas from arch/m68k and arch/ppc files.
7 *
8 * TODO:
9 * This file needs a *really* good cleanup. Restructure and optimize.
10 * Make sure it can be compiled for non-APUS configs. Begin to move
11 * Amiga specific stuff into mach/amiga.
12 */
13
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/initrd.h>
18#include <linux/seq_file.h>
19
20/* Needs INITSERIAL call in head.S! */
21#undef APUS_DEBUG
22
23#include <asm/bootinfo.h>
24#include <asm/setup.h>
25#include <asm/amigahw.h>
26#include <asm/amigaints.h>
27#include <asm/amigappc.h>
28#include <asm/pgtable.h>
29#include <asm/dma.h>
30#include <asm/machdep.h>
31#include <asm/time.h>
32
33unsigned long m68k_machtype;
34char debug_device[6] = "";
35
36extern void amiga_init_IRQ(void);
37
38extern void apus_setup_pci_ptrs(void);
39
40void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
41/* machine dependent irq functions */
42void (*mach_init_IRQ) (void) __initdata = NULL;
43void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
44void (*mach_get_model) (char *model) = NULL;
45int (*mach_get_hardware_list) (char *buffer) = NULL;
46int (*mach_get_irq_list) (struct seq_file *, void *) = NULL;
47void (*mach_process_int) (int, struct pt_regs *) = NULL;
48/* machine dependent timer functions */
49unsigned long (*mach_gettimeoffset) (void);
50void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
51int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
52int (*mach_set_clock_mmss) (unsigned long) = NULL;
53void (*mach_reset)( void );
54long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
55#ifdef CONFIG_HEARTBEAT
56void (*mach_heartbeat) (int) = NULL;
57extern void apus_heartbeat (void);
58#endif
59
60extern unsigned long amiga_model;
61extern unsigned decrementer_count;/* count value for 1e6/HZ microseconds */
62extern unsigned count_period_num; /* 1 decrementer count equals */
63extern unsigned count_period_den; /* count_period_num / count_period_den us */
64
65int num_memory = 0;
66struct mem_info memory[NUM_MEMINFO];/* memory description */
67/* FIXME: Duplicate memory data to avoid conflicts with m68k shared code. */
68int m68k_realnum_memory = 0;
69struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
70
71struct mem_info ramdisk;
72
73extern void config_amiga(void);
74
75static int __60nsram = 0;
76
77/* for cpuinfo */
78static int __bus_speed = 0;
79static int __speed_test_failed = 0;
80
81/********************************************** COMPILE PROTECTION */
82/* Provide some stubs that links to Amiga specific functions.
83 * This allows CONFIG_APUS to be removed from generic PPC files while
84 * preventing link errors for other PPC targets.
85 */
86unsigned long apus_get_rtc_time(void)
87{
88#ifdef CONFIG_APUS
89 extern unsigned long m68k_get_rtc_time(void);
90
91 return m68k_get_rtc_time ();
92#else
93 return 0;
94#endif
95}
96
97int apus_set_rtc_time(unsigned long nowtime)
98{
99#ifdef CONFIG_APUS
100 extern int m68k_set_rtc_time(unsigned long nowtime);
101
102 return m68k_set_rtc_time (nowtime);
103#else
104 return 0;
105#endif
106}
107
108/*********************************************************** SETUP */
109/* From arch/m68k/kernel/setup.c. */
110void __init apus_setup_arch(void)
111{
112#ifdef CONFIG_APUS
113 extern char cmd_line[];
114 int i;
115 char *p, *q;
116
117 /* Let m68k-shared code know it should do the Amiga thing. */
118 m68k_machtype = MACH_AMIGA;
119
120 /* Parse the command line for arch-specific options.
121 * For the m68k, this is currently only "debug=xxx" to enable printing
122 * certain kernel messages to some machine-specific device. */
123 for( p = cmd_line; p && *p; ) {
124 i = 0;
125 if (!strncmp( p, "debug=", 6 )) {
126 strlcpy( debug_device, p+6, sizeof(debug_device) );
127 if ((q = strchr( debug_device, ' ' ))) *q = 0;
128 i = 1;
129 } else if (!strncmp( p, "60nsram", 7 )) {
130 APUS_WRITE (APUS_REG_WAITSTATE,
131 REGWAITSTATE_SETRESET
132 |REGWAITSTATE_PPCR
133 |REGWAITSTATE_PPCW);
134 __60nsram = 1;
135 i = 1;
136 }
137
138 if (i) {
139 /* option processed, delete it */
140 if ((q = strchr( p, ' ' )))
141 strcpy( p, q+1 );
142 else
143 *p = 0;
144 } else {
145 if ((p = strchr( p, ' ' ))) ++p;
146 }
147 }
148
149 config_amiga();
150
151#if 0 /* Enable for logging - also include logging.o in Makefile rule */
152 {
153#define LOG_SIZE 4096
154 void* base;
155
156 /* Throw away some memory - the P5 firmare stomps on top
157 * of CHIP memory during bootup.
158 */
159 amiga_chip_alloc(0x1000);
160
161 base = amiga_chip_alloc(LOG_SIZE+sizeof(klog_data_t));
162 LOG_INIT(base, base+sizeof(klog_data_t), LOG_SIZE);
163 }
164#endif
165#endif
166}
167
168int
169apus_show_cpuinfo(struct seq_file *m)
170{
171 extern int __map_without_bats;
172 extern unsigned long powerup_PCI_present;
173
174 seq_printf(m, "machine\t\t: Amiga\n");
175 seq_printf(m, "bus speed\t: %d%s", __bus_speed,
176 (__speed_test_failed) ? " [failed]\n" : "\n");
177 seq_printf(m, "using BATs\t: %s\n",
178 (__map_without_bats) ? "No" : "Yes");
179 seq_printf(m, "ram speed\t: %dns\n", (__60nsram) ? 60 : 70);
180 seq_printf(m, "PCI bridge\t: %s\n",
181 (powerup_PCI_present) ? "Yes" : "No");
182 return 0;
183}
184
185static void get_current_tb(unsigned long long *time)
186{
187 __asm __volatile ("1:mftbu 4 \n\t"
188 " mftb 5 \n\t"
189 " mftbu 6 \n\t"
190 " cmpw 4,6 \n\t"
191 " bne 1b \n\t"
192 " stw 4,0(%0)\n\t"
193 " stw 5,4(%0)\n\t"
194 :
195 : "r" (time)
196 : "r4", "r5", "r6");
197}
198
199
200void apus_calibrate_decr(void)
201{
202#ifdef CONFIG_APUS
203 unsigned long freq;
204
205 /* This algorithm for determining the bus speed was
206 contributed by Ralph Schmidt. */
207 unsigned long long start, stop;
208 int bus_speed;
209 int speed_test_failed = 0;
210
211 {
212 unsigned long loop = amiga_eclock / 10;
213
214 get_current_tb (&start);
215 while (loop--) {
216 unsigned char tmp;
217
218 tmp = ciaa.pra;
219 }
220 get_current_tb (&stop);
221 }
222
223 bus_speed = (((unsigned long)(stop-start))*10*4) / 1000000;
224 if (AMI_1200 == amiga_model)
225 bus_speed /= 2;
226
227 if ((bus_speed >= 47) && (bus_speed < 53)) {
228 bus_speed = 50;
229 freq = 12500000;
230 } else if ((bus_speed >= 57) && (bus_speed < 63)) {
231 bus_speed = 60;
232 freq = 15000000;
233 } else if ((bus_speed >= 63) && (bus_speed < 69)) {
234 bus_speed = 67;
235 freq = 16666667;
236 } else {
237 printk ("APUS: Unable to determine bus speed (%d). "
238 "Defaulting to 50MHz", bus_speed);
239 bus_speed = 50;
240 freq = 12500000;
241 speed_test_failed = 1;
242 }
243
244 /* Ease diagnostics... */
245 {
246 extern int __map_without_bats;
247 extern unsigned long powerup_PCI_present;
248
249 printk ("APUS: BATs=%d, BUS=%dMHz",
250 (__map_without_bats) ? 0 : 1,
251 bus_speed);
252 if (speed_test_failed)
253 printk ("[FAILED - please report]");
254
255 printk (", RAM=%dns, PCI bridge=%d\n",
256 (__60nsram) ? 60 : 70,
257 (powerup_PCI_present) ? 1 : 0);
258
259 /* print a bit more if asked politely... */
260 if (!(ciaa.pra & 0x40)){
261 extern unsigned int bat_addrs[4][3];
262 int b;
263 for (b = 0; b < 4; ++b) {
264 printk ("APUS: BAT%d ", b);
265 printk ("%08x-%08x -> %08x\n",
266 bat_addrs[b][0],
267 bat_addrs[b][1],
268 bat_addrs[b][2]);
269 }
270 }
271
272 }
273
274 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
275 freq/1000000, freq%1000000);
276 tb_ticks_per_jiffy = freq / HZ;
277 tb_to_us = mulhwu_scale_factor(freq, 1000000);
278
279 __bus_speed = bus_speed;
280 __speed_test_failed = speed_test_failed;
281#endif
282}
283
284void arch_gettod(int *year, int *mon, int *day, int *hour,
285 int *min, int *sec)
286{
287#ifdef CONFIG_APUS
288 if (mach_gettod)
289 mach_gettod(year, mon, day, hour, min, sec);
290 else
291 *year = *mon = *day = *hour = *min = *sec = 0;
292#endif
293}
294
295/* for "kbd-reset" cmdline param */
296__init
297void kbd_reset_setup(char *str, int *ints)
298{
299}
300
301/*********************************************************** MEMORY */
302#define KMAP_MAX 32
303unsigned long kmap_chunks[KMAP_MAX*3];
304int kmap_chunk_count = 0;
305
306/* From pgtable.h */
307static __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
308{
309 pgd_t *dir = 0;
310 pmd_t *pmd = 0;
311 pte_t *pte = 0;
312
313 va &= PAGE_MASK;
314
315 dir = pgd_offset( mm, va );
316 if (dir)
317 {
318 pmd = pmd_offset(dir, va & PAGE_MASK);
319 if (pmd && pmd_present(*pmd))
320 {
321 pte = pte_offset(pmd, va);
322 }
323 }
324 return pte;
325}
326
327
328/* Again simulating an m68k/mm/kmap.c function. */
329void kernel_set_cachemode( unsigned long address, unsigned long size,
330 unsigned int cmode )
331{
332 unsigned long mask, flags;
333
334 switch (cmode)
335 {
336 case IOMAP_FULL_CACHING:
337 mask = ~(_PAGE_NO_CACHE | _PAGE_GUARDED);
338 flags = 0;
339 break;
340 case IOMAP_NOCACHE_SER:
341 mask = ~0;
342 flags = (_PAGE_NO_CACHE | _PAGE_GUARDED);
343 break;
344 default:
345 panic ("kernel_set_cachemode() doesn't support mode %d\n",
346 cmode);
347 break;
348 }
349
350 size /= PAGE_SIZE;
351 address &= PAGE_MASK;
352 while (size--)
353 {
354 pte_t *pte;
355
356 pte = my_find_pte(&init_mm, address);
357 if ( !pte )
358 {
359 printk("pte NULL in kernel_set_cachemode()\n");
360 return;
361 }
362
363 pte_val (*pte) &= mask;
364 pte_val (*pte) |= flags;
365 flush_tlb_page(find_vma(&init_mm,address),address);
366
367 address += PAGE_SIZE;
368 }
369}
370
371unsigned long mm_ptov (unsigned long paddr)
372{
373 unsigned long ret;
374 if (paddr < 16*1024*1024)
375 ret = ZTWO_VADDR(paddr);
376 else {
377 int i;
378
379 for (i = 0; i < kmap_chunk_count;){
380 unsigned long phys = kmap_chunks[i++];
381 unsigned long size = kmap_chunks[i++];
382 unsigned long virt = kmap_chunks[i++];
383 if (paddr >= phys
384 && paddr < (phys + size)){
385 ret = virt + paddr - phys;
386 goto exit;
387 }
388 }
389
390 ret = (unsigned long) __va(paddr);
391 }
392exit:
393#ifdef DEBUGPV
394 printk ("PTOV(%lx)=%lx\n", paddr, ret);
395#endif
396 return ret;
397}
398
399int mm_end_of_chunk (unsigned long addr, int len)
400{
401 if (memory[0].addr + memory[0].size == addr + len)
402 return 1;
403 return 0;
404}
405
406/*********************************************************** CACHE */
407
408#define L1_CACHE_BYTES 32
409#define MAX_CACHE_SIZE 8192
410void cache_push(__u32 addr, int length)
411{
412 addr = mm_ptov(addr);
413
414 if (MAX_CACHE_SIZE < length)
415 length = MAX_CACHE_SIZE;
416
417 while(length > 0){
418 __asm ("dcbf 0,%0\n\t"
419 : : "r" (addr));
420 addr += L1_CACHE_BYTES;
421 length -= L1_CACHE_BYTES;
422 }
423 /* Also flush trailing block */
424 __asm ("dcbf 0,%0\n\t"
425 "sync \n\t"
426 : : "r" (addr));
427}
428
429void cache_clear(__u32 addr, int length)
430{
431 if (MAX_CACHE_SIZE < length)
432 length = MAX_CACHE_SIZE;
433
434 addr = mm_ptov(addr);
435
436 __asm ("dcbf 0,%0\n\t"
437 "sync \n\t"
438 "icbi 0,%0 \n\t"
439 "isync \n\t"
440 : : "r" (addr));
441
442 addr += L1_CACHE_BYTES;
443 length -= L1_CACHE_BYTES;
444
445 while(length > 0){
446 __asm ("dcbf 0,%0\n\t"
447 "sync \n\t"
448 "icbi 0,%0 \n\t"
449 "isync \n\t"
450 : : "r" (addr));
451 addr += L1_CACHE_BYTES;
452 length -= L1_CACHE_BYTES;
453 }
454
455 __asm ("dcbf 0,%0\n\t"
456 "sync \n\t"
457 "icbi 0,%0 \n\t"
458 "isync \n\t"
459 : : "r" (addr));
460}
461
462/****************************************************** from setup.c */
463void
464apus_restart(char *cmd)
465{
466 local_irq_disable();
467
468 APUS_WRITE(APUS_REG_LOCK,
469 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2);
470 APUS_WRITE(APUS_REG_LOCK,
471 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK3);
472 APUS_WRITE(APUS_REG_LOCK,
473 REGLOCK_BLACKMAGICK2|REGLOCK_BLACKMAGICK3);
474 APUS_WRITE(APUS_REG_SHADOW, REGSHADOW_SELFRESET);
475 APUS_WRITE(APUS_REG_RESET, REGRESET_AMIGARESET);
476 for(;;);
477}
478
479void
480apus_power_off(void)
481{
482 for (;;);
483}
484
485void
486apus_halt(void)
487{
488 apus_restart(NULL);
489}
490
491/****************************************************** IRQ stuff */
492
493static unsigned char last_ipl[8];
494
495int apus_get_irq(void)
496{
497 unsigned char ipl_emu, mask;
498 unsigned int level;
499
500 APUS_READ(APUS_IPL_EMU, ipl_emu);
501 level = (ipl_emu >> 3) & IPLEMU_IPLMASK;
502 mask = IPLEMU_SETRESET|IPLEMU_DISABLEINT|level;
503 level ^= 7;
504
505 /* Save previous IPL value */
506 if (last_ipl[level])
507 return -2;
508 last_ipl[level] = ipl_emu;
509
510 /* Set to current IPL value */
511 APUS_WRITE(APUS_IPL_EMU, mask);
512 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|level);
513
514
515#ifdef __INTERRUPT_DEBUG
516 printk("<%d:%d>", level, ~ipl_emu & IPLEMU_IPLMASK);
517#endif
518 return level + IRQ_AMIGA_AUTO;
519}
520
521void apus_end_irq(unsigned int irq)
522{
523 unsigned char ipl_emu;
524 unsigned int level = irq - IRQ_AMIGA_AUTO;
525#ifdef __INTERRUPT_DEBUG
526 printk("{%d}", ~last_ipl[level] & IPLEMU_IPLMASK);
527#endif
528 /* Restore IPL to the previous value */
529 ipl_emu = last_ipl[level] & IPLEMU_IPLMASK;
530 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET|IPLEMU_DISABLEINT|ipl_emu);
531 last_ipl[level] = 0;
532 ipl_emu ^= 7;
533 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|ipl_emu);
534}
535
536/****************************************************** debugging */
537
538/* some serial hardware definitions */
539#define SDR_OVRUN (1<<15)
540#define SDR_RBF (1<<14)
541#define SDR_TBE (1<<13)
542#define SDR_TSRE (1<<12)
543
544#define AC_SETCLR (1<<15)
545#define AC_UARTBRK (1<<11)
546
547#define SER_DTR (1<<7)
548#define SER_RTS (1<<6)
549#define SER_DCD (1<<5)
550#define SER_CTS (1<<4)
551#define SER_DSR (1<<3)
552
553static __inline__ void ser_RTSon(void)
554{
555 ciab.pra &= ~SER_RTS; /* active low */
556}
557
558int __debug_ser_out( unsigned char c )
559{
560 amiga_custom.serdat = c | 0x100;
561 mb();
562 while (!(amiga_custom.serdatr & 0x2000))
563 barrier();
564 return 1;
565}
566
567unsigned char __debug_ser_in( void )
568{
569 unsigned char c;
570
571 /* XXX: is that ok?? derived from amiga_ser.c... */
572 while( !(amiga_custom.intreqr & IF_RBF) )
573 barrier();
574 c = amiga_custom.serdatr;
575 /* clear the interrupt, so that another character can be read */
576 amiga_custom.intreq = IF_RBF;
577 return c;
578}
579
580int __debug_serinit( void )
581{
582 unsigned long flags;
583
584 local_irq_save(flags);
585
586 /* turn off Rx and Tx interrupts */
587 amiga_custom.intena = IF_RBF | IF_TBE;
588
589 /* clear any pending interrupt */
590 amiga_custom.intreq = IF_RBF | IF_TBE;
591
592 local_irq_restore(flags);
593
594 /*
595 * set the appropriate directions for the modem control flags,
596 * and clear RTS and DTR
597 */
598 ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
599 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
600
601#ifdef CONFIG_KGDB
602 /* turn Rx interrupts on for GDB */
603 amiga_custom.intena = IF_SETCLR | IF_RBF;
604 ser_RTSon();
605#endif
606
607 return 0;
608}
609
610void __debug_print_hex(unsigned long x)
611{
612 int i;
613 char hexchars[] = "0123456789ABCDEF";
614
615 for (i = 0; i < 8; i++) {
616 __debug_ser_out(hexchars[(x >> 28) & 15]);
617 x <<= 4;
618 }
619 __debug_ser_out('\n');
620 __debug_ser_out('\r');
621}
622
623void __debug_print_string(char* s)
624{
625 unsigned char c;
626 while((c = *s++))
627 __debug_ser_out(c);
628 __debug_ser_out('\n');
629 __debug_ser_out('\r');
630}
631
632static void apus_progress(char *s, unsigned short value)
633{
634 __debug_print_string(s);
635}
636
637/****************************************************** init */
638
639/* The number of spurious interrupts */
640volatile unsigned int num_spurious;
641
642extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
643
644
645extern void amiga_enable_irq(unsigned int irq);
646extern void amiga_disable_irq(unsigned int irq);
647
648struct hw_interrupt_type amiga_sys_irqctrl = {
649 .typename = "Amiga IPL",
650 .end = apus_end_irq,
651};
652
653struct hw_interrupt_type amiga_irqctrl = {
654 .typename = "Amiga ",
655 .enable = amiga_enable_irq,
656 .disable = amiga_disable_irq,
657};
658
659#define HARDWARE_MAPPED_SIZE (512*1024)
660unsigned long __init apus_find_end_of_memory(void)
661{
662 int shadow = 0;
663 unsigned long total;
664
665 /* The memory size reported by ADOS excludes the 512KB
666 reserved for PPC exception registers and possibly 512KB
667 containing a shadow of the ADOS ROM. */
668 {
669 unsigned long size = memory[0].size;
670
671 /* If 2MB aligned, size was probably user
672 specified. We can't tell anything about shadowing
673 in this case so skip shadow assignment. */
674 if (0 != (size & 0x1fffff)){
675 /* Align to 512KB to ensure correct handling
676 of both memfile and system specified
677 sizes. */
678 size = ((size+0x0007ffff) & 0xfff80000);
679 /* If memory is 1MB aligned, assume
680 shadowing. */
681 shadow = !(size & 0x80000);
682 }
683
684 /* Add the chunk that ADOS does not see. by aligning
685 the size to the nearest 2MB limit upwards. */
686 memory[0].size = ((size+0x001fffff) & 0xffe00000);
687 }
688
689 ppc_memstart = memory[0].addr;
690 ppc_memoffset = PAGE_OFFSET - PPC_MEMSTART;
691 total = memory[0].size;
692
693 /* Remove the memory chunks that are controlled by special
694 Phase5 hardware. */
695
696 /* Remove the upper 512KB if it contains a shadow of
697 the ADOS ROM. FIXME: It might be possible to
698 disable this shadow HW. Check the booter
699 (ppc_boot.c) */
700 if (shadow)
701 total -= HARDWARE_MAPPED_SIZE;
702
703 /* Remove the upper 512KB where the PPC exception
704 vectors are mapped. */
705 total -= HARDWARE_MAPPED_SIZE;
706
707 /* Linux/APUS only handles one block of memory -- the one on
708 the PowerUP board. Other system memory is horrible slow in
709 comparison. The user can use other memory for swapping
710 using the z2ram device. */
711 return total;
712}
713
714static void __init
715apus_map_io(void)
716{
717 /* Map PPC exception vectors. */
718 io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
719 /* Map chip and ZorroII memory */
720 io_block_mapping(zTwoBase, 0x00000000, 0x01000000, _PAGE_IO);
721}
722
723__init
724void apus_init_IRQ(void)
725{
726 struct irqaction *action;
727 int i;
728
729#ifdef CONFIG_PCI
730 apus_setup_pci_ptrs();
731#endif
732
733 for ( i = 0 ; i < AMI_IRQS; i++ ) {
734 irq_desc[i].status = IRQ_LEVEL;
735 if (i < IRQ_AMIGA_AUTO) {
736 irq_desc[i].chip = &amiga_irqctrl;
737 } else {
738 irq_desc[i].chip = &amiga_sys_irqctrl;
739 action = &amiga_sys_irqaction[i-IRQ_AMIGA_AUTO];
740 if (action->name)
741 setup_irq(i, action);
742 }
743 }
744
745 amiga_init_IRQ();
746
747}
748
749__init
750void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
751 unsigned long r6, unsigned long r7)
752{
753 extern int parse_bootinfo(const struct bi_record *);
754 extern char _end[];
755
756 /* Parse bootinfo. The bootinfo is located right after
757 the kernel bss */
758 parse_bootinfo((const struct bi_record *)&_end);
759#ifdef CONFIG_BLK_DEV_INITRD
760 /* Take care of initrd if we have one. Use data from
761 bootinfo to avoid the need to initialize PPC
762 registers when kernel is booted via a PPC reset. */
763 if ( ramdisk.addr ) {
764 initrd_start = (unsigned long) __va(ramdisk.addr);
765 initrd_end = (unsigned long)
766 __va(ramdisk.size + ramdisk.addr);
767 }
768#endif /* CONFIG_BLK_DEV_INITRD */
769
770 ISA_DMA_THRESHOLD = 0x00ffffff;
771
772 ppc_md.setup_arch = apus_setup_arch;
773 ppc_md.show_cpuinfo = apus_show_cpuinfo;
774 ppc_md.init_IRQ = apus_init_IRQ;
775 ppc_md.get_irq = apus_get_irq;
776
777#ifdef CONFIG_HEARTBEAT
778 ppc_md.heartbeat = apus_heartbeat;
779 ppc_md.heartbeat_count = 1;
780#endif
781#ifdef APUS_DEBUG
782 __debug_serinit();
783 ppc_md.progress = apus_progress;
784#endif
785 ppc_md.init = NULL;
786
787 ppc_md.restart = apus_restart;
788 ppc_md.power_off = apus_power_off;
789 ppc_md.halt = apus_halt;
790
791 ppc_md.time_init = NULL;
792 ppc_md.set_rtc_time = apus_set_rtc_time;
793 ppc_md.get_rtc_time = apus_get_rtc_time;
794 ppc_md.calibrate_decr = apus_calibrate_decr;
795
796 ppc_md.find_end_of_memory = apus_find_end_of_memory;
797 ppc_md.setup_io_mappings = apus_map_io;
798}
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index 0f66f0f82c32..1644e44c8757 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -67,7 +67,7 @@ static __inline__ unsigned long ide_default_io_base(int index)
67#define ide_init_default_irq(base) ide_default_irq(base) 67#define ide_init_default_irq(base) ide_default_irq(base)
68#endif 68#endif
69 69
70#if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE ) 70#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
71#define IDE_ARCH_ACK_INTR 1 71#define IDE_ARCH_ACK_INTR 1
72#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) 72#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
73#endif 73#endif
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 347de53e49af..e775ff1ca413 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -102,12 +102,8 @@
102#else /* 32-bit */ 102#else /* 32-bit */
103/* Default MSR for kernel mode. */ 103/* Default MSR for kernel mode. */
104#ifndef MSR_KERNEL /* reg_booke.h also defines this */ 104#ifndef MSR_KERNEL /* reg_booke.h also defines this */
105#ifdef CONFIG_APUS_FAST_EXCEPT
106#define MSR_KERNEL (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR)
107#else
108#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR) 105#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
109#endif 106#endif
110#endif
111 107
112#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) 108#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
113#endif 109#endif
diff --git a/include/asm-ppc/amigahw.h b/include/asm-ppc/amigahw.h
deleted file mode 100644
index 90fd1274d727..000000000000
--- a/include/asm-ppc/amigahw.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifdef __KERNEL__
2#ifndef __ASMPPC_AMIGAHW_H
3#define __ASMPPC_AMIGAHW_H
4
5#include <asm-m68k/amigahw.h>
6
7#undef CHIP_PHYSADDR
8#ifdef CONFIG_APUS_FAST_EXCEPT
9#define CHIP_PHYSADDR (0x000000)
10#else
11#define CHIP_PHYSADDR (0x004000)
12#endif
13
14
15#endif /* __ASMPPC_AMIGAHW_H */
16#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigaints.h b/include/asm-ppc/amigaints.h
deleted file mode 100644
index aa3ff6349e81..000000000000
--- a/include/asm-ppc/amigaints.h
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2** amigaints.h -- Amiga Linux interrupt handling structs and prototypes
3**
4** Copyright 1992 by Greg Harp
5**
6** This file is subject to the terms and conditions of the GNU General Public
7** License. See the file COPYING in the main directory of this archive
8** for more details.
9**
10** Created 10/2/92 by Greg Harp
11*/
12
13#ifdef __KERNEL__
14#ifndef _ASMm68k_AMIGAINTS_H_
15#define _ASMm68k_AMIGAINTS_H_
16
17/*
18** Amiga Interrupt sources.
19**
20*/
21
22#define AUTO_IRQS (8)
23#define AMI_STD_IRQS (14)
24#define CIA_IRQS (5)
25#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
26
27/* vertical blanking interrupt */
28#define IRQ_AMIGA_VERTB 0
29
30/* copper interrupt */
31#define IRQ_AMIGA_COPPER 1
32
33/* Audio interrupts */
34#define IRQ_AMIGA_AUD0 2
35#define IRQ_AMIGA_AUD1 3
36#define IRQ_AMIGA_AUD2 4
37#define IRQ_AMIGA_AUD3 5
38
39/* Blitter done interrupt */
40#define IRQ_AMIGA_BLIT 6
41
42/* floppy disk interrupts */
43#define IRQ_AMIGA_DSKSYN 7
44#define IRQ_AMIGA_DSKBLK 8
45
46/* builtin serial port interrupts */
47#define IRQ_AMIGA_RBF 9
48#define IRQ_AMIGA_TBE 10
49
50/* software interrupts */
51#define IRQ_AMIGA_SOFT 11
52
53/* interrupts from external hardware */
54#define IRQ_AMIGA_PORTS 12
55#define IRQ_AMIGA_EXTER 13
56
57/* CIA interrupt sources */
58#define IRQ_AMIGA_CIAA 14
59#define IRQ_AMIGA_CIAA_TA 14
60#define IRQ_AMIGA_CIAA_TB 15
61#define IRQ_AMIGA_CIAA_ALRM 16
62#define IRQ_AMIGA_CIAA_SP 17
63#define IRQ_AMIGA_CIAA_FLG 18
64#define IRQ_AMIGA_CIAB 19
65#define IRQ_AMIGA_CIAB_TA 19
66#define IRQ_AMIGA_CIAB_TB 20
67#define IRQ_AMIGA_CIAB_ALRM 21
68#define IRQ_AMIGA_CIAB_SP 22
69#define IRQ_AMIGA_CIAB_FLG 23
70
71/* auto-vector interrupts */
72#define IRQ_AMIGA_AUTO 24
73#define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */
74#define IRQ_AMIGA_AUTO_1 25
75#define IRQ_AMIGA_AUTO_2 26
76#define IRQ_AMIGA_AUTO_3 27
77#define IRQ_AMIGA_AUTO_4 28
78#define IRQ_AMIGA_AUTO_5 29
79#define IRQ_AMIGA_AUTO_6 30
80#define IRQ_AMIGA_AUTO_7 31
81
82#define IRQ_FLOPPY IRQ_AMIGA_DSKBLK
83
84/* INTREQR masks */
85#define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
86#define IRQ2_MASK 0x0008 /* INTREQR mask for IRQ 2 */
87#define IRQ3_MASK 0x0070 /* INTREQR mask for IRQ 3 */
88#define IRQ4_MASK 0x0780 /* INTREQR mask for IRQ 4 */
89#define IRQ5_MASK 0x1800 /* INTREQR mask for IRQ 5 */
90#define IRQ6_MASK 0x2000 /* INTREQR mask for IRQ 6 */
91#define IRQ7_MASK 0x4000 /* INTREQR mask for IRQ 7 */
92
93#define IF_SETCLR 0x8000 /* set/clr bit */
94#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */
95#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */
96#define IF_DSKSYN 0x1000 /* disk sync interrupt */
97#define IF_RBF 0x0800 /* serial receive buffer full interrupt */
98#define IF_AUD3 0x0400 /* audio channel 3 done interrupt */
99#define IF_AUD2 0x0200 /* audio channel 2 done interrupt */
100#define IF_AUD1 0x0100 /* audio channel 1 done interrupt */
101#define IF_AUD0 0x0080 /* audio channel 0 done interrupt */
102#define IF_BLIT 0x0040 /* blitter done interrupt */
103#define IF_VERTB 0x0020 /* vertical blanking interrupt */
104#define IF_COPER 0x0010 /* copper interrupt */
105#define IF_PORTS 0x0008 /* external level 2 and CIA A interrupt */
106#define IF_SOFT 0x0004 /* software initiated interrupt */
107#define IF_DSKBLK 0x0002 /* diskblock DMA finished */
108#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */
109
110extern void amiga_do_irq(int irq, struct pt_regs *fp);
111extern void amiga_do_irq_list(int irq, struct pt_regs *fp);
112
113/* CIA interrupt control register bits */
114
115#define CIA_ICR_TA 0x01
116#define CIA_ICR_TB 0x02
117#define CIA_ICR_ALRM 0x04
118#define CIA_ICR_SP 0x08
119#define CIA_ICR_FLG 0x10
120#define CIA_ICR_ALL 0x1f
121#define CIA_ICR_SETCLR 0x80
122
123/* to access the interrupt control registers of CIA's use only
124** these functions, they behave exactly like the amiga os routines
125*/
126
127extern struct ciabase ciaa_base, ciab_base;
128
129extern unsigned char cia_set_irq(unsigned int irq, int set);
130extern unsigned char cia_able_irq(unsigned int irq, int enable);
131
132#endif /* asm-m68k/amigaints.h */
133#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigappc.h b/include/asm-ppc/amigappc.h
deleted file mode 100644
index 35114ce5135f..000000000000
--- a/include/asm-ppc/amigappc.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2** asm-ppc/amigappc.h -- This header defines some values and pointers for
3** the Phase 5 PowerUp card.
4**
5** Copyright 1997, 1998 by Phase5, Germany.
6**
7** This file is subject to the terms and conditions of the GNU General Public
8** License. See the file COPYING in the main directory of this archive
9** for more details.
10**
11** Created: 7/22/97 by Jesper Skov
12*/
13
14#ifdef __KERNEL__
15#ifndef _M68K_AMIGAPPC_H
16#define _M68K_AMIGAPPC_H
17
18#ifndef __ASSEMBLY__
19
20/* #include <asm/system.h> */
21#define mb() __asm__ __volatile__ ("sync" : : : "memory")
22
23#define APUS_WRITE(_a_, _v_) \
24do { \
25 (*((volatile unsigned char *)(_a_)) = (_v_)); \
26 mb(); \
27} while (0)
28
29#define APUS_READ(_a_, _v_) \
30do { \
31 (_v_) = (*((volatile unsigned char *)(_a_))); \
32 mb(); \
33} while (0)
34#endif /* ndef __ASSEMBLY__ */
35
36/* Maybe add a [#ifdef WANT_ZTWOBASE] condition to amigahw.h? */
37#define zTwoBase (0x80000000)
38
39#define APUS_IPL_BASE (zTwoBase + 0x00f60000)
40#define APUS_REG_RESET (APUS_IPL_BASE + 0x00)
41#define APUS_REG_WAITSTATE (APUS_IPL_BASE + 0x10)
42#define APUS_REG_SHADOW (APUS_IPL_BASE + 0x18)
43#define APUS_REG_LOCK (APUS_IPL_BASE + 0x20)
44#define APUS_REG_INT (APUS_IPL_BASE + 0x28)
45#define APUS_IPL_EMU (APUS_IPL_BASE + 0x30)
46#define APUS_INT_LVL (APUS_IPL_BASE + 0x38)
47
48#define REGSHADOW_SETRESET (0x80)
49#define REGSHADOW_SELFRESET (0x40)
50
51#define REGLOCK_SETRESET (0x80)
52#define REGLOCK_BLACKMAGICK1 (0x40)
53#define REGLOCK_BLACKMAGICK2 (0x20)
54#define REGLOCK_BLACKMAGICK3 (0x10)
55
56#define REGWAITSTATE_SETRESET (0x80)
57#define REGWAITSTATE_PPCW (0x08)
58#define REGWAITSTATE_PPCR (0x04)
59
60#define REGRESET_SETRESET (0x80)
61#define REGRESET_PPCRESET (0x10)
62#define REGRESET_M68KRESET (0x08)
63#define REGRESET_AMIGARESET (0x04)
64#define REGRESET_AUXRESET (0x02)
65#define REGRESET_SCSIRESET (0x01)
66
67#define REGINT_SETRESET (0x80)
68#define REGINT_ENABLEIPL (0x02)
69#define REGINT_INTMASTER (0x01)
70
71#define IPLEMU_SETRESET (0x80)
72#define IPLEMU_DISABLEINT (0x40)
73#define IPLEMU_IPL2 (0x20)
74#define IPLEMU_IPL1 (0x10)
75#define IPLEMU_IPL0 (0x08)
76#define IPLEMU_PPCIPL2 (0x04)
77#define IPLEMU_PPCIPL1 (0x02)
78#define IPLEMU_PPCIPL0 (0x01)
79#define IPLEMU_IPLMASK (IPLEMU_PPCIPL2|IPLEMU_PPCIPL1|IPLEMU_PPCIPL0)
80
81#define INTLVL_SETRESET (0x80)
82#define INTLVL_MASK (0x7f)
83
84#endif /* _M68k_AMIGAPPC_H */
85#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
index 2ace4a74f263..f6ed77aee328 100644
--- a/include/asm-ppc/bootinfo.h
+++ b/include/asm-ppc/bootinfo.h
@@ -11,10 +11,6 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13 13
14#if defined(CONFIG_APUS) && !defined(__BOOTER__)
15#include <asm-m68k/bootinfo.h>
16#else
17
18struct bi_record { 14struct bi_record {
19 unsigned long tag; /* tag ID */ 15 unsigned long tag; /* tag ID */
20 unsigned long size; /* size of record (in bytes) */ 16 unsigned long size; /* size of record (in bytes) */
@@ -44,7 +40,6 @@ bootinfo_addr(unsigned long offset)
44 return (struct bi_record *)_ALIGN((offset) + (1 << 20) - 1, 40 return (struct bi_record *)_ALIGN((offset) + (1 << 20) - 1,
45 (1 << 20)); 41 (1 << 20));
46} 42}
47#endif /* CONFIG_APUS */
48 43
49 44
50#endif /* _PPC_BOOTINFO_H */ 45#endif /* _PPC_BOOTINFO_H */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index f776c49f5579..8f58231a8bc6 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -30,7 +30,7 @@
30#include <asm/mpc8xx.h> 30#include <asm/mpc8xx.h>
31#elif defined(CONFIG_8260) 31#elif defined(CONFIG_8260)
32#include <asm/mpc8260.h> 32#include <asm/mpc8260.h>
33#elif defined(CONFIG_APUS) || !defined(CONFIG_PCI) 33#elif !defined(CONFIG_PCI)
34#define _IO_BASE 0 34#define _IO_BASE 0
35#define _ISA_MEM_BASE 0 35#define _ISA_MEM_BASE 0
36#define PCI_DRAM_OFFSET 0 36#define PCI_DRAM_OFFSET 0
@@ -145,24 +145,7 @@ static inline void writeb(__u8 b, volatile void __iomem *addr)
145} 145}
146#endif 146#endif
147 147
148#if defined(CONFIG_APUS) 148#if defined (CONFIG_8260_PCI9)
149static inline __u16 readw(const volatile void __iomem *addr)
150{
151 return *(__force volatile __u16 *)(addr);
152}
153static inline __u32 readl(const volatile void __iomem *addr)
154{
155 return *(__force volatile __u32 *)(addr);
156}
157static inline void writew(__u16 b, volatile void __iomem *addr)
158{
159 *(__force volatile __u16 *)(addr) = b;
160}
161static inline void writel(__u32 b, volatile void __iomem *addr)
162{
163 *(__force volatile __u32 *)(addr) = b;
164}
165#elif defined (CONFIG_8260_PCI9)
166/* Use macros if PCI9 workaround enabled */ 149/* Use macros if PCI9 workaround enabled */
167#define readw(addr) in_le16((volatile u16 *)(addr)) 150#define readw(addr) in_le16((volatile u16 *)(addr))
168#define readl(addr) in_le32((volatile u32 *)(addr)) 151#define readl(addr) in_le32((volatile u32 *)(addr))
@@ -185,7 +168,7 @@ static inline void writel(__u32 b, volatile void __iomem *addr)
185{ 168{
186 out_le32(addr, b); 169 out_le32(addr, b);
187} 170}
188#endif /* CONFIG_APUS */ 171#endif /* CONFIG_8260_PCI9 */
189 172
190#define readb_relaxed(addr) readb(addr) 173#define readb_relaxed(addr) readb(addr)
191#define readw_relaxed(addr) readw(addr) 174#define readw_relaxed(addr) readw(addr)
@@ -300,13 +283,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \
300} 283}
301 284
302__do_out_asm(outb, "stbx") 285__do_out_asm(outb, "stbx")
303#ifdef CONFIG_APUS 286#if defined (CONFIG_8260_PCI9)
304__do_in_asm(inb, "lbzx")
305__do_in_asm(inw, "lhz%U1%X1")
306__do_in_asm(inl, "lwz%U1%X1")
307__do_out_asm(outl,"stw%U0%X0")
308__do_out_asm(outw, "sth%U0%X0")
309#elif defined (CONFIG_8260_PCI9)
310/* in asm cannot be defined if PCI9 workaround is used */ 287/* in asm cannot be defined if PCI9 workaround is used */
311#define inb(port) in_8((port)+___IO_BASE) 288#define inb(port) in_8((port)+___IO_BASE)
312#define inw(port) in_le16((port)+___IO_BASE) 289#define inw(port) in_le16((port)+___IO_BASE)
@@ -371,7 +348,6 @@ extern void __iomem *ioremap64(unsigned long long address, unsigned long size);
371#define ioremap_nocache(addr, size) ioremap((addr), (size)) 348#define ioremap_nocache(addr, size) ioremap((addr), (size))
372extern void iounmap(volatile void __iomem *addr); 349extern void iounmap(volatile void __iomem *addr);
373extern unsigned long iopa(unsigned long addr); 350extern unsigned long iopa(unsigned long addr);
374extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
375extern void io_block_mapping(unsigned long virt, phys_addr_t phys, 351extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
376 unsigned int size, int flags); 352 unsigned int size, int flags);
377 353
@@ -384,24 +360,16 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
384 */ 360 */
385extern inline unsigned long virt_to_bus(volatile void * address) 361extern inline unsigned long virt_to_bus(volatile void * address)
386{ 362{
387#ifndef CONFIG_APUS
388 if (address == (void *)0) 363 if (address == (void *)0)
389 return 0; 364 return 0;
390 return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET; 365 return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET;
391#else
392 return iopa ((unsigned long) address);
393#endif
394} 366}
395 367
396extern inline void * bus_to_virt(unsigned long address) 368extern inline void * bus_to_virt(unsigned long address)
397{ 369{
398#ifndef CONFIG_APUS
399 if (address == 0) 370 if (address == 0)
400 return NULL; 371 return NULL;
401 return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); 372 return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
402#else
403 return (void*) mm_ptov (address);
404#endif
405} 373}
406 374
407/* 375/*
@@ -410,20 +378,12 @@ extern inline void * bus_to_virt(unsigned long address)
410 */ 378 */
411extern inline unsigned long virt_to_phys(volatile void * address) 379extern inline unsigned long virt_to_phys(volatile void * address)
412{ 380{
413#ifndef CONFIG_APUS
414 return (unsigned long) address - KERNELBASE; 381 return (unsigned long) address - KERNELBASE;
415#else
416 return iopa ((unsigned long) address);
417#endif
418} 382}
419 383
420extern inline void * phys_to_virt(unsigned long address) 384extern inline void * phys_to_virt(unsigned long address)
421{ 385{
422#ifndef CONFIG_APUS
423 return (void *) (address + KERNELBASE); 386 return (void *) (address + KERNELBASE);
424#else
425 return (void*) mm_ptov (address);
426#endif
427} 387}
428 388
429/* 389/*
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 293a444a1d77..a20b499b0186 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -8,10 +8,6 @@
8#include <asm/setup.h> 8#include <asm/setup.h>
9#include <asm/page.h> 9#include <asm/page.h>
10 10
11#ifdef CONFIG_APUS
12#include <asm-m68k/machdep.h>
13#endif
14
15struct pt_regs; 11struct pt_regs;
16struct pci_bus; 12struct pci_bus;
17struct pci_dev; 13struct pci_dev;
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index fe95c8258cf9..ad4c5a1bc9d6 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -97,62 +97,22 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
97extern void copy_user_page(void *to, void *from, unsigned long vaddr, 97extern void copy_user_page(void *to, void *from, unsigned long vaddr,
98 struct page *pg); 98 struct page *pg);
99 99
100#ifndef CONFIG_APUS
101#define PPC_MEMSTART 0 100#define PPC_MEMSTART 0
102#define PPC_PGSTART 0
103#define PPC_MEMOFFSET PAGE_OFFSET 101#define PPC_MEMOFFSET PAGE_OFFSET
104#else
105extern unsigned long ppc_memstart;
106extern unsigned long ppc_pgstart;
107extern unsigned long ppc_memoffset;
108#define PPC_MEMSTART ppc_memstart
109#define PPC_PGSTART ppc_pgstart
110#define PPC_MEMOFFSET ppc_memoffset
111#endif
112 102
113#if defined(CONFIG_APUS) && !defined(MODULE)
114/* map phys->virtual and virtual->phys for RAM pages */
115static inline unsigned long ___pa(unsigned long v)
116{
117 unsigned long p;
118 asm volatile ("1: addis %0, %1, %2;"
119 ".section \".vtop_fixup\",\"aw\";"
120 ".align 1;"
121 ".long 1b;"
122 ".previous;"
123 : "=r" (p)
124 : "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
125
126 return p;
127}
128static inline void* ___va(unsigned long p)
129{
130 unsigned long v;
131 asm volatile ("1: addis %0, %1, %2;"
132 ".section \".ptov_fixup\",\"aw\";"
133 ".align 1;"
134 ".long 1b;"
135 ".previous;"
136 : "=r" (v)
137 : "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
138
139 return (void*) v;
140}
141#else
142#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET) 103#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET)
143#define ___va(paddr) ((paddr)+PPC_MEMOFFSET) 104#define ___va(paddr) ((paddr)+PPC_MEMOFFSET)
144#endif
145 105
146extern int page_is_ram(unsigned long pfn); 106extern int page_is_ram(unsigned long pfn);
147 107
148#define __pa(x) ___pa((unsigned long)(x)) 108#define __pa(x) ___pa((unsigned long)(x))
149#define __va(x) ((void *)(___va((unsigned long)(x)))) 109#define __va(x) ((void *)(___va((unsigned long)(x))))
150 110
151#define ARCH_PFN_OFFSET (PPC_PGSTART) 111#define ARCH_PFN_OFFSET 0
152#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 112#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
153#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) 113#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
154 114
155#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr) 115#define pfn_valid(pfn) ((pfn) < max_mapnr)
156#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 116#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
157 117
158/* Pure 2^n version of get_order */ 118/* Pure 2^n version of get_order */
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index c159315d2c8f..063ad91cbbcc 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -765,14 +765,6 @@ extern void paging_init(void);
765#define pte_to_pgoff(pte) (pte_val(pte) >> 3) 765#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
766#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) 766#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
767 767
768/* CONFIG_APUS */
769/* For virtual address to physical address conversion */
770extern void cache_clear(__u32 addr, int length);
771extern void cache_push(__u32 addr, int length);
772extern int mm_end_of_chunk (unsigned long addr, int len);
773extern unsigned long iopa(unsigned long addr);
774extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
775
776/* Values for nocacheflag and cmode */ 768/* Values for nocacheflag and cmode */
777/* These are not used by the APUS kernel_map, but prevents 769/* These are not used by the APUS kernel_map, but prevents
778 compilation errors. */ 770 compilation errors. */