summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/octeon/cvmx-gpio-defs.h
blob: 8123b82093692b5aef6851ab692af7b18cbd8406 (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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
/***********************license start***************
 * Author: Cavium Networks
 *
 * Contact: support@caviumnetworks.com
 * This file is part of the OCTEON SDK
 *
 * Copyright (c) 2003-2012 Cavium Networks
 *
 * This file is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, Version 2, as
 * published by the Free Software Foundation.
 *
 * This file is distributed in the hope that it will be useful, but
 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
 * NONINFRINGEMENT.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this file; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 * or visit http://www.gnu.org/licenses/.
 *
 * This file may also be available under a different license from Cavium.
 * Contact Cavium Networks for more information
 ***********************license end**************************************/

#ifndef __CVMX_GPIO_DEFS_H__
#define __CVMX_GPIO_DEFS_H__

#define CVMX_GPIO_BIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000800ull) + ((offset) & 15) * 8)
#define CVMX_GPIO_BOOT_ENA (CVMX_ADD_IO_SEG(0x00010700000008A8ull))
#define CVMX_GPIO_CLK_GENX(offset) (CVMX_ADD_IO_SEG(0x00010700000008C0ull) + ((offset) & 3) * 8)
#define CVMX_GPIO_CLK_QLMX(offset) (CVMX_ADD_IO_SEG(0x00010700000008E0ull) + ((offset) & 1) * 8)
#define CVMX_GPIO_DBG_ENA (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
#define CVMX_GPIO_INT_CLR (CVMX_ADD_IO_SEG(0x0001070000000898ull))
#define CVMX_GPIO_MULTI_CAST (CVMX_ADD_IO_SEG(0x00010700000008B0ull))
#define CVMX_GPIO_PIN_ENA (CVMX_ADD_IO_SEG(0x00010700000008B8ull))
#define CVMX_GPIO_RX_DAT (CVMX_ADD_IO_SEG(0x0001070000000880ull))
#define CVMX_GPIO_TIM_CTL (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
#define CVMX_GPIO_TX_CLR (CVMX_ADD_IO_SEG(0x0001070000000890ull))
#define CVMX_GPIO_TX_SET (CVMX_ADD_IO_SEG(0x0001070000000888ull))
#define CVMX_GPIO_XBIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000900ull) + ((offset) & 31) * 8 - 8*16)

union cvmx_gpio_bit_cfgx {
	uint64_t u64;
	struct cvmx_gpio_bit_cfgx_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_21_63:42;
		uint64_t output_sel:5;
		uint64_t synce_sel:2;
		uint64_t clk_gen:1;
		uint64_t clk_sel:2;
		uint64_t fil_sel:4;
		uint64_t fil_cnt:4;
		uint64_t int_type:1;
		uint64_t int_en:1;
		uint64_t rx_xor:1;
		uint64_t tx_oe:1;
#else
		uint64_t tx_oe:1;
		uint64_t rx_xor:1;
		uint64_t int_en:1;
		uint64_t int_type:1;
		uint64_t fil_cnt:4;
		uint64_t fil_sel:4;
		uint64_t clk_sel:2;
		uint64_t clk_gen:1;
		uint64_t synce_sel:2;
		uint64_t output_sel:5;
		uint64_t reserved_21_63:42;
#endif
	} s;
	struct cvmx_gpio_bit_cfgx_cn30xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_12_63:52;
		uint64_t fil_sel:4;
		uint64_t fil_cnt:4;
		uint64_t int_type:1;
		uint64_t int_en:1;
		uint64_t rx_xor:1;
		uint64_t tx_oe:1;
#else
		uint64_t tx_oe:1;
		uint64_t rx_xor:1;
		uint64_t int_en:1;
		uint64_t int_type:1;
		uint64_t fil_cnt:4;
		uint64_t fil_sel:4;
		uint64_t reserved_12_63:52;
#endif
	} cn30xx;
	struct cvmx_gpio_bit_cfgx_cn30xx cn31xx;
	struct cvmx_gpio_bit_cfgx_cn30xx cn38xx;
	struct cvmx_gpio_bit_cfgx_cn30xx cn38xxp2;
	struct cvmx_gpio_bit_cfgx_cn30xx cn50xx;
	struct cvmx_gpio_bit_cfgx_cn52xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_15_63:49;
		uint64_t clk_gen:1;
		uint64_t clk_sel:2;
		uint64_t fil_sel:4;
		uint64_t fil_cnt:4;
		uint64_t int_type:1;
		uint64_t int_en:1;
		uint64_t rx_xor:1;
		uint64_t tx_oe:1;
#else
		uint64_t tx_oe:1;
		uint64_t rx_xor:1;
		uint64_t int_en:1;
		uint64_t int_type:1;
		uint64_t fil_cnt:4;
		uint64_t fil_sel:4;
		uint64_t clk_sel:2;
		uint64_t clk_gen:1;
		uint64_t reserved_15_63:49;
#endif
	} cn52xx;
	struct cvmx_gpio_bit_cfgx_cn52xx cn52xxp1;
	struct cvmx_gpio_bit_cfgx_cn52xx cn56xx;
	struct cvmx_gpio_bit_cfgx_cn52xx cn56xxp1;
	struct cvmx_gpio_bit_cfgx_cn30xx cn58xx;
	struct cvmx_gpio_bit_cfgx_cn30xx cn58xxp1;
	struct cvmx_gpio_bit_cfgx_s cn61xx;
	struct cvmx_gpio_bit_cfgx_s cn63xx;
	struct cvmx_gpio_bit_cfgx_s cn63xxp1;
	struct cvmx_gpio_bit_cfgx_s cn66xx;
	struct cvmx_gpio_bit_cfgx_s cn68xx;
	struct cvmx_gpio_bit_cfgx_s cn68xxp1;
	struct cvmx_gpio_bit_cfgx_s cn70xx;
	struct cvmx_gpio_bit_cfgx_s cn73xx;
	struct cvmx_gpio_bit_cfgx_s cnf71xx;
};

union cvmx_gpio_boot_ena {
	uint64_t u64;
	struct cvmx_gpio_boot_ena_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_12_63:52;
		uint64_t boot_ena:4;
		uint64_t reserved_0_7:8;
#else
		uint64_t reserved_0_7:8;
		uint64_t boot_ena:4;
		uint64_t reserved_12_63:52;
#endif
	} s;
	struct cvmx_gpio_boot_ena_s cn30xx;
	struct cvmx_gpio_boot_ena_s cn31xx;
	struct cvmx_gpio_boot_ena_s cn50xx;
};

union cvmx_gpio_clk_genx {
	uint64_t u64;
	struct cvmx_gpio_clk_genx_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_32_63:32;
		uint64_t n:32;
#else
		uint64_t n:32;
		uint64_t reserved_32_63:32;
#endif
	} s;
	struct cvmx_gpio_clk_genx_s cn52xx;
	struct cvmx_gpio_clk_genx_s cn52xxp1;
	struct cvmx_gpio_clk_genx_s cn56xx;
	struct cvmx_gpio_clk_genx_s cn56xxp1;
	struct cvmx_gpio_clk_genx_s cn61xx;
	struct cvmx_gpio_clk_genx_s cn63xx;
	struct cvmx_gpio_clk_genx_s cn63xxp1;
	struct cvmx_gpio_clk_genx_s cn66xx;
	struct cvmx_gpio_clk_genx_s cn68xx;
	struct cvmx_gpio_clk_genx_s cn68xxp1;
	struct cvmx_gpio_clk_genx_s cnf71xx;
};

union cvmx_gpio_clk_qlmx {
	uint64_t u64;
	struct cvmx_gpio_clk_qlmx_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_11_63:53;
		uint64_t qlm_sel:3;
		uint64_t reserved_3_7:5;
		uint64_t div:1;
		uint64_t lane_sel:2;
#else
		uint64_t lane_sel:2;
		uint64_t div:1;
		uint64_t reserved_3_7:5;
		uint64_t qlm_sel:3;
		uint64_t reserved_11_63:53;
#endif
	} s;
	struct cvmx_gpio_clk_qlmx_cn61xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_10_63:54;
		uint64_t qlm_sel:2;
		uint64_t reserved_3_7:5;
		uint64_t div:1;
		uint64_t lane_sel:2;
#else
		uint64_t lane_sel:2;
		uint64_t div:1;
		uint64_t reserved_3_7:5;
		uint64_t qlm_sel:2;
		uint64_t reserved_10_63:54;
#endif
	} cn61xx;
	struct cvmx_gpio_clk_qlmx_cn63xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_3_63:61;
		uint64_t div:1;
		uint64_t lane_sel:2;
#else
		uint64_t lane_sel:2;
		uint64_t div:1;
		uint64_t reserved_3_63:61;
#endif
	} cn63xx;
	struct cvmx_gpio_clk_qlmx_cn63xx cn63xxp1;
	struct cvmx_gpio_clk_qlmx_cn61xx cn66xx;
	struct cvmx_gpio_clk_qlmx_s cn68xx;
	struct cvmx_gpio_clk_qlmx_s cn68xxp1;
	struct cvmx_gpio_clk_qlmx_cn61xx cnf71xx;
};

union cvmx_gpio_dbg_ena {
	uint64_t u64;
	struct cvmx_gpio_dbg_ena_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_21_63:43;
		uint64_t dbg_ena:21;
#else
		uint64_t dbg_ena:21;
		uint64_t reserved_21_63:43;
#endif
	} s;
	struct cvmx_gpio_dbg_ena_s cn30xx;
	struct cvmx_gpio_dbg_ena_s cn31xx;
	struct cvmx_gpio_dbg_ena_s cn50xx;
};

union cvmx_gpio_int_clr {
	uint64_t u64;
	struct cvmx_gpio_int_clr_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_16_63:48;
		uint64_t type:16;
#else
		uint64_t type:16;
		uint64_t reserved_16_63:48;
#endif
	} s;
	struct cvmx_gpio_int_clr_s cn30xx;
	struct cvmx_gpio_int_clr_s cn31xx;
	struct cvmx_gpio_int_clr_s cn38xx;
	struct cvmx_gpio_int_clr_s cn38xxp2;
	struct cvmx_gpio_int_clr_s cn50xx;
	struct cvmx_gpio_int_clr_s cn52xx;
	struct cvmx_gpio_int_clr_s cn52xxp1;
	struct cvmx_gpio_int_clr_s cn56xx;
	struct cvmx_gpio_int_clr_s cn56xxp1;
	struct cvmx_gpio_int_clr_s cn58xx;
	struct cvmx_gpio_int_clr_s cn58xxp1;
	struct cvmx_gpio_int_clr_s cn61xx;
	struct cvmx_gpio_int_clr_s cn63xx;
	struct cvmx_gpio_int_clr_s cn63xxp1;
	struct cvmx_gpio_int_clr_s cn66xx;
	struct cvmx_gpio_int_clr_s cn68xx;
	struct cvmx_gpio_int_clr_s cn68xxp1;
	struct cvmx_gpio_int_clr_s cnf71xx;
};

union cvmx_gpio_multi_cast {
	uint64_t u64;
	struct cvmx_gpio_multi_cast_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_1_63:63;
		uint64_t en:1;
#else
		uint64_t en:1;
		uint64_t reserved_1_63:63;
#endif
	} s;
	struct cvmx_gpio_multi_cast_s cn61xx;
	struct cvmx_gpio_multi_cast_s cnf71xx;
};

union cvmx_gpio_pin_ena {
	uint64_t u64;
	struct cvmx_gpio_pin_ena_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_20_63:44;
		uint64_t ena19:1;
		uint64_t ena18:1;
		uint64_t reserved_0_17:18;
#else
		uint64_t reserved_0_17:18;
		uint64_t ena18:1;
		uint64_t ena19:1;
		uint64_t reserved_20_63:44;
#endif
	} s;
	struct cvmx_gpio_pin_ena_s cn66xx;
};

union cvmx_gpio_rx_dat {
	uint64_t u64;
	struct cvmx_gpio_rx_dat_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_24_63:40;
		uint64_t dat:24;
#else
		uint64_t dat:24;
		uint64_t reserved_24_63:40;
#endif
	} s;
	struct cvmx_gpio_rx_dat_s cn30xx;
	struct cvmx_gpio_rx_dat_s cn31xx;
	struct cvmx_gpio_rx_dat_cn38xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_16_63:48;
		uint64_t dat:16;
#else
		uint64_t dat:16;
		uint64_t reserved_16_63:48;
#endif
	} cn38xx;
	struct cvmx_gpio_rx_dat_cn38xx cn38xxp2;
	struct cvmx_gpio_rx_dat_s cn50xx;
	struct cvmx_gpio_rx_dat_cn38xx cn52xx;
	struct cvmx_gpio_rx_dat_cn38xx cn52xxp1;
	struct cvmx_gpio_rx_dat_cn38xx cn56xx;
	struct cvmx_gpio_rx_dat_cn38xx cn56xxp1;
	struct cvmx_gpio_rx_dat_cn38xx cn58xx;
	struct cvmx_gpio_rx_dat_cn38xx cn58xxp1;
	struct cvmx_gpio_rx_dat_cn61xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_20_63:44;
		uint64_t dat:20;
#else
		uint64_t dat:20;
		uint64_t reserved_20_63:44;
#endif
	} cn61xx;
	struct cvmx_gpio_rx_dat_cn38xx cn63xx;
	struct cvmx_gpio_rx_dat_cn38xx cn63xxp1;
	struct cvmx_gpio_rx_dat_cn61xx cn66xx;
	struct cvmx_gpio_rx_dat_cn38xx cn68xx;
	struct cvmx_gpio_rx_dat_cn38xx cn68xxp1;
	struct cvmx_gpio_rx_dat_cn61xx cnf71xx;
};

union cvmx_gpio_tim_ctl {
	uint64_t u64;
	struct cvmx_gpio_tim_ctl_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_4_63:60;
		uint64_t sel:4;
#else
		uint64_t sel:4;
		uint64_t reserved_4_63:60;
#endif
	} s;
	struct cvmx_gpio_tim_ctl_s cn68xx;
	struct cvmx_gpio_tim_ctl_s cn68xxp1;
};

union cvmx_gpio_tx_clr {
	uint64_t u64;
	struct cvmx_gpio_tx_clr_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_24_63:40;
		uint64_t clr:24;
#else
		uint64_t clr:24;
		uint64_t reserved_24_63:40;
#endif
	} s;
	struct cvmx_gpio_tx_clr_s cn30xx;
	struct cvmx_gpio_tx_clr_s cn31xx;
	struct cvmx_gpio_tx_clr_cn38xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_16_63:48;
		uint64_t clr:16;
#else
		uint64_t clr:16;
		uint64_t reserved_16_63:48;
#endif
	} cn38xx;
	struct cvmx_gpio_tx_clr_cn38xx cn38xxp2;
	struct cvmx_gpio_tx_clr_s cn50xx;
	struct cvmx_gpio_tx_clr_cn38xx cn52xx;
	struct cvmx_gpio_tx_clr_cn38xx cn52xxp1;
	struct cvmx_gpio_tx_clr_cn38xx cn56xx;
	struct cvmx_gpio_tx_clr_cn38xx cn56xxp1;
	struct cvmx_gpio_tx_clr_cn38xx cn58xx;
	struct cvmx_gpio_tx_clr_cn38xx cn58xxp1;
	struct cvmx_gpio_tx_clr_cn61xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_20_63:44;
		uint64_t clr:20;
#else
		uint64_t clr:20;
		uint64_t reserved_20_63:44;
#endif
	} cn61xx;
	struct cvmx_gpio_tx_clr_cn38xx cn63xx;
	struct cvmx_gpio_tx_clr_cn38xx cn63xxp1;
	struct cvmx_gpio_tx_clr_cn61xx cn66xx;
	struct cvmx_gpio_tx_clr_cn38xx cn68xx;
	struct cvmx_gpio_tx_clr_cn38xx cn68xxp1;
	struct cvmx_gpio_tx_clr_cn61xx cnf71xx;
};

union cvmx_gpio_tx_set {
	uint64_t u64;
	struct cvmx_gpio_tx_set_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_24_63:40;
		uint64_t set:24;
#else
		uint64_t set:24;
		uint64_t reserved_24_63:40;
#endif
	} s;
	struct cvmx_gpio_tx_set_s cn30xx;
	struct cvmx_gpio_tx_set_s cn31xx;
	struct cvmx_gpio_tx_set_cn38xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_16_63:48;
		uint64_t set:16;
#else
		uint64_t set:16;
		uint64_t reserved_16_63:48;
#endif
	} cn38xx;
	struct cvmx_gpio_tx_set_cn38xx cn38xxp2;
	struct cvmx_gpio_tx_set_s cn50xx;
	struct cvmx_gpio_tx_set_cn38xx cn52xx;
	struct cvmx_gpio_tx_set_cn38xx cn52xxp1;
	struct cvmx_gpio_tx_set_cn38xx cn56xx;
	struct cvmx_gpio_tx_set_cn38xx cn56xxp1;
	struct cvmx_gpio_tx_set_cn38xx cn58xx;
	struct cvmx_gpio_tx_set_cn38xx cn58xxp1;
	struct cvmx_gpio_tx_set_cn61xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_20_63:44;
		uint64_t set:20;
#else
		uint64_t set:20;
		uint64_t reserved_20_63:44;
#endif
	} cn61xx;
	struct cvmx_gpio_tx_set_cn38xx cn63xx;
	struct cvmx_gpio_tx_set_cn38xx cn63xxp1;
	struct cvmx_gpio_tx_set_cn61xx cn66xx;
	struct cvmx_gpio_tx_set_cn38xx cn68xx;
	struct cvmx_gpio_tx_set_cn38xx cn68xxp1;
	struct cvmx_gpio_tx_set_cn61xx cnf71xx;
};

union cvmx_gpio_xbit_cfgx {
	uint64_t u64;
	struct cvmx_gpio_xbit_cfgx_s {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_17_63:47;
		uint64_t synce_sel:2;
		uint64_t clk_gen:1;
		uint64_t clk_sel:2;
		uint64_t fil_sel:4;
		uint64_t fil_cnt:4;
		uint64_t int_type:1;
		uint64_t int_en:1;
		uint64_t rx_xor:1;
		uint64_t tx_oe:1;
#else
		uint64_t tx_oe:1;
		uint64_t rx_xor:1;
		uint64_t int_en:1;
		uint64_t int_type:1;
		uint64_t fil_cnt:4;
		uint64_t fil_sel:4;
		uint64_t clk_sel:2;
		uint64_t clk_gen:1;
		uint64_t synce_sel:2;
		uint64_t reserved_17_63:47;
#endif
	} s;
	struct cvmx_gpio_xbit_cfgx_cn30xx {
#ifdef __BIG_ENDIAN_BITFIELD
		uint64_t reserved_12_63:52;
		uint64_t fil_sel:4;
		uint64_t fil_cnt:4;
		uint64_t reserved_2_3:2;
		uint64_t rx_xor:1;
		uint64_t tx_oe:1;
#else
		uint64_t tx_oe:1;
		uint64_t rx_xor:1;
		uint64_t reserved_2_3:2;
		uint64_t fil_cnt:4;
		uint64_t fil_sel:4;
		uint64_t reserved_12_63:52;
#endif
	} cn30xx;
	struct cvmx_gpio_xbit_cfgx_cn30xx cn31xx;
	struct cvmx_gpio_xbit_cfgx_cn30xx cn50xx;
	struct cvmx_gpio_xbit_cfgx_s cn61xx;
	struct cvmx_gpio_xbit_cfgx_s cn66xx;
	struct cvmx_gpio_xbit_cfgx_s cnf71xx;
};

#endif