Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ioat3: hardware version 3.2 register / descriptor definitions

ioat3.2 adds raid5 and raid6 offload capabilities.

Signed-off-by: Tom Picard <tom.s.picard@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+185 -2
+1 -1
drivers/dma/ioat/dma.h
··· 155 155 156 156 /** 157 157 * struct ioat_desc_sw - wrapper around hardware descriptor 158 - * @hw: hardware DMA descriptor 158 + * @hw: hardware DMA descriptor (for memcpy) 159 159 * @node: this descriptor will either be on the free list, 160 160 * or attached to a transaction list (async_tx.tx_list) 161 161 * @txd: the generic software descriptor for all engines
+25 -1
drivers/dma/ioat/dma_v2.h
··· 114 114 return num_descs; 115 115 } 116 116 117 + /** 118 + * struct ioat_ring_ent - wrapper around hardware descriptor 119 + * @hw: hardware DMA descriptor (for memcpy) 120 + * @fill: hardware fill descriptor 121 + * @xor: hardware xor descriptor 122 + * @xor_ex: hardware xor extension descriptor 123 + * @pq: hardware pq descriptor 124 + * @pq_ex: hardware pq extension descriptor 125 + * @pqu: hardware pq update descriptor 126 + * @raw: hardware raw (un-typed) descriptor 127 + * @txd: the generic software descriptor for all engines 128 + * @len: total transaction length for unmap 129 + * @id: identifier for debug 130 + */ 131 + 117 132 struct ioat_ring_ent { 118 - struct ioat_dma_descriptor *hw; 133 + union { 134 + struct ioat_dma_descriptor *hw; 135 + struct ioat_fill_descriptor *fill; 136 + struct ioat_xor_descriptor *xor; 137 + struct ioat_xor_ext_descriptor *xor_ex; 138 + struct ioat_pq_descriptor *pq; 139 + struct ioat_pq_ext_descriptor *pq_ex; 140 + struct ioat_pq_update_descriptor *pqu; 141 + struct ioat_raw_descriptor *raw; 142 + }; 119 143 struct dma_async_tx_descriptor txd; 120 144 size_t len; 121 145 #ifdef DEBUG
+142
drivers/dma/ioat/hw.h
··· 37 37 #define IOAT_VER_1_2 0x12 /* Version 1.2 */ 38 38 #define IOAT_VER_2_0 0x20 /* Version 2.0 */ 39 39 #define IOAT_VER_3_0 0x30 /* Version 3.0 */ 40 + #define IOAT_VER_3_2 0x32 /* Version 3.2 */ 40 41 41 42 struct ioat_dma_descriptor { 42 43 uint32_t size; ··· 56 55 unsigned int dest_dca:1; 57 56 unsigned int hint:1; 58 57 unsigned int rsvd2:13; 58 + #define IOAT_OP_COPY 0x00 59 59 unsigned int op:8; 60 60 } ctl_f; 61 61 }; ··· 71 69 uint64_t tx_cnt; 72 70 }; 73 71 uint64_t user2; 72 + }; 73 + 74 + struct ioat_fill_descriptor { 75 + uint32_t size; 76 + union { 77 + uint32_t ctl; 78 + struct { 79 + unsigned int int_en:1; 80 + unsigned int rsvd:1; 81 + unsigned int dest_snoop_dis:1; 82 + unsigned int compl_write:1; 83 + unsigned int fence:1; 84 + unsigned int rsvd2:2; 85 + unsigned int dest_brk:1; 86 + unsigned int bundle:1; 87 + unsigned int rsvd4:15; 88 + #define IOAT_OP_FILL 0x01 89 + unsigned int op:8; 90 + } ctl_f; 91 + }; 92 + uint64_t src_data; 93 + uint64_t dst_addr; 94 + uint64_t next; 95 + uint64_t rsv1; 96 + uint64_t next_dst_addr; 97 + uint64_t user1; 98 + uint64_t user2; 99 + }; 100 + 101 + struct ioat_xor_descriptor { 102 + uint32_t size; 103 + union { 104 + uint32_t ctl; 105 + struct { 106 + unsigned int int_en:1; 107 + unsigned int src_snoop_dis:1; 108 + unsigned int dest_snoop_dis:1; 109 + unsigned int compl_write:1; 110 + unsigned int fence:1; 111 + unsigned int src_cnt:3; 112 + unsigned int bundle:1; 113 + unsigned int dest_dca:1; 114 + unsigned int hint:1; 115 + unsigned int rsvd:13; 116 + #define IOAT_OP_XOR 0x87 117 + #define IOAT_OP_XOR_VAL 0x88 118 + unsigned int op:8; 119 + } ctl_f; 120 + }; 121 + uint64_t src_addr; 122 + uint64_t dst_addr; 123 + uint64_t next; 124 + uint64_t src_addr2; 125 + uint64_t src_addr3; 126 + uint64_t src_addr4; 127 + uint64_t src_addr5; 128 + }; 129 + 130 + struct ioat_xor_ext_descriptor { 131 + uint64_t src_addr6; 132 + uint64_t src_addr7; 133 + uint64_t src_addr8; 134 + uint64_t next; 135 + uint64_t rsvd[4]; 136 + }; 137 + 138 + struct ioat_pq_descriptor { 139 + uint32_t size; 140 + union { 141 + uint32_t ctl; 142 + struct { 143 + unsigned int int_en:1; 144 + unsigned int src_snoop_dis:1; 145 + unsigned int dest_snoop_dis:1; 146 + unsigned int compl_write:1; 147 + unsigned int fence:1; 148 + unsigned int src_cnt:3; 149 + unsigned int bundle:1; 150 + unsigned int dest_dca:1; 151 + unsigned int hint:1; 152 + unsigned int p_disable:1; 153 + unsigned int q_disable:1; 154 + unsigned int rsvd:11; 155 + #define IOAT_OP_PQ 0x89 156 + #define IOAT_OP_PQ_VAL 0x8a 157 + unsigned int op:8; 158 + } ctl_f; 159 + }; 160 + uint64_t src_addr; 161 + uint64_t p_addr; 162 + uint64_t next; 163 + uint64_t src_addr2; 164 + uint64_t src_addr3; 165 + uint8_t coef[8]; 166 + uint64_t q_addr; 167 + }; 168 + 169 + struct ioat_pq_ext_descriptor { 170 + uint64_t src_addr4; 171 + uint64_t src_addr5; 172 + uint64_t src_addr6; 173 + uint64_t next; 174 + uint64_t src_addr7; 175 + uint64_t src_addr8; 176 + uint64_t rsvd[2]; 177 + }; 178 + 179 + struct ioat_pq_update_descriptor { 180 + uint32_t size; 181 + union { 182 + uint32_t ctl; 183 + struct { 184 + unsigned int int_en:1; 185 + unsigned int src_snoop_dis:1; 186 + unsigned int dest_snoop_dis:1; 187 + unsigned int compl_write:1; 188 + unsigned int fence:1; 189 + unsigned int src_cnt:3; 190 + unsigned int bundle:1; 191 + unsigned int dest_dca:1; 192 + unsigned int hint:1; 193 + unsigned int p_disable:1; 194 + unsigned int q_disable:1; 195 + unsigned int rsvd:3; 196 + unsigned int coef:8; 197 + #define IOAT_OP_PQ_UP 0x8b 198 + unsigned int op:8; 199 + } ctl_f; 200 + }; 201 + uint64_t src_addr; 202 + uint64_t p_addr; 203 + uint64_t next; 204 + uint64_t src_addr2; 205 + uint64_t p_src; 206 + uint64_t q_src; 207 + uint64_t q_addr; 208 + }; 209 + 210 + struct ioat_raw_descriptor { 211 + uint64_t field[8]; 74 212 }; 75 213 #endif
+17
drivers/dma/ioat/registers.h
··· 64 64 65 65 #define IOAT_DEVICE_STATUS_OFFSET 0x0E /* 16-bit */ 66 66 #define IOAT_DEVICE_STATUS_DEGRADED_MODE 0x0001 67 + #define IOAT_DEVICE_MMIO_RESTRICTED 0x0002 68 + #define IOAT_DEVICE_MEMORY_BYPASS 0x0004 69 + #define IOAT_DEVICE_ADDRESS_REMAPPING 0x0008 70 + 71 + #define IOAT_DMA_CAP_OFFSET 0x10 /* 32-bit */ 72 + #define IOAT_CAP_PAGE_BREAK 0x00000001 73 + #define IOAT_CAP_CRC 0x00000002 74 + #define IOAT_CAP_SKIP_MARKER 0x00000004 75 + #define IOAT_CAP_DCA 0x00000010 76 + #define IOAT_CAP_CRC_MOVE 0x00000020 77 + #define IOAT_CAP_FILL_BLOCK 0x00000040 78 + #define IOAT_CAP_APIC 0x00000080 79 + #define IOAT_CAP_XOR 0x00000100 80 + #define IOAT_CAP_PQ 0x00000200 67 81 68 82 #define IOAT_CHANNEL_MMIO_SIZE 0x80 /* Each Channel MMIO space is this size */ 69 83 ··· 238 224 #define IOAT_CHANERR_INT_CONFIGURATION_ERR 0x2000 239 225 #define IOAT_CHANERR_SOFT_ERR 0x4000 240 226 #define IOAT_CHANERR_UNAFFILIATED_ERR 0x8000 227 + #define IOAT_CHANERR_XOR_P_OR_CRC_ERR 0x10000 228 + #define IOAT_CHANERR_XOR_Q_ERR 0x20000 229 + #define IOAT_CHANERR_DESCRIPTOR_COUNT_ERR 0x40000 241 230 242 231 #define IOAT_CHANERR_MASK_OFFSET 0x2C /* 32-bit Channel Error Register */ 243 232