162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * arch/arm/mach-footbridge/include/mach/irqs.h
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 1998 Russell King
662306a36Sopenharmony_ci * Copyright (C) 1998 Phil Blundell
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Changelog:
962306a36Sopenharmony_ci *  20-Jan-1998	RMK	Started merge of EBSA286, CATS and NetWinder
1062306a36Sopenharmony_ci *  01-Feb-1999	PJB	ISA IRQs start at 0 not 16
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci#include <asm/mach-types.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define NR_IRQS			36
1562306a36Sopenharmony_ci#define NR_DC21285_IRQS		16
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define _ISA_IRQ(x)		(0 + (x))
1862306a36Sopenharmony_ci#define _ISA_INR(x)		((x) - 0)
1962306a36Sopenharmony_ci#define _DC21285_IRQ(x)		(16 + (x))
2062306a36Sopenharmony_ci#define _DC21285_INR(x)		((x) - 16)
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/*
2362306a36Sopenharmony_ci * This is a list of all interrupts that the 21285
2462306a36Sopenharmony_ci * can generate and we handle.
2562306a36Sopenharmony_ci */
2662306a36Sopenharmony_ci#define IRQ_CONRX		_DC21285_IRQ(0)
2762306a36Sopenharmony_ci#define IRQ_CONTX		_DC21285_IRQ(1)
2862306a36Sopenharmony_ci#define IRQ_TIMER1		_DC21285_IRQ(2)
2962306a36Sopenharmony_ci#define IRQ_TIMER2		_DC21285_IRQ(3)
3062306a36Sopenharmony_ci#define IRQ_TIMER3		_DC21285_IRQ(4)
3162306a36Sopenharmony_ci#define IRQ_IN0			_DC21285_IRQ(5)
3262306a36Sopenharmony_ci#define IRQ_IN1			_DC21285_IRQ(6)
3362306a36Sopenharmony_ci#define IRQ_IN2			_DC21285_IRQ(7)
3462306a36Sopenharmony_ci#define IRQ_IN3			_DC21285_IRQ(8)
3562306a36Sopenharmony_ci#define IRQ_DOORBELLHOST	_DC21285_IRQ(9)
3662306a36Sopenharmony_ci#define IRQ_DMA1		_DC21285_IRQ(10)
3762306a36Sopenharmony_ci#define IRQ_DMA2		_DC21285_IRQ(11)
3862306a36Sopenharmony_ci#define IRQ_PCI			_DC21285_IRQ(12)
3962306a36Sopenharmony_ci#define IRQ_SDRAMPARITY		_DC21285_IRQ(13)
4062306a36Sopenharmony_ci#define IRQ_I2OINPOST		_DC21285_IRQ(14)
4162306a36Sopenharmony_ci#define IRQ_PCI_ABORT		_DC21285_IRQ(15)
4262306a36Sopenharmony_ci#define IRQ_PCI_SERR		_DC21285_IRQ(16)
4362306a36Sopenharmony_ci#define IRQ_DISCARD_TIMER	_DC21285_IRQ(17)
4462306a36Sopenharmony_ci#define IRQ_PCI_DPERR		_DC21285_IRQ(18)
4562306a36Sopenharmony_ci#define IRQ_PCI_PERR		_DC21285_IRQ(19)
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci#define IRQ_ISA_TIMER		_ISA_IRQ(0)
4862306a36Sopenharmony_ci#define IRQ_ISA_KEYBOARD	_ISA_IRQ(1)
4962306a36Sopenharmony_ci#define IRQ_ISA_CASCADE		_ISA_IRQ(2)
5062306a36Sopenharmony_ci#define IRQ_ISA_UART2		_ISA_IRQ(3)
5162306a36Sopenharmony_ci#define IRQ_ISA_UART		_ISA_IRQ(4)
5262306a36Sopenharmony_ci#define IRQ_ISA_FLOPPY		_ISA_IRQ(6)
5362306a36Sopenharmony_ci#define IRQ_ISA_PRINTER		_ISA_IRQ(7)
5462306a36Sopenharmony_ci#define IRQ_ISA_RTC_ALARM	_ISA_IRQ(8)
5562306a36Sopenharmony_ci#define IRQ_ISA_2		_ISA_IRQ(9)
5662306a36Sopenharmony_ci#define IRQ_ISA_PS2MOUSE	_ISA_IRQ(12)
5762306a36Sopenharmony_ci#define IRQ_ISA_HARDDISK1	_ISA_IRQ(14)
5862306a36Sopenharmony_ci#define IRQ_ISA_HARDDISK2	_ISA_IRQ(15)
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define IRQ_MASK_UART_RX	(1 << 2)
6162306a36Sopenharmony_ci#define IRQ_MASK_UART_TX	(1 << 3)
6262306a36Sopenharmony_ci#define IRQ_MASK_TIMER1		(1 << 4)
6362306a36Sopenharmony_ci#define IRQ_MASK_TIMER2		(1 << 5)
6462306a36Sopenharmony_ci#define IRQ_MASK_TIMER3		(1 << 6)
6562306a36Sopenharmony_ci#define IRQ_MASK_IN0		(1 << 8)
6662306a36Sopenharmony_ci#define IRQ_MASK_IN1		(1 << 9)
6762306a36Sopenharmony_ci#define IRQ_MASK_IN2		(1 << 10)
6862306a36Sopenharmony_ci#define IRQ_MASK_IN3		(1 << 11)
6962306a36Sopenharmony_ci#define IRQ_MASK_DOORBELLHOST	(1 << 15)
7062306a36Sopenharmony_ci#define IRQ_MASK_DMA1		(1 << 16)
7162306a36Sopenharmony_ci#define IRQ_MASK_DMA2		(1 << 17)
7262306a36Sopenharmony_ci#define IRQ_MASK_PCI		(1 << 18)
7362306a36Sopenharmony_ci#define IRQ_MASK_SDRAMPARITY	(1 << 24)
7462306a36Sopenharmony_ci#define IRQ_MASK_I2OINPOST	(1 << 25)
7562306a36Sopenharmony_ci#define IRQ_MASK_PCI_ABORT	((1 << 29) | (1 << 30))
7662306a36Sopenharmony_ci#define IRQ_MASK_PCI_SERR	(1 << 23)
7762306a36Sopenharmony_ci#define IRQ_MASK_DISCARD_TIMER	(1 << 27)
7862306a36Sopenharmony_ci#define IRQ_MASK_PCI_DPERR	(1 << 28)
7962306a36Sopenharmony_ci#define IRQ_MASK_PCI_PERR	(1 << 31)
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci/*
8262306a36Sopenharmony_ci * Netwinder interrupt allocations
8362306a36Sopenharmony_ci */
8462306a36Sopenharmony_ci#define IRQ_NETWINDER_ETHER10	IRQ_IN0
8562306a36Sopenharmony_ci#define IRQ_NETWINDER_ETHER100	IRQ_IN1
8662306a36Sopenharmony_ci#define IRQ_NETWINDER_VIDCOMP	IRQ_IN2
8762306a36Sopenharmony_ci#define IRQ_NETWINDER_PS2MOUSE	_ISA_IRQ(5)
8862306a36Sopenharmony_ci#define IRQ_NETWINDER_IR	_ISA_IRQ(6)
8962306a36Sopenharmony_ci#define IRQ_NETWINDER_BUTTON	_ISA_IRQ(10)
9062306a36Sopenharmony_ci#define IRQ_NETWINDER_VGA	_ISA_IRQ(11)
9162306a36Sopenharmony_ci#define IRQ_NETWINDER_SOUND	_ISA_IRQ(12)
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define I8042_KBD_IRQ	IRQ_ISA_KEYBOARD
9462306a36Sopenharmony_ci#define I8042_AUX_IRQ	(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
9562306a36Sopenharmony_ci#define IRQ_FLOPPYDISK	IRQ_ISA_FLOPPY
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci#define irq_canonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
98