2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
11 #include <linux/bootmem.h>
12 #include <asm/bootinfo.h>
13 #include <asm/traps.h>
14 #include <asm/smp-ops.h>
15 #include <asm/cacheflush.h>
19 /* Loongson CPU address windows config space base address */
20 unsigned long __maybe_unused _loongson_addrwincfg_base;
22 static void __init mips_nmi_setup(void)
25 extern char except_vec_nmi;
27 base = (void *)(CAC_BASE + 0x380);
28 memcpy(base, &except_vec_nmi, 0x80);
29 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
32 void __init prom_init(void)
34 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
35 _loongson_addrwincfg_base = (unsigned long)
36 ioremap(LOONGSON_ADDRWINCFG_BASE, LOONGSON_ADDRWINCFG_SIZE);
42 /* init base address of io space */
43 set_io_port_base((unsigned long)
44 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
47 prom_init_numa_memory();
52 /*init the uart base address */
53 prom_init_uart_base();
54 register_smp_ops(&loongson3_smp_ops);
55 board_nmi_handler_setup = mips_nmi_setup;
58 void __init prom_free_prom_memory(void)