1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology
4 * Author: Fuxin Zhang, zhangfx@lemote.com
6 #include <linux/delay.h>
7 #include <linux/interrupt.h>
11 * the first level int-handler will jump here if it is a bonito irq
13 void bonito_irqdispatch(void)
18 /* workaround the IO dma problem: let cpu looping to allow DMA finish */
19 int_status
= LOONGSON_INTISR
;
20 while (int_status
& (1 << 10)) {
22 int_status
= LOONGSON_INTISR
;
25 /* Get pending sources, masked by current enables */
26 int_status
= LOONGSON_INTISR
& LOONGSON_INTEN
;
29 i
= __ffs(int_status
);
30 do_IRQ(LOONGSON_IRQ_BASE
+ i
);
34 asmlinkage
void plat_irq_dispatch(void)
38 pending
= read_c0_cause() & read_c0_status() & ST0_IM
;
40 /* machine-specific plat_irq_dispatch */
41 mach_irq_dispatch(pending
);
44 void __init
arch_init_irq(void)
47 * Clear all of the interrupts while we change the able around a bit.
48 * int-handler is not on bootstrap
50 clear_c0_status(ST0_IM
| ST0_BEV
);
53 LOONGSON_INTSTEER
= 0;
56 * Mask out all interrupt by writing "1" to all bit position in
57 * the interrupt reset reg.
59 LOONGSON_INTENCLR
= ~0;
61 /* machine specific irq init */