hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/s390/include/asm/pci_insn.h
....@@ -2,6 +2,8 @@
22 #ifndef _ASM_S390_PCI_INSN_H
33 #define _ASM_S390_PCI_INSN_H
44
5
+#include <linux/jump_label.h>
6
+
57 /* Load/Store status codes */
68 #define ZPCI_PCI_ST_FUNC_NOT_ENABLED 4
79 #define ZPCI_PCI_ST_FUNC_IN_ERR 8
....@@ -38,6 +40,8 @@
3840 #define ZPCI_MOD_FC_RESET_ERROR 7
3941 #define ZPCI_MOD_FC_RESET_BLOCK 9
4042 #define ZPCI_MOD_FC_SET_MEASURE 10
43
+#define ZPCI_MOD_FC_REG_INT_D 16
44
+#define ZPCI_MOD_FC_DEREG_INT_D 17
4145
4246 /* FIB function controls */
4347 #define ZPCI_FIB_FC_ENABLED 0x80
....@@ -51,16 +55,7 @@
5155 #define ZPCI_FIB_FC_LS_BLOCKED 0x20
5256 #define ZPCI_FIB_FC_DMAAS_REG 0x10
5357
54
-/* Function Information Block */
55
-struct zpci_fib {
56
- u32 fmt : 8; /* format */
57
- u32 : 24;
58
- u32 : 32;
59
- u8 fc; /* function controls */
60
- u64 : 56;
61
- u64 pba; /* PCI base address */
62
- u64 pal; /* PCI address limit */
63
- u64 iota; /* I/O Translation Anchor */
58
+struct zpci_fib_fmt0 {
6459 u32 : 1;
6560 u32 isc : 3; /* Interrupt subclass */
6661 u32 noi : 12; /* Number of interrupts */
....@@ -72,16 +67,80 @@
7267 u32 : 32;
7368 u64 aibv; /* Adapter int bit vector address */
7469 u64 aisb; /* Adapter int summary bit address */
70
+};
71
+
72
+struct zpci_fib_fmt1 {
73
+ u32 : 4;
74
+ u32 noi : 12;
75
+ u32 : 16;
76
+ u32 dibvo : 16;
77
+ u32 : 16;
78
+ u64 : 64;
79
+ u64 : 64;
80
+};
81
+
82
+/* Function Information Block */
83
+struct zpci_fib {
84
+ u32 fmt : 8; /* format */
85
+ u32 : 24;
86
+ u32 : 32;
87
+ u8 fc; /* function controls */
88
+ u64 : 56;
89
+ u64 pba; /* PCI base address */
90
+ u64 pal; /* PCI address limit */
91
+ u64 iota; /* I/O Translation Anchor */
92
+ union {
93
+ struct zpci_fib_fmt0 fmt0;
94
+ struct zpci_fib_fmt1 fmt1;
95
+ };
7596 u64 fmb_addr; /* Function measurement block address and key */
7697 u32 : 32;
7798 u32 gd;
7899 } __packed __aligned(8);
79100
101
+/* directed interruption information block */
102
+struct zpci_diib {
103
+ u32 : 1;
104
+ u32 isc : 3;
105
+ u32 : 28;
106
+ u16 : 16;
107
+ u16 nr_cpus;
108
+ u64 disb_addr;
109
+ u64 : 64;
110
+ u64 : 64;
111
+} __packed __aligned(8);
112
+
113
+/* cpu directed interruption information block */
114
+struct zpci_cdiib {
115
+ u64 : 64;
116
+ u64 dibv_addr;
117
+ u64 : 64;
118
+ u64 : 64;
119
+ u64 : 64;
120
+} __packed __aligned(8);
121
+
122
+union zpci_sic_iib {
123
+ struct zpci_diib diib;
124
+ struct zpci_cdiib cdiib;
125
+};
126
+
127
+DECLARE_STATIC_KEY_FALSE(have_mio);
128
+
80129 u8 zpci_mod_fc(u64 req, struct zpci_fib *fib, u8 *status);
81130 int zpci_refresh_trans(u64 fn, u64 addr, u64 range);
82
-int zpci_load(u64 *data, u64 req, u64 offset);
83
-int zpci_store(u64 data, u64 req, u64 offset);
84
-int zpci_store_block(const u64 *data, u64 req, u64 offset);
85
-int zpci_set_irq_ctrl(u16 ctl, char *unused, u8 isc);
131
+int __zpci_load(u64 *data, u64 req, u64 offset);
132
+int zpci_load(u64 *data, const volatile void __iomem *addr, unsigned long len);
133
+int __zpci_store(u64 data, u64 req, u64 offset);
134
+int zpci_store(const volatile void __iomem *addr, u64 data, unsigned long len);
135
+int __zpci_store_block(const u64 *data, u64 req, u64 offset);
136
+void zpci_barrier(void);
137
+int __zpci_set_irq_ctrl(u16 ctl, u8 isc, union zpci_sic_iib *iib);
138
+
139
+static inline int zpci_set_irq_ctrl(u16 ctl, u8 isc)
140
+{
141
+ union zpci_sic_iib iib = {{0}};
142
+
143
+ return __zpci_set_irq_ctrl(ctl, isc, &iib);
144
+}
86145
87146 #endif