18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *   Interrupt Control Unit
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __ASM_MACH_ICU_H
78c2ecf20Sopenharmony_ci#define __ASM_MACH_ICU_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include "addr-map.h"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define ICU_VIRT_BASE	(AXI_VIRT_BASE + 0x82000)
128c2ecf20Sopenharmony_ci#define ICU_REG(x)	(ICU_VIRT_BASE + (x))
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define ICU2_VIRT_BASE	(AXI_VIRT_BASE + 0x84000)
158c2ecf20Sopenharmony_ci#define ICU2_REG(x)	(ICU2_VIRT_BASE + (x))
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define ICU_INT_CONF(n)		ICU_REG((n) << 2)
188c2ecf20Sopenharmony_ci#define ICU_INT_CONF_MASK	(0xf)
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci/************ PXA168/PXA910 (MMP) *********************/
218c2ecf20Sopenharmony_ci#define ICU_INT_CONF_AP_INT	(1 << 6)
228c2ecf20Sopenharmony_ci#define ICU_INT_CONF_CP_INT	(1 << 5)
238c2ecf20Sopenharmony_ci#define ICU_INT_CONF_IRQ	(1 << 4)
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define ICU_AP_FIQ_SEL_INT_NUM	ICU_REG(0x108)	/* AP FIQ Selected Interrupt */
268c2ecf20Sopenharmony_ci#define ICU_AP_IRQ_SEL_INT_NUM	ICU_REG(0x10C)	/* AP IRQ Selected Interrupt */
278c2ecf20Sopenharmony_ci#define ICU_AP_GBL_IRQ_MSK	ICU_REG(0x114)	/* AP Global Interrupt Mask */
288c2ecf20Sopenharmony_ci#define ICU_INT_STATUS_0	ICU_REG(0x128)	/* Interrupt Stuats 0 */
298c2ecf20Sopenharmony_ci#define ICU_INT_STATUS_1	ICU_REG(0x12C)	/* Interrupt Status 1 */
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci/************************** MMP2 ***********************/
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/*
348c2ecf20Sopenharmony_ci * IRQ0/FIQ0 is routed to SP IRQ/FIQ.
358c2ecf20Sopenharmony_ci * IRQ1 is routed to PJ4 IRQ, and IRQ2 is routes to PJ4 FIQ.
368c2ecf20Sopenharmony_ci */
378c2ecf20Sopenharmony_ci#define ICU_INT_ROUTE_SP_IRQ		(1 << 4)
388c2ecf20Sopenharmony_ci#define ICU_INT_ROUTE_PJ4_IRQ		(1 << 5)
398c2ecf20Sopenharmony_ci#define ICU_INT_ROUTE_PJ4_FIQ		(1 << 6)
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_IRQ_STATUS0	ICU_REG(0x138)
428c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_IRQ_STATUS1	ICU_REG(0x13c)
438c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_FIQ_STATUS0	ICU_REG(0x140)
448c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_FIQ_STATUS1	ICU_REG(0x144)
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define MMP2_ICU_INT4_STATUS		ICU_REG(0x150)
478c2ecf20Sopenharmony_ci#define MMP2_ICU_INT5_STATUS		ICU_REG(0x154)
488c2ecf20Sopenharmony_ci#define MMP2_ICU_INT17_STATUS		ICU_REG(0x158)
498c2ecf20Sopenharmony_ci#define MMP2_ICU_INT35_STATUS		ICU_REG(0x15c)
508c2ecf20Sopenharmony_ci#define MMP2_ICU_INT51_STATUS		ICU_REG(0x160)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define MMP2_ICU_INT4_MASK		ICU_REG(0x168)
538c2ecf20Sopenharmony_ci#define MMP2_ICU_INT5_MASK		ICU_REG(0x16C)
548c2ecf20Sopenharmony_ci#define MMP2_ICU_INT17_MASK		ICU_REG(0x170)
558c2ecf20Sopenharmony_ci#define MMP2_ICU_INT35_MASK		ICU_REG(0x174)
568c2ecf20Sopenharmony_ci#define MMP2_ICU_INT51_MASK		ICU_REG(0x178)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define MMP2_ICU_SP_IRQ_SEL		ICU_REG(0x100)
598c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_IRQ_SEL		ICU_REG(0x104)
608c2ecf20Sopenharmony_ci#define MMP2_ICU_PJ4_FIQ_SEL		ICU_REG(0x108)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define MMP2_ICU_INVERT			ICU_REG(0x164)
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define MMP2_ICU_INV_PMIC		(1 << 0)
658c2ecf20Sopenharmony_ci#define MMP2_ICU_INV_PERF		(1 << 1)
668c2ecf20Sopenharmony_ci#define MMP2_ICU_INV_COMMTX		(1 << 2)
678c2ecf20Sopenharmony_ci#define MMP2_ICU_INV_COMMRX		(1 << 3)
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#endif /* __ASM_MACH_ICU_H */
70