1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 23ddc7e26SGreg Ungerer #ifndef _M68K_IRQ_H_ 33ddc7e26SGreg Ungerer #define _M68K_IRQ_H_ 43ddc7e26SGreg Ungerer 53ddc7e26SGreg Ungerer /* 63ddc7e26SGreg Ungerer * This should be the same as the max(NUM_X_SOURCES) for all the 73ddc7e26SGreg Ungerer * different m68k hosts compiled into the kernel. 83ddc7e26SGreg Ungerer * Currently the Atari has 72 and the Amiga 24, but if both are 93ddc7e26SGreg Ungerer * supported in the kernel it is better to make room for 72. 10736b24dbSMichael Schmitz * With EtherNAT add-on card on Atari, the highest interrupt 11736b24dbSMichael Schmitz * number is 140 so NR_IRQS needs to be 141. 123ddc7e26SGreg Ungerer */ 133ddc7e26SGreg Ungerer #if defined(CONFIG_COLDFIRE) 143ddc7e26SGreg Ungerer #define NR_IRQS 256 15*05d51e42SLaurent Vivier #elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || \ 16*05d51e42SLaurent Vivier defined(CONFIG_SUN3X) || defined(CONFIG_VIRT) 173ddc7e26SGreg Ungerer #define NR_IRQS 200 18736b24dbSMichael Schmitz #elif defined(CONFIG_ATARI) 19736b24dbSMichael Schmitz #define NR_IRQS 141 20736b24dbSMichael Schmitz #elif defined(CONFIG_MAC) 213ddc7e26SGreg Ungerer #define NR_IRQS 72 223ddc7e26SGreg Ungerer #elif defined(CONFIG_Q40) 233ddc7e26SGreg Ungerer #define NR_IRQS 43 243ddc7e26SGreg Ungerer #elif defined(CONFIG_AMIGA) || !defined(CONFIG_MMU) 253ddc7e26SGreg Ungerer #define NR_IRQS 32 263ddc7e26SGreg Ungerer #elif defined(CONFIG_APOLLO) 273ddc7e26SGreg Ungerer #define NR_IRQS 24 283ddc7e26SGreg Ungerer #elif defined(CONFIG_HP300) 293ddc7e26SGreg Ungerer #define NR_IRQS 8 3049148020SSam Ravnborg #else 313ddc7e26SGreg Ungerer #define NR_IRQS 0 3249148020SSam Ravnborg #endif 333ddc7e26SGreg Ungerer 3478ccdffcSGreg Ungerer #if defined(CONFIG_M68020) || defined(CONFIG_M68030) || \ 3578ccdffcSGreg Ungerer defined(CONFIG_M68040) || defined(CONFIG_M68060) 363ddc7e26SGreg Ungerer 373ddc7e26SGreg Ungerer /* 383ddc7e26SGreg Ungerer * Interrupt source definitions 393ddc7e26SGreg Ungerer * General interrupt sources are the level 1-7. 403ddc7e26SGreg Ungerer * Adding an interrupt service routine for one of these sources 413ddc7e26SGreg Ungerer * results in the addition of that routine to a chain of routines. 423ddc7e26SGreg Ungerer * Each one is called in succession. Each individual interrupt 433ddc7e26SGreg Ungerer * service routine should determine if the device associated with 443ddc7e26SGreg Ungerer * that routine requires service. 453ddc7e26SGreg Ungerer */ 463ddc7e26SGreg Ungerer 473ddc7e26SGreg Ungerer #define IRQ_SPURIOUS 0 483ddc7e26SGreg Ungerer 493ddc7e26SGreg Ungerer #define IRQ_AUTO_1 1 /* level 1 interrupt */ 503ddc7e26SGreg Ungerer #define IRQ_AUTO_2 2 /* level 2 interrupt */ 513ddc7e26SGreg Ungerer #define IRQ_AUTO_3 3 /* level 3 interrupt */ 523ddc7e26SGreg Ungerer #define IRQ_AUTO_4 4 /* level 4 interrupt */ 533ddc7e26SGreg Ungerer #define IRQ_AUTO_5 5 /* level 5 interrupt */ 543ddc7e26SGreg Ungerer #define IRQ_AUTO_6 6 /* level 6 interrupt */ 553ddc7e26SGreg Ungerer #define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */ 563ddc7e26SGreg Ungerer 573ddc7e26SGreg Ungerer #define IRQ_USER 8 583ddc7e26SGreg Ungerer 594936f63cSGeert Uytterhoeven struct irq_data; 604936f63cSGeert Uytterhoeven struct irq_chip; 614936f63cSGeert Uytterhoeven struct irq_desc; 624936f63cSGeert Uytterhoeven extern unsigned int m68k_irq_startup(struct irq_data *data); 634936f63cSGeert Uytterhoeven extern unsigned int m68k_irq_startup_irq(unsigned int irq); 644936f63cSGeert Uytterhoeven extern void m68k_irq_shutdown(struct irq_data *data); 654936f63cSGeert Uytterhoeven extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, 664936f63cSGeert Uytterhoeven struct pt_regs *)); 67f30a6484SGeert Uytterhoeven extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt); 684936f63cSGeert Uytterhoeven extern void m68k_setup_irq_controller(struct irq_chip *, 69bd0b9ac4SThomas Gleixner void (*handle)(struct irq_desc *desc), 704936f63cSGeert Uytterhoeven unsigned int irq, unsigned int cnt); 714936f63cSGeert Uytterhoeven 724936f63cSGeert Uytterhoeven extern unsigned int irq_canonicalize(unsigned int irq); 734936f63cSGeert Uytterhoeven 743ddc7e26SGreg Ungerer #else 753ddc7e26SGreg Ungerer #define irq_canonicalize(irq) (irq) 7678ccdffcSGreg Ungerer #endif /* !(CONFIG_M68020 || CONFIG_M68030 || CONFIG_M68040 || CONFIG_M68060) */ 773ddc7e26SGreg Ungerer 78739735d5SGeert Uytterhoeven asmlinkage void do_IRQ(int irq, struct pt_regs *regs); 794936f63cSGeert Uytterhoeven extern atomic_t irq_err_count; 80739735d5SGeert Uytterhoeven 813ddc7e26SGreg Ungerer #endif /* _M68K_IRQ_H_ */ 82