18c2ecf20Sopenharmony_ci/***********************license start***************
28c2ecf20Sopenharmony_ci * Author: Cavium Networks
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Contact: support@caviumnetworks.com
58c2ecf20Sopenharmony_ci * This file is part of the OCTEON SDK
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (c) 2003-2012 Cavium Networks
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * This file is free software; you can redistribute it and/or modify
108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as
118c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * This file is distributed in the hope that it will be useful, but
148c2ecf20Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
158c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
168c2ecf20Sopenharmony_ci * NONINFRINGEMENT.  See the GNU General Public License for more
178c2ecf20Sopenharmony_ci * details.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License
208c2ecf20Sopenharmony_ci * along with this file; if not, write to the Free Software
218c2ecf20Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
228c2ecf20Sopenharmony_ci * or visit http://www.gnu.org/licenses/.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * This file may also be available under a different license from Cavium.
258c2ecf20Sopenharmony_ci * Contact Cavium Networks for more information
268c2ecf20Sopenharmony_ci ***********************license end**************************************/
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#ifndef __CVMX_LED_DEFS_H__
298c2ecf20Sopenharmony_ci#define __CVMX_LED_DEFS_H__
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define CVMX_LED_BLINK (CVMX_ADD_IO_SEG(0x0001180000001A48ull))
328c2ecf20Sopenharmony_ci#define CVMX_LED_CLK_PHASE (CVMX_ADD_IO_SEG(0x0001180000001A08ull))
338c2ecf20Sopenharmony_ci#define CVMX_LED_CYLON (CVMX_ADD_IO_SEG(0x0001180000001AF8ull))
348c2ecf20Sopenharmony_ci#define CVMX_LED_DBG (CVMX_ADD_IO_SEG(0x0001180000001A18ull))
358c2ecf20Sopenharmony_ci#define CVMX_LED_EN (CVMX_ADD_IO_SEG(0x0001180000001A00ull))
368c2ecf20Sopenharmony_ci#define CVMX_LED_POLARITY (CVMX_ADD_IO_SEG(0x0001180000001A50ull))
378c2ecf20Sopenharmony_ci#define CVMX_LED_PRT (CVMX_ADD_IO_SEG(0x0001180000001A10ull))
388c2ecf20Sopenharmony_ci#define CVMX_LED_PRT_FMT (CVMX_ADD_IO_SEG(0x0001180000001A30ull))
398c2ecf20Sopenharmony_ci#define CVMX_LED_PRT_STATUSX(offset) (CVMX_ADD_IO_SEG(0x0001180000001A80ull) + ((offset) & 7) * 8)
408c2ecf20Sopenharmony_ci#define CVMX_LED_UDD_CNTX(offset) (CVMX_ADD_IO_SEG(0x0001180000001A20ull) + ((offset) & 1) * 8)
418c2ecf20Sopenharmony_ci#define CVMX_LED_UDD_DATX(offset) (CVMX_ADD_IO_SEG(0x0001180000001A38ull) + ((offset) & 1) * 8)
428c2ecf20Sopenharmony_ci#define CVMX_LED_UDD_DAT_CLRX(offset) (CVMX_ADD_IO_SEG(0x0001180000001AC8ull) + ((offset) & 1) * 16)
438c2ecf20Sopenharmony_ci#define CVMX_LED_UDD_DAT_SETX(offset) (CVMX_ADD_IO_SEG(0x0001180000001AC0ull) + ((offset) & 1) * 16)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciunion cvmx_led_blink {
468c2ecf20Sopenharmony_ci	uint64_t u64;
478c2ecf20Sopenharmony_ci	struct cvmx_led_blink_s {
488c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
498c2ecf20Sopenharmony_ci		uint64_t reserved_8_63:56;
508c2ecf20Sopenharmony_ci		uint64_t rate:8;
518c2ecf20Sopenharmony_ci#else
528c2ecf20Sopenharmony_ci		uint64_t rate:8;
538c2ecf20Sopenharmony_ci		uint64_t reserved_8_63:56;
548c2ecf20Sopenharmony_ci#endif
558c2ecf20Sopenharmony_ci	} s;
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciunion cvmx_led_clk_phase {
598c2ecf20Sopenharmony_ci	uint64_t u64;
608c2ecf20Sopenharmony_ci	struct cvmx_led_clk_phase_s {
618c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
628c2ecf20Sopenharmony_ci		uint64_t reserved_7_63:57;
638c2ecf20Sopenharmony_ci		uint64_t phase:7;
648c2ecf20Sopenharmony_ci#else
658c2ecf20Sopenharmony_ci		uint64_t phase:7;
668c2ecf20Sopenharmony_ci		uint64_t reserved_7_63:57;
678c2ecf20Sopenharmony_ci#endif
688c2ecf20Sopenharmony_ci	} s;
698c2ecf20Sopenharmony_ci};
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciunion cvmx_led_cylon {
728c2ecf20Sopenharmony_ci	uint64_t u64;
738c2ecf20Sopenharmony_ci	struct cvmx_led_cylon_s {
748c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
758c2ecf20Sopenharmony_ci		uint64_t reserved_16_63:48;
768c2ecf20Sopenharmony_ci		uint64_t rate:16;
778c2ecf20Sopenharmony_ci#else
788c2ecf20Sopenharmony_ci		uint64_t rate:16;
798c2ecf20Sopenharmony_ci		uint64_t reserved_16_63:48;
808c2ecf20Sopenharmony_ci#endif
818c2ecf20Sopenharmony_ci	} s;
828c2ecf20Sopenharmony_ci};
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ciunion cvmx_led_dbg {
858c2ecf20Sopenharmony_ci	uint64_t u64;
868c2ecf20Sopenharmony_ci	struct cvmx_led_dbg_s {
878c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
888c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
898c2ecf20Sopenharmony_ci		uint64_t dbg_en:1;
908c2ecf20Sopenharmony_ci#else
918c2ecf20Sopenharmony_ci		uint64_t dbg_en:1;
928c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
938c2ecf20Sopenharmony_ci#endif
948c2ecf20Sopenharmony_ci	} s;
958c2ecf20Sopenharmony_ci};
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ciunion cvmx_led_en {
988c2ecf20Sopenharmony_ci	uint64_t u64;
998c2ecf20Sopenharmony_ci	struct cvmx_led_en_s {
1008c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1018c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
1028c2ecf20Sopenharmony_ci		uint64_t en:1;
1038c2ecf20Sopenharmony_ci#else
1048c2ecf20Sopenharmony_ci		uint64_t en:1;
1058c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
1068c2ecf20Sopenharmony_ci#endif
1078c2ecf20Sopenharmony_ci	} s;
1088c2ecf20Sopenharmony_ci};
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ciunion cvmx_led_polarity {
1118c2ecf20Sopenharmony_ci	uint64_t u64;
1128c2ecf20Sopenharmony_ci	struct cvmx_led_polarity_s {
1138c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1148c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
1158c2ecf20Sopenharmony_ci		uint64_t polarity:1;
1168c2ecf20Sopenharmony_ci#else
1178c2ecf20Sopenharmony_ci		uint64_t polarity:1;
1188c2ecf20Sopenharmony_ci		uint64_t reserved_1_63:63;
1198c2ecf20Sopenharmony_ci#endif
1208c2ecf20Sopenharmony_ci	} s;
1218c2ecf20Sopenharmony_ci};
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ciunion cvmx_led_prt {
1248c2ecf20Sopenharmony_ci	uint64_t u64;
1258c2ecf20Sopenharmony_ci	struct cvmx_led_prt_s {
1268c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1278c2ecf20Sopenharmony_ci		uint64_t reserved_8_63:56;
1288c2ecf20Sopenharmony_ci		uint64_t prt_en:8;
1298c2ecf20Sopenharmony_ci#else
1308c2ecf20Sopenharmony_ci		uint64_t prt_en:8;
1318c2ecf20Sopenharmony_ci		uint64_t reserved_8_63:56;
1328c2ecf20Sopenharmony_ci#endif
1338c2ecf20Sopenharmony_ci	} s;
1348c2ecf20Sopenharmony_ci};
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ciunion cvmx_led_prt_fmt {
1378c2ecf20Sopenharmony_ci	uint64_t u64;
1388c2ecf20Sopenharmony_ci	struct cvmx_led_prt_fmt_s {
1398c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1408c2ecf20Sopenharmony_ci		uint64_t reserved_4_63:60;
1418c2ecf20Sopenharmony_ci		uint64_t format:4;
1428c2ecf20Sopenharmony_ci#else
1438c2ecf20Sopenharmony_ci		uint64_t format:4;
1448c2ecf20Sopenharmony_ci		uint64_t reserved_4_63:60;
1458c2ecf20Sopenharmony_ci#endif
1468c2ecf20Sopenharmony_ci	} s;
1478c2ecf20Sopenharmony_ci};
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ciunion cvmx_led_prt_statusx {
1508c2ecf20Sopenharmony_ci	uint64_t u64;
1518c2ecf20Sopenharmony_ci	struct cvmx_led_prt_statusx_s {
1528c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1538c2ecf20Sopenharmony_ci		uint64_t reserved_6_63:58;
1548c2ecf20Sopenharmony_ci		uint64_t status:6;
1558c2ecf20Sopenharmony_ci#else
1568c2ecf20Sopenharmony_ci		uint64_t status:6;
1578c2ecf20Sopenharmony_ci		uint64_t reserved_6_63:58;
1588c2ecf20Sopenharmony_ci#endif
1598c2ecf20Sopenharmony_ci	} s;
1608c2ecf20Sopenharmony_ci};
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ciunion cvmx_led_udd_cntx {
1638c2ecf20Sopenharmony_ci	uint64_t u64;
1648c2ecf20Sopenharmony_ci	struct cvmx_led_udd_cntx_s {
1658c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1668c2ecf20Sopenharmony_ci		uint64_t reserved_6_63:58;
1678c2ecf20Sopenharmony_ci		uint64_t cnt:6;
1688c2ecf20Sopenharmony_ci#else
1698c2ecf20Sopenharmony_ci		uint64_t cnt:6;
1708c2ecf20Sopenharmony_ci		uint64_t reserved_6_63:58;
1718c2ecf20Sopenharmony_ci#endif
1728c2ecf20Sopenharmony_ci	} s;
1738c2ecf20Sopenharmony_ci};
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ciunion cvmx_led_udd_datx {
1768c2ecf20Sopenharmony_ci	uint64_t u64;
1778c2ecf20Sopenharmony_ci	struct cvmx_led_udd_datx_s {
1788c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1798c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
1808c2ecf20Sopenharmony_ci		uint64_t dat:32;
1818c2ecf20Sopenharmony_ci#else
1828c2ecf20Sopenharmony_ci		uint64_t dat:32;
1838c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
1848c2ecf20Sopenharmony_ci#endif
1858c2ecf20Sopenharmony_ci	} s;
1868c2ecf20Sopenharmony_ci};
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ciunion cvmx_led_udd_dat_clrx {
1898c2ecf20Sopenharmony_ci	uint64_t u64;
1908c2ecf20Sopenharmony_ci	struct cvmx_led_udd_dat_clrx_s {
1918c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
1928c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
1938c2ecf20Sopenharmony_ci		uint64_t clr:32;
1948c2ecf20Sopenharmony_ci#else
1958c2ecf20Sopenharmony_ci		uint64_t clr:32;
1968c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
1978c2ecf20Sopenharmony_ci#endif
1988c2ecf20Sopenharmony_ci	} s;
1998c2ecf20Sopenharmony_ci};
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ciunion cvmx_led_udd_dat_setx {
2028c2ecf20Sopenharmony_ci	uint64_t u64;
2038c2ecf20Sopenharmony_ci	struct cvmx_led_udd_dat_setx_s {
2048c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
2058c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
2068c2ecf20Sopenharmony_ci		uint64_t set:32;
2078c2ecf20Sopenharmony_ci#else
2088c2ecf20Sopenharmony_ci		uint64_t set:32;
2098c2ecf20Sopenharmony_ci		uint64_t reserved_32_63:32;
2108c2ecf20Sopenharmony_ci#endif
2118c2ecf20Sopenharmony_ci	} s;
2128c2ecf20Sopenharmony_ci};
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci#endif
215