18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * System-specific setup, especially interrupts.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
58c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
68c2ecf20Sopenharmony_ci * for more details.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 1998 Harald Koerfgen
98c2ecf20Sopenharmony_ci * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2020  Maciej W. Rozycki
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#include <linux/console.h>
128c2ecf20Sopenharmony_ci#include <linux/export.h>
138c2ecf20Sopenharmony_ci#include <linux/init.h>
148c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
158c2ecf20Sopenharmony_ci#include <linux/ioport.h>
168c2ecf20Sopenharmony_ci#include <linux/irq.h>
178c2ecf20Sopenharmony_ci#include <linux/irqnr.h>
188c2ecf20Sopenharmony_ci#include <linux/memblock.h>
198c2ecf20Sopenharmony_ci#include <linux/param.h>
208c2ecf20Sopenharmony_ci#include <linux/percpu-defs.h>
218c2ecf20Sopenharmony_ci#include <linux/sched.h>
228c2ecf20Sopenharmony_ci#include <linux/spinlock.h>
238c2ecf20Sopenharmony_ci#include <linux/types.h>
248c2ecf20Sopenharmony_ci#include <linux/pm.h>
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#include <asm/addrspace.h>
278c2ecf20Sopenharmony_ci#include <asm/bootinfo.h>
288c2ecf20Sopenharmony_ci#include <asm/cpu.h>
298c2ecf20Sopenharmony_ci#include <asm/cpu-features.h>
308c2ecf20Sopenharmony_ci#include <asm/cpu-type.h>
318c2ecf20Sopenharmony_ci#include <asm/irq.h>
328c2ecf20Sopenharmony_ci#include <asm/irq_cpu.h>
338c2ecf20Sopenharmony_ci#include <asm/mipsregs.h>
348c2ecf20Sopenharmony_ci#include <asm/page.h>
358c2ecf20Sopenharmony_ci#include <asm/reboot.h>
368c2ecf20Sopenharmony_ci#include <asm/sections.h>
378c2ecf20Sopenharmony_ci#include <asm/time.h>
388c2ecf20Sopenharmony_ci#include <asm/traps.h>
398c2ecf20Sopenharmony_ci#include <asm/wbflush.h>
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#include <asm/dec/interrupts.h>
428c2ecf20Sopenharmony_ci#include <asm/dec/ioasic.h>
438c2ecf20Sopenharmony_ci#include <asm/dec/ioasic_addrs.h>
448c2ecf20Sopenharmony_ci#include <asm/dec/ioasic_ints.h>
458c2ecf20Sopenharmony_ci#include <asm/dec/kn01.h>
468c2ecf20Sopenharmony_ci#include <asm/dec/kn02.h>
478c2ecf20Sopenharmony_ci#include <asm/dec/kn02ba.h>
488c2ecf20Sopenharmony_ci#include <asm/dec/kn02ca.h>
498c2ecf20Sopenharmony_ci#include <asm/dec/kn03.h>
508c2ecf20Sopenharmony_ci#include <asm/dec/kn230.h>
518c2ecf20Sopenharmony_ci#include <asm/dec/system.h>
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciextern void dec_machine_restart(char *command);
558c2ecf20Sopenharmony_ciextern void dec_machine_halt(void);
568c2ecf20Sopenharmony_ciextern void dec_machine_power_off(void);
578c2ecf20Sopenharmony_ciextern irqreturn_t dec_intr_halt(int irq, void *dev_id);
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciunsigned long dec_kn_slot_base, dec_kn_slot_size;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciEXPORT_SYMBOL(dec_kn_slot_base);
628c2ecf20Sopenharmony_ciEXPORT_SYMBOL(dec_kn_slot_size);
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciint dec_tc_bus;
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ciDEFINE_SPINLOCK(ioasic_ssr_lock);
678c2ecf20Sopenharmony_ciEXPORT_SYMBOL(ioasic_ssr_lock);
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_civolatile u32 *ioasic_base;
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciEXPORT_SYMBOL(ioasic_base);
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci/*
748c2ecf20Sopenharmony_ci * IRQ routing and priority tables.  Priorites are set as follows:
758c2ecf20Sopenharmony_ci *
768c2ecf20Sopenharmony_ci *		KN01	KN230	KN02	KN02-BA	KN02-CA	KN03
778c2ecf20Sopenharmony_ci *
788c2ecf20Sopenharmony_ci * MEMORY	CPU	CPU	CPU	ASIC	CPU	CPU
798c2ecf20Sopenharmony_ci * RTC		CPU	CPU	CPU	ASIC	CPU	CPU
808c2ecf20Sopenharmony_ci * DMA		-	-	-	ASIC	ASIC	ASIC
818c2ecf20Sopenharmony_ci * SERIAL0	CPU	CPU	CSR	ASIC	ASIC	ASIC
828c2ecf20Sopenharmony_ci * SERIAL1	-	-	-	ASIC	-	ASIC
838c2ecf20Sopenharmony_ci * SCSI		CPU	CPU	CSR	ASIC	ASIC	ASIC
848c2ecf20Sopenharmony_ci * ETHERNET	CPU	*	CSR	ASIC	ASIC	ASIC
858c2ecf20Sopenharmony_ci * other	-	-	-	ASIC	-	-
868c2ecf20Sopenharmony_ci * TC2		-	-	CSR	CPU	ASIC	ASIC
878c2ecf20Sopenharmony_ci * TC1		-	-	CSR	CPU	ASIC	ASIC
888c2ecf20Sopenharmony_ci * TC0		-	-	CSR	CPU	ASIC	ASIC
898c2ecf20Sopenharmony_ci * other	-	CPU	-	CPU	ASIC	ASIC
908c2ecf20Sopenharmony_ci * other	-	-	-	-	CPU	CPU
918c2ecf20Sopenharmony_ci *
928c2ecf20Sopenharmony_ci * * -- shared with SCSI
938c2ecf20Sopenharmony_ci */
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciint dec_interrupt[DEC_NR_INTS] = {
968c2ecf20Sopenharmony_ci	[0 ... DEC_NR_INTS - 1] = -1
978c2ecf20Sopenharmony_ci};
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciEXPORT_SYMBOL(dec_interrupt);
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciint_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
1028c2ecf20Sopenharmony_ci	{ { .i = ~0 }, { .p = dec_intr_unimplemented } },
1038c2ecf20Sopenharmony_ci};
1048c2ecf20Sopenharmony_ciint_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2] = {
1058c2ecf20Sopenharmony_ci	{ { .i = ~0 }, { .p = asic_intr_unimplemented } },
1068c2ecf20Sopenharmony_ci};
1078c2ecf20Sopenharmony_ciint cpu_fpu_mask = DEC_CPU_IRQ_MASK(DEC_CPU_INR_FPU);
1088c2ecf20Sopenharmony_ciint *fpu_kstat_irq;
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_cistatic irq_handler_t busirq_handler;
1118c2ecf20Sopenharmony_cistatic unsigned int busirq_flags = IRQF_NO_THREAD;
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/*
1148c2ecf20Sopenharmony_ci * Bus error (DBE/IBE exceptions and bus interrupts) handling setup.
1158c2ecf20Sopenharmony_ci */
1168c2ecf20Sopenharmony_cistatic void __init dec_be_init(void)
1178c2ecf20Sopenharmony_ci{
1188c2ecf20Sopenharmony_ci	switch (mips_machtype) {
1198c2ecf20Sopenharmony_ci	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
1208c2ecf20Sopenharmony_ci		board_be_handler = dec_kn01_be_handler;
1218c2ecf20Sopenharmony_ci		busirq_handler = dec_kn01_be_interrupt;
1228c2ecf20Sopenharmony_ci		busirq_flags |= IRQF_SHARED;
1238c2ecf20Sopenharmony_ci		dec_kn01_be_init();
1248c2ecf20Sopenharmony_ci		break;
1258c2ecf20Sopenharmony_ci	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
1268c2ecf20Sopenharmony_ci	case MACH_DS5000_XX:	/* DS5000/xx Maxine */
1278c2ecf20Sopenharmony_ci		board_be_handler = dec_kn02xa_be_handler;
1288c2ecf20Sopenharmony_ci		busirq_handler = dec_kn02xa_be_interrupt;
1298c2ecf20Sopenharmony_ci		dec_kn02xa_be_init();
1308c2ecf20Sopenharmony_ci		break;
1318c2ecf20Sopenharmony_ci	case MACH_DS5000_200:	/* DS5000/200 3max */
1328c2ecf20Sopenharmony_ci	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
1338c2ecf20Sopenharmony_ci	case MACH_DS5900:	/* DS5900 bigmax */
1348c2ecf20Sopenharmony_ci		board_be_handler = dec_ecc_be_handler;
1358c2ecf20Sopenharmony_ci		busirq_handler = dec_ecc_be_interrupt;
1368c2ecf20Sopenharmony_ci		dec_ecc_be_init();
1378c2ecf20Sopenharmony_ci		break;
1388c2ecf20Sopenharmony_ci	}
1398c2ecf20Sopenharmony_ci}
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_civoid __init plat_mem_setup(void)
1428c2ecf20Sopenharmony_ci{
1438c2ecf20Sopenharmony_ci	board_be_init = dec_be_init;
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci	wbflush_setup();
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci	_machine_restart = dec_machine_restart;
1488c2ecf20Sopenharmony_ci	_machine_halt = dec_machine_halt;
1498c2ecf20Sopenharmony_ci	pm_power_off = dec_machine_power_off;
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci	ioport_resource.start = ~0UL;
1528c2ecf20Sopenharmony_ci	ioport_resource.end = 0UL;
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	/* Stay away from the firmware working memory area for now. */
1558c2ecf20Sopenharmony_ci	memblock_reserve(PHYS_OFFSET, __pa_symbol(&_text) - PHYS_OFFSET);
1568c2ecf20Sopenharmony_ci}
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci/*
1598c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin)
1608c2ecf20Sopenharmony_ci * or DS3100 (aka Pmax).
1618c2ecf20Sopenharmony_ci */
1628c2ecf20Sopenharmony_cistatic int kn01_interrupt[DEC_NR_INTS] __initdata = {
1638c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= -1,
1648c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
1658c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
1668c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11),
1678c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= -1,
1688c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
1698c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
1708c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= -1,
1718c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
1728c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE),
1738c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS),
1748c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
1758c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC),
1768c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
1778c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
1788c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_SII),
1798c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= -1,
1808c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= -1,
1818c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
1828c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
1838c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_VIDEO),
1848c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
1858c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
1868c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
1878c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
1888c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
1898c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
1908c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
1918c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
1928c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
1938c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
1948c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
1958c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
1968c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
1978c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
1988c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
1998c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
2008c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
2018c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
2028c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
2038c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
2048c2ecf20Sopenharmony_ci};
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_cistatic int_ptr kn01_cpu_mask_nr_tbl[][2] __initdata = {
2078c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_BUS) },
2088c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS) } },
2098c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_RTC) },
2108c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC) } },
2118c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_DZ11) },
2128c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11) } },
2138c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_SII) },
2148c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_SII) } },
2158c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_LANCE) },
2168c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE) } },
2178c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
2188c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
2198c2ecf20Sopenharmony_ci};
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_cistatic void __init dec_init_kn01(void)
2228c2ecf20Sopenharmony_ci{
2238c2ecf20Sopenharmony_ci	/* IRQ routing. */
2248c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn01_interrupt,
2258c2ecf20Sopenharmony_ci		sizeof(kn01_interrupt));
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
2288c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl,
2298c2ecf20Sopenharmony_ci		sizeof(kn01_cpu_mask_nr_tbl));
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci}				/* dec_init_kn01 */
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/*
2378c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN230, aka DS5100, aka MIPSmate.
2388c2ecf20Sopenharmony_ci */
2398c2ecf20Sopenharmony_cistatic int kn230_interrupt[DEC_NR_INTS] __initdata = {
2408c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= -1,
2418c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
2428c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
2438c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11),
2448c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= -1,
2458c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
2468c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
2478c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_HALT),
2488c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
2498c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_LANCE),
2508c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS),
2518c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
2528c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC),
2538c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
2548c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
2558c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_SII),
2568c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= -1,
2578c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= -1,
2588c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
2598c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
2608c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
2618c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
2628c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
2638c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
2648c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
2658c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
2668c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
2678c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
2688c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
2698c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
2708c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
2718c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
2728c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
2738c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
2748c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
2758c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
2768c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
2778c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
2788c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
2798c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
2808c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
2818c2ecf20Sopenharmony_ci};
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_cistatic int_ptr kn230_cpu_mask_nr_tbl[][2] __initdata = {
2848c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_BUS) },
2858c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS) } },
2868c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_RTC) },
2878c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC) } },
2888c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_DZ11) },
2898c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11) } },
2908c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_SII) },
2918c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_SII) } },
2928c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
2938c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
2948c2ecf20Sopenharmony_ci};
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistatic void __init dec_init_kn230(void)
2978c2ecf20Sopenharmony_ci{
2988c2ecf20Sopenharmony_ci	/* IRQ routing. */
2998c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn230_interrupt,
3008c2ecf20Sopenharmony_ci		sizeof(kn230_interrupt));
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
3038c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl,
3048c2ecf20Sopenharmony_ci		sizeof(kn230_cpu_mask_nr_tbl));
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci}				/* dec_init_kn230 */
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci/*
3128c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN02, aka DS5000/200, aka 3max.
3138c2ecf20Sopenharmony_ci */
3148c2ecf20Sopenharmony_cistatic int kn02_interrupt[DEC_NR_INTS] __initdata = {
3158c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02_CPU_INR_CASCADE),
3168c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
3178c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
3188c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= KN02_IRQ_NR(KN02_CSR_INR_DZ11),
3198c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= KN02_IRQ_NR(KN02_CSR_INR_ASC),
3208c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
3218c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
3228c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= -1,
3238c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
3248c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= KN02_IRQ_NR(KN02_CSR_INR_LANCE),
3258c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS),
3268c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
3278c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC),
3288c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
3298c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
3308c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
3318c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= KN02_IRQ_NR(KN02_CSR_INR_TC0),
3328c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= KN02_IRQ_NR(KN02_CSR_INR_TC1),
3338c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= KN02_IRQ_NR(KN02_CSR_INR_TC2),
3348c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
3358c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
3368c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
3378c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
3388c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
3398c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
3408c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
3418c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
3428c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
3438c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
3448c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
3458c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
3468c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
3478c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
3488c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
3498c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
3508c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
3518c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
3528c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
3538c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
3548c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
3558c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
3568c2ecf20Sopenharmony_ci};
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_cistatic int_ptr kn02_cpu_mask_nr_tbl[][2] __initdata = {
3598c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_BUS) },
3608c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS) } },
3618c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_RTC) },
3628c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC) } },
3638c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_CASCADE) },
3648c2ecf20Sopenharmony_ci		{ .p = kn02_io_int } },
3658c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
3668c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
3678c2ecf20Sopenharmony_ci};
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_cistatic int_ptr kn02_asic_mask_nr_tbl[][2] __initdata = {
3708c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_DZ11) },
3718c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_DZ11) } },
3728c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_ASC) },
3738c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_ASC) } },
3748c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_LANCE) },
3758c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_LANCE) } },
3768c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC2) },
3778c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC2) } },
3788c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC1) },
3798c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC1) } },
3808c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC0) },
3818c2ecf20Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC0) } },
3828c2ecf20Sopenharmony_ci	{ { .i = KN02_IRQ_ALL },
3838c2ecf20Sopenharmony_ci		{ .p = kn02_all_int } },
3848c2ecf20Sopenharmony_ci};
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_cistatic void __init dec_init_kn02(void)
3878c2ecf20Sopenharmony_ci{
3888c2ecf20Sopenharmony_ci	/* IRQ routing. */
3898c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn02_interrupt,
3908c2ecf20Sopenharmony_ci		sizeof(kn02_interrupt));
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
3938c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02_cpu_mask_nr_tbl,
3948c2ecf20Sopenharmony_ci		sizeof(kn02_cpu_mask_nr_tbl));
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci	/* KN02 CSR IRQ priorities. */
3978c2ecf20Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl,
3988c2ecf20Sopenharmony_ci		sizeof(kn02_asic_mask_nr_tbl));
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
4018c2ecf20Sopenharmony_ci	init_kn02_irqs(KN02_IRQ_BASE);
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci}				/* dec_init_kn02 */
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci/*
4078c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN02-BA, aka DS5000/1xx
4088c2ecf20Sopenharmony_ci * (xx = 20, 25, 33), aka 3min.  Also applies to KN04(-BA), aka
4098c2ecf20Sopenharmony_ci * DS5000/150, aka 4min.
4108c2ecf20Sopenharmony_ci */
4118c2ecf20Sopenharmony_cistatic int kn02ba_interrupt[DEC_NR_INTS] __initdata = {
4128c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_CASCADE),
4138c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
4148c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
4158c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
4168c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02BA_IO_INR_ASC),
4178c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
4188c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
4198c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_HALT),
4208c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
4218c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02BA_IO_INR_LANCE),
4228c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= IO_IRQ_NR(KN02BA_IO_INR_BUS),
4238c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN02BA_IO_INR_PSU),
4248c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= IO_IRQ_NR(KN02BA_IO_INR_RTC),
4258c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02BA_IO_INR_SCC0),
4268c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN02BA_IO_INR_SCC1),
4278c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
4288c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0),
4298c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1),
4308c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2),
4318c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
4328c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
4338c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
4348c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
4358c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
4368c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
4378c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
4388c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
4398c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
4408c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
4418c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
4428c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
4438c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
4448c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
4458c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
4468c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
4478c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
4488c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
4498c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
4508c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
4518c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
4528c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
4538c2ecf20Sopenharmony_ci};
4548c2ecf20Sopenharmony_ci
4558c2ecf20Sopenharmony_cistatic int_ptr kn02ba_cpu_mask_nr_tbl[][2] __initdata = {
4568c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_CASCADE) },
4578c2ecf20Sopenharmony_ci		{ .p = kn02xa_io_int } },
4588c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC2) },
4598c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2) } },
4608c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC1) },
4618c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1) } },
4628c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC0) },
4638c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0) } },
4648c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
4658c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
4668c2ecf20Sopenharmony_ci};
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_cistatic int_ptr kn02ba_asic_mask_nr_tbl[][2] __initdata = {
4698c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_BUS) },
4708c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_BUS) } },
4718c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_RTC) },
4728c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_RTC) } },
4738c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
4748c2ecf20Sopenharmony_ci		{ .p = asic_dma_int } },
4758c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_SCC0) },
4768c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_SCC0) } },
4778c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_SCC1) },
4788c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_SCC1) } },
4798c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_ASC) },
4808c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_ASC) } },
4818c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_LANCE) },
4828c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_LANCE) } },
4838c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
4848c2ecf20Sopenharmony_ci		{ .p = asic_all_int } },
4858c2ecf20Sopenharmony_ci};
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_cistatic void __init dec_init_kn02ba(void)
4888c2ecf20Sopenharmony_ci{
4898c2ecf20Sopenharmony_ci	/* IRQ routing. */
4908c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn02ba_interrupt,
4918c2ecf20Sopenharmony_ci		sizeof(kn02ba_interrupt));
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
4948c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02ba_cpu_mask_nr_tbl,
4958c2ecf20Sopenharmony_ci		sizeof(kn02ba_cpu_mask_nr_tbl));
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
4988c2ecf20Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl,
4998c2ecf20Sopenharmony_ci		sizeof(kn02ba_asic_mask_nr_tbl));
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
5028c2ecf20Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci}				/* dec_init_kn02ba */
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_ci/*
5088c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN02-CA, aka DS5000/xx,
5098c2ecf20Sopenharmony_ci * (xx = 20, 25, 33), aka MAXine.  Also applies to KN04(-CA), aka
5108c2ecf20Sopenharmony_ci * DS5000/50, aka 4MAXine.
5118c2ecf20Sopenharmony_ci */
5128c2ecf20Sopenharmony_cistatic int kn02ca_interrupt[DEC_NR_INTS] __initdata = {
5138c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_CASCADE),
5148c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= IO_IRQ_NR(KN02CA_IO_INR_AB_RECV),
5158c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= IO_IRQ_NR(KN02CA_IO_INR_AB_XMIT),
5168c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
5178c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02CA_IO_INR_ASC),
5188c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= IO_IRQ_NR(KN02CA_IO_INR_FLOPPY),
5198c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
5208c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_HALT),
5218c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= IO_IRQ_NR(KN02CA_IO_INR_ISDN),
5228c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02CA_IO_INR_LANCE),
5238c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS),
5248c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
5258c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC),
5268c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02CA_IO_INR_SCC0),
5278c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
5288c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
5298c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN02CA_IO_INR_TC0),
5308c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN02CA_IO_INR_TC1),
5318c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
5328c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_TIMER),
5338c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= IO_IRQ_NR(KN02CA_IO_INR_VIDEO),
5348c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
5358c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
5368c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
5378c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= IO_IRQ_NR(IO_INR_FLOPPY_ERR),
5388c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= IO_IRQ_NR(IO_INR_ISDN_ERR),
5398c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= IO_IRQ_NR(IO_INR_ISDN_RXDMA),
5408c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= IO_IRQ_NR(IO_INR_ISDN_TXDMA),
5418c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
5428c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
5438c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
5448c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
5458c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
5468c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= IO_IRQ_NR(IO_INR_AB_RXERR),
5478c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= IO_IRQ_NR(IO_INR_AB_RXDMA),
5488c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= IO_IRQ_NR(IO_INR_AB_TXERR),
5498c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= IO_IRQ_NR(IO_INR_AB_TXDMA),
5508c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
5518c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
5528c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
5538c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
5548c2ecf20Sopenharmony_ci};
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_cistatic int_ptr kn02ca_cpu_mask_nr_tbl[][2] __initdata = {
5578c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_BUS) },
5588c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS) } },
5598c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_RTC) },
5608c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC) } },
5618c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_CASCADE) },
5628c2ecf20Sopenharmony_ci		{ .p = kn02xa_io_int } },
5638c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
5648c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
5658c2ecf20Sopenharmony_ci};
5668c2ecf20Sopenharmony_ci
5678c2ecf20Sopenharmony_cistatic int_ptr kn02ca_asic_mask_nr_tbl[][2] __initdata = {
5688c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
5698c2ecf20Sopenharmony_ci		{ .p = asic_dma_int } },
5708c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_SCC0) },
5718c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_SCC0) } },
5728c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_ASC) },
5738c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_ASC) } },
5748c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_LANCE) },
5758c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_LANCE) } },
5768c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_TC1) },
5778c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_TC1) } },
5788c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_TC0) },
5798c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_TC0) } },
5808c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
5818c2ecf20Sopenharmony_ci		{ .p = asic_all_int } },
5828c2ecf20Sopenharmony_ci};
5838c2ecf20Sopenharmony_ci
5848c2ecf20Sopenharmony_cistatic void __init dec_init_kn02ca(void)
5858c2ecf20Sopenharmony_ci{
5868c2ecf20Sopenharmony_ci	/* IRQ routing. */
5878c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn02ca_interrupt,
5888c2ecf20Sopenharmony_ci		sizeof(kn02ca_interrupt));
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
5918c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02ca_cpu_mask_nr_tbl,
5928c2ecf20Sopenharmony_ci		sizeof(kn02ca_cpu_mask_nr_tbl));
5938c2ecf20Sopenharmony_ci
5948c2ecf20Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
5958c2ecf20Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl,
5968c2ecf20Sopenharmony_ci		sizeof(kn02ca_asic_mask_nr_tbl));
5978c2ecf20Sopenharmony_ci
5988c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
5998c2ecf20Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_ci}				/* dec_init_kn02ca */
6028c2ecf20Sopenharmony_ci
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_ci/*
6058c2ecf20Sopenharmony_ci * Machine-specific initialisation for KN03, aka DS5000/240,
6068c2ecf20Sopenharmony_ci * aka 3max+ and DS5900, aka BIGmax.  Also applies to KN05, aka
6078c2ecf20Sopenharmony_ci * DS5000/260, aka 4max+ and DS5900/260.
6088c2ecf20Sopenharmony_ci */
6098c2ecf20Sopenharmony_cistatic int kn03_interrupt[DEC_NR_INTS] __initdata = {
6108c2ecf20Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN03_CPU_INR_CASCADE),
6118c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
6128c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
6138c2ecf20Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
6148c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN03_IO_INR_ASC),
6158c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
6168c2ecf20Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
6178c2ecf20Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_HALT),
6188c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
6198c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN03_IO_INR_LANCE),
6208c2ecf20Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS),
6218c2ecf20Sopenharmony_ci	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN03_IO_INR_PSU),
6228c2ecf20Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC),
6238c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN03_IO_INR_SCC0),
6248c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN03_IO_INR_SCC1),
6258c2ecf20Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
6268c2ecf20Sopenharmony_ci	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN03_IO_INR_TC0),
6278c2ecf20Sopenharmony_ci	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN03_IO_INR_TC1),
6288c2ecf20Sopenharmony_ci	[DEC_IRQ_TC2]		= IO_IRQ_NR(KN03_IO_INR_TC2),
6298c2ecf20Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
6308c2ecf20Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
6318c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
6328c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
6338c2ecf20Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
6348c2ecf20Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
6358c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
6368c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
6378c2ecf20Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
6388c2ecf20Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
6398c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
6408c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
6418c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
6428c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
6438c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
6448c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
6458c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
6468c2ecf20Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
6478c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
6488c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
6498c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
6508c2ecf20Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
6518c2ecf20Sopenharmony_ci};
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_cistatic int_ptr kn03_cpu_mask_nr_tbl[][2] __initdata = {
6548c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_BUS) },
6558c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS) } },
6568c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_RTC) },
6578c2ecf20Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC) } },
6588c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_CASCADE) },
6598c2ecf20Sopenharmony_ci		{ .p = kn03_io_int } },
6608c2ecf20Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
6618c2ecf20Sopenharmony_ci		{ .p = cpu_all_int } },
6628c2ecf20Sopenharmony_ci};
6638c2ecf20Sopenharmony_ci
6648c2ecf20Sopenharmony_cistatic int_ptr kn03_asic_mask_nr_tbl[][2] __initdata = {
6658c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
6668c2ecf20Sopenharmony_ci		{ .p = asic_dma_int } },
6678c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_SCC0) },
6688c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_SCC0) } },
6698c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_SCC1) },
6708c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_SCC1) } },
6718c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_ASC) },
6728c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_ASC) } },
6738c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_LANCE) },
6748c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_LANCE) } },
6758c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC2) },
6768c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC2) } },
6778c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC1) },
6788c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC1) } },
6798c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC0) },
6808c2ecf20Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC0) } },
6818c2ecf20Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
6828c2ecf20Sopenharmony_ci		{ .p = asic_all_int } },
6838c2ecf20Sopenharmony_ci};
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_cistatic void __init dec_init_kn03(void)
6868c2ecf20Sopenharmony_ci{
6878c2ecf20Sopenharmony_ci	/* IRQ routing. */
6888c2ecf20Sopenharmony_ci	memcpy(&dec_interrupt, &kn03_interrupt,
6898c2ecf20Sopenharmony_ci		sizeof(kn03_interrupt));
6908c2ecf20Sopenharmony_ci
6918c2ecf20Sopenharmony_ci	/* CPU IRQ priorities. */
6928c2ecf20Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn03_cpu_mask_nr_tbl,
6938c2ecf20Sopenharmony_ci		sizeof(kn03_cpu_mask_nr_tbl));
6948c2ecf20Sopenharmony_ci
6958c2ecf20Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
6968c2ecf20Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl,
6978c2ecf20Sopenharmony_ci		sizeof(kn03_asic_mask_nr_tbl));
6988c2ecf20Sopenharmony_ci
6998c2ecf20Sopenharmony_ci	mips_cpu_irq_init();
7008c2ecf20Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_ci}				/* dec_init_kn03 */
7038c2ecf20Sopenharmony_ci
7048c2ecf20Sopenharmony_ci
7058c2ecf20Sopenharmony_civoid __init arch_init_irq(void)
7068c2ecf20Sopenharmony_ci{
7078c2ecf20Sopenharmony_ci	switch (mips_machtype) {
7088c2ecf20Sopenharmony_ci	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
7098c2ecf20Sopenharmony_ci		dec_init_kn01();
7108c2ecf20Sopenharmony_ci		break;
7118c2ecf20Sopenharmony_ci	case MACH_DS5100:	/* DS5100 MIPSmate */
7128c2ecf20Sopenharmony_ci		dec_init_kn230();
7138c2ecf20Sopenharmony_ci		break;
7148c2ecf20Sopenharmony_ci	case MACH_DS5000_200:	/* DS5000/200 3max */
7158c2ecf20Sopenharmony_ci		dec_init_kn02();
7168c2ecf20Sopenharmony_ci		break;
7178c2ecf20Sopenharmony_ci	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
7188c2ecf20Sopenharmony_ci		dec_init_kn02ba();
7198c2ecf20Sopenharmony_ci		break;
7208c2ecf20Sopenharmony_ci	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
7218c2ecf20Sopenharmony_ci	case MACH_DS5900:	/* DS5900 bigmax */
7228c2ecf20Sopenharmony_ci		dec_init_kn03();
7238c2ecf20Sopenharmony_ci		break;
7248c2ecf20Sopenharmony_ci	case MACH_DS5000_XX:	/* Personal DS5000/xx */
7258c2ecf20Sopenharmony_ci		dec_init_kn02ca();
7268c2ecf20Sopenharmony_ci		break;
7278c2ecf20Sopenharmony_ci	case MACH_DS5800:	/* DS5800 Isis */
7288c2ecf20Sopenharmony_ci		panic("Don't know how to set this up!");
7298c2ecf20Sopenharmony_ci		break;
7308c2ecf20Sopenharmony_ci	case MACH_DS5400:	/* DS5400 MIPSfair */
7318c2ecf20Sopenharmony_ci		panic("Don't know how to set this up!");
7328c2ecf20Sopenharmony_ci		break;
7338c2ecf20Sopenharmony_ci	case MACH_DS5500:	/* DS5500 MIPSfair-2 */
7348c2ecf20Sopenharmony_ci		panic("Don't know how to set this up!");
7358c2ecf20Sopenharmony_ci		break;
7368c2ecf20Sopenharmony_ci	}
7378c2ecf20Sopenharmony_ci
7388c2ecf20Sopenharmony_ci	/* Free the FPU interrupt if the exception is present. */
7398c2ecf20Sopenharmony_ci	if (!cpu_has_nofpuex) {
7408c2ecf20Sopenharmony_ci		cpu_fpu_mask = 0;
7418c2ecf20Sopenharmony_ci		dec_interrupt[DEC_IRQ_FPU] = -1;
7428c2ecf20Sopenharmony_ci	}
7438c2ecf20Sopenharmony_ci	/* Free the halt interrupt unused on R4k systems.  */
7448c2ecf20Sopenharmony_ci	if (current_cpu_type() == CPU_R4000SC ||
7458c2ecf20Sopenharmony_ci	    current_cpu_type() == CPU_R4400SC)
7468c2ecf20Sopenharmony_ci		dec_interrupt[DEC_IRQ_HALT] = -1;
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci	/* Register board interrupts: FPU and cascade. */
7498c2ecf20Sopenharmony_ci	if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) &&
7508c2ecf20Sopenharmony_ci	    dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
7518c2ecf20Sopenharmony_ci		struct irq_desc *desc_fpu;
7528c2ecf20Sopenharmony_ci		int irq_fpu;
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci		irq_fpu = dec_interrupt[DEC_IRQ_FPU];
7558c2ecf20Sopenharmony_ci		if (request_irq(irq_fpu, no_action, IRQF_NO_THREAD, "fpu",
7568c2ecf20Sopenharmony_ci				NULL))
7578c2ecf20Sopenharmony_ci			pr_err("Failed to register fpu interrupt\n");
7588c2ecf20Sopenharmony_ci		desc_fpu = irq_to_desc(irq_fpu);
7598c2ecf20Sopenharmony_ci		fpu_kstat_irq = this_cpu_ptr(desc_fpu->kstat_irqs);
7608c2ecf20Sopenharmony_ci	}
7618c2ecf20Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_CASCADE] >= 0) {
7628c2ecf20Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_CASCADE], no_action,
7638c2ecf20Sopenharmony_ci				IRQF_NO_THREAD, "cascade", NULL))
7648c2ecf20Sopenharmony_ci			pr_err("Failed to register cascade interrupt\n");
7658c2ecf20Sopenharmony_ci	}
7668c2ecf20Sopenharmony_ci	/* Register the bus error interrupt. */
7678c2ecf20Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_BUS] >= 0 && busirq_handler) {
7688c2ecf20Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_BUS], busirq_handler,
7698c2ecf20Sopenharmony_ci				busirq_flags, "bus error", busirq_handler))
7708c2ecf20Sopenharmony_ci			pr_err("Failed to register bus error interrupt\n");
7718c2ecf20Sopenharmony_ci	}
7728c2ecf20Sopenharmony_ci	/* Register the HALT interrupt. */
7738c2ecf20Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_HALT] >= 0) {
7748c2ecf20Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_HALT], dec_intr_halt,
7758c2ecf20Sopenharmony_ci				IRQF_NO_THREAD, "halt", NULL))
7768c2ecf20Sopenharmony_ci			pr_err("Failed to register halt interrupt\n");
7778c2ecf20Sopenharmony_ci	}
7788c2ecf20Sopenharmony_ci}
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ciasmlinkage unsigned int dec_irq_dispatch(unsigned int irq)
7818c2ecf20Sopenharmony_ci{
7828c2ecf20Sopenharmony_ci	do_IRQ(irq);
7838c2ecf20Sopenharmony_ci	return 0;
7848c2ecf20Sopenharmony_ci}
785