Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson: Add NMI handler support

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@cavium.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16587/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Huacai Chen and committed by
Ralf Baechle
b392ee07 0a00024d

+13
+13
arch/mips/loongson64/common/init.c
··· 10 10 11 11 #include <linux/bootmem.h> 12 12 #include <asm/bootinfo.h> 13 + #include <asm/traps.h> 13 14 #include <asm/smp-ops.h> 15 + #include <asm/cacheflush.h> 14 16 15 17 #include <loongson.h> 16 18 17 19 /* Loongson CPU address windows config space base address */ 18 20 unsigned long __maybe_unused _loongson_addrwincfg_base; 21 + 22 + static void __init mips_nmi_setup(void) 23 + { 24 + void *base; 25 + extern char except_vec_nmi; 26 + 27 + base = (void *)(CAC_BASE + 0x380); 28 + memcpy(base, &except_vec_nmi, 0x80); 29 + flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); 30 + } 19 31 20 32 void __init prom_init(void) 21 33 { ··· 52 40 /*init the uart base address */ 53 41 prom_init_uart_base(); 54 42 register_smp_ops(&loongson3_smp_ops); 43 + board_nmi_handler_setup = mips_nmi_setup; 55 44 } 56 45 57 46 void __init prom_free_prom_memory(void)