summaryrefslogtreecommitdiff
path: root/arch/mips/mach-octeon/include/mach/cvmx-mio-defs.h
blob: 23a18be54e24342bb207877e761296647ad5243d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2020 Marvell International Ltd.
 */

#ifndef __CVMX_MIO_DEFS_H__
#define __CVMX_MIO_DEFS_H__

#define CVMX_MIO_PTP_CLOCK_CFG	  (0x0001070000000F00ull)
#define CVMX_MIO_PTP_EVT_CNT	  (0x0001070000000F28ull)
#define CVMX_MIO_RST_BOOT	  (0x0001180000001600ull)
#define CVMX_MIO_RST_CTLX(offset) (0x0001180000001618ull + ((offset) & 1))
#define CVMX_MIO_QLMX_CFG(offset) (0x0001180000001590ull + ((offset) & 7) * 8)

/**
 * cvmx_mio_ptp_clock_cfg
 *
 * This register configures the timestamp architecture.
 *
 */
union cvmx_mio_ptp_clock_cfg {
	u64 u64;
	struct cvmx_mio_ptp_clock_cfg_s {
		u64 reserved_40_63 : 24;
		u64 ext_clk_edge : 2;
		u64 ckout_out4 : 1;
		u64 pps_out : 5;
		u64 pps_inv : 1;
		u64 pps_en : 1;
		u64 ckout_out : 4;
		u64 ckout_inv : 1;
		u64 ckout_en : 1;
		u64 evcnt_in : 6;
		u64 evcnt_edge : 1;
		u64 evcnt_en : 1;
		u64 tstmp_in : 6;
		u64 tstmp_edge : 1;
		u64 tstmp_en : 1;
		u64 ext_clk_in : 6;
		u64 ext_clk_en : 1;
		u64 ptp_en : 1;
	} s;
	struct cvmx_mio_ptp_clock_cfg_cn61xx {
		u64 reserved_42_63 : 22;
		u64 pps : 1;
		u64 ckout : 1;
		u64 ext_clk_edge : 2;
		u64 ckout_out4 : 1;
		u64 pps_out : 5;
		u64 pps_inv : 1;
		u64 pps_en : 1;
		u64 ckout_out : 4;
		u64 ckout_inv : 1;
		u64 ckout_en : 1;
		u64 evcnt_in : 6;
		u64 evcnt_edge : 1;
		u64 evcnt_en : 1;
		u64 tstmp_in : 6;
		u64 tstmp_edge : 1;
		u64 tstmp_en : 1;
		u64 ext_clk_in : 6;
		u64 ext_clk_en : 1;
		u64 ptp_en : 1;
	} cn61xx;
	struct cvmx_mio_ptp_clock_cfg_cn63xx {
		u64 reserved_24_63 : 40;
		u64 evcnt_in : 6;
		u64 evcnt_edge : 1;
		u64 evcnt_en : 1;
		u64 tstmp_in : 6;
		u64 tstmp_edge : 1;
		u64 tstmp_en : 1;
		u64 ext_clk_in : 6;
		u64 ext_clk_en : 1;
		u64 ptp_en : 1;
	} cn63xx;
	struct cvmx_mio_ptp_clock_cfg_cn63xx cn63xxp1;
	struct cvmx_mio_ptp_clock_cfg_s cn66xx;
	struct cvmx_mio_ptp_clock_cfg_cn61xx cn68xx;
	struct cvmx_mio_ptp_clock_cfg_cn63xx cn68xxp1;
	struct cvmx_mio_ptp_clock_cfg_cn70xx {
		u64 reserved_42_63 : 22;
		u64 ckout : 1;
		u64 pps : 1;
		u64 ext_clk_edge : 2;
		u64 reserved_32_37 : 6;
		u64 pps_inv : 1;
		u64 pps_en : 1;
		u64 reserved_26_29 : 4;
		u64 ckout_inv : 1;
		u64 ckout_en : 1;
		u64 evcnt_in : 6;
		u64 evcnt_edge : 1;
		u64 evcnt_en : 1;
		u64 tstmp_in : 6;
		u64 tstmp_edge : 1;
		u64 tstmp_en : 1;
		u64 ext_clk_in : 6;
		u64 ext_clk_en : 1;
		u64 ptp_en : 1;
	} cn70xx;
	struct cvmx_mio_ptp_clock_cfg_cn70xx cn70xxp1;
	struct cvmx_mio_ptp_clock_cfg_cn70xx cn73xx;
	struct cvmx_mio_ptp_clock_cfg_cn70xx cn78xx;
	struct cvmx_mio_ptp_clock_cfg_cn70xx cn78xxp1;
	struct cvmx_mio_ptp_clock_cfg_cn61xx cnf71xx;
	struct cvmx_mio_ptp_clock_cfg_cn70xx cnf75xx;
};

typedef union cvmx_mio_ptp_clock_cfg cvmx_mio_ptp_clock_cfg_t;

/**
 * cvmx_mio_ptp_evt_cnt
 *
 * This register contains the PTP event counter.
 *
 */
union cvmx_mio_ptp_evt_cnt {
	u64 u64;
	struct cvmx_mio_ptp_evt_cnt_s {
		u64 cntr : 64;
	} s;
	struct cvmx_mio_ptp_evt_cnt_s cn61xx;
	struct cvmx_mio_ptp_evt_cnt_s cn63xx;
	struct cvmx_mio_ptp_evt_cnt_s cn63xxp1;
	struct cvmx_mio_ptp_evt_cnt_s cn66xx;
	struct cvmx_mio_ptp_evt_cnt_s cn68xx;
	struct cvmx_mio_ptp_evt_cnt_s cn68xxp1;
	struct cvmx_mio_ptp_evt_cnt_s cn70xx;
	struct cvmx_mio_ptp_evt_cnt_s cn70xxp1;
	struct cvmx_mio_ptp_evt_cnt_s cn73xx;
	struct cvmx_mio_ptp_evt_cnt_s cn78xx;
	struct cvmx_mio_ptp_evt_cnt_s cn78xxp1;
	struct cvmx_mio_ptp_evt_cnt_s cnf71xx;
	struct cvmx_mio_ptp_evt_cnt_s cnf75xx;
};

typedef union cvmx_mio_ptp_evt_cnt cvmx_mio_ptp_evt_cnt_t;

/**
 * cvmx_mio_rst_boot
 *
 * Notes:
 * JTCSRDIS, EJTAGDIS, ROMEN reset to 1 in authentik mode; in all other modes they reset to 0.
 *
 */
union cvmx_mio_rst_boot {
	u64 u64;
	struct cvmx_mio_rst_boot_s {
		u64 chipkill : 1;
		u64 jtcsrdis : 1;
		u64 ejtagdis : 1;
		u64 romen : 1;
		u64 ckill_ppdis : 1;
		u64 jt_tstmode : 1;
		u64 reserved_50_57 : 8;
		u64 lboot_ext : 2;
		u64 reserved_44_47 : 4;
		u64 qlm4_spd : 4;
		u64 qlm3_spd : 4;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} s;
	struct cvmx_mio_rst_boot_cn61xx {
		u64 chipkill : 1;
		u64 jtcsrdis : 1;
		u64 ejtagdis : 1;
		u64 romen : 1;
		u64 ckill_ppdis : 1;
		u64 jt_tstmode : 1;
		u64 reserved_50_57 : 8;
		u64 lboot_ext : 2;
		u64 reserved_36_47 : 12;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} cn61xx;
	struct cvmx_mio_rst_boot_cn63xx {
		u64 reserved_36_63 : 28;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} cn63xx;
	struct cvmx_mio_rst_boot_cn63xx cn63xxp1;
	struct cvmx_mio_rst_boot_cn66xx {
		u64 chipkill : 1;
		u64 jtcsrdis : 1;
		u64 ejtagdis : 1;
		u64 romen : 1;
		u64 ckill_ppdis : 1;
		u64 reserved_50_58 : 9;
		u64 lboot_ext : 2;
		u64 reserved_36_47 : 12;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} cn66xx;
	struct cvmx_mio_rst_boot_cn68xx {
		u64 reserved_59_63 : 5;
		u64 jt_tstmode : 1;
		u64 reserved_44_57 : 14;
		u64 qlm4_spd : 4;
		u64 qlm3_spd : 4;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} cn68xx;
	struct cvmx_mio_rst_boot_cn68xxp1 {
		u64 reserved_44_63 : 20;
		u64 qlm4_spd : 4;
		u64 qlm3_spd : 4;
		u64 c_mul : 6;
		u64 pnr_mul : 6;
		u64 qlm2_spd : 4;
		u64 qlm1_spd : 4;
		u64 qlm0_spd : 4;
		u64 lboot : 10;
		u64 rboot : 1;
		u64 rboot_pin : 1;
	} cn68xxp1;
	struct cvmx_mio_rst_boot_cn61xx cnf71xx;
};

typedef union cvmx_mio_rst_boot cvmx_mio_rst_boot_t;

/**
 * cvmx_mio_rst_ctl#
 *
 * Notes:
 * GEN1_Only mode is enabled for PEM0 when QLM1_SPD[0] is set or when sclk < 550Mhz.
 * GEN1_Only mode is enabled for PEM1 when QLM1_SPD[1] is set or when sclk < 550Mhz.
 */
union cvmx_mio_rst_ctlx {
	u64 u64;
	struct cvmx_mio_rst_ctlx_s {
		u64 reserved_13_63 : 51;
		u64 in_rev_ln : 1;
		u64 rev_lanes : 1;
		u64 gen1_only : 1;
		u64 prst_link : 1;
		u64 rst_done : 1;
		u64 rst_link : 1;
		u64 host_mode : 1;
		u64 prtmode : 2;
		u64 rst_drv : 1;
		u64 rst_rcv : 1;
		u64 rst_chip : 1;
		u64 rst_val : 1;
	} s;
	struct cvmx_mio_rst_ctlx_s cn61xx;
	struct cvmx_mio_rst_ctlx_cn63xx {
		u64 reserved_10_63 : 54;
		u64 prst_link : 1;
		u64 rst_done : 1;
		u64 rst_link : 1;
		u64 host_mode : 1;
		u64 prtmode : 2;
		u64 rst_drv : 1;
		u64 rst_rcv : 1;
		u64 rst_chip : 1;
		u64 rst_val : 1;
	} cn63xx;
	struct cvmx_mio_rst_ctlx_cn63xxp1 {
		u64 reserved_9_63 : 55;
		u64 rst_done : 1;
		u64 rst_link : 1;
		u64 host_mode : 1;
		u64 prtmode : 2;
		u64 rst_drv : 1;
		u64 rst_rcv : 1;
		u64 rst_chip : 1;
		u64 rst_val : 1;
	} cn63xxp1;
	struct cvmx_mio_rst_ctlx_cn63xx cn66xx;
	struct cvmx_mio_rst_ctlx_cn63xx cn68xx;
	struct cvmx_mio_rst_ctlx_cn63xx cn68xxp1;
	struct cvmx_mio_rst_ctlx_s cnf71xx;
};

typedef union cvmx_mio_rst_ctlx cvmx_mio_rst_ctlx_t;

/**
 * cvmx_mio_qlm#_cfg
 *
 * Notes:
 * Certain QLM_SPD is valid only for certain QLM_CFG configuration, refer to HRM for valid
 * combinations.  These csrs are reset only on COLD_RESET.  The Reset values for QLM_SPD and QLM_CFG
 * are as follows:               MIO_QLM0_CFG  SPD=F, CFG=2 SGMII (AGX0)
 *                               MIO_QLM1_CFG  SPD=0, CFG=1 PCIE 2x1 (PEM0/PEM1)
 */
union cvmx_mio_qlmx_cfg {
	u64 u64;
	struct cvmx_mio_qlmx_cfg_s {
		u64 reserved_15_63 : 49;
		u64 prtmode : 1;
		u64 reserved_12_13 : 2;
		u64 qlm_spd : 4;
		u64 reserved_4_7 : 4;
		u64 qlm_cfg : 4;
	} s;
	struct cvmx_mio_qlmx_cfg_cn61xx {
		u64 reserved_15_63 : 49;
		u64 prtmode : 1;
		u64 reserved_12_13 : 2;
		u64 qlm_spd : 4;
		u64 reserved_2_7 : 6;
		u64 qlm_cfg : 2;
	} cn61xx;
	struct cvmx_mio_qlmx_cfg_cn66xx {
		u64 reserved_12_63 : 52;
		u64 qlm_spd : 4;
		u64 reserved_4_7 : 4;
		u64 qlm_cfg : 4;
	} cn66xx;
	struct cvmx_mio_qlmx_cfg_cn68xx {
		u64 reserved_12_63 : 52;
		u64 qlm_spd : 4;
		u64 reserved_3_7 : 5;
		u64 qlm_cfg : 3;
	} cn68xx;
	struct cvmx_mio_qlmx_cfg_cn68xx cn68xxp1;
	struct cvmx_mio_qlmx_cfg_cn61xx cnf71xx;
};

typedef union cvmx_mio_qlmx_cfg cvmx_mio_qlmx_cfg_t;

#endif