162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci** amigaints.h -- Amiga Linux interrupt handling structs and prototypes
362306a36Sopenharmony_ci**
462306a36Sopenharmony_ci** Copyright 1992 by Greg Harp
562306a36Sopenharmony_ci**
662306a36Sopenharmony_ci** This file is subject to the terms and conditions of the GNU General Public
762306a36Sopenharmony_ci** License.  See the file COPYING in the main directory of this archive
862306a36Sopenharmony_ci** for more details.
962306a36Sopenharmony_ci**
1062306a36Sopenharmony_ci** Created 10/2/92 by Greg Harp
1162306a36Sopenharmony_ci*/
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#ifndef _ASMm68k_AMIGAINTS_H_
1462306a36Sopenharmony_ci#define _ASMm68k_AMIGAINTS_H_
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#include <asm/irq.h>
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/*
1962306a36Sopenharmony_ci** Amiga Interrupt sources.
2062306a36Sopenharmony_ci**
2162306a36Sopenharmony_ci*/
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define AUTO_IRQS           (8)
2462306a36Sopenharmony_ci#define AMI_STD_IRQS        (14)
2562306a36Sopenharmony_ci#define CIA_IRQS            (5)
2662306a36Sopenharmony_ci#define AMI_IRQS            (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci/* builtin serial port interrupts */
2962306a36Sopenharmony_ci#define IRQ_AMIGA_TBE		(IRQ_USER+0)
3062306a36Sopenharmony_ci#define IRQ_AMIGA_RBF		(IRQ_USER+11)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci/* floppy disk interrupts */
3362306a36Sopenharmony_ci#define IRQ_AMIGA_DSKBLK	(IRQ_USER+1)
3462306a36Sopenharmony_ci#define IRQ_AMIGA_DSKSYN	(IRQ_USER+12)
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci/* software interrupts */
3762306a36Sopenharmony_ci#define IRQ_AMIGA_SOFT		(IRQ_USER+2)
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* interrupts from external hardware */
4062306a36Sopenharmony_ci#define IRQ_AMIGA_PORTS		IRQ_AUTO_2
4162306a36Sopenharmony_ci#define IRQ_AMIGA_EXTER		IRQ_AUTO_6
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/* copper interrupt */
4462306a36Sopenharmony_ci#define IRQ_AMIGA_COPPER	(IRQ_USER+4)
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* vertical blanking interrupt */
4762306a36Sopenharmony_ci#define IRQ_AMIGA_VERTB		(IRQ_USER+5)
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci/* Blitter done interrupt */
5062306a36Sopenharmony_ci#define IRQ_AMIGA_BLIT		(IRQ_USER+6)
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/* Audio interrupts */
5362306a36Sopenharmony_ci#define IRQ_AMIGA_AUD0		(IRQ_USER+7)
5462306a36Sopenharmony_ci#define IRQ_AMIGA_AUD1		(IRQ_USER+8)
5562306a36Sopenharmony_ci#define IRQ_AMIGA_AUD2		(IRQ_USER+9)
5662306a36Sopenharmony_ci#define IRQ_AMIGA_AUD3		(IRQ_USER+10)
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci/* CIA interrupt sources */
5962306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA		(IRQ_USER+14)
6062306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA_TA	(IRQ_USER+14)
6162306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA_TB	(IRQ_USER+15)
6262306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA_ALRM	(IRQ_USER+16)
6362306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA_SP	(IRQ_USER+17)
6462306a36Sopenharmony_ci#define IRQ_AMIGA_CIAA_FLG	(IRQ_USER+18)
6562306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB		(IRQ_USER+19)
6662306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB_TA	(IRQ_USER+19)
6762306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB_TB	(IRQ_USER+20)
6862306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB_ALRM	(IRQ_USER+21)
6962306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB_SP	(IRQ_USER+22)
7062306a36Sopenharmony_ci#define IRQ_AMIGA_CIAB_FLG	(IRQ_USER+23)
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* INTREQR masks */
7462306a36Sopenharmony_ci#define IF_SETCLR   0x8000      /* set/clr bit */
7562306a36Sopenharmony_ci#define IF_INTEN    0x4000	/* master interrupt bit in INT* registers */
7662306a36Sopenharmony_ci#define IF_EXTER    0x2000	/* external level 6 and CIA B interrupt */
7762306a36Sopenharmony_ci#define IF_DSKSYN   0x1000	/* disk sync interrupt */
7862306a36Sopenharmony_ci#define IF_RBF	    0x0800	/* serial receive buffer full interrupt */
7962306a36Sopenharmony_ci#define IF_AUD3     0x0400	/* audio channel 3 done interrupt */
8062306a36Sopenharmony_ci#define IF_AUD2     0x0200	/* audio channel 2 done interrupt */
8162306a36Sopenharmony_ci#define IF_AUD1     0x0100	/* audio channel 1 done interrupt */
8262306a36Sopenharmony_ci#define IF_AUD0     0x0080	/* audio channel 0 done interrupt */
8362306a36Sopenharmony_ci#define IF_BLIT     0x0040	/* blitter done interrupt */
8462306a36Sopenharmony_ci#define IF_VERTB    0x0020	/* vertical blanking interrupt */
8562306a36Sopenharmony_ci#define IF_COPER    0x0010	/* copper interrupt */
8662306a36Sopenharmony_ci#define IF_PORTS    0x0008	/* external level 2 and CIA A interrupt */
8762306a36Sopenharmony_ci#define IF_SOFT     0x0004	/* software initiated interrupt */
8862306a36Sopenharmony_ci#define IF_DSKBLK   0x0002	/* diskblock DMA finished */
8962306a36Sopenharmony_ci#define IF_TBE	    0x0001	/* serial transmit buffer empty interrupt */
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci/* CIA interrupt control register bits */
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define CIA_ICR_TA	0x01
9462306a36Sopenharmony_ci#define CIA_ICR_TB	0x02
9562306a36Sopenharmony_ci#define CIA_ICR_ALRM	0x04
9662306a36Sopenharmony_ci#define CIA_ICR_SP	0x08
9762306a36Sopenharmony_ci#define CIA_ICR_FLG	0x10
9862306a36Sopenharmony_ci#define CIA_ICR_ALL	0x1f
9962306a36Sopenharmony_ci#define CIA_ICR_SETCLR	0x80
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ciextern void amiga_init_IRQ(void);
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci/* to access the interrupt control registers of CIA's use only
10462306a36Sopenharmony_ci** these functions, they behave exactly like the amiga os routines
10562306a36Sopenharmony_ci*/
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ciextern struct ciabase ciaa_base, ciab_base;
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ciextern void cia_init_IRQ(struct ciabase *base);
11062306a36Sopenharmony_ciextern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask);
11162306a36Sopenharmony_ciextern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask);
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci#endif /* asm-m68k/amigaints.h */
114