2 * Copyright(c) 2004 - 2009 Intel Corporation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59
16 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * The full GNU General Public License is included in this distribution in the
19 * file called COPYING.
24 /* PCI Configuration Space Values */
25 #define IOAT_MMIO_BAR 0
28 #define IOAT_PCI_DID_5000 0x1A38
29 #define IOAT_PCI_DID_CNB 0x360B
30 #define IOAT_PCI_DID_SCNB 0x65FF
31 #define IOAT_PCI_DID_SNB 0x402F
33 #define IOAT_VER_1_2 0x12 /* Version 1.2 */
34 #define IOAT_VER_2_0 0x20 /* Version 2.0 */
35 #define IOAT_VER_3_0 0x30 /* Version 3.0 */
36 #define IOAT_VER_3_2 0x32 /* Version 3.2 */
38 #define PCI_DEVICE_ID_INTEL_IOAT_IVB0 0x0e20
39 #define PCI_DEVICE_ID_INTEL_IOAT_IVB1 0x0e21
40 #define PCI_DEVICE_ID_INTEL_IOAT_IVB2 0x0e22
41 #define PCI_DEVICE_ID_INTEL_IOAT_IVB3 0x0e23
42 #define PCI_DEVICE_ID_INTEL_IOAT_IVB4 0x0e24
43 #define PCI_DEVICE_ID_INTEL_IOAT_IVB5 0x0e25
44 #define PCI_DEVICE_ID_INTEL_IOAT_IVB6 0x0e26
45 #define PCI_DEVICE_ID_INTEL_IOAT_IVB7 0x0e27
46 #define PCI_DEVICE_ID_INTEL_IOAT_IVB8 0x0e2e
47 #define PCI_DEVICE_ID_INTEL_IOAT_IVB9 0x0e2f
49 int system_has_dca_enabled(struct pci_dev *pdev);
51 struct ioat_dma_descriptor {
56 unsigned int int_en:1;
57 unsigned int src_snoop_dis:1;
58 unsigned int dest_snoop_dis:1;
59 unsigned int compl_write:1;
62 unsigned int src_brk:1;
63 unsigned int dest_brk:1;
64 unsigned int bundle:1;
65 unsigned int dest_dca:1;
67 unsigned int rsvd2:13;
68 #define IOAT_OP_COPY 0x00
77 /* store some driver data in an unused portion of the descriptor */
85 struct ioat_fill_descriptor {
90 unsigned int int_en:1;
92 unsigned int dest_snoop_dis:1;
93 unsigned int compl_write:1;
96 unsigned int dest_brk:1;
97 unsigned int bundle:1;
98 unsigned int rsvd4:15;
99 #define IOAT_OP_FILL 0x01
107 uint64_t next_dst_addr;
112 struct ioat_xor_descriptor {
117 unsigned int int_en:1;
118 unsigned int src_snoop_dis:1;
119 unsigned int dest_snoop_dis:1;
120 unsigned int compl_write:1;
121 unsigned int fence:1;
122 unsigned int src_cnt:3;
123 unsigned int bundle:1;
124 unsigned int dest_dca:1;
126 unsigned int rsvd:13;
127 #define IOAT_OP_XOR 0x87
128 #define IOAT_OP_XOR_VAL 0x88
141 struct ioat_xor_ext_descriptor {
149 struct ioat_pq_descriptor {
154 unsigned int int_en:1;
155 unsigned int src_snoop_dis:1;
156 unsigned int dest_snoop_dis:1;
157 unsigned int compl_write:1;
158 unsigned int fence:1;
159 unsigned int src_cnt:3;
160 unsigned int bundle:1;
161 unsigned int dest_dca:1;
163 unsigned int p_disable:1;
164 unsigned int q_disable:1;
165 unsigned int rsvd:11;
166 #define IOAT_OP_PQ 0x89
167 #define IOAT_OP_PQ_VAL 0x8a
180 struct ioat_pq_ext_descriptor {
190 struct ioat_pq_update_descriptor {
195 unsigned int int_en:1;
196 unsigned int src_snoop_dis:1;
197 unsigned int dest_snoop_dis:1;
198 unsigned int compl_write:1;
199 unsigned int fence:1;
200 unsigned int src_cnt:3;
201 unsigned int bundle:1;
202 unsigned int dest_dca:1;
204 unsigned int p_disable:1;
205 unsigned int q_disable:1;
208 #define IOAT_OP_PQ_UP 0x8b
221 struct ioat_raw_descriptor {