Commit b392ee07 authored by Huacai Chen's avatar Huacai Chen Committed by Ralf Baechle

MIPS: Loongson: Add NMI handler support

Signed-off-by: default avatarHuacai 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 0a00024d
...@@ -10,13 +10,25 @@ ...@@ -10,13 +10,25 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/traps.h>
#include <asm/smp-ops.h> #include <asm/smp-ops.h>
#include <asm/cacheflush.h>
#include <loongson.h> #include <loongson.h>
/* Loongson CPU address windows config space base address */ /* Loongson CPU address windows config space base address */
unsigned long __maybe_unused _loongson_addrwincfg_base; unsigned long __maybe_unused _loongson_addrwincfg_base;
static void __init mips_nmi_setup(void)
{
void *base;
extern char except_vec_nmi;
base = (void *)(CAC_BASE + 0x380);
memcpy(base, &except_vec_nmi, 0x80);
flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
}
void __init prom_init(void) void __init prom_init(void)
{ {
#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
...@@ -40,6 +52,7 @@ void __init prom_init(void) ...@@ -40,6 +52,7 @@ void __init prom_init(void)
/*init the uart base address */ /*init the uart base address */
prom_init_uart_base(); prom_init_uart_base();
register_smp_ops(&loongson3_smp_ops); register_smp_ops(&loongson3_smp_ops);
board_nmi_handler_setup = mips_nmi_setup;
} }
void __init prom_free_prom_memory(void) void __init prom_free_prom_memory(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment