162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * System-specific setup, especially interrupts.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
562306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
662306a36Sopenharmony_ci * for more details.
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Copyright (C) 1998 Harald Koerfgen
962306a36Sopenharmony_ci * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2020  Maciej W. Rozycki
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci#include <linux/console.h>
1262306a36Sopenharmony_ci#include <linux/export.h>
1362306a36Sopenharmony_ci#include <linux/init.h>
1462306a36Sopenharmony_ci#include <linux/interrupt.h>
1562306a36Sopenharmony_ci#include <linux/ioport.h>
1662306a36Sopenharmony_ci#include <linux/irq.h>
1762306a36Sopenharmony_ci#include <linux/irqnr.h>
1862306a36Sopenharmony_ci#include <linux/memblock.h>
1962306a36Sopenharmony_ci#include <linux/param.h>
2062306a36Sopenharmony_ci#include <linux/percpu-defs.h>
2162306a36Sopenharmony_ci#include <linux/sched.h>
2262306a36Sopenharmony_ci#include <linux/spinlock.h>
2362306a36Sopenharmony_ci#include <linux/types.h>
2462306a36Sopenharmony_ci#include <linux/pm.h>
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#include <asm/addrspace.h>
2762306a36Sopenharmony_ci#include <asm/bootinfo.h>
2862306a36Sopenharmony_ci#include <asm/cpu.h>
2962306a36Sopenharmony_ci#include <asm/cpu-features.h>
3062306a36Sopenharmony_ci#include <asm/cpu-type.h>
3162306a36Sopenharmony_ci#include <asm/irq.h>
3262306a36Sopenharmony_ci#include <asm/irq_cpu.h>
3362306a36Sopenharmony_ci#include <asm/mipsregs.h>
3462306a36Sopenharmony_ci#include <asm/page.h>
3562306a36Sopenharmony_ci#include <asm/reboot.h>
3662306a36Sopenharmony_ci#include <asm/sections.h>
3762306a36Sopenharmony_ci#include <asm/time.h>
3862306a36Sopenharmony_ci#include <asm/traps.h>
3962306a36Sopenharmony_ci#include <asm/wbflush.h>
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#include <asm/dec/interrupts.h>
4262306a36Sopenharmony_ci#include <asm/dec/ioasic.h>
4362306a36Sopenharmony_ci#include <asm/dec/ioasic_addrs.h>
4462306a36Sopenharmony_ci#include <asm/dec/ioasic_ints.h>
4562306a36Sopenharmony_ci#include <asm/dec/kn01.h>
4662306a36Sopenharmony_ci#include <asm/dec/kn02.h>
4762306a36Sopenharmony_ci#include <asm/dec/kn02ba.h>
4862306a36Sopenharmony_ci#include <asm/dec/kn02ca.h>
4962306a36Sopenharmony_ci#include <asm/dec/kn03.h>
5062306a36Sopenharmony_ci#include <asm/dec/kn230.h>
5162306a36Sopenharmony_ci#include <asm/dec/system.h>
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ciextern void dec_machine_restart(char *command);
5562306a36Sopenharmony_ciextern void dec_machine_halt(void);
5662306a36Sopenharmony_ciextern void dec_machine_power_off(void);
5762306a36Sopenharmony_ciextern irqreturn_t dec_intr_halt(int irq, void *dev_id);
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciunsigned long dec_kn_slot_base, dec_kn_slot_size;
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ciEXPORT_SYMBOL(dec_kn_slot_base);
6262306a36Sopenharmony_ciEXPORT_SYMBOL(dec_kn_slot_size);
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ciint dec_tc_bus;
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ciDEFINE_SPINLOCK(ioasic_ssr_lock);
6762306a36Sopenharmony_ciEXPORT_SYMBOL(ioasic_ssr_lock);
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_civolatile u32 *ioasic_base;
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ciEXPORT_SYMBOL(ioasic_base);
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/*
7462306a36Sopenharmony_ci * IRQ routing and priority tables.  Priorities are set as follows:
7562306a36Sopenharmony_ci *
7662306a36Sopenharmony_ci *		KN01	KN230	KN02	KN02-BA	KN02-CA	KN03
7762306a36Sopenharmony_ci *
7862306a36Sopenharmony_ci * MEMORY	CPU	CPU	CPU	ASIC	CPU	CPU
7962306a36Sopenharmony_ci * RTC		CPU	CPU	CPU	ASIC	CPU	CPU
8062306a36Sopenharmony_ci * DMA		-	-	-	ASIC	ASIC	ASIC
8162306a36Sopenharmony_ci * SERIAL0	CPU	CPU	CSR	ASIC	ASIC	ASIC
8262306a36Sopenharmony_ci * SERIAL1	-	-	-	ASIC	-	ASIC
8362306a36Sopenharmony_ci * SCSI		CPU	CPU	CSR	ASIC	ASIC	ASIC
8462306a36Sopenharmony_ci * ETHERNET	CPU	*	CSR	ASIC	ASIC	ASIC
8562306a36Sopenharmony_ci * other	-	-	-	ASIC	-	-
8662306a36Sopenharmony_ci * TC2		-	-	CSR	CPU	ASIC	ASIC
8762306a36Sopenharmony_ci * TC1		-	-	CSR	CPU	ASIC	ASIC
8862306a36Sopenharmony_ci * TC0		-	-	CSR	CPU	ASIC	ASIC
8962306a36Sopenharmony_ci * other	-	CPU	-	CPU	ASIC	ASIC
9062306a36Sopenharmony_ci * other	-	-	-	-	CPU	CPU
9162306a36Sopenharmony_ci *
9262306a36Sopenharmony_ci * * -- shared with SCSI
9362306a36Sopenharmony_ci */
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ciint dec_interrupt[DEC_NR_INTS] = {
9662306a36Sopenharmony_ci	[0 ... DEC_NR_INTS - 1] = -1
9762306a36Sopenharmony_ci};
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ciEXPORT_SYMBOL(dec_interrupt);
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ciint_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
10262306a36Sopenharmony_ci	{ { .i = ~0 }, { .p = dec_intr_unimplemented } },
10362306a36Sopenharmony_ci};
10462306a36Sopenharmony_ciint_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2] = {
10562306a36Sopenharmony_ci	{ { .i = ~0 }, { .p = asic_intr_unimplemented } },
10662306a36Sopenharmony_ci};
10762306a36Sopenharmony_ciint cpu_fpu_mask = DEC_CPU_IRQ_MASK(DEC_CPU_INR_FPU);
10862306a36Sopenharmony_ciint *fpu_kstat_irq;
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_cistatic irq_handler_t busirq_handler;
11162306a36Sopenharmony_cistatic unsigned int busirq_flags = IRQF_NO_THREAD;
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci/*
11462306a36Sopenharmony_ci * Bus error (DBE/IBE exceptions and bus interrupts) handling setup.
11562306a36Sopenharmony_ci */
11662306a36Sopenharmony_cistatic void __init dec_be_init(void)
11762306a36Sopenharmony_ci{
11862306a36Sopenharmony_ci	switch (mips_machtype) {
11962306a36Sopenharmony_ci	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
12062306a36Sopenharmony_ci		mips_set_be_handler(dec_kn01_be_handler);
12162306a36Sopenharmony_ci		busirq_handler = dec_kn01_be_interrupt;
12262306a36Sopenharmony_ci		busirq_flags |= IRQF_SHARED;
12362306a36Sopenharmony_ci		dec_kn01_be_init();
12462306a36Sopenharmony_ci		break;
12562306a36Sopenharmony_ci	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
12662306a36Sopenharmony_ci	case MACH_DS5000_XX:	/* DS5000/xx Maxine */
12762306a36Sopenharmony_ci		mips_set_be_handler(dec_kn02xa_be_handler);
12862306a36Sopenharmony_ci		busirq_handler = dec_kn02xa_be_interrupt;
12962306a36Sopenharmony_ci		dec_kn02xa_be_init();
13062306a36Sopenharmony_ci		break;
13162306a36Sopenharmony_ci	case MACH_DS5000_200:	/* DS5000/200 3max */
13262306a36Sopenharmony_ci	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
13362306a36Sopenharmony_ci	case MACH_DS5900:	/* DS5900 bigmax */
13462306a36Sopenharmony_ci		mips_set_be_handler(dec_ecc_be_handler);
13562306a36Sopenharmony_ci		busirq_handler = dec_ecc_be_interrupt;
13662306a36Sopenharmony_ci		dec_ecc_be_init();
13762306a36Sopenharmony_ci		break;
13862306a36Sopenharmony_ci	}
13962306a36Sopenharmony_ci}
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_civoid __init plat_mem_setup(void)
14262306a36Sopenharmony_ci{
14362306a36Sopenharmony_ci	board_be_init = dec_be_init;
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci	wbflush_setup();
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci	_machine_restart = dec_machine_restart;
14862306a36Sopenharmony_ci	_machine_halt = dec_machine_halt;
14962306a36Sopenharmony_ci	pm_power_off = dec_machine_power_off;
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci	ioport_resource.start = ~0UL;
15262306a36Sopenharmony_ci	ioport_resource.end = 0UL;
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci	/* Stay away from the firmware working memory area for now. */
15562306a36Sopenharmony_ci	memblock_reserve(PHYS_OFFSET, __pa_symbol(&_text) - PHYS_OFFSET);
15662306a36Sopenharmony_ci}
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci/*
15962306a36Sopenharmony_ci * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin)
16062306a36Sopenharmony_ci * or DS3100 (aka Pmax).
16162306a36Sopenharmony_ci */
16262306a36Sopenharmony_cistatic int kn01_interrupt[DEC_NR_INTS] __initdata = {
16362306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= -1,
16462306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
16562306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
16662306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11),
16762306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= -1,
16862306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
16962306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
17062306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= -1,
17162306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
17262306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE),
17362306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS),
17462306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
17562306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC),
17662306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
17762306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
17862306a36Sopenharmony_ci	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_SII),
17962306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= -1,
18062306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= -1,
18162306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
18262306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
18362306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_VIDEO),
18462306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
18562306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
18662306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
18762306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
18862306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
18962306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
19062306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
19162306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
19262306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
19362306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
19462306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
19562306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
19662306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
19762306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
19862306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
19962306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
20062306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
20162306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
20262306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
20362306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
20462306a36Sopenharmony_ci};
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_cistatic int_ptr kn01_cpu_mask_nr_tbl[][2] __initdata = {
20762306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_BUS) },
20862306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS) } },
20962306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_RTC) },
21062306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC) } },
21162306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_DZ11) },
21262306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11) } },
21362306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_SII) },
21462306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_SII) } },
21562306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN01_CPU_INR_LANCE) },
21662306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE) } },
21762306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
21862306a36Sopenharmony_ci		{ .p = cpu_all_int } },
21962306a36Sopenharmony_ci};
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_cistatic void __init dec_init_kn01(void)
22262306a36Sopenharmony_ci{
22362306a36Sopenharmony_ci	/* IRQ routing. */
22462306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn01_interrupt,
22562306a36Sopenharmony_ci		sizeof(kn01_interrupt));
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_ci	/* CPU IRQ priorities. */
22862306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl,
22962306a36Sopenharmony_ci		sizeof(kn01_cpu_mask_nr_tbl));
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci	mips_cpu_irq_init();
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ci}				/* dec_init_kn01 */
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci
23662306a36Sopenharmony_ci/*
23762306a36Sopenharmony_ci * Machine-specific initialisation for KN230, aka DS5100, aka MIPSmate.
23862306a36Sopenharmony_ci */
23962306a36Sopenharmony_cistatic int kn230_interrupt[DEC_NR_INTS] __initdata = {
24062306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= -1,
24162306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
24262306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
24362306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11),
24462306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= -1,
24562306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
24662306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
24762306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_HALT),
24862306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
24962306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_LANCE),
25062306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS),
25162306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
25262306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC),
25362306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
25462306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
25562306a36Sopenharmony_ci	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_SII),
25662306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= -1,
25762306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= -1,
25862306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
25962306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
26062306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
26162306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
26262306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
26362306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
26462306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
26562306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
26662306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
26762306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
26862306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
26962306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
27062306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
27162306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
27262306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
27362306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
27462306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
27562306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
27662306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
27762306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
27862306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
27962306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
28062306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
28162306a36Sopenharmony_ci};
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_cistatic int_ptr kn230_cpu_mask_nr_tbl[][2] __initdata = {
28462306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_BUS) },
28562306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS) } },
28662306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_RTC) },
28762306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC) } },
28862306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_DZ11) },
28962306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11) } },
29062306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN230_CPU_INR_SII) },
29162306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN230_CPU_INR_SII) } },
29262306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
29362306a36Sopenharmony_ci		{ .p = cpu_all_int } },
29462306a36Sopenharmony_ci};
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_cistatic void __init dec_init_kn230(void)
29762306a36Sopenharmony_ci{
29862306a36Sopenharmony_ci	/* IRQ routing. */
29962306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn230_interrupt,
30062306a36Sopenharmony_ci		sizeof(kn230_interrupt));
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci	/* CPU IRQ priorities. */
30362306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl,
30462306a36Sopenharmony_ci		sizeof(kn230_cpu_mask_nr_tbl));
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_ci	mips_cpu_irq_init();
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci}				/* dec_init_kn230 */
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_ci/*
31262306a36Sopenharmony_ci * Machine-specific initialisation for KN02, aka DS5000/200, aka 3max.
31362306a36Sopenharmony_ci */
31462306a36Sopenharmony_cistatic int kn02_interrupt[DEC_NR_INTS] __initdata = {
31562306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02_CPU_INR_CASCADE),
31662306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
31762306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
31862306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= KN02_IRQ_NR(KN02_CSR_INR_DZ11),
31962306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= KN02_IRQ_NR(KN02_CSR_INR_ASC),
32062306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
32162306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
32262306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= -1,
32362306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
32462306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= KN02_IRQ_NR(KN02_CSR_INR_LANCE),
32562306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS),
32662306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
32762306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC),
32862306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= -1,
32962306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
33062306a36Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
33162306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= KN02_IRQ_NR(KN02_CSR_INR_TC0),
33262306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= KN02_IRQ_NR(KN02_CSR_INR_TC1),
33362306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= KN02_IRQ_NR(KN02_CSR_INR_TC2),
33462306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
33562306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
33662306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= -1,
33762306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= -1,
33862306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= -1,
33962306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
34062306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
34162306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
34262306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
34362306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= -1,
34462306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= -1,
34562306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= -1,
34662306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= -1,
34762306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= -1,
34862306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
34962306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
35062306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
35162306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
35262306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
35362306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
35462306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
35562306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
35662306a36Sopenharmony_ci};
35762306a36Sopenharmony_ci
35862306a36Sopenharmony_cistatic int_ptr kn02_cpu_mask_nr_tbl[][2] __initdata = {
35962306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_BUS) },
36062306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS) } },
36162306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_RTC) },
36262306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC) } },
36362306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02_CPU_INR_CASCADE) },
36462306a36Sopenharmony_ci		{ .p = kn02_io_int } },
36562306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
36662306a36Sopenharmony_ci		{ .p = cpu_all_int } },
36762306a36Sopenharmony_ci};
36862306a36Sopenharmony_ci
36962306a36Sopenharmony_cistatic int_ptr kn02_asic_mask_nr_tbl[][2] __initdata = {
37062306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_DZ11) },
37162306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_DZ11) } },
37262306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_ASC) },
37362306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_ASC) } },
37462306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_LANCE) },
37562306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_LANCE) } },
37662306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC2) },
37762306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC2) } },
37862306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC1) },
37962306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC1) } },
38062306a36Sopenharmony_ci	{ { .i = KN02_IRQ_MASK(KN02_CSR_INR_TC0) },
38162306a36Sopenharmony_ci		{ .i = KN02_IRQ_NR(KN02_CSR_INR_TC0) } },
38262306a36Sopenharmony_ci	{ { .i = KN02_IRQ_ALL },
38362306a36Sopenharmony_ci		{ .p = kn02_all_int } },
38462306a36Sopenharmony_ci};
38562306a36Sopenharmony_ci
38662306a36Sopenharmony_cistatic void __init dec_init_kn02(void)
38762306a36Sopenharmony_ci{
38862306a36Sopenharmony_ci	/* IRQ routing. */
38962306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn02_interrupt,
39062306a36Sopenharmony_ci		sizeof(kn02_interrupt));
39162306a36Sopenharmony_ci
39262306a36Sopenharmony_ci	/* CPU IRQ priorities. */
39362306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02_cpu_mask_nr_tbl,
39462306a36Sopenharmony_ci		sizeof(kn02_cpu_mask_nr_tbl));
39562306a36Sopenharmony_ci
39662306a36Sopenharmony_ci	/* KN02 CSR IRQ priorities. */
39762306a36Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl,
39862306a36Sopenharmony_ci		sizeof(kn02_asic_mask_nr_tbl));
39962306a36Sopenharmony_ci
40062306a36Sopenharmony_ci	mips_cpu_irq_init();
40162306a36Sopenharmony_ci	init_kn02_irqs(KN02_IRQ_BASE);
40262306a36Sopenharmony_ci
40362306a36Sopenharmony_ci}				/* dec_init_kn02 */
40462306a36Sopenharmony_ci
40562306a36Sopenharmony_ci
40662306a36Sopenharmony_ci/*
40762306a36Sopenharmony_ci * Machine-specific initialisation for KN02-BA, aka DS5000/1xx
40862306a36Sopenharmony_ci * (xx = 20, 25, 33), aka 3min.  Also applies to KN04(-BA), aka
40962306a36Sopenharmony_ci * DS5000/150, aka 4min.
41062306a36Sopenharmony_ci */
41162306a36Sopenharmony_cistatic int kn02ba_interrupt[DEC_NR_INTS] __initdata = {
41262306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_CASCADE),
41362306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
41462306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
41562306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
41662306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02BA_IO_INR_ASC),
41762306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
41862306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
41962306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_HALT),
42062306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
42162306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02BA_IO_INR_LANCE),
42262306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= IO_IRQ_NR(KN02BA_IO_INR_BUS),
42362306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN02BA_IO_INR_PSU),
42462306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= IO_IRQ_NR(KN02BA_IO_INR_RTC),
42562306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02BA_IO_INR_SCC0),
42662306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN02BA_IO_INR_SCC1),
42762306a36Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
42862306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0),
42962306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1),
43062306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2),
43162306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
43262306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
43362306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
43462306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
43562306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
43662306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
43762306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
43862306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
43962306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
44062306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
44162306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
44262306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
44362306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
44462306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
44562306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
44662306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
44762306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
44862306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
44962306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
45062306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
45162306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
45262306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
45362306a36Sopenharmony_ci};
45462306a36Sopenharmony_ci
45562306a36Sopenharmony_cistatic int_ptr kn02ba_cpu_mask_nr_tbl[][2] __initdata = {
45662306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_CASCADE) },
45762306a36Sopenharmony_ci		{ .p = kn02xa_io_int } },
45862306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC2) },
45962306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2) } },
46062306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC1) },
46162306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1) } },
46262306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC0) },
46362306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0) } },
46462306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
46562306a36Sopenharmony_ci		{ .p = cpu_all_int } },
46662306a36Sopenharmony_ci};
46762306a36Sopenharmony_ci
46862306a36Sopenharmony_cistatic int_ptr kn02ba_asic_mask_nr_tbl[][2] __initdata = {
46962306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_BUS) },
47062306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_BUS) } },
47162306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_RTC) },
47262306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_RTC) } },
47362306a36Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
47462306a36Sopenharmony_ci		{ .p = asic_dma_int } },
47562306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_SCC0) },
47662306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_SCC0) } },
47762306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_SCC1) },
47862306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_SCC1) } },
47962306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_ASC) },
48062306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_ASC) } },
48162306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02BA_IO_INR_LANCE) },
48262306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02BA_IO_INR_LANCE) } },
48362306a36Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
48462306a36Sopenharmony_ci		{ .p = asic_all_int } },
48562306a36Sopenharmony_ci};
48662306a36Sopenharmony_ci
48762306a36Sopenharmony_cistatic void __init dec_init_kn02ba(void)
48862306a36Sopenharmony_ci{
48962306a36Sopenharmony_ci	/* IRQ routing. */
49062306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn02ba_interrupt,
49162306a36Sopenharmony_ci		sizeof(kn02ba_interrupt));
49262306a36Sopenharmony_ci
49362306a36Sopenharmony_ci	/* CPU IRQ priorities. */
49462306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02ba_cpu_mask_nr_tbl,
49562306a36Sopenharmony_ci		sizeof(kn02ba_cpu_mask_nr_tbl));
49662306a36Sopenharmony_ci
49762306a36Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
49862306a36Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl,
49962306a36Sopenharmony_ci		sizeof(kn02ba_asic_mask_nr_tbl));
50062306a36Sopenharmony_ci
50162306a36Sopenharmony_ci	mips_cpu_irq_init();
50262306a36Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
50362306a36Sopenharmony_ci
50462306a36Sopenharmony_ci}				/* dec_init_kn02ba */
50562306a36Sopenharmony_ci
50662306a36Sopenharmony_ci
50762306a36Sopenharmony_ci/*
50862306a36Sopenharmony_ci * Machine-specific initialisation for KN02-CA, aka DS5000/xx,
50962306a36Sopenharmony_ci * (xx = 20, 25, 33), aka MAXine.  Also applies to KN04(-CA), aka
51062306a36Sopenharmony_ci * DS5000/50, aka 4MAXine.
51162306a36Sopenharmony_ci */
51262306a36Sopenharmony_cistatic int kn02ca_interrupt[DEC_NR_INTS] __initdata = {
51362306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_CASCADE),
51462306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= IO_IRQ_NR(KN02CA_IO_INR_AB_RECV),
51562306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= IO_IRQ_NR(KN02CA_IO_INR_AB_XMIT),
51662306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
51762306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02CA_IO_INR_ASC),
51862306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= IO_IRQ_NR(KN02CA_IO_INR_FLOPPY),
51962306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
52062306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_HALT),
52162306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= IO_IRQ_NR(KN02CA_IO_INR_ISDN),
52262306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02CA_IO_INR_LANCE),
52362306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS),
52462306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= -1,
52562306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC),
52662306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02CA_IO_INR_SCC0),
52762306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= -1,
52862306a36Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
52962306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN02CA_IO_INR_TC0),
53062306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN02CA_IO_INR_TC1),
53162306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= -1,
53262306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_TIMER),
53362306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= IO_IRQ_NR(KN02CA_IO_INR_VIDEO),
53462306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
53562306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
53662306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
53762306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= IO_IRQ_NR(IO_INR_FLOPPY_ERR),
53862306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= IO_IRQ_NR(IO_INR_ISDN_ERR),
53962306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= IO_IRQ_NR(IO_INR_ISDN_RXDMA),
54062306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= IO_IRQ_NR(IO_INR_ISDN_TXDMA),
54162306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
54262306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
54362306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
54462306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
54562306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
54662306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= IO_IRQ_NR(IO_INR_AB_RXERR),
54762306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= IO_IRQ_NR(IO_INR_AB_RXDMA),
54862306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= IO_IRQ_NR(IO_INR_AB_TXERR),
54962306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= IO_IRQ_NR(IO_INR_AB_TXDMA),
55062306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= -1,
55162306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= -1,
55262306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= -1,
55362306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= -1,
55462306a36Sopenharmony_ci};
55562306a36Sopenharmony_ci
55662306a36Sopenharmony_cistatic int_ptr kn02ca_cpu_mask_nr_tbl[][2] __initdata = {
55762306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_BUS) },
55862306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS) } },
55962306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_RTC) },
56062306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC) } },
56162306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_CASCADE) },
56262306a36Sopenharmony_ci		{ .p = kn02xa_io_int } },
56362306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
56462306a36Sopenharmony_ci		{ .p = cpu_all_int } },
56562306a36Sopenharmony_ci};
56662306a36Sopenharmony_ci
56762306a36Sopenharmony_cistatic int_ptr kn02ca_asic_mask_nr_tbl[][2] __initdata = {
56862306a36Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
56962306a36Sopenharmony_ci		{ .p = asic_dma_int } },
57062306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_SCC0) },
57162306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_SCC0) } },
57262306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_ASC) },
57362306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_ASC) } },
57462306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_LANCE) },
57562306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_LANCE) } },
57662306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_TC1) },
57762306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_TC1) } },
57862306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN02CA_IO_INR_TC0) },
57962306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN02CA_IO_INR_TC0) } },
58062306a36Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
58162306a36Sopenharmony_ci		{ .p = asic_all_int } },
58262306a36Sopenharmony_ci};
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_cistatic void __init dec_init_kn02ca(void)
58562306a36Sopenharmony_ci{
58662306a36Sopenharmony_ci	/* IRQ routing. */
58762306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn02ca_interrupt,
58862306a36Sopenharmony_ci		sizeof(kn02ca_interrupt));
58962306a36Sopenharmony_ci
59062306a36Sopenharmony_ci	/* CPU IRQ priorities. */
59162306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn02ca_cpu_mask_nr_tbl,
59262306a36Sopenharmony_ci		sizeof(kn02ca_cpu_mask_nr_tbl));
59362306a36Sopenharmony_ci
59462306a36Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
59562306a36Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl,
59662306a36Sopenharmony_ci		sizeof(kn02ca_asic_mask_nr_tbl));
59762306a36Sopenharmony_ci
59862306a36Sopenharmony_ci	mips_cpu_irq_init();
59962306a36Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
60062306a36Sopenharmony_ci
60162306a36Sopenharmony_ci}				/* dec_init_kn02ca */
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci
60462306a36Sopenharmony_ci/*
60562306a36Sopenharmony_ci * Machine-specific initialisation for KN03, aka DS5000/240,
60662306a36Sopenharmony_ci * aka 3max+ and DS5900, aka BIGmax.  Also applies to KN05, aka
60762306a36Sopenharmony_ci * DS5000/260, aka 4max+ and DS5900/260.
60862306a36Sopenharmony_ci */
60962306a36Sopenharmony_cistatic int kn03_interrupt[DEC_NR_INTS] __initdata = {
61062306a36Sopenharmony_ci	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN03_CPU_INR_CASCADE),
61162306a36Sopenharmony_ci	[DEC_IRQ_AB_RECV]	= -1,
61262306a36Sopenharmony_ci	[DEC_IRQ_AB_XMIT]	= -1,
61362306a36Sopenharmony_ci	[DEC_IRQ_DZ11]		= -1,
61462306a36Sopenharmony_ci	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN03_IO_INR_ASC),
61562306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY]	= -1,
61662306a36Sopenharmony_ci	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
61762306a36Sopenharmony_ci	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_HALT),
61862306a36Sopenharmony_ci	[DEC_IRQ_ISDN]		= -1,
61962306a36Sopenharmony_ci	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN03_IO_INR_LANCE),
62062306a36Sopenharmony_ci	[DEC_IRQ_BUS]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS),
62162306a36Sopenharmony_ci	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN03_IO_INR_PSU),
62262306a36Sopenharmony_ci	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC),
62362306a36Sopenharmony_ci	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN03_IO_INR_SCC0),
62462306a36Sopenharmony_ci	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN03_IO_INR_SCC1),
62562306a36Sopenharmony_ci	[DEC_IRQ_SII]		= -1,
62662306a36Sopenharmony_ci	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN03_IO_INR_TC0),
62762306a36Sopenharmony_ci	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN03_IO_INR_TC1),
62862306a36Sopenharmony_ci	[DEC_IRQ_TC2]		= IO_IRQ_NR(KN03_IO_INR_TC2),
62962306a36Sopenharmony_ci	[DEC_IRQ_TIMER]		= -1,
63062306a36Sopenharmony_ci	[DEC_IRQ_VIDEO]		= -1,
63162306a36Sopenharmony_ci	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
63262306a36Sopenharmony_ci	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
63362306a36Sopenharmony_ci	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
63462306a36Sopenharmony_ci	[DEC_IRQ_FLOPPY_ERR]	= -1,
63562306a36Sopenharmony_ci	[DEC_IRQ_ISDN_ERR]	= -1,
63662306a36Sopenharmony_ci	[DEC_IRQ_ISDN_RXDMA]	= -1,
63762306a36Sopenharmony_ci	[DEC_IRQ_ISDN_TXDMA]	= -1,
63862306a36Sopenharmony_ci	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
63962306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
64062306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
64162306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
64262306a36Sopenharmony_ci	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
64362306a36Sopenharmony_ci	[DEC_IRQ_AB_RXERR]	= -1,
64462306a36Sopenharmony_ci	[DEC_IRQ_AB_RXDMA]	= -1,
64562306a36Sopenharmony_ci	[DEC_IRQ_AB_TXERR]	= -1,
64662306a36Sopenharmony_ci	[DEC_IRQ_AB_TXDMA]	= -1,
64762306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
64862306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
64962306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
65062306a36Sopenharmony_ci	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
65162306a36Sopenharmony_ci};
65262306a36Sopenharmony_ci
65362306a36Sopenharmony_cistatic int_ptr kn03_cpu_mask_nr_tbl[][2] __initdata = {
65462306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_BUS) },
65562306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS) } },
65662306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_RTC) },
65762306a36Sopenharmony_ci		{ .i = DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC) } },
65862306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_MASK(KN03_CPU_INR_CASCADE) },
65962306a36Sopenharmony_ci		{ .p = kn03_io_int } },
66062306a36Sopenharmony_ci	{ { .i = DEC_CPU_IRQ_ALL },
66162306a36Sopenharmony_ci		{ .p = cpu_all_int } },
66262306a36Sopenharmony_ci};
66362306a36Sopenharmony_ci
66462306a36Sopenharmony_cistatic int_ptr kn03_asic_mask_nr_tbl[][2] __initdata = {
66562306a36Sopenharmony_ci	{ { .i = IO_IRQ_DMA },
66662306a36Sopenharmony_ci		{ .p = asic_dma_int } },
66762306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_SCC0) },
66862306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_SCC0) } },
66962306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_SCC1) },
67062306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_SCC1) } },
67162306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_ASC) },
67262306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_ASC) } },
67362306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_LANCE) },
67462306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_LANCE) } },
67562306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC2) },
67662306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC2) } },
67762306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC1) },
67862306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC1) } },
67962306a36Sopenharmony_ci	{ { .i = IO_IRQ_MASK(KN03_IO_INR_TC0) },
68062306a36Sopenharmony_ci		{ .i = IO_IRQ_NR(KN03_IO_INR_TC0) } },
68162306a36Sopenharmony_ci	{ { .i = IO_IRQ_ALL },
68262306a36Sopenharmony_ci		{ .p = asic_all_int } },
68362306a36Sopenharmony_ci};
68462306a36Sopenharmony_ci
68562306a36Sopenharmony_cistatic void __init dec_init_kn03(void)
68662306a36Sopenharmony_ci{
68762306a36Sopenharmony_ci	/* IRQ routing. */
68862306a36Sopenharmony_ci	memcpy(&dec_interrupt, &kn03_interrupt,
68962306a36Sopenharmony_ci		sizeof(kn03_interrupt));
69062306a36Sopenharmony_ci
69162306a36Sopenharmony_ci	/* CPU IRQ priorities. */
69262306a36Sopenharmony_ci	memcpy(&cpu_mask_nr_tbl, &kn03_cpu_mask_nr_tbl,
69362306a36Sopenharmony_ci		sizeof(kn03_cpu_mask_nr_tbl));
69462306a36Sopenharmony_ci
69562306a36Sopenharmony_ci	/* I/O ASIC IRQ priorities. */
69662306a36Sopenharmony_ci	memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl,
69762306a36Sopenharmony_ci		sizeof(kn03_asic_mask_nr_tbl));
69862306a36Sopenharmony_ci
69962306a36Sopenharmony_ci	mips_cpu_irq_init();
70062306a36Sopenharmony_ci	init_ioasic_irqs(IO_IRQ_BASE);
70162306a36Sopenharmony_ci
70262306a36Sopenharmony_ci}				/* dec_init_kn03 */
70362306a36Sopenharmony_ci
70462306a36Sopenharmony_ci
70562306a36Sopenharmony_civoid __init arch_init_irq(void)
70662306a36Sopenharmony_ci{
70762306a36Sopenharmony_ci	switch (mips_machtype) {
70862306a36Sopenharmony_ci	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
70962306a36Sopenharmony_ci		dec_init_kn01();
71062306a36Sopenharmony_ci		break;
71162306a36Sopenharmony_ci	case MACH_DS5100:	/* DS5100 MIPSmate */
71262306a36Sopenharmony_ci		dec_init_kn230();
71362306a36Sopenharmony_ci		break;
71462306a36Sopenharmony_ci	case MACH_DS5000_200:	/* DS5000/200 3max */
71562306a36Sopenharmony_ci		dec_init_kn02();
71662306a36Sopenharmony_ci		break;
71762306a36Sopenharmony_ci	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
71862306a36Sopenharmony_ci		dec_init_kn02ba();
71962306a36Sopenharmony_ci		break;
72062306a36Sopenharmony_ci	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
72162306a36Sopenharmony_ci	case MACH_DS5900:	/* DS5900 bigmax */
72262306a36Sopenharmony_ci		dec_init_kn03();
72362306a36Sopenharmony_ci		break;
72462306a36Sopenharmony_ci	case MACH_DS5000_XX:	/* Personal DS5000/xx */
72562306a36Sopenharmony_ci		dec_init_kn02ca();
72662306a36Sopenharmony_ci		break;
72762306a36Sopenharmony_ci	case MACH_DS5800:	/* DS5800 Isis */
72862306a36Sopenharmony_ci		panic("Don't know how to set this up!");
72962306a36Sopenharmony_ci		break;
73062306a36Sopenharmony_ci	case MACH_DS5400:	/* DS5400 MIPSfair */
73162306a36Sopenharmony_ci		panic("Don't know how to set this up!");
73262306a36Sopenharmony_ci		break;
73362306a36Sopenharmony_ci	case MACH_DS5500:	/* DS5500 MIPSfair-2 */
73462306a36Sopenharmony_ci		panic("Don't know how to set this up!");
73562306a36Sopenharmony_ci		break;
73662306a36Sopenharmony_ci	}
73762306a36Sopenharmony_ci
73862306a36Sopenharmony_ci	/* Free the FPU interrupt if the exception is present. */
73962306a36Sopenharmony_ci	if (!cpu_has_nofpuex) {
74062306a36Sopenharmony_ci		cpu_fpu_mask = 0;
74162306a36Sopenharmony_ci		dec_interrupt[DEC_IRQ_FPU] = -1;
74262306a36Sopenharmony_ci	}
74362306a36Sopenharmony_ci	/* Free the halt interrupt unused on R4k systems.  */
74462306a36Sopenharmony_ci	if (current_cpu_type() == CPU_R4000SC ||
74562306a36Sopenharmony_ci	    current_cpu_type() == CPU_R4400SC)
74662306a36Sopenharmony_ci		dec_interrupt[DEC_IRQ_HALT] = -1;
74762306a36Sopenharmony_ci
74862306a36Sopenharmony_ci	/* Register board interrupts: FPU and cascade. */
74962306a36Sopenharmony_ci	if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) &&
75062306a36Sopenharmony_ci	    dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
75162306a36Sopenharmony_ci		struct irq_desc *desc_fpu;
75262306a36Sopenharmony_ci		int irq_fpu;
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_ci		irq_fpu = dec_interrupt[DEC_IRQ_FPU];
75562306a36Sopenharmony_ci		if (request_irq(irq_fpu, no_action, IRQF_NO_THREAD, "fpu",
75662306a36Sopenharmony_ci				NULL))
75762306a36Sopenharmony_ci			pr_err("Failed to register fpu interrupt\n");
75862306a36Sopenharmony_ci		desc_fpu = irq_to_desc(irq_fpu);
75962306a36Sopenharmony_ci		fpu_kstat_irq = this_cpu_ptr(desc_fpu->kstat_irqs);
76062306a36Sopenharmony_ci	}
76162306a36Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_CASCADE] >= 0) {
76262306a36Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_CASCADE], no_action,
76362306a36Sopenharmony_ci				IRQF_NO_THREAD, "cascade", NULL))
76462306a36Sopenharmony_ci			pr_err("Failed to register cascade interrupt\n");
76562306a36Sopenharmony_ci	}
76662306a36Sopenharmony_ci	/* Register the bus error interrupt. */
76762306a36Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_BUS] >= 0 && busirq_handler) {
76862306a36Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_BUS], busirq_handler,
76962306a36Sopenharmony_ci				busirq_flags, "bus error", busirq_handler))
77062306a36Sopenharmony_ci			pr_err("Failed to register bus error interrupt\n");
77162306a36Sopenharmony_ci	}
77262306a36Sopenharmony_ci	/* Register the HALT interrupt. */
77362306a36Sopenharmony_ci	if (dec_interrupt[DEC_IRQ_HALT] >= 0) {
77462306a36Sopenharmony_ci		if (request_irq(dec_interrupt[DEC_IRQ_HALT], dec_intr_halt,
77562306a36Sopenharmony_ci				IRQF_NO_THREAD, "halt", NULL))
77662306a36Sopenharmony_ci			pr_err("Failed to register halt interrupt\n");
77762306a36Sopenharmony_ci	}
77862306a36Sopenharmony_ci}
77962306a36Sopenharmony_ci
78062306a36Sopenharmony_ciasmlinkage unsigned int dec_irq_dispatch(unsigned int irq)
78162306a36Sopenharmony_ci{
78262306a36Sopenharmony_ci	do_IRQ(irq);
78362306a36Sopenharmony_ci	return 0;
78462306a36Sopenharmony_ci}
785