blob: fa8c0455c3523316e00a6eaaaed4bf4347ccdb42 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * include/linux/irqchip/arm-gic-common.h
4 *
5 * Copyright (C) 2016 ARM Limited, All Rights Reserved.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006 */
7#ifndef __LINUX_IRQCHIP_ARM_GIC_COMMON_H
8#define __LINUX_IRQCHIP_ARM_GIC_COMMON_H
9
10#include <linux/types.h>
11#include <linux/ioport.h>
12
David Brazdil0f672f62019-12-10 10:32:29 +000013#define GICD_INT_DEF_PRI 0xa0
14#define GICD_INT_DEF_PRI_X4 ((GICD_INT_DEF_PRI << 24) |\
15 (GICD_INT_DEF_PRI << 16) |\
16 (GICD_INT_DEF_PRI << 8) |\
17 GICD_INT_DEF_PRI)
18
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000019enum gic_type {
20 GIC_V2,
21 GIC_V3,
22};
23
24struct gic_kvm_info {
25 /* GIC type */
26 enum gic_type type;
27 /* Virtual CPU interface */
28 struct resource vcpu;
29 /* Interrupt number */
30 unsigned int maint_irq;
31 /* Virtual control interface */
32 struct resource vctrl;
33 /* vlpi support */
34 bool has_v4;
Olivier Deprez157378f2022-04-04 15:47:50 +020035 /* rvpeid support */
36 bool has_v4_1;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000037};
38
39const struct gic_kvm_info *gic_get_kvm_info(void);
40
David Brazdil0f672f62019-12-10 10:32:29 +000041struct irq_domain;
42struct fwnode_handle;
43int gicv2m_init(struct fwnode_handle *parent_handle,
44 struct irq_domain *parent);
45
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000046#endif /* __LINUX_IRQCHIP_ARM_GIC_COMMON_H */