xref: /linux/arch/loongarch/include/asm/kvm_pch_pic.h (revision e785dfacf7e7fe94370fa0e8e3ff1bc8fe179831)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2024 Loongson Technology Corporation Limited
4  */
5 
6 #ifndef __ASM_KVM_PCH_PIC_H
7 #define __ASM_KVM_PCH_PIC_H
8 
9 #include <kvm/iodev.h>
10 
11 struct loongarch_pch_pic {
12 	spinlock_t lock;
13 	struct kvm *kvm;
14 	struct kvm_io_device device;
15 	uint64_t mask; /* 1:disable irq, 0:enable irq */
16 	uint64_t htmsi_en; /* 1:msi */
17 	uint64_t edge; /* 1:edge triggered, 0:level triggered */
18 	uint64_t auto_ctrl0; /* only use default value 00b */
19 	uint64_t auto_ctrl1; /* only use default value 00b */
20 	uint64_t last_intirr; /* edge detection */
21 	uint64_t irr; /* interrupt request register */
22 	uint64_t isr; /* interrupt service register */
23 	uint64_t polarity; /* 0: high level trigger, 1: low level trigger */
24 	uint8_t  route_entry[64]; /* default value 0, route to int0: eiointc */
25 	uint8_t  htmsi_vector[64]; /* irq route table for routing to eiointc */
26 	uint64_t pch_pic_base;
27 };
28 
29 int kvm_loongarch_register_pch_pic_device(void);
30 
31 #endif /* __ASM_KVM_PCH_PIC_H */
32