1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021 Western Digital Corporation or its affiliates.
4 * Copyright (C) 2022 Ventana Micro Systems Inc.
7 #ifndef _IRQ_RISCV_APLIC_MAIN_H
8 #define _IRQ_RISCV_APLIC_MAIN_H
10 #include <linux/device.h>
12 #include <linux/irq.h>
13 #include <linux/irqdomain.h>
14 #include <linux/fwnode.h>
16 #define APLIC_DEFAULT_PRIORITY 1
33 struct aplic_msicfg msicfg
;
36 void aplic_irq_unmask(struct irq_data
*d
);
37 void aplic_irq_mask(struct irq_data
*d
);
38 int aplic_irq_set_type(struct irq_data
*d
, unsigned int type
);
39 int aplic_irqdomain_translate(struct irq_fwspec
*fwspec
, u32 gsi_base
,
40 unsigned long *hwirq
, unsigned int *type
);
41 void aplic_init_hw_global(struct aplic_priv
*priv
, bool msi_mode
);
42 int aplic_setup_priv(struct aplic_priv
*priv
, struct device
*dev
, void __iomem
*regs
);
43 int aplic_direct_setup(struct device
*dev
, void __iomem
*regs
);
44 #ifdef CONFIG_RISCV_APLIC_MSI
45 int aplic_msi_setup(struct device
*dev
, void __iomem
*regs
);
47 static inline int aplic_msi_setup(struct device
*dev
, void __iomem
*regs
)