.. | .. |
---|
2 | 2 | #ifndef _ASM_S390_PCI_INSN_H |
---|
3 | 3 | #define _ASM_S390_PCI_INSN_H |
---|
4 | 4 | |
---|
| 5 | +#include <linux/jump_label.h> |
---|
| 6 | + |
---|
5 | 7 | /* Load/Store status codes */ |
---|
6 | 8 | #define ZPCI_PCI_ST_FUNC_NOT_ENABLED 4 |
---|
7 | 9 | #define ZPCI_PCI_ST_FUNC_IN_ERR 8 |
---|
.. | .. |
---|
38 | 40 | #define ZPCI_MOD_FC_RESET_ERROR 7 |
---|
39 | 41 | #define ZPCI_MOD_FC_RESET_BLOCK 9 |
---|
40 | 42 | #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 |
---|
41 | 45 | |
---|
42 | 46 | /* FIB function controls */ |
---|
43 | 47 | #define ZPCI_FIB_FC_ENABLED 0x80 |
---|
.. | .. |
---|
51 | 55 | #define ZPCI_FIB_FC_LS_BLOCKED 0x20 |
---|
52 | 56 | #define ZPCI_FIB_FC_DMAAS_REG 0x10 |
---|
53 | 57 | |
---|
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 { |
---|
64 | 59 | u32 : 1; |
---|
65 | 60 | u32 isc : 3; /* Interrupt subclass */ |
---|
66 | 61 | u32 noi : 12; /* Number of interrupts */ |
---|
.. | .. |
---|
72 | 67 | u32 : 32; |
---|
73 | 68 | u64 aibv; /* Adapter int bit vector address */ |
---|
74 | 69 | 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 | + }; |
---|
75 | 96 | u64 fmb_addr; /* Function measurement block address and key */ |
---|
76 | 97 | u32 : 32; |
---|
77 | 98 | u32 gd; |
---|
78 | 99 | } __packed __aligned(8); |
---|
79 | 100 | |
---|
| 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 | + |
---|
80 | 129 | u8 zpci_mod_fc(u64 req, struct zpci_fib *fib, u8 *status); |
---|
81 | 130 | 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 | +} |
---|
86 | 145 | |
---|
87 | 146 | #endif |
---|