Commit e6b6e3ff authored by Adrian Bunk's avatar Adrian Bunk Committed by Paul Mackerras

[POWERPC] Remove APUS support from arch/ppc

Current status of APUS:
- arch/powerpc/: removed in 2.6.23
- arch/ppc/: marked BROKEN since 2 years

This therefore removes the remaining parts of APUS support from
arch/ppc, include/asm-ppc, arch/powerpc and include/asm-powerpc.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 8237bf08
......@@ -573,24 +573,9 @@ choice
Select PReP if configuring for a PReP machine.
Select Gemini if configuring for a Synergy Microsystems' Gemini
series Single Board Computer. More information is available at:
<http://www.synergymicro.com/PressRel/97_10_15.html>.
Select APUS if configuring for a PowerUP Amiga. More information is
available at: <http://linux-apus.sourceforge.net/>.
config PPC_PREP
bool "PReP"
config APUS
bool "Amiga-APUS"
depends on BROKEN
help
Select APUS if configuring for a PowerUP Amiga.
More information is available at:
<http://linux-apus.sourceforge.net/>.
config KATANA
bool "Artesyn-Katana"
help
......@@ -1027,132 +1012,6 @@ config CMDLINE
some command-line options at build time by entering them here. In
most cases you will need to specify the root device here.
config AMIGA
bool
depends on APUS
default y
help
This option enables support for the Amiga series of computers.
config ZORRO
bool
depends on APUS
default y
help
This enables support for the Zorro bus in the Amiga. If you have
expansion cards in your Amiga that conform to the Amiga
AutoConfig(tm) specification, say Y, otherwise N. Note that even
expansion cards that do not fit in the Zorro slots but fit in e.g.
the CPU slot may fall in this category, so you have to say Y to let
Linux use these.
config ABSTRACT_CONSOLE
bool
depends on APUS
default y
config APUS_FAST_EXCEPT
bool
depends on APUS
default y
config AMIGA_PCMCIA
bool "Amiga 1200/600 PCMCIA support"
depends on APUS && EXPERIMENTAL
help
Include support in the kernel for pcmcia on Amiga 1200 and Amiga
600. If you intend to use pcmcia cards say Y; otherwise say N.
config AMIGA_BUILTIN_SERIAL
tristate "Amiga builtin serial support"
depends on APUS
help
If you want to use your Amiga's built-in serial port in Linux,
answer Y.
To compile this driver as a module, choose M here.
config GVPIOEXT
tristate "GVP IO-Extender support"
depends on APUS
help
If you want to use a GVP IO-Extender serial card in Linux, say Y.
Otherwise, say N.
config GVPIOEXT_LP
tristate "GVP IO-Extender parallel printer support"
depends on GVPIOEXT
help
Say Y to enable driving a printer from the parallel port on your
GVP IO-Extender card, N otherwise.
config GVPIOEXT_PLIP
tristate "GVP IO-Extender PLIP support"
depends on GVPIOEXT
help
Say Y to enable doing IP over the parallel port on your GVP
IO-Extender card, N otherwise.
config MULTIFACE_III_TTY
tristate "Multiface Card III serial support"
depends on APUS
help
If you want to use a Multiface III card's serial port in Linux,
answer Y.
To compile this driver as a module, choose M here.
config A2232
tristate "Commodore A2232 serial support (EXPERIMENTAL)"
depends on EXPERIMENTAL && APUS
---help---
This option supports the 2232 7-port serial card shipped with the
Amiga 2000 and other Zorro-bus machines, dating from 1989. At
a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
ports were connected with 8 pin DIN connectors on the card bracket,
for which 8 pin to DB25 adapters were supplied. The card also had
jumpers internally to toggle various pinning configurations.
This driver can be built as a module; but then "generic_serial"
will also be built as a module. This has to be loaded before
"ser_a2232". If you want to do this, answer M here.
config WHIPPET_SERIAL
tristate "Hisoft Whippet PCMCIA serial support"
depends on AMIGA_PCMCIA
help
HiSoft has a web page at <http://www.hisoft.co.uk/>, but there
is no listing for the Whippet in their Amiga section.
config APNE
tristate "PCMCIA NE2000 support"
depends on AMIGA_PCMCIA
help
If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
say N.
To compile this driver as a module, choose M here: the
module will be called apne.
config SERIAL_CONSOLE
bool "Support for serial port console"
depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)
config HEARTBEAT
bool "Use power LED as a heartbeat"
depends on APUS
help
Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is
a hyperbolic function of the 5-minute load average.
config PROC_HARDWARE
bool "/proc/hardware support"
depends on APUS
source "drivers/zorro/Kconfig"
if !44x || BROKEN
source kernel/power/Kconfig
endif
......@@ -1227,8 +1086,7 @@ config MCA
config PCI
bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx
default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx
default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
default y if !40x && !CPM2 && !8xx && !83xx && !85xx
default PCI_QSPAN if !4xx && !CPM2 && 8xx
help
Find out whether your system includes a PCI bus. PCI is the name of
......@@ -1284,10 +1142,6 @@ config 8260_PCI9_IDMA4
endchoice
config PCI_PERMEDIA
bool "PCI for Permedia2"
depends on !4xx && !8xx && APUS
source "drivers/pci/Kconfig"
source "drivers/pcmcia/Kconfig"
......
......@@ -69,7 +69,6 @@ core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
core-$(CONFIG_XMON) += arch/ppc/xmon/
core-$(CONFIG_APUS) += arch/ppc/amiga/
drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
......
#
# Makefile for Linux arch/m68k/amiga source directory
#
obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \
chipram.o amiga_ksyms.o
obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
#include "../../m68k/amiga/amiga_ksyms.c"
/*
* Amiga Linux interrupt handling code
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*
* 11/07/96: rewritten interrupt handling, irq lists are exists now only for
* this sources where it makes sense (VERTB/PORTS/EXTER) and you must
* be careful that dev_id for this sources is unique since this the
* only possibility to distinguish between different handlers for
* free_irq. irq lists also have different irq flags:
* - IRQ_FLG_FAST: handler is inserted at top of list (after other
* fast handlers)
* - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
* they're executed irq level is set to the previous
* one, but handlers don't need to be reentrant, if
* reentrance occurred, slow handlers will be just
* called again.
* The whole interrupt handling for CIAs is moved to cia.c
* /Roman Zippel
*
* 07/08/99: rewamp of the interrupt handling - we now have two types of
* interrupts, normal and fast handlers, fast handlers being
* marked with SA_INTERRUPT and runs with all other interrupts
* disabled. Normal interrupts disable their own source but
* run with all other interrupt sources enabled.
* PORTS and EXTER interrupts are always shared even if the
* drivers do not explicitly mark this when calling
* request_irq which they really should do.
* This is similar to the way interrupts are handled on all
* other architectures and makes a ton of sense besides
* having the advantage of making it easier to share
* drivers.
* /Jes
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
#include <asm/amipcmcia.h>
#ifdef CONFIG_APUS
#include <asm/amigappc.h>
#endif
extern void cia_init_IRQ(struct ciabase *base);
unsigned short ami_intena_vals[AMI_STD_IRQS] = {
IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT,
IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_SOFT, IF_PORTS, IF_EXTER
};
static const unsigned char ami_servers[AMI_STD_IRQS] = {
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
};
static short ami_ablecount[AMI_IRQS];
static void ami_badint(int irq, void *dev_id, struct pt_regs *fp)
{
/* num_spurious += 1;*/
}
/*
* void amiga_init_IRQ(void)
*
* Parameters: None
*
* Returns: Nothing
*
* This function should be called during kernel startup to initialize
* the amiga IRQ handling routines.
*/
__init
void amiga_init_IRQ(void)
{
int i;
for (i = 0; i < AMI_IRQS; i++)
ami_ablecount[i] = 0;
/* turn off PCMCIA interrupts */
if (AMIGAHW_PRESENT(PCMCIA))
gayle.inten = GAYLE_IRQ_IDE;
/* turn off all interrupts... */
amiga_custom.intena = 0x7fff;
amiga_custom.intreq = 0x7fff;
#ifdef CONFIG_APUS
/* Clear any inter-CPU interrupt requests. Circumvents bug in
Blizzard IPL emulation HW (or so it appears). */
APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);
/* Init IPL emulation. */
APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
#endif
/* ... and enable the master interrupt bit */
amiga_custom.intena = IF_SETCLR | IF_INTEN;
cia_init_IRQ(&ciaa_base);
cia_init_IRQ(&ciab_base);
}
/*
* Enable/disable a particular machine specific interrupt source.
* Note that this may affect other interrupts in case of a shared interrupt.
* This function should only be called for a _very_ short time to change some
* internal data, that may not be changed by the interrupt at the same time.
* ami_(enable|disable)_irq calls may also be nested.
*/
void amiga_enable_irq(unsigned int irq)
{
if (irq >= AMI_IRQS) {
printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
return;
}
ami_ablecount[irq]--;
if (ami_ablecount[irq]<0)
ami_ablecount[irq]=0;
else if (ami_ablecount[irq])
return;
/* No action for auto-vector interrupts */
if (irq >= IRQ_AMIGA_AUTO){
printk("%s: Trying to enable auto-vector IRQ %i\n",
__FUNCTION__, irq - IRQ_AMIGA_AUTO);
return;
}
if (irq >= IRQ_AMIGA_CIAA) {
cia_set_irq(irq, 0);
cia_able_irq(irq, 1);
return;
}
/* enable the interrupt */
amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq];
}
void amiga_disable_irq(unsigned int irq)
{
if (irq >= AMI_IRQS) {
printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
return;
}
if (ami_ablecount[irq]++)
return;
/* No action for auto-vector interrupts */
if (irq >= IRQ_AMIGA_AUTO) {
printk("%s: Trying to disable auto-vector IRQ %i\n",
__FUNCTION__, irq - IRQ_AMIGA_AUTO);
return;
}
if (irq >= IRQ_AMIGA_CIAA) {
cia_able_irq(irq, 0);
return;
}
/* disable the interrupt */
amiga_custom.intena = ami_intena_vals[irq];
}
inline void amiga_do_irq(int irq, struct pt_regs *fp)
{
irq_desc_t *desc = irq_desc + irq;
struct irqaction *action = desc->action;
kstat_cpu(0).irqs[irq]++;
action->handler(irq, action->dev_id, fp);
}
void amiga_do_irq_list(int irq, struct pt_regs *fp)
{
irq_desc_t *desc = irq_desc + irq;
struct irqaction *action;
kstat_cpu(0).irqs[irq]++;
amiga_custom.intreq = ami_intena_vals[irq];
for (action = desc->action; action; action = action->next)
action->handler(irq, action->dev_id, fp);
}
/*
* The builtin Amiga hardware interrupt handlers.
*/
static void ami_int1(int irq, void *dev_id, struct pt_regs *fp)
{
unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
/* if serial transmit buffer empty, interrupt */
if (ints & IF_TBE) {
amiga_custom.intreq = IF_TBE;
amiga_do_irq(IRQ_AMIGA_TBE, fp);
}
/* if floppy disk transfer complete, interrupt */
if (ints & IF_DSKBLK) {
amiga_custom.intreq = IF_DSKBLK;
amiga_do_irq(IRQ_AMIGA_DSKBLK, fp);
}
/* if software interrupt set, interrupt */
if (ints & IF_SOFT) {
amiga_custom.intreq = IF_SOFT;
amiga_do_irq(IRQ_AMIGA_SOFT, fp);
}
}
static void ami_int3(int irq, void *dev_id, struct pt_regs *fp)
{
unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
/* if a blitter interrupt */
if (ints & IF_BLIT) {
amiga_custom.intreq = IF_BLIT;
amiga_do_irq(IRQ_AMIGA_BLIT, fp);
}
/* if a copper interrupt */
if (ints & IF_COPER) {
amiga_custom.intreq = IF_COPER;
amiga_do_irq(IRQ_AMIGA_COPPER, fp);
}
/* if a vertical blank interrupt */
if (ints & IF_VERTB)
amiga_do_irq_list(IRQ_AMIGA_VERTB, fp);
}
static void ami_int4(int irq, void *dev_id, struct pt_regs *fp)
{
unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
/* if audio 0 interrupt */
if (ints & IF_AUD0) {
amiga_custom.intreq = IF_AUD0;
amiga_do_irq(IRQ_AMIGA_AUD0, fp);
}
/* if audio 1 interrupt */
if (ints & IF_AUD1) {
amiga_custom.intreq = IF_AUD1;
amiga_do_irq(IRQ_AMIGA_AUD1, fp);
}
/* if audio 2 interrupt */
if (ints & IF_AUD2) {
amiga_custom.intreq = IF_AUD2;
amiga_do_irq(IRQ_AMIGA_AUD2, fp);
}
/* if audio 3 interrupt */
if (ints & IF_AUD3) {
amiga_custom.intreq = IF_AUD3;
amiga_do_irq(IRQ_AMIGA_AUD3, fp);
}
}
static void ami_int5(int irq, void *dev_id, struct pt_regs *fp)
{
unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
/* if serial receive buffer full interrupt */
if (ints & IF_RBF) {
/* acknowledge of IF_RBF must be done by the serial interrupt */
amiga_do_irq(IRQ_AMIGA_RBF, fp);
}
/* if a disk sync interrupt */
if (ints & IF_DSKSYN) {
amiga_custom.intreq = IF_DSKSYN;
amiga_do_irq(IRQ_AMIGA_DSKSYN, fp);
}
}
static void ami_int7(int irq, void *dev_id, struct pt_regs *fp)
{
panic ("level 7 interrupt received\n");
}
#ifdef CONFIG_APUS
/* The PPC irq handling links all handlers requested on the same vector
and executes them in a loop. Having ami_badint at the end of the chain
is a bad idea. */
struct irqaction amiga_sys_irqaction[AUTO_IRQS] = {
{ .handler = ami_badint, .name = "spurious int" },
{ .handler = ami_int1, .name = "int1 handler" },
{ 0, /* CIAA */ },
{ .handler = ami_int3, .name = "int3 handler" },
{ .handler = ami_int4, .name = "int4 handler" },
{ .handler = ami_int5, .name = "int5 handler" },
{ 0, /* CIAB */ },
{ .handler = ami_int7, .name = "int7 handler" },
};
#else
void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
ami_badint, ami_int1, ami_badint, ami_int3,
ami_int4, ami_int5, ami_badint, ami_int7
};
#endif
#include "../../m68k/amiga/amisound.c"
/*
* Extracted from arch/m68k/kernel/setup.c.
* Should be properly generalized and put somewhere else.
* Jesper
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/init.h>
#include <asm/setup.h>
#include <asm/bootinfo.h>
extern char cmd_line[CL_SIZE];
extern int num_memory;
extern int m68k_realnum_memory;
extern struct mem_info memory[NUM_MEMINFO];
extern struct mem_info m68k_memory[NUM_MEMINFO];
extern struct mem_info ramdisk;
extern int amiga_parse_bootinfo(const struct bi_record *);
extern int atari_parse_bootinfo(const struct bi_record *);
extern int mac_parse_bootinfo(const struct bi_record *);
void __init parse_bootinfo(const struct bi_record *record)
{
while (record->tag != BI_LAST) {
int unknown = 0;
const u_long *data = record->data;
switch (record->tag) {
case BI_MACHTYPE:
case BI_CPUTYPE:
case BI_FPUTYPE:
case BI_MMUTYPE:
/* Already set up by head.S */
break;
case BI_MEMCHUNK:
if (num_memory < NUM_MEMINFO) {
memory[num_memory].addr = data[0];
memory[num_memory].size = data[1];
num_memory++;
/* FIXME: duplicate for m68k drivers. */
m68k_memory[m68k_realnum_memory].addr = data[0];
m68k_memory[m68k_realnum_memory].size = data[1];
m68k_realnum_memory++;
} else
printk("parse_bootinfo: too many memory chunks\n");
break;
case BI_RAMDISK:
ramdisk.addr = data[0];
ramdisk.size = data[1];
break;
case BI_COMMAND_LINE:
strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
break;
default:
if (MACH_IS_AMIGA)
unknown = amiga_parse_bootinfo(record);
else if (MACH_IS_ATARI)
unknown = atari_parse_bootinfo(record);
else if (MACH_IS_MAC)
unknown = mac_parse_bootinfo(record);
else
unknown = 1;
}
if (unknown)
printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
record->tag);
record = (struct bi_record *)((u_long)record+record->size);
}
}
#include "../../m68k/amiga/chipram.c"
/*
* Copyright (C) 1996 Roman Zippel
*
* The concept of some functions bases on the original Amiga OS function
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
struct ciabase {
volatile struct CIA *cia;
u_char icr_mask, icr_data;
u_short int_mask;
int handler_irq, cia_irq, server_irq;
char *name;
} ciaa_base = {
&ciaa, 0, 0, IF_PORTS,
IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA,
IRQ_AMIGA_PORTS,
"CIAA handler"
}, ciab_base = {
&ciab, 0, 0, IF_EXTER,
IRQ_AMIGA_AUTO_6, IRQ_AMIGA_CIAB,
IRQ_AMIGA_EXTER,
"CIAB handler"
};
#define CIA_SET_BASE_ADJUST_IRQ(base, irq) \
do { \
if (irq >= IRQ_AMIGA_CIAB) { \
base = &ciab_base; \
irq -= IRQ_AMIGA_CIAB; \
} else { \
base = &ciaa_base; \
irq -= IRQ_AMIGA_CIAA; \
} \
} while (0)
/*
* Cause or clear CIA interrupts, return old interrupt status.
*/
static unsigned char cia_set_irq_private(struct ciabase *base,
unsigned char mask)
{
u_char old;
old = (base->icr_data |= base->cia->icr);
if (mask & CIA_ICR_SETCLR)
base->icr_data |= mask;
else
base->icr_data &= ~mask;
if (base->icr_data & base->icr_mask)
amiga_custom.intreq = IF_SETCLR | base->int_mask;
return old & base->icr_mask;
}
unsigned char cia_set_irq(unsigned int irq, int set)
{
struct ciabase *base;
unsigned char mask;
if (irq >= IRQ_AMIGA_CIAB)
mask = (1 << (irq - IRQ_AMIGA_CIAB));
else
mask = (1 << (irq - IRQ_AMIGA_CIAA));
mask |= (set) ? CIA_ICR_SETCLR : 0;
CIA_SET_BASE_ADJUST_IRQ(base, irq);
return cia_set_irq_private(base, mask);
}
unsigned char cia_get_irq_mask(unsigned int irq)
{
struct ciabase *base;
CIA_SET_BASE_ADJUST_IRQ(base, irq);
return base->cia->icr;
}
/*
* Enable or disable CIA interrupts, return old interrupt mask.
*/
static unsigned char cia_able_irq_private(struct ciabase *base,
unsigned char mask)
{
u_char old;
old = base->icr_mask;
base->icr_data |= base->cia->icr;
base->cia->icr = mask;
if (mask & CIA_ICR_SETCLR)
base->icr_mask |= mask;
else
base->icr_mask &= ~mask;
base->icr_mask &= CIA_ICR_ALL;
if (base->icr_data & base->icr_mask)
amiga_custom.intreq = IF_SETCLR | base->int_mask;
return old;
}
unsigned char cia_able_irq(unsigned int irq, int enable)
{
struct ciabase *base;
unsigned char mask;
if (irq >= IRQ_AMIGA_CIAB)
mask = (1 << (irq - IRQ_AMIGA_CIAB));
else
mask = (1 << (irq - IRQ_AMIGA_CIAA));
mask |= (enable) ? CIA_ICR_SETCLR : 0;
CIA_SET_BASE_ADJUST_IRQ(base, irq);
return cia_able_irq_private(base, mask);
}
static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
{
struct ciabase *base = (struct ciabase *)dev_id;
irq_desc_t *desc;
struct irqaction *action;
int i;
unsigned char ints;
irq = base->cia_irq;
desc = irq_desc + irq;
ints = cia_set_irq_private(base, CIA_ICR_ALL);
amiga_custom.intreq = base->int_mask;
for (i = 0; i < CIA_IRQS; i++, irq++) {
if (ints & 1) {
kstat_cpu(0).irqs[irq]++;
action = desc->action;
action->handler(irq, action->dev_id, fp);
}
ints >>= 1;
desc++;
}
amiga_do_irq_list(base->server_irq, fp);
}
void __init cia_init_IRQ(struct ciabase *base)
{
extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
struct irqaction *action;
/* clear any pending interrupt and turn off all interrupts */
cia_set_irq_private(base, CIA_ICR_ALL);
cia_able_irq_private(base, CIA_ICR_ALL);
/* install CIA handler */
action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO];
action->handler = cia_handler;
action->dev_id = base;
action->name = base->name;
setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]);
amiga_custom.intena = IF_SETCLR | base->int_mask;
}
This diff is collapsed.
/*
* Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c
* Needed to drive the m68k emulating IRQ hardware on the PowerUp boards.
*/
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <asm/setup.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/page.h>
#include <asm/machdep.h>
/* table for system interrupt handlers */
static irq_handler_t irq_list[SYS_IRQS];
static const char *default_names[SYS_IRQS] = {
"spurious int", "int1 handler", "int2 handler", "int3 handler",
"int4 handler", "int5 handler", "int6 handler", "int7 handler"
};
/* The number of spurious interrupts */
volatile unsigned int num_spurious;
#define NUM_IRQ_NODES 100
static irq_node_t nodes[NUM_IRQ_NODES];
/*
* void init_IRQ(void)
*
* Parameters: None
*
* Returns: Nothing
*
* This function should be called during kernel startup to initialize
* the IRQ handling routines.
*/
__init
void m68k_init_IRQ(void)
{
int i;
for (i = 0; i < SYS_IRQS; i++) {
if (mach_default_handler)
irq_list[i].handler = (*mach_default_handler)[i];
irq_list[i].flags = 0;
irq_list[i].dev_id = NULL;
irq_list[i].devname = default_names[i];
}
for (i = 0; i < NUM_IRQ_NODES; i++)
nodes[i].handler = NULL;
mach_init_IRQ ();
}
irq_node_t *new_irq_node(void)
{
irq_node_t *node;
short i;
for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--)
if (!node->handler)
return node;
printk ("new_irq_node: out of nodes\n");
return NULL;
}
int sys_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id)
{
if (irq < IRQ1 || irq > IRQ7) {
printk("%s: Incorrect IRQ %d from %s\n",
__FUNCTION__, irq, devname);
return -ENXIO;
}
#if 0
if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
if (irq_list[irq].flags & IRQ_FLG_LOCK) {
printk("%s: IRQ %d from %s is not replaceable\n",
__FUNCTION__, irq, irq_list[irq].devname);
return -EBUSY;
}
if (!(flags & IRQ_FLG_REPLACE)) {
printk("%s: %s can't replace IRQ %d from %s\n",
__FUNCTION__, devname, irq, irq_list[irq].devname);
return -EBUSY;
}
}
#endif
irq_list[irq].handler = handler;
irq_list[irq].flags = flags;
irq_list[irq].dev_id = dev_id;
irq_list[irq].devname = devname;
return 0;
}
void sys_free_irq(unsigned int irq, void *dev_id)
{
if (irq < IRQ1 || irq > IRQ7) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
return;
}
if (irq_list[irq].dev_id != dev_id)
printk("%s: Removing probably wrong IRQ %d from %s\n",
__FUNCTION__, irq, irq_list[irq].devname);
irq_list[irq].handler = (*mach_default_handler)[irq];
irq_list[irq].flags = 0;
irq_list[irq].dev_id = NULL;
irq_list[irq].devname = default_names[irq];
}
asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
{
if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
vec -= VEC_SPUR;
kstat_cpu(0).irqs[vec]++;
irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
} else {
if (mach_process_int)
mach_process_int(vec, fp);
else
panic("Can't process interrupt vector %ld\n", vec);
return;
}
}
int m68k_get_irq_list(struct seq_file *p, void *v)
{
int i;
/* autovector interrupts */
if (mach_default_handler) {
for (i = 0; i < SYS_IRQS; i++) {
seq_printf(p, "auto %2d: %10u ", i,
i ? kstat_cpu(0).irqs[i] : num_spurious);
seq_puts(p, " ");
seq_printf(p, "%s\n", irq_list[i].devname);
}
}
mach_get_irq_list(p, v);
return 0;
}
#include "../../m68k/amiga/pcmcia.c"
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <asm/machdep.h>
#include <asm/io.h>
#include <linux/timex.h>
unsigned long m68k_get_rtc_time(void)
{
unsigned int year, mon, day, hour, min, sec;
extern void arch_gettod(int *year, int *mon, int *day, int *hour,
int *min, int *sec);
arch_gettod (&year, &mon, &day, &hour, &min, &sec);
if ((year += 1900) < 1970)
year += 100;
return mktime(year, mon, day, hour, min, sec);
}
int m68k_set_rtc_time(unsigned long nowtime)
{
if (mach_set_clock_mmss)
return mach_set_clock_mmss (nowtime);
return -1;
}
void apus_heartbeat (void)
{
#ifdef CONFIG_HEARTBEAT
static unsigned cnt = 0, period = 0, dist = 0;
if (cnt == 0 || cnt == dist)
mach_heartbeat( 1 );
else if (cnt == 7 || cnt == dist+7)
mach_heartbeat( 0 );
if (++cnt > period) {
cnt = 0;
/* The hyperbolic function below modifies the heartbeat period
* length in dependency of the current (5min) load. It goes
* through the points f(0)=126, f(1)=86, f(5)=51,
* f(inf)->30. */
period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
dist = period / 4;
}
#endif
/* should be made smarter */
ppc_md.heartbeat_count = 1;
}
This diff is collapsed.
......@@ -32,10 +32,6 @@
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#ifdef CONFIG_APUS
#include <asm/amigappc.h>
#endif
/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
#define LOAD_BAT(n, reg, RA, RB) \
/* see the comment for clear_bats() -- Cort */ \
......@@ -128,14 +124,6 @@ __start:
*/
bl early_init
#ifdef CONFIG_APUS
/* On APUS the __va/__pa constants need to be set to the correct
* values before continuing.
*/
mr r4,r30
bl fix_mem_constants
#endif /* CONFIG_APUS */
/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
* the physical address we are running at, returned by early_init()
*/
......@@ -145,7 +133,7 @@ __after_mmu_off:
bl flush_tlbs
bl initial_bats
#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT)
#ifdef CONFIG_BOOTX_TEXT
bl setup_disp_bat
#endif
......@@ -161,7 +149,6 @@ __after_mmu_off:
#endif /* CONFIG_6xx */
#ifndef CONFIG_APUS
/*
* We need to run with _start at physical address 0.
* If the MMU is already turned on, we copy stuff to KERNELBASE,
......@@ -172,7 +159,7 @@ __after_mmu_off:
addis r4,r3,KERNELBASE@h /* current address of _start */
cmpwi 0,r4,0 /* are we already running at 0? */
bne relocate_kernel
#endif /* CONFIG_APUS */
/*
* we now have the 1st 16M of ram mapped with the bats.
* prep needs the mmu to be turned on here, but pmac already has it on.
......@@ -812,85 +799,6 @@ copy_and_flush:
addi r6,r6,4
blr
#ifdef CONFIG_APUS
/*
* On APUS the physical base address of the kernel is not known at compile
* time, which means the __pa/__va constants used are incorrect. In the
* __init section is recorded the virtual addresses of instructions using
* these constants, so all that has to be done is fix these before
* continuing the kernel boot.
*
* r4 = The physical address of the kernel base.
*/
fix_mem_constants:
mr r10,r4
addis r10,r10,-KERNELBASE@h /* virt_to_phys constant */
neg r11,r10 /* phys_to_virt constant */
lis r12,__vtop_table_begin@h
ori r12,r12,__vtop_table_begin@l
add r12,r12,r10 /* table begin phys address */
lis r13,__vtop_table_end@h
ori r13,r13,__vtop_table_end@l
add r13,r13,r10 /* table end phys address */
subi r12,r12,4
subi r13,r13,4
1: lwzu r14,4(r12) /* virt address of instruction */
add r14,r14,r10 /* phys address of instruction */
lwz r15,0(r14) /* instruction, now insert top */
rlwimi r15,r10,16,16,31 /* half of vp const in low half */
stw r15,0(r14) /* of instruction and restore. */
dcbst r0,r14 /* write it to memory */
sync
icbi r0,r14 /* flush the icache line */
cmpw r12,r13
bne 1b
sync /* additional sync needed on g4 */
isync
/*
* Map the memory where the exception handlers will
* be copied to when hash constants have been patched.
*/
#ifdef CONFIG_APUS_FAST_EXCEPT
lis r8,0xfff0
#else
lis r8,0
#endif
ori r8,r8,0x2 /* 128KB, supervisor */
mtspr SPRN_DBAT3U,r8
mtspr SPRN_DBAT3L,r8
lis r12,__ptov_table_begin@h
ori r12,r12,__ptov_table_begin@l
add r12,r12,r10 /* table begin phys address */
lis r13,__ptov_table_end@h
ori r13,r13,__ptov_table_end@l
add r13,r13,r10 /* table end phys address */
subi r12,r12,4
subi r13,r13,4
1: lwzu r14,4(r12) /* virt address of instruction */
add r14,r14,r10 /* phys address of instruction */
lwz r15,0(r14) /* instruction, now insert top */
rlwimi r15,r11,16,16,31 /* half of pv const in low half*/
stw r15,0(r14) /* of instruction and restore. */
dcbst r0,r14 /* write it to memory */
sync
icbi r0,r14 /* flush the icache line */
cmpw r12,r13
bne 1b
sync /* additional sync needed on g4 */
isync /* No speculative loading until now */
blr
/***********************************************************************
* Please note that on APUS the exception handlers are located at the
* physical address 0xfff0000. For this reason, the exception handlers
* cannot use relative branches to access the code below.
***********************************************************************/
#endif /* CONFIG_APUS */
#ifdef CONFIG_SMP
.globl __secondary_start_pmac_0
__secondary_start_pmac_0:
......@@ -1043,19 +951,6 @@ start_here:
bl machine_init
bl MMU_init
#ifdef CONFIG_APUS
/* Copy exception code to exception vector base on APUS. */
lis r4,KERNELBASE@h
#ifdef CONFIG_APUS_FAST_EXCEPT
lis r3,0xfff0 /* Copy to 0xfff00000 */
#else
lis r3,0 /* Copy to 0x00000000 */
#endif
li r5,0x4000 /* # bytes of memory to copy */
li r6,0
bl copy_and_flush /* copy the first 0x4000 bytes */
#endif /* CONFIG_APUS */
/*
* Go back to running unmapped so we can load up new values
* for SDR1 (hash table pointer) and the segment registers
......@@ -1232,11 +1127,7 @@ initial_bats:
#else
ori r8,r8,2 /* R/W access */
#endif /* CONFIG_SMP */
#ifdef CONFIG_APUS
ori r11,r11,BL_8M<<2|0x2 /* set up 8MB BAT registers for 604 */
#else
ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
#endif /* CONFIG_APUS */
mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
......@@ -1245,7 +1136,7 @@ initial_bats:
isync
blr
#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT)
#ifdef CONFIG_BOOTX_TEXT
setup_disp_bat:
/*
* setup the display bat prepared for us in prom.c
......@@ -1268,7 +1159,7 @@ setup_disp_bat:
mtspr SPRN_IBAT3U,r11
blr
#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */
#endif /* defined(CONFIG_BOOTX_TEXT) */
#ifdef CONFIG_8260
/* Jump into the system reset for the rom.
......
......@@ -60,8 +60,6 @@ long long __ashrdi3(long long, int);
long long __ashldi3(long long, int);
long long __lshrdi3(long long, int);
extern unsigned long mm_ptov (unsigned long paddr);
EXPORT_SYMBOL(clear_pages);
EXPORT_SYMBOL(clear_user_page);
EXPORT_SYMBOL(transfer_to_handler);
......@@ -118,7 +116,6 @@ EXPORT_SYMBOL(_outsw_ns);
EXPORT_SYMBOL(_insl_ns);
EXPORT_SYMBOL(_outsl_ns);
EXPORT_SYMBOL(iopa);
EXPORT_SYMBOL(mm_ptov);
EXPORT_SYMBOL(ioremap);
#ifdef CONFIG_44x
EXPORT_SYMBOL(ioremap64);
......
......@@ -25,7 +25,6 @@
#include <asm/pgtable.h>
#include <asm/bootinfo.h>
#include <asm/setup.h>
#include <asm/amigappc.h>
#include <asm/smp.h>
#include <asm/elf.h>
#include <asm/cputable.h>
......
......@@ -426,41 +426,3 @@ unsigned long iopa(unsigned long addr)
return(pa);
}
/* This is will find the virtual address for a physical one....
* Swiped from APUS, could be dangerous :-).
* This is only a placeholder until I really find a way to make this
* work. -- Dan
*/
unsigned long
mm_ptov (unsigned long paddr)
{
unsigned long ret;
#if 0
if (paddr < 16*1024*1024)
ret = ZTWO_VADDR(paddr);
else {
int i;
for (i = 0; i < kmap_chunk_count;){
unsigned long phys = kmap_chunks[i++];
unsigned long size = kmap_chunks[i++];
unsigned long virt = kmap_chunks[i++];
if (paddr >= phys
&& paddr < (phys + size)){
ret = virt + paddr - phys;
goto exit;
}
}
ret = (unsigned long) __va(paddr);
}
exit:
#ifdef DEBUGPV
printk ("PTOV(%lx)=%lx\n", paddr, ret);
#endif
#else
ret = (unsigned long)paddr + KERNELBASE;
#endif
return ret;
}
......@@ -2,10 +2,6 @@
# Makefile for the linux kernel.
#
obj-$(CONFIG_APUS) += apus_setup.o
ifeq ($(CONFIG_APUS),y)
obj-$(CONFIG_PCI) += apus_pci.o
endif
obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_PQ2ADS) += pq2ads.o
......
/*
* Copyright (C) Michel Dnzer <michdaen@iiic.ethz.ch>
*
* APUS PCI routines.
*
* Currently, only B/CVisionPPC cards (Permedia2) are supported.
*
* Thanks to Geert Uytterhoeven for the idea:
* Read values from given config space(s) for the first devices, -1 otherwise
*
*/
#ifdef CONFIG_AMIGA
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/pci-bridge.h>
#include <asm/machdep.h>
#include "apus_pci.h"
/* These definitions are mostly adapted from pm2fb.c */
#undef APUS_PCI_MASTER_DEBUG
#ifdef APUS_PCI_MASTER_DEBUG
#define DPRINTK(a,b...) printk(KERN_DEBUG "apus_pci: %s: " a, __FUNCTION__ , ## b)
#else
#define DPRINTK(a,b...)
#endif
/*
* The _DEFINITIVE_ memory mapping/unmapping functions.
* This is due to the fact that they're changing soooo often...
*/
#define DEFW() wmb()
#define DEFR() rmb()
#define DEFRW() mb()
#define DEVNO(d) ((d)>>3)
#define FNNO(d) ((d)&7)
extern unsigned long powerup_PCI_present;
static struct pci_controller *apus_hose;
void *pci_io_base(unsigned int bus)
{
return 0;
}
int
apus_pcibios_read_config(struct pci_bus *bus, int devfn, int offset,
int len, u32 *val)
{
int fnno = FNNO(devfn);
int devno = DEVNO(devfn);
volatile unsigned char *cfg_data;
if (bus->number > 0 || devno != 1) {
*val = ~0;
return PCIBIOS_DEVICE_NOT_FOUND;
}
/* base address + function offset + offset ^ endianness conversion */
/* XXX the fnno<<5 bit seems wacky -- paulus */
cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
switch (len) {
case 1:
*val = readb(cfg_data);
break;
case 2:
*val = readw(cfg_data);
break;
default:
*val = readl(cfg_data);
break;
}
DPRINTK("read b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
bus->number, devfn>>3, devfn&7, offset, len, *val);
return PCIBIOS_SUCCESSFUL;
}
int
apus_pcibios_write_config(struct pci_bus *bus, int devfn, int offset,
int len, u32 *val)
{
int fnno = FNNO(devfn);
int devno = DEVNO(devfn);
volatile unsigned char *cfg_data;
if (bus->number > 0 || devno != 1) {
return PCIBIOS_DEVICE_NOT_FOUND;
}
/* base address + function offset + offset ^ endianness conversion */
/* XXX the fnno<<5 bit seems wacky -- paulus */
cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
switch (len) {
case 1:
writeb(val, cfg_data); DEFW();
break;
case 2:
writew(val, cfg_data); DEFW();
break;
default:
writel(val, cfg_data); DEFW();
break;
}
DPRINTK("write b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
bus->number, devfn>>3, devfn&7, offset, len, val);
return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops apus_pci_ops = {
apus_pcibios_read_config,
apus_pcibios_write_config
};
static struct resource pci_mem = { "B/CVisionPPC PCI mem", CVPPC_FB_APERTURE_ONE, CVPPC_PCI_CONFIG, IORESOURCE_MEM };
void __init
apus_pcibios_fixup(void)
{
/* struct pci_dev *dev = pci_find_slot(0, 1<<3);
unsigned int reg, val, offset;*/
/* FIXME: interrupt? */
/*dev->interrupt = xxx;*/
request_resource(&iomem_resource, &pci_mem);
printk("%s: PCI mem resource requested\n", __FUNCTION__);
}
static void __init apus_pcibios_fixup_bus(struct pci_bus *bus)
{
bus->resource[1] = &pci_mem;
}
/*
* This is from pm2fb.c again
*
* Check if PCI (B/CVisionPPC) is available, initialize it and set up
* the pcibios_* pointers
*/
void __init
apus_setup_pci_ptrs(void)
{
if (!powerup_PCI_present) {
DPRINTK("no PCI bridge detected\n");
return;
}
DPRINTK("Phase5 B/CVisionPPC PCI bridge detected.\n");
apus_hose = pcibios_alloc_controller();
if (!apus_hose) {
printk("apus_pci: Can't allocate PCI controller structure\n");
return;
}
if (!(apus_hose->cfg_data = ioremap(CVPPC_PCI_CONFIG, 256))) {
printk("apus_pci: unable to map PCI config region\n");
return;
}
if (!(apus_hose->cfg_addr = ioremap(CSPPC_PCI_BRIDGE, 256))) {
printk("apus_pci: unable to map PCI bridge\n");
return;
}
writel(CSPPCF_BRIDGE_BIG_ENDIAN, apus_hose->cfg_addr + CSPPC_BRIDGE_ENDIAN);
DEFW();
writel(CVPPC_REGS_REGION, apus_hose->cfg_data+ PCI_BASE_ADDRESS_0);
DEFW();
writel(CVPPC_FB_APERTURE_ONE, apus_hose->cfg_data + PCI_BASE_ADDRESS_1);
DEFW();
writel(CVPPC_FB_APERTURE_TWO, apus_hose->cfg_data + PCI_BASE_ADDRESS_2);
DEFW();
writel(CVPPC_ROM_ADDRESS, apus_hose->cfg_data + PCI_ROM_ADDRESS);
DEFW();
writel(0xef000000 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER, apus_hose->cfg_data + PCI_COMMAND);
DEFW();
apus_hose->first_busno = 0;
apus_hose->last_busno = 0;
apus_hose->ops = &apus_pci_ops;
ppc_md.pcibios_fixup = apus_pcibios_fixup;
ppc_md.pcibios_fixup_bus = apus_pcibios_fixup_bus;
return;
}
#endif /* CONFIG_AMIGA */
/*
* Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
* driver.
*
* Copyright (c) 1998-1999 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file README.legal in the main directory of this archive
* for more details.
*/
#ifndef APUS_PCI_H
#define APUS_PCI_H
#define CSPPC_PCI_BRIDGE 0xfffe0000
#define CSPPC_BRIDGE_ENDIAN 0x0000
#define CSPPC_BRIDGE_INT 0x0010
#define CVPPC_PCI_CONFIG 0xfffc0000
#define CVPPC_ROM_ADDRESS 0xe2000001
#define CVPPC_REGS_REGION 0xef000000
#define CVPPC_FB_APERTURE_ONE 0xe0000000
#define CVPPC_FB_APERTURE_TWO 0xe1000000
#define CVPPC_FB_SIZE 0x00800000
/* CVPPC_BRIDGE_ENDIAN */
#define CSPPCF_BRIDGE_BIG_ENDIAN 0x02
/* CVPPC_BRIDGE_INT */
#define CSPPCF_BRIDGE_ACTIVE_INT2 0x01
#endif /* APUS_PCI_H */
This diff is collapsed.
......@@ -67,7 +67,7 @@ static __inline__ unsigned long ide_default_io_base(int index)
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
#if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
#define IDE_ARCH_ACK_INTR 1
#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
#endif
......
......@@ -102,12 +102,8 @@
#else /* 32-bit */
/* Default MSR for kernel mode. */
#ifndef MSR_KERNEL /* reg_booke.h also defines this */
#ifdef CONFIG_APUS_FAST_EXCEPT
#define MSR_KERNEL (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR)
#else
#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
#endif
#endif
#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
#endif
......
#ifdef __KERNEL__
#ifndef __ASMPPC_AMIGAHW_H
#define __ASMPPC_AMIGAHW_H
#include <asm-m68k/amigahw.h>
#undef CHIP_PHYSADDR
#ifdef CONFIG_APUS_FAST_EXCEPT
#define CHIP_PHYSADDR (0x000000)
#else
#define CHIP_PHYSADDR (0x004000)
#endif
#endif /* __ASMPPC_AMIGAHW_H */
#endif /* __KERNEL__ */
/*
** amigaints.h -- Amiga Linux interrupt handling structs and prototypes
**
** Copyright 1992 by Greg Harp
**
** This file is subject to the terms and conditions of the GNU General Public
** License. See the file COPYING in the main directory of this archive
** for more details.
**
** Created 10/2/92 by Greg Harp
*/
#ifdef __KERNEL__
#ifndef _ASMm68k_AMIGAINTS_H_
#define _ASMm68k_AMIGAINTS_H_
/*
** Amiga Interrupt sources.
**
*/
#define AUTO_IRQS (8)
#define AMI_STD_IRQS (14)
#define CIA_IRQS (5)
#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
/* vertical blanking interrupt */
#define IRQ_AMIGA_VERTB 0
/* copper interrupt */
#define IRQ_AMIGA_COPPER 1
/* Audio interrupts */
#define IRQ_AMIGA_AUD0 2
#define IRQ_AMIGA_AUD1 3
#define IRQ_AMIGA_AUD2 4
#define IRQ_AMIGA_AUD3 5
/* Blitter done interrupt */
#define IRQ_AMIGA_BLIT 6
/* floppy disk interrupts */
#define IRQ_AMIGA_DSKSYN 7
#define IRQ_AMIGA_DSKBLK 8
/* builtin serial port interrupts */
#define IRQ_AMIGA_RBF 9
#define IRQ_AMIGA_TBE 10
/* software interrupts */
#define IRQ_AMIGA_SOFT 11
/* interrupts from external hardware */
#define IRQ_AMIGA_PORTS 12
#define IRQ_AMIGA_EXTER 13
/* CIA interrupt sources */
#define IRQ_AMIGA_CIAA 14
#define IRQ_AMIGA_CIAA_TA 14
#define IRQ_AMIGA_CIAA_TB 15
#define IRQ_AMIGA_CIAA_ALRM 16
#define IRQ_AMIGA_CIAA_SP 17
#define IRQ_AMIGA_CIAA_FLG 18
#define IRQ_AMIGA_CIAB 19
#define IRQ_AMIGA_CIAB_TA 19
#define IRQ_AMIGA_CIAB_TB 20
#define IRQ_AMIGA_CIAB_ALRM 21
#define IRQ_AMIGA_CIAB_SP 22
#define IRQ_AMIGA_CIAB_FLG 23
/* auto-vector interrupts */
#define IRQ_AMIGA_AUTO 24
#define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */
#define IRQ_AMIGA_AUTO_1 25
#define IRQ_AMIGA_AUTO_2 26
#define IRQ_AMIGA_AUTO_3 27
#define IRQ_AMIGA_AUTO_4 28
#define IRQ_AMIGA_AUTO_5 29
#define IRQ_AMIGA_AUTO_6 30
#define IRQ_AMIGA_AUTO_7 31
#define IRQ_FLOPPY IRQ_AMIGA_DSKBLK
/* INTREQR masks */
#define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
#define IRQ2_MASK 0x0008 /* INTREQR mask for IRQ 2 */
#define IRQ3_MASK 0x0070 /* INTREQR mask for IRQ 3 */
#define IRQ4_MASK 0x0780 /* INTREQR mask for IRQ 4 */
#define IRQ5_MASK 0x1800 /* INTREQR mask for IRQ 5 */
#define IRQ6_MASK 0x2000 /* INTREQR mask for IRQ 6 */
#define IRQ7_MASK 0x4000 /* INTREQR mask for IRQ 7 */
#define IF_SETCLR 0x8000 /* set/clr bit */
#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */
#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */
#define IF_DSKSYN 0x1000 /* disk sync interrupt */
#define IF_RBF 0x0800 /* serial receive buffer full interrupt */
#define IF_AUD3 0x0400 /* audio channel 3 done interrupt */
#define IF_AUD2 0x0200 /* audio channel 2 done interrupt */
#define IF_AUD1 0x0100 /* audio channel 1 done interrupt */
#define IF_AUD0 0x0080 /* audio channel 0 done interrupt */
#define IF_BLIT 0x0040 /* blitter done interrupt */
#define IF_VERTB 0x0020 /* vertical blanking interrupt */
#define IF_COPER 0x0010 /* copper interrupt */
#define IF_PORTS 0x0008 /* external level 2 and CIA A interrupt */
#define IF_SOFT 0x0004 /* software initiated interrupt */
#define IF_DSKBLK 0x0002 /* diskblock DMA finished */
#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */
extern void amiga_do_irq(int irq, struct pt_regs *fp);
extern void amiga_do_irq_list(int irq, struct pt_regs *fp);
/* CIA interrupt control register bits */
#define CIA_ICR_TA 0x01
#define CIA_ICR_TB 0x02
#define CIA_ICR_ALRM 0x04
#define CIA_ICR_SP 0x08
#define CIA_ICR_FLG 0x10
#define CIA_ICR_ALL 0x1f
#define CIA_ICR_SETCLR 0x80
/* to access the interrupt control registers of CIA's use only
** these functions, they behave exactly like the amiga os routines
*/
extern struct ciabase ciaa_base, ciab_base;
extern unsigned char cia_set_irq(unsigned int irq, int set);
extern unsigned char cia_able_irq(unsigned int irq, int enable);
#endif /* asm-m68k/amigaints.h */
#endif /* __KERNEL__ */
/*
** asm-ppc/amigappc.h -- This header defines some values and pointers for
** the Phase 5 PowerUp card.
**
** Copyright 1997, 1998 by Phase5, Germany.
**
** This file is subject to the terms and conditions of the GNU General Public
** License. See the file COPYING in the main directory of this archive
** for more details.
**
** Created: 7/22/97 by Jesper Skov
*/
#ifdef __KERNEL__
#ifndef _M68K_AMIGAPPC_H
#define _M68K_AMIGAPPC_H
#ifndef __ASSEMBLY__
/* #include <asm/system.h> */
#define mb() __asm__ __volatile__ ("sync" : : : "memory")
#define APUS_WRITE(_a_, _v_) \
do { \
(*((volatile unsigned char *)(_a_)) = (_v_)); \
mb(); \
} while (0)
#define APUS_READ(_a_, _v_) \
do { \
(_v_) = (*((volatile unsigned char *)(_a_))); \
mb(); \
} while (0)
#endif /* ndef __ASSEMBLY__ */
/* Maybe add a [#ifdef WANT_ZTWOBASE] condition to amigahw.h? */
#define zTwoBase (0x80000000)
#define APUS_IPL_BASE (zTwoBase + 0x00f60000)
#define APUS_REG_RESET (APUS_IPL_BASE + 0x00)
#define APUS_REG_WAITSTATE (APUS_IPL_BASE + 0x10)
#define APUS_REG_SHADOW (APUS_IPL_BASE + 0x18)
#define APUS_REG_LOCK (APUS_IPL_BASE + 0x20)
#define APUS_REG_INT (APUS_IPL_BASE + 0x28)
#define APUS_IPL_EMU (APUS_IPL_BASE + 0x30)
#define APUS_INT_LVL (APUS_IPL_BASE + 0x38)
#define REGSHADOW_SETRESET (0x80)
#define REGSHADOW_SELFRESET (0x40)
#define REGLOCK_SETRESET (0x80)
#define REGLOCK_BLACKMAGICK1 (0x40)
#define REGLOCK_BLACKMAGICK2 (0x20)
#define REGLOCK_BLACKMAGICK3 (0x10)
#define REGWAITSTATE_SETRESET (0x80)
#define REGWAITSTATE_PPCW (0x08)
#define REGWAITSTATE_PPCR (0x04)
#define REGRESET_SETRESET (0x80)
#define REGRESET_PPCRESET (0x10)
#define REGRESET_M68KRESET (0x08)
#define REGRESET_AMIGARESET (0x04)
#define REGRESET_AUXRESET (0x02)
#define REGRESET_SCSIRESET (0x01)
#define REGINT_SETRESET (0x80)
#define REGINT_ENABLEIPL (0x02)
#define REGINT_INTMASTER (0x01)
#define IPLEMU_SETRESET (0x80)
#define IPLEMU_DISABLEINT (0x40)
#define IPLEMU_IPL2 (0x20)
#define IPLEMU_IPL1 (0x10)
#define IPLEMU_IPL0 (0x08)
#define IPLEMU_PPCIPL2 (0x04)
#define IPLEMU_PPCIPL1 (0x02)
#define IPLEMU_PPCIPL0 (0x01)
#define IPLEMU_IPLMASK (IPLEMU_PPCIPL2|IPLEMU_PPCIPL1|IPLEMU_PPCIPL0)
#define INTLVL_SETRESET (0x80)
#define INTLVL_MASK (0x7f)
#endif /* _M68k_AMIGAPPC_H */
#endif /* __KERNEL__ */
......@@ -11,10 +11,6 @@
#include <asm/page.h>
#if defined(CONFIG_APUS) && !defined(__BOOTER__)
#include <asm-m68k/bootinfo.h>
#else
struct bi_record {
unsigned long tag; /* tag ID */
unsigned long size; /* size of record (in bytes) */
......@@ -44,7 +40,6 @@ bootinfo_addr(unsigned long offset)
return (struct bi_record *)_ALIGN((offset) + (1 << 20) - 1,
(1 << 20));
}
#endif /* CONFIG_APUS */
#endif /* _PPC_BOOTINFO_H */
......
......@@ -30,7 +30,7 @@
#include <asm/mpc8xx.h>
#elif defined(CONFIG_8260)
#include <asm/mpc8260.h>
#elif defined(CONFIG_APUS) || !defined(CONFIG_PCI)
#elif !defined(CONFIG_PCI)
#define _IO_BASE 0
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
......@@ -145,24 +145,7 @@ static inline void writeb(__u8 b, volatile void __iomem *addr)
}
#endif
#if defined(CONFIG_APUS)
static inline __u16 readw(const volatile void __iomem *addr)
{
return *(__force volatile __u16 *)(addr);
}
static inline __u32 readl(const volatile void __iomem *addr)
{
return *(__force volatile __u32 *)(addr);
}
static inline void writew(__u16 b, volatile void __iomem *addr)
{
*(__force volatile __u16 *)(addr) = b;
}
static inline void writel(__u32 b, volatile void __iomem *addr)
{
*(__force volatile __u32 *)(addr) = b;
}
#elif defined (CONFIG_8260_PCI9)
#if defined (CONFIG_8260_PCI9)
/* Use macros if PCI9 workaround enabled */
#define readw(addr) in_le16((volatile u16 *)(addr))
#define readl(addr) in_le32((volatile u32 *)(addr))
......@@ -185,7 +168,7 @@ static inline void writel(__u32 b, volatile void __iomem *addr)
{
out_le32(addr, b);
}
#endif /* CONFIG_APUS */
#endif /* CONFIG_8260_PCI9 */
#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
......@@ -300,13 +283,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \
}
__do_out_asm(outb, "stbx")
#ifdef CONFIG_APUS
__do_in_asm(inb, "lbzx")
__do_in_asm(inw, "lhz%U1%X1")
__do_in_asm(inl, "lwz%U1%X1")
__do_out_asm(outl,"stw%U0%X0")
__do_out_asm(outw, "sth%U0%X0")
#elif defined (CONFIG_8260_PCI9)
#if defined (CONFIG_8260_PCI9)
/* in asm cannot be defined if PCI9 workaround is used */
#define inb(port) in_8((port)+___IO_BASE)
#define inw(port) in_le16((port)+___IO_BASE)
......@@ -371,7 +348,6 @@ extern void __iomem *ioremap64(unsigned long long address, unsigned long size);
#define ioremap_nocache(addr, size) ioremap((addr), (size))
extern void iounmap(volatile void __iomem *addr);
extern unsigned long iopa(unsigned long addr);
extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
unsigned int size, int flags);
......@@ -384,24 +360,16 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
*/
extern inline unsigned long virt_to_bus(volatile void * address)
{
#ifndef CONFIG_APUS
if (address == (void *)0)
return 0;
return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET;
#else
return iopa ((unsigned long) address);
#endif
}
extern inline void * bus_to_virt(unsigned long address)
{
#ifndef CONFIG_APUS
if (address == 0)
return NULL;
return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
#else
return (void*) mm_ptov (address);
#endif
}
/*
......@@ -410,20 +378,12 @@ extern inline void * bus_to_virt(unsigned long address)
*/
extern inline unsigned long virt_to_phys(volatile void * address)
{
#ifndef CONFIG_APUS
return (unsigned long) address - KERNELBASE;
#else
return iopa ((unsigned long) address);
#endif
}
extern inline void * phys_to_virt(unsigned long address)
{
#ifndef CONFIG_APUS
return (void *) (address + KERNELBASE);
#else
return (void*) mm_ptov (address);
#endif
}
/*
......
......@@ -8,10 +8,6 @@
#include <asm/setup.h>
#include <asm/page.h>
#ifdef CONFIG_APUS
#include <asm-m68k/machdep.h>
#endif
struct pt_regs;
struct pci_bus;
struct pci_dev;
......
......@@ -97,62 +97,22 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
extern void copy_user_page(void *to, void *from, unsigned long vaddr,
struct page *pg);
#ifndef CONFIG_APUS
#define PPC_MEMSTART 0
#define PPC_PGSTART 0
#define PPC_MEMOFFSET PAGE_OFFSET
#else
extern unsigned long ppc_memstart;
extern unsigned long ppc_pgstart;
extern unsigned long ppc_memoffset;
#define PPC_MEMSTART ppc_memstart
#define PPC_PGSTART ppc_pgstart
#define PPC_MEMOFFSET ppc_memoffset
#endif
#if defined(CONFIG_APUS) && !defined(MODULE)
/* map phys->virtual and virtual->phys for RAM pages */
static inline unsigned long ___pa(unsigned long v)
{
unsigned long p;
asm volatile ("1: addis %0, %1, %2;"
".section \".vtop_fixup\",\"aw\";"
".align 1;"
".long 1b;"
".previous;"
: "=r" (p)
: "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
return p;
}
static inline void* ___va(unsigned long p)
{
unsigned long v;
asm volatile ("1: addis %0, %1, %2;"
".section \".ptov_fixup\",\"aw\";"
".align 1;"
".long 1b;"
".previous;"
: "=r" (v)
: "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
return (void*) v;
}
#else
#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET)
#define ___va(paddr) ((paddr)+PPC_MEMOFFSET)
#endif
extern int page_is_ram(unsigned long pfn);
#define __pa(x) ___pa((unsigned long)(x))
#define __va(x) ((void *)(___va((unsigned long)(x))))
#define ARCH_PFN_OFFSET (PPC_PGSTART)
#define ARCH_PFN_OFFSET 0
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr)
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
/* Pure 2^n version of get_order */
......
......@@ -765,14 +765,6 @@ extern void paging_init(void);
#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
/* CONFIG_APUS */
/* For virtual address to physical address conversion */
extern void cache_clear(__u32 addr, int length);
extern void cache_push(__u32 addr, int length);
extern int mm_end_of_chunk (unsigned long addr, int len);
extern unsigned long iopa(unsigned long addr);
extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
/* Values for nocacheflag and cmode */
/* These are not used by the APUS kernel_map, but prevents
compilation errors. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment