qat_c62xreg.h revision 1.1.8.2 1 1.1.8.2 martin /* $NetBSD: qat_c62xreg.h,v 1.1.8.2 2020/04/13 08:04:46 martin Exp $ */
2 1.1.8.2 martin
3 1.1.8.2 martin /*
4 1.1.8.2 martin * Copyright (c) 2019 Internet Initiative Japan, Inc.
5 1.1.8.2 martin * All rights reserved.
6 1.1.8.2 martin *
7 1.1.8.2 martin * Redistribution and use in source and binary forms, with or without
8 1.1.8.2 martin * modification, are permitted provided that the following conditions
9 1.1.8.2 martin * are met:
10 1.1.8.2 martin * 1. Redistributions of source code must retain the above copyright
11 1.1.8.2 martin * notice, this list of conditions and the following disclaimer.
12 1.1.8.2 martin * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.8.2 martin * notice, this list of conditions and the following disclaimer in the
14 1.1.8.2 martin * documentation and/or other materials provided with the distribution.
15 1.1.8.2 martin *
16 1.1.8.2 martin * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 1.1.8.2 martin * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 1.1.8.2 martin * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 1.1.8.2 martin * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 1.1.8.2 martin * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 1.1.8.2 martin * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 1.1.8.2 martin * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1.8.2 martin * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 1.1.8.2 martin * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 1.1.8.2 martin * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1.8.2 martin * POSSIBILITY OF SUCH DAMAGE.
27 1.1.8.2 martin */
28 1.1.8.2 martin
29 1.1.8.2 martin /*
30 1.1.8.2 martin * Copyright(c) 2014 Intel Corporation.
31 1.1.8.2 martin * Redistribution and use in source and binary forms, with or without
32 1.1.8.2 martin * modification, are permitted provided that the following conditions
33 1.1.8.2 martin * are met:
34 1.1.8.2 martin *
35 1.1.8.2 martin * * Redistributions of source code must retain the above copyright
36 1.1.8.2 martin * notice, this list of conditions and the following disclaimer.
37 1.1.8.2 martin * * Redistributions in binary form must reproduce the above copyright
38 1.1.8.2 martin * notice, this list of conditions and the following disclaimer in
39 1.1.8.2 martin * the documentation and/or other materials provided with the
40 1.1.8.2 martin * distribution.
41 1.1.8.2 martin * * Neither the name of Intel Corporation nor the names of its
42 1.1.8.2 martin * contributors may be used to endorse or promote products derived
43 1.1.8.2 martin * from this software without specific prior written permission.
44 1.1.8.2 martin *
45 1.1.8.2 martin * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46 1.1.8.2 martin * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47 1.1.8.2 martin * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48 1.1.8.2 martin * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49 1.1.8.2 martin * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 1.1.8.2 martin * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 1.1.8.2 martin * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52 1.1.8.2 martin * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53 1.1.8.2 martin * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54 1.1.8.2 martin * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55 1.1.8.2 martin * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 1.1.8.2 martin */
57 1.1.8.2 martin
58 1.1.8.2 martin #ifndef _DEV_PCI_QAT_C62XREG_H_
59 1.1.8.2 martin #define _DEV_PCI_QAT_C62XREG_H_
60 1.1.8.2 martin
61 1.1.8.2 martin /* Max number of accelerators and engines */
62 1.1.8.2 martin #define MAX_ACCEL_C62X 5
63 1.1.8.2 martin #define MAX_AE_C62X 10
64 1.1.8.2 martin
65 1.1.8.2 martin /* PCIe BAR index */
66 1.1.8.2 martin #define BAR_SRAM_ID_C62X 0
67 1.1.8.2 martin #define BAR_PMISC_ID_C62X 1
68 1.1.8.2 martin #define BAR_ETR_ID_C62X 2
69 1.1.8.2 martin
70 1.1.8.2 martin /* BAR PMISC sub-regions */
71 1.1.8.2 martin #define AE_OFFSET_C62X 0x20000
72 1.1.8.2 martin #define AE_LOCAL_OFFSET_C62X 0x20800
73 1.1.8.2 martin #define CAP_GLOBAL_OFFSET_C62X 0x30000
74 1.1.8.2 martin
75 1.1.8.2 martin #define SOFTSTRAP_REG_C62X 0x2EC
76 1.1.8.2 martin #define SOFTSTRAP_SS_POWERGATE_CY_C62X __BIT(23)
77 1.1.8.2 martin #define SOFTSTRAP_SS_POWERGATE_PKE_C62X __BIT(24)
78 1.1.8.2 martin
79 1.1.8.2 martin #define ACCEL_REG_OFFSET_C62X 16
80 1.1.8.2 martin #define ACCEL_MASK_C62X 0x1F
81 1.1.8.2 martin #define AE_MASK_C62X 0x3FF
82 1.1.8.2 martin
83 1.1.8.2 martin #define SMIAPF0_C62X 0x3A028
84 1.1.8.2 martin #define SMIAPF1_C62X 0x3A030
85 1.1.8.2 martin #define SMIA0_MASK_C62X 0xFFFF
86 1.1.8.2 martin #define SMIA1_MASK_C62X 0x1
87 1.1.8.2 martin
88 1.1.8.2 martin /* Error detection and correction */
89 1.1.8.2 martin #define AE_CTX_ENABLES_C62X(i) ((i) * 0x1000 + 0x20818)
90 1.1.8.2 martin #define AE_MISC_CONTROL_C62X(i) ((i) * 0x1000 + 0x20960)
91 1.1.8.2 martin #define ENABLE_AE_ECC_ERR_C62X __BIT(28)
92 1.1.8.2 martin #define ENABLE_AE_ECC_PARITY_CORR_C62X (__BIT(24) | __BIT(12))
93 1.1.8.2 martin #define ERRSSMSH_EN_C62X __BIT(3)
94 1.1.8.2 martin /* BIT(2) enables the logging of push/pull data errors. */
95 1.1.8.2 martin #define PPERR_EN_C62X (__BIT(2))
96 1.1.8.2 martin
97 1.1.8.2 martin /* Mask for VF2PF interrupts */
98 1.1.8.2 martin #define VF2PF1_16_C62X (0xFFFF << 9)
99 1.1.8.2 martin #define ERRSOU3_VF2PF_C62X(errsou3) (((errsou3) & 0x01FFFE00) >> 9)
100 1.1.8.2 martin #define ERRMSK3_VF2PF_C62X(vf_mask) (((vf_mask) & 0xFFFF) << 9)
101 1.1.8.2 martin
102 1.1.8.2 martin /* Masks for correctable error interrupts. */
103 1.1.8.2 martin #define ERRMSK0_CERR_C62X (__BIT(24) | __BIT(16) | __BIT(8) | __BIT(0))
104 1.1.8.2 martin #define ERRMSK1_CERR_C62X (__BIT(24) | __BIT(16) | __BIT(8) | __BIT(0))
105 1.1.8.2 martin #define ERRMSK3_CERR_C62X (__BIT(7))
106 1.1.8.2 martin #define ERRMSK4_CERR_C62X (__BIT(8) | __BIT(0))
107 1.1.8.2 martin #define ERRMSK5_CERR_C62X (0)
108 1.1.8.2 martin
109 1.1.8.2 martin /* Masks for uncorrectable error interrupts. */
110 1.1.8.2 martin #define ERRMSK0_UERR_C62X (__BIT(25) | __BIT(17) | __BIT(9) | __BIT(1))
111 1.1.8.2 martin #define ERRMSK1_UERR_C62X (__BIT(25) | __BIT(17) | __BIT(9) | __BIT(1))
112 1.1.8.2 martin #define ERRMSK3_UERR_C62X (__BIT(8) | __BIT(6) | __BIT(5) | __BIT(4) | \
113 1.1.8.2 martin __BIT(3) | __BIT(2) | __BIT(0))
114 1.1.8.2 martin #define ERRMSK4_UERR_C62X (__BIT(9) | __BIT(1))
115 1.1.8.2 martin #define ERRMSK5_UERR_C62X (__BIT(18) | __BIT(17) | __BIT(16))
116 1.1.8.2 martin
117 1.1.8.2 martin /* RI CPP control */
118 1.1.8.2 martin #define RICPPINTCTL_C62X (0x3A000 + 0x110)
119 1.1.8.2 martin /*
120 1.1.8.2 martin * BIT(2) enables error detection and reporting on the RI Parity Error.
121 1.1.8.2 martin * BIT(1) enables error detection and reporting on the RI CPP Pull interface.
122 1.1.8.2 martin * BIT(0) enables error detection and reporting on the RI CPP Push interface.
123 1.1.8.2 martin */
124 1.1.8.2 martin #define RICPP_EN_C62X (__BIT(2) | __BIT(1) | __BIT(0))
125 1.1.8.2 martin
126 1.1.8.2 martin /* TI CPP control */
127 1.1.8.2 martin #define TICPPINTCTL_C62X (0x3A400 + 0x138)
128 1.1.8.2 martin /*
129 1.1.8.2 martin * BIT(3) enables error detection and reporting on the ETR Parity Error.
130 1.1.8.2 martin * BIT(2) enables error detection and reporting on the TI Parity Error.
131 1.1.8.2 martin * BIT(1) enables error detection and reporting on the TI CPP Pull interface.
132 1.1.8.2 martin * BIT(0) enables error detection and reporting on the TI CPP Push interface.
133 1.1.8.2 martin */
134 1.1.8.2 martin #define TICPP_EN_C62X \
135 1.1.8.2 martin (__BIT(4) | __BIT(3) | __BIT(2) | __BIT(1) | __BIT(0))
136 1.1.8.2 martin
137 1.1.8.2 martin /* CFC Uncorrectable Errors */
138 1.1.8.2 martin #define CPP_CFC_ERR_CTRL_C62X (0x30000 + 0xC00)
139 1.1.8.2 martin /*
140 1.1.8.2 martin * BIT(1) enables interrupt.
141 1.1.8.2 martin * BIT(0) enables detecting and logging of push/pull data errors.
142 1.1.8.2 martin */
143 1.1.8.2 martin #define CPP_CFC_UE_C62X (__BIT(1) | __BIT(0))
144 1.1.8.2 martin
145 1.1.8.2 martin /* Correctable SecureRAM Error Reg */
146 1.1.8.2 martin #define SECRAMCERR_C62X (0x3AC00 + 0x00)
147 1.1.8.2 martin /* BIT(3) enables fixing and logging of correctable errors. */
148 1.1.8.2 martin #define SECRAM_CERR_C62X (__BIT(3))
149 1.1.8.2 martin
150 1.1.8.2 martin /* Uncorrectable SecureRAM Error Reg */
151 1.1.8.2 martin /*
152 1.1.8.2 martin * BIT(17) enables interrupt.
153 1.1.8.2 martin * BIT(3) enables detecting and logging of uncorrectable errors.
154 1.1.8.2 martin */
155 1.1.8.2 martin #define SECRAM_UERR_C62X (__BIT(17) | __BIT(3))
156 1.1.8.2 martin
157 1.1.8.2 martin /* Miscellaneous Memory Target Errors Register */
158 1.1.8.2 martin /*
159 1.1.8.2 martin * BIT(3) enables detecting and logging push/pull data errors.
160 1.1.8.2 martin * BIT(2) enables interrupt.
161 1.1.8.2 martin */
162 1.1.8.2 martin #define TGT_UERR_C62X (__BIT(3) | __BIT(2))
163 1.1.8.2 martin
164 1.1.8.2 martin
165 1.1.8.2 martin #define SLICEPWRDOWN_C62X(i) ((i) * 0x4000 + 0x2C)
166 1.1.8.2 martin /* Enabling PKE4-PKE0. */
167 1.1.8.2 martin #define MMP_PWR_UP_MSK_C62X \
168 1.1.8.2 martin (__BIT(20) | __BIT(19) | __BIT(18) | __BIT(17) | __BIT(16))
169 1.1.8.2 martin
170 1.1.8.2 martin /* CPM Uncorrectable Errors */
171 1.1.8.2 martin #define INTMASKSSM_C62X(i) ((i) * 0x4000 + 0x0)
172 1.1.8.2 martin /* Disabling interrupts for correctable errors. */
173 1.1.8.2 martin #define INTMASKSSM_UERR_C62X \
174 1.1.8.2 martin (__BIT(11) | __BIT(9) | __BIT(7) | __BIT(5) | __BIT(3) | __BIT(1))
175 1.1.8.2 martin
176 1.1.8.2 martin /* MMP */
177 1.1.8.2 martin /* BIT(3) enables correction. */
178 1.1.8.2 martin #define CERRSSMMMP_EN_C62X (__BIT(3))
179 1.1.8.2 martin
180 1.1.8.2 martin /* BIT(3) enables logging. */
181 1.1.8.2 martin #define UERRSSMMMP_EN_C62X (__BIT(3))
182 1.1.8.2 martin
183 1.1.8.2 martin /* ETR */
184 1.1.8.2 martin #define ETR_MAX_BANKS_C62X 16
185 1.1.8.2 martin #define ETR_TX_RX_GAP_C62X 8
186 1.1.8.2 martin #define ETR_TX_RINGS_MASK_C62X 0xFF
187 1.1.8.2 martin #define ETR_BUNDLE_SIZE_C62X 0x1000
188 1.1.8.2 martin
189 1.1.8.2 martin /* AE firmware */
190 1.1.8.2 martin #define AE_FW_PROD_TYPE_C62X 0x01000000
191 1.1.8.2 martin #define AE_FW_MOF_NAME_C62X "qat_c62x.bin"
192 1.1.8.2 martin #define AE_FW_MMP_NAME_C62X "qat_c62x_mmp.bin"
193 1.1.8.2 martin #define AE_FW_UOF_NAME_C62X "icp_qat_ae.suof"
194 1.1.8.2 martin
195 1.1.8.2 martin /* Clock frequency */
196 1.1.8.2 martin #define CLOCK_PER_SEC_C62X (685 * 1000000 / 16)
197 1.1.8.2 martin
198 1.1.8.2 martin #endif
199