2019-05-27 13:55:01 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2009-07-02 22:22:36 +07:00
|
|
|
/*
|
2009-11-06 17:35:34 +07:00
|
|
|
* Copyright (C) 2009 Lemote Inc.
|
2010-01-04 16:16:51 +07:00
|
|
|
* Author: Wu Zhangjin, wuzhangjin@gmail.com
|
2009-07-02 22:22:36 +07:00
|
|
|
*/
|
|
|
|
|
2018-10-31 05:09:49 +07:00
|
|
|
#include <linux/memblock.h>
|
2014-11-20 04:52:50 +07:00
|
|
|
#include <asm/bootinfo.h>
|
2017-06-22 22:06:50 +07:00
|
|
|
#include <asm/traps.h>
|
2014-03-21 17:44:08 +07:00
|
|
|
#include <asm/smp-ops.h>
|
2017-06-22 22:06:50 +07:00
|
|
|
#include <asm/cacheflush.h>
|
2019-11-07 11:01:15 +07:00
|
|
|
#include <asm/fw/fw.h>
|
2009-07-02 22:22:36 +07:00
|
|
|
|
2009-07-02 22:23:03 +07:00
|
|
|
#include <loongson.h>
|
2009-07-02 22:22:36 +07:00
|
|
|
|
2017-06-22 22:06:50 +07:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2009-07-02 22:22:36 +07:00
|
|
|
void __init prom_init(void)
|
|
|
|
{
|
2019-11-07 11:01:15 +07:00
|
|
|
fw_init_cmdline();
|
2009-07-02 22:22:36 +07:00
|
|
|
prom_init_env();
|
2014-03-21 17:44:02 +07:00
|
|
|
|
|
|
|
/* init base address of io space */
|
|
|
|
set_io_port_base((unsigned long)
|
|
|
|
ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
|
|
|
|
|
2014-06-26 10:41:28 +07:00
|
|
|
prom_init_numa_memory();
|
2009-11-06 17:35:34 +07:00
|
|
|
|
2019-10-20 22:01:35 +07:00
|
|
|
/* Hardcode to CPU UART 0 */
|
|
|
|
setup_8250_early_printk_port(TO_UNCAC(LOONGSON_REG_BASE + 0x1e0), 0, 1024);
|
|
|
|
|
2014-03-21 17:44:08 +07:00
|
|
|
register_smp_ops(&loongson3_smp_ops);
|
2017-06-22 22:06:50 +07:00
|
|
|
board_nmi_handler_setup = mips_nmi_setup;
|
2009-07-02 22:22:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
void __init prom_free_prom_memory(void)
|
|
|
|
{
|
|
|
|
}
|