2018-08-04 10:23:16 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-07-10 18:00:26 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Regents of the University of California
|
|
|
|
* Copyright (C) 2017 SiFive
|
2018-08-04 10:23:16 +02:00
|
|
|
* Copyright (C) 2018 Christoph Hellwig
|
2017-07-10 18:00:26 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irqchip.h>
|
2023-03-28 09:22:18 +05:30
|
|
|
#include <linux/irqdomain.h>
|
|
|
|
#include <linux/module.h>
|
2018-10-02 12:15:07 -07:00
|
|
|
#include <linux/seq_file.h>
|
2023-03-28 09:22:19 +05:30
|
|
|
#include <asm/sbi.h>
|
2017-07-10 18:00:26 -07:00
|
|
|
|
2023-03-28 09:22:18 +05:30
|
|
|
static struct fwnode_handle *(*__get_intc_node)(void);
|
|
|
|
|
|
|
|
void riscv_set_intc_hwnode_fn(struct fwnode_handle *(*fn)(void))
|
|
|
|
{
|
|
|
|
__get_intc_node = fn;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct fwnode_handle *riscv_get_intc_hwnode(void)
|
|
|
|
{
|
|
|
|
if (__get_intc_node)
|
|
|
|
return __get_intc_node();
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(riscv_get_intc_hwnode);
|
|
|
|
|
2018-10-02 12:15:07 -07:00
|
|
|
int arch_show_interrupts(struct seq_file *p, int prec)
|
|
|
|
{
|
|
|
|
show_ipi_stats(p, prec);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-07-10 18:00:26 -07:00
|
|
|
void __init init_IRQ(void)
|
|
|
|
{
|
|
|
|
irqchip_init();
|
2020-06-01 14:45:40 +05:30
|
|
|
if (!handle_arch_irq)
|
|
|
|
panic("No interrupt controller found.");
|
2023-03-28 09:22:19 +05:30
|
|
|
sbi_ipi_init();
|
2017-07-10 18:00:26 -07:00
|
|
|
}
|