18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Miscellaneous definitions used to initialise the interrupt vector table
38c2ecf20Sopenharmony_ci * with the machine-specific interrupt routines.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
68c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
78c2ecf20Sopenharmony_ci * for more details.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Copyright (C) 1997 by Paul M. Antoine.
108c2ecf20Sopenharmony_ci * reworked 1998 by Harald Koerfgen.
118c2ecf20Sopenharmony_ci * Copyright (C) 2001, 2002, 2003  Maciej W. Rozycki
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#ifndef __ASM_DEC_INTERRUPTS_H
158c2ecf20Sopenharmony_ci#define __ASM_DEC_INTERRUPTS_H
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#include <irq.h>
188c2ecf20Sopenharmony_ci#include <asm/mipsregs.h>
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci * The list of possible system devices which provide an
238c2ecf20Sopenharmony_ci * interrupt.  Not all devices exist on a given system.
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci#define DEC_IRQ_CASCADE		0	/* cascade from CSR or I/O ASIC */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* Ordinary interrupts */
288c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_RECV		1	/* ACCESS.bus receive */
298c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_XMIT		2	/* ACCESS.bus transmit */
308c2ecf20Sopenharmony_ci#define DEC_IRQ_DZ11		3	/* DZ11 (DC7085) serial */
318c2ecf20Sopenharmony_ci#define DEC_IRQ_ASC		4	/* ASC (NCR53C94) SCSI */
328c2ecf20Sopenharmony_ci#define DEC_IRQ_FLOPPY		5	/* 82077 FDC */
338c2ecf20Sopenharmony_ci#define DEC_IRQ_FPU		6	/* R3k FPU */
348c2ecf20Sopenharmony_ci#define DEC_IRQ_HALT		7	/* HALT button or from ACCESS.Bus */
358c2ecf20Sopenharmony_ci#define DEC_IRQ_ISDN		8	/* Am79C30A ISDN */
368c2ecf20Sopenharmony_ci#define DEC_IRQ_LANCE		9	/* LANCE (Am7990) Ethernet */
378c2ecf20Sopenharmony_ci#define DEC_IRQ_BUS		10	/* memory, I/O bus read/write errors */
388c2ecf20Sopenharmony_ci#define DEC_IRQ_PSU		11	/* power supply unit warning */
398c2ecf20Sopenharmony_ci#define DEC_IRQ_RTC		12	/* DS1287 RTC */
408c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC0		13	/* SCC (Z85C30) serial #0 */
418c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC1		14	/* SCC (Z85C30) serial #1 */
428c2ecf20Sopenharmony_ci#define DEC_IRQ_SII		15	/* SII (DC7061) SCSI */
438c2ecf20Sopenharmony_ci#define DEC_IRQ_TC0		16	/* TURBOchannel slot #0 */
448c2ecf20Sopenharmony_ci#define DEC_IRQ_TC1		17	/* TURBOchannel slot #1 */
458c2ecf20Sopenharmony_ci#define DEC_IRQ_TC2		18	/* TURBOchannel slot #2 */
468c2ecf20Sopenharmony_ci#define DEC_IRQ_TIMER		19	/* ARC periodic timer */
478c2ecf20Sopenharmony_ci#define DEC_IRQ_VIDEO		20	/* framebuffer */
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* I/O ASIC DMA interrupts */
508c2ecf20Sopenharmony_ci#define DEC_IRQ_ASC_MERR	21	/* ASC memory read error */
518c2ecf20Sopenharmony_ci#define DEC_IRQ_ASC_ERR		22	/* ASC page overrun */
528c2ecf20Sopenharmony_ci#define DEC_IRQ_ASC_DMA		23	/* ASC buffer pointer loaded */
538c2ecf20Sopenharmony_ci#define DEC_IRQ_FLOPPY_ERR	24	/* FDC error */
548c2ecf20Sopenharmony_ci#define DEC_IRQ_ISDN_ERR	25	/* ISDN memory read/overrun error */
558c2ecf20Sopenharmony_ci#define DEC_IRQ_ISDN_RXDMA	26	/* ISDN recv buffer pointer loaded */
568c2ecf20Sopenharmony_ci#define DEC_IRQ_ISDN_TXDMA	27	/* ISDN xmit buffer pointer loaded */
578c2ecf20Sopenharmony_ci#define DEC_IRQ_LANCE_MERR	28	/* LANCE memory read error */
588c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC0A_RXERR	29	/* SCC0A (printer) receive overrun */
598c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC0A_RXDMA	30	/* SCC0A receive half page */
608c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC0A_TXERR	31	/* SCC0A xmit memory read/overrun */
618c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC0A_TXDMA	32	/* SCC0A transmit page end */
628c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_RXERR	33	/* ACCESS.bus receive overrun */
638c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_RXDMA	34	/* ACCESS.bus receive half page */
648c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_TXERR	35	/* ACCESS.bus xmit memory read/ovrn */
658c2ecf20Sopenharmony_ci#define DEC_IRQ_AB_TXDMA	36	/* ACCESS.bus transmit page end */
668c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC1A_RXERR	37	/* SCC1A (modem) receive overrun */
678c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC1A_RXDMA	38	/* SCC1A receive half page */
688c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC1A_TXERR	39	/* SCC1A xmit memory read/overrun */
698c2ecf20Sopenharmony_ci#define DEC_IRQ_SCC1A_TXDMA	40	/* SCC1A transmit page end */
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/* TC5 & TC6 are virtual slots for KN02's onboard devices */
728c2ecf20Sopenharmony_ci#define DEC_IRQ_TC5		DEC_IRQ_ASC	/* virtual PMAZ-AA */
738c2ecf20Sopenharmony_ci#define DEC_IRQ_TC6		DEC_IRQ_LANCE	/* virtual PMAD-AA */
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define DEC_NR_INTS		41
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci/* Largest of cpu mask_nr tables. */
798c2ecf20Sopenharmony_ci#define DEC_MAX_CPU_INTS	6
808c2ecf20Sopenharmony_ci/* Largest of asic mask_nr tables. */
818c2ecf20Sopenharmony_ci#define DEC_MAX_ASIC_INTS	9
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci/*
858c2ecf20Sopenharmony_ci * CPU interrupt bits common to all systems.
868c2ecf20Sopenharmony_ci */
878c2ecf20Sopenharmony_ci#define DEC_CPU_INR_FPU		7	/* R3k FPU */
888c2ecf20Sopenharmony_ci#define DEC_CPU_INR_SW1		1	/* software #1 */
898c2ecf20Sopenharmony_ci#define DEC_CPU_INR_SW0		0	/* software #0 */
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define DEC_CPU_IRQ_BASE	MIPS_CPU_IRQ_BASE	/* first IRQ assigned to CPU */
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define DEC_CPU_IRQ_NR(n)	((n) + DEC_CPU_IRQ_BASE)
948c2ecf20Sopenharmony_ci#define DEC_CPU_IRQ_MASK(n)	(1 << ((n) + CAUSEB_IP))
958c2ecf20Sopenharmony_ci#define DEC_CPU_IRQ_ALL		(0xff << CAUSEB_IP)
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/*
1018c2ecf20Sopenharmony_ci * Interrupt table structures to hide differences between systems.
1028c2ecf20Sopenharmony_ci */
1038c2ecf20Sopenharmony_citypedef union { int i; void *p; } int_ptr;
1048c2ecf20Sopenharmony_ciextern int dec_interrupt[DEC_NR_INTS];
1058c2ecf20Sopenharmony_ciextern int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2];
1068c2ecf20Sopenharmony_ciextern int_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2];
1078c2ecf20Sopenharmony_ciextern int cpu_fpu_mask;
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/*
1118c2ecf20Sopenharmony_ci * Common interrupt routine prototypes for all DECStations
1128c2ecf20Sopenharmony_ci */
1138c2ecf20Sopenharmony_ciextern void kn02_io_int(void);
1148c2ecf20Sopenharmony_ciextern void kn02xa_io_int(void);
1158c2ecf20Sopenharmony_ciextern void kn03_io_int(void);
1168c2ecf20Sopenharmony_ciextern void asic_dma_int(void);
1178c2ecf20Sopenharmony_ciextern void asic_all_int(void);
1188c2ecf20Sopenharmony_ciextern void kn02_all_int(void);
1198c2ecf20Sopenharmony_ciextern void cpu_all_int(void);
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ciextern void dec_intr_unimplemented(void);
1228c2ecf20Sopenharmony_ciextern void asic_intr_unimplemented(void);
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#endif
127