18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Port on Texas Instruments TMS320C6x architecture
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
68c2ecf20Sopenharmony_ci *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  Large parts taken directly from powerpc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef _ASM_C6X_IRQ_H
118c2ecf20Sopenharmony_ci#define _ASM_C6X_IRQ_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/irqdomain.h>
148c2ecf20Sopenharmony_ci#include <linux/threads.h>
158c2ecf20Sopenharmony_ci#include <linux/list.h>
168c2ecf20Sopenharmony_ci#include <linux/radix-tree.h>
178c2ecf20Sopenharmony_ci#include <asm/percpu.h>
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define irq_canonicalize(irq)  (irq)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci * The C64X+ core has 16 IRQ vectors. One each is used by Reset and NMI. Two
238c2ecf20Sopenharmony_ci * are reserved. The remaining 12 vectors are used to route SoC interrupts.
248c2ecf20Sopenharmony_ci * These interrupt vectors are prioritized with IRQ 4 having the highest
258c2ecf20Sopenharmony_ci * priority and IRQ 15 having the lowest.
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci * The C64x+ megamodule provides a PIC which combines SoC IRQ sources into a
288c2ecf20Sopenharmony_ci * single core IRQ vector. There are four combined sources, each of which
298c2ecf20Sopenharmony_ci * feed into one of the 12 general interrupt vectors. The remaining 8 vectors
308c2ecf20Sopenharmony_ci * can each route a single SoC interrupt directly.
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci#define NR_PRIORITY_IRQS 16
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Total number of virq in the platform */
358c2ecf20Sopenharmony_ci#define NR_IRQS		256
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* This number is used when no interrupt has been assigned */
388c2ecf20Sopenharmony_ci#define NO_IRQ		0
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciextern void __init init_pic_c64xplus(void);
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciextern void init_IRQ(void);
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_cistruct pt_regs;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciextern asmlinkage void c6x_do_IRQ(unsigned int prio, struct pt_regs *regs);
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciextern unsigned long irq_err_count;
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* _ASM_C6X_IRQ_H */
51