1 /***********************license start***************
2 * Author: Cavium Networks
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
7 * Copyright (c) 2003-2012 Cavium Networks
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
28 #ifndef __CVMX_GPIO_DEFS_H__
29 #define __CVMX_GPIO_DEFS_H__
31 #define CVMX_GPIO_BIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000800ull) + ((offset) & 15) * 8)
32 #define CVMX_GPIO_BOOT_ENA (CVMX_ADD_IO_SEG(0x00010700000008A8ull))
33 #define CVMX_GPIO_CLK_GENX(offset) (CVMX_ADD_IO_SEG(0x00010700000008C0ull) + ((offset) & 3) * 8)
34 #define CVMX_GPIO_CLK_QLMX(offset) (CVMX_ADD_IO_SEG(0x00010700000008E0ull) + ((offset) & 1) * 8)
35 #define CVMX_GPIO_DBG_ENA (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
36 #define CVMX_GPIO_INT_CLR (CVMX_ADD_IO_SEG(0x0001070000000898ull))
37 #define CVMX_GPIO_MULTI_CAST (CVMX_ADD_IO_SEG(0x00010700000008B0ull))
38 #define CVMX_GPIO_PIN_ENA (CVMX_ADD_IO_SEG(0x00010700000008B8ull))
39 #define CVMX_GPIO_RX_DAT (CVMX_ADD_IO_SEG(0x0001070000000880ull))
40 #define CVMX_GPIO_TIM_CTL (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
41 #define CVMX_GPIO_TX_CLR (CVMX_ADD_IO_SEG(0x0001070000000890ull))
42 #define CVMX_GPIO_TX_SET (CVMX_ADD_IO_SEG(0x0001070000000888ull))
43 #define CVMX_GPIO_XBIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000900ull) + ((offset) & 31) * 8 - 8*16)
45 union cvmx_gpio_bit_cfgx
{
47 struct cvmx_gpio_bit_cfgx_s
{
48 #ifdef __BIG_ENDIAN_BITFIELD
49 uint64_t reserved_21_63
:42;
50 uint64_t output_sel
:5;
70 uint64_t output_sel
:5;
71 uint64_t reserved_21_63
:42;
74 struct cvmx_gpio_bit_cfgx_cn30xx
{
75 #ifdef __BIG_ENDIAN_BITFIELD
76 uint64_t reserved_12_63
:52;
90 uint64_t reserved_12_63
:52;
93 struct cvmx_gpio_bit_cfgx_cn52xx
{
94 #ifdef __BIG_ENDIAN_BITFIELD
95 uint64_t reserved_15_63
:49;
113 uint64_t reserved_15_63
:49;
118 union cvmx_gpio_boot_ena
{
120 struct cvmx_gpio_boot_ena_s
{
121 #ifdef __BIG_ENDIAN_BITFIELD
122 uint64_t reserved_12_63
:52;
124 uint64_t reserved_0_7
:8;
126 uint64_t reserved_0_7
:8;
128 uint64_t reserved_12_63
:52;
133 union cvmx_gpio_clk_genx
{
135 struct cvmx_gpio_clk_genx_s
{
136 #ifdef __BIG_ENDIAN_BITFIELD
137 uint64_t reserved_32_63
:32;
141 uint64_t reserved_32_63
:32;
146 union cvmx_gpio_clk_qlmx
{
148 struct cvmx_gpio_clk_qlmx_s
{
149 #ifdef __BIG_ENDIAN_BITFIELD
150 uint64_t reserved_11_63
:53;
152 uint64_t reserved_3_7
:5;
158 uint64_t reserved_3_7
:5;
160 uint64_t reserved_11_63
:53;
163 struct cvmx_gpio_clk_qlmx_cn61xx
{
164 #ifdef __BIG_ENDIAN_BITFIELD
165 uint64_t reserved_10_63
:54;
167 uint64_t reserved_3_7
:5;
173 uint64_t reserved_3_7
:5;
175 uint64_t reserved_10_63
:54;
178 struct cvmx_gpio_clk_qlmx_cn63xx
{
179 #ifdef __BIG_ENDIAN_BITFIELD
180 uint64_t reserved_3_63
:61;
186 uint64_t reserved_3_63
:61;
191 union cvmx_gpio_dbg_ena
{
193 struct cvmx_gpio_dbg_ena_s
{
194 #ifdef __BIG_ENDIAN_BITFIELD
195 uint64_t reserved_21_63
:43;
199 uint64_t reserved_21_63
:43;
204 union cvmx_gpio_int_clr
{
206 struct cvmx_gpio_int_clr_s
{
207 #ifdef __BIG_ENDIAN_BITFIELD
208 uint64_t reserved_16_63
:48;
212 uint64_t reserved_16_63
:48;
217 union cvmx_gpio_multi_cast
{
219 struct cvmx_gpio_multi_cast_s
{
220 #ifdef __BIG_ENDIAN_BITFIELD
221 uint64_t reserved_1_63
:63;
225 uint64_t reserved_1_63
:63;
230 union cvmx_gpio_pin_ena
{
232 struct cvmx_gpio_pin_ena_s
{
233 #ifdef __BIG_ENDIAN_BITFIELD
234 uint64_t reserved_20_63
:44;
237 uint64_t reserved_0_17
:18;
239 uint64_t reserved_0_17
:18;
242 uint64_t reserved_20_63
:44;
247 union cvmx_gpio_rx_dat
{
249 struct cvmx_gpio_rx_dat_s
{
250 #ifdef __BIG_ENDIAN_BITFIELD
251 uint64_t reserved_24_63
:40;
255 uint64_t reserved_24_63
:40;
258 struct cvmx_gpio_rx_dat_cn38xx
{
259 #ifdef __BIG_ENDIAN_BITFIELD
260 uint64_t reserved_16_63
:48;
264 uint64_t reserved_16_63
:48;
267 struct cvmx_gpio_rx_dat_cn61xx
{
268 #ifdef __BIG_ENDIAN_BITFIELD
269 uint64_t reserved_20_63
:44;
273 uint64_t reserved_20_63
:44;
278 union cvmx_gpio_tim_ctl
{
280 struct cvmx_gpio_tim_ctl_s
{
281 #ifdef __BIG_ENDIAN_BITFIELD
282 uint64_t reserved_4_63
:60;
286 uint64_t reserved_4_63
:60;
291 union cvmx_gpio_tx_clr
{
293 struct cvmx_gpio_tx_clr_s
{
294 #ifdef __BIG_ENDIAN_BITFIELD
295 uint64_t reserved_24_63
:40;
299 uint64_t reserved_24_63
:40;
302 struct cvmx_gpio_tx_clr_cn38xx
{
303 #ifdef __BIG_ENDIAN_BITFIELD
304 uint64_t reserved_16_63
:48;
308 uint64_t reserved_16_63
:48;
311 struct cvmx_gpio_tx_clr_cn61xx
{
312 #ifdef __BIG_ENDIAN_BITFIELD
313 uint64_t reserved_20_63
:44;
317 uint64_t reserved_20_63
:44;
322 union cvmx_gpio_tx_set
{
324 struct cvmx_gpio_tx_set_s
{
325 #ifdef __BIG_ENDIAN_BITFIELD
326 uint64_t reserved_24_63
:40;
330 uint64_t reserved_24_63
:40;
333 struct cvmx_gpio_tx_set_cn38xx
{
334 #ifdef __BIG_ENDIAN_BITFIELD
335 uint64_t reserved_16_63
:48;
339 uint64_t reserved_16_63
:48;
342 struct cvmx_gpio_tx_set_cn61xx
{
343 #ifdef __BIG_ENDIAN_BITFIELD
344 uint64_t reserved_20_63
:44;
348 uint64_t reserved_20_63
:44;
353 union cvmx_gpio_xbit_cfgx
{
355 struct cvmx_gpio_xbit_cfgx_s
{
356 #ifdef __BIG_ENDIAN_BITFIELD
357 uint64_t reserved_17_63
:47;
358 uint64_t synce_sel
:2;
376 uint64_t synce_sel
:2;
377 uint64_t reserved_17_63
:47;
380 struct cvmx_gpio_xbit_cfgx_cn30xx
{
381 #ifdef __BIG_ENDIAN_BITFIELD
382 uint64_t reserved_12_63
:52;
385 uint64_t reserved_2_3
:2;
391 uint64_t reserved_2_3
:2;
394 uint64_t reserved_12_63
:52;