162306a36Sopenharmony_ci/***********************license start***************
262306a36Sopenharmony_ci * Author: Cavium Inc.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Contact: support@cavium.com
562306a36Sopenharmony_ci * This file is part of the OCTEON SDK
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (c) 2003-2014 Cavium Inc.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * This file is free software; you can redistribute it and/or modify
1062306a36Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as
1162306a36Sopenharmony_ci * published by the Free Software Foundation.
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci * This file is distributed in the hope that it will be useful, but
1462306a36Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
1562306a36Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
1662306a36Sopenharmony_ci * NONINFRINGEMENT.  See the GNU General Public License for more
1762306a36Sopenharmony_ci * details.
1862306a36Sopenharmony_ci *
1962306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License
2062306a36Sopenharmony_ci * along with this file; if not, write to the Free Software
2162306a36Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2262306a36Sopenharmony_ci * or visit http://www.gnu.org/licenses/.
2362306a36Sopenharmony_ci *
2462306a36Sopenharmony_ci * This file may also be available under a different license from Cavium.
2562306a36Sopenharmony_ci * Contact Cavium Inc. for more information
2662306a36Sopenharmony_ci ***********************license end**************************************/
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#ifndef __CVMX_RST_DEFS_H__
2962306a36Sopenharmony_ci#define __CVMX_RST_DEFS_H__
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define CVMX_RST_BOOT (CVMX_ADD_IO_SEG(0x0001180006001600ull))
3262306a36Sopenharmony_ci#define CVMX_RST_CFG (CVMX_ADD_IO_SEG(0x0001180006001610ull))
3362306a36Sopenharmony_ci#define CVMX_RST_CKILL (CVMX_ADD_IO_SEG(0x0001180006001638ull))
3462306a36Sopenharmony_ci#define CVMX_RST_CTLX(offset) (CVMX_ADD_IO_SEG(0x0001180006001640ull) + ((offset) & 3) * 8)
3562306a36Sopenharmony_ci#define CVMX_RST_DELAY (CVMX_ADD_IO_SEG(0x0001180006001608ull))
3662306a36Sopenharmony_ci#define CVMX_RST_ECO (CVMX_ADD_IO_SEG(0x00011800060017B8ull))
3762306a36Sopenharmony_ci#define CVMX_RST_INT (CVMX_ADD_IO_SEG(0x0001180006001628ull))
3862306a36Sopenharmony_ci#define CVMX_RST_OCX (CVMX_ADD_IO_SEG(0x0001180006001618ull))
3962306a36Sopenharmony_ci#define CVMX_RST_POWER_DBG (CVMX_ADD_IO_SEG(0x0001180006001708ull))
4062306a36Sopenharmony_ci#define CVMX_RST_PP_POWER (CVMX_ADD_IO_SEG(0x0001180006001700ull))
4162306a36Sopenharmony_ci#define CVMX_RST_SOFT_PRSTX(offset) (CVMX_ADD_IO_SEG(0x00011800060016C0ull) + ((offset) & 3) * 8)
4262306a36Sopenharmony_ci#define CVMX_RST_SOFT_RST (CVMX_ADD_IO_SEG(0x0001180006001680ull))
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciunion cvmx_rst_boot {
4562306a36Sopenharmony_ci	uint64_t u64;
4662306a36Sopenharmony_ci	struct cvmx_rst_boot_s {
4762306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
4862306a36Sopenharmony_ci		uint64_t chipkill:1;
4962306a36Sopenharmony_ci		uint64_t jtcsrdis:1;
5062306a36Sopenharmony_ci		uint64_t ejtagdis:1;
5162306a36Sopenharmony_ci		uint64_t romen:1;
5262306a36Sopenharmony_ci		uint64_t ckill_ppdis:1;
5362306a36Sopenharmony_ci		uint64_t jt_tstmode:1;
5462306a36Sopenharmony_ci		uint64_t vrm_err:1;
5562306a36Sopenharmony_ci		uint64_t reserved_37_56:20;
5662306a36Sopenharmony_ci		uint64_t c_mul:7;
5762306a36Sopenharmony_ci		uint64_t pnr_mul:6;
5862306a36Sopenharmony_ci		uint64_t reserved_21_23:3;
5962306a36Sopenharmony_ci		uint64_t lboot_oci:3;
6062306a36Sopenharmony_ci		uint64_t lboot_ext:6;
6162306a36Sopenharmony_ci		uint64_t lboot:10;
6262306a36Sopenharmony_ci		uint64_t rboot:1;
6362306a36Sopenharmony_ci		uint64_t rboot_pin:1;
6462306a36Sopenharmony_ci#else
6562306a36Sopenharmony_ci		uint64_t rboot_pin:1;
6662306a36Sopenharmony_ci		uint64_t rboot:1;
6762306a36Sopenharmony_ci		uint64_t lboot:10;
6862306a36Sopenharmony_ci		uint64_t lboot_ext:6;
6962306a36Sopenharmony_ci		uint64_t lboot_oci:3;
7062306a36Sopenharmony_ci		uint64_t reserved_21_23:3;
7162306a36Sopenharmony_ci		uint64_t pnr_mul:6;
7262306a36Sopenharmony_ci		uint64_t c_mul:7;
7362306a36Sopenharmony_ci		uint64_t reserved_37_56:20;
7462306a36Sopenharmony_ci		uint64_t vrm_err:1;
7562306a36Sopenharmony_ci		uint64_t jt_tstmode:1;
7662306a36Sopenharmony_ci		uint64_t ckill_ppdis:1;
7762306a36Sopenharmony_ci		uint64_t romen:1;
7862306a36Sopenharmony_ci		uint64_t ejtagdis:1;
7962306a36Sopenharmony_ci		uint64_t jtcsrdis:1;
8062306a36Sopenharmony_ci		uint64_t chipkill:1;
8162306a36Sopenharmony_ci#endif
8262306a36Sopenharmony_ci	} s;
8362306a36Sopenharmony_ci};
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ciunion cvmx_rst_cfg {
8662306a36Sopenharmony_ci	uint64_t u64;
8762306a36Sopenharmony_ci	struct cvmx_rst_cfg_s {
8862306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
8962306a36Sopenharmony_ci		uint64_t bist_delay:58;
9062306a36Sopenharmony_ci		uint64_t reserved_3_5:3;
9162306a36Sopenharmony_ci		uint64_t cntl_clr_bist:1;
9262306a36Sopenharmony_ci		uint64_t warm_clr_bist:1;
9362306a36Sopenharmony_ci		uint64_t soft_clr_bist:1;
9462306a36Sopenharmony_ci#else
9562306a36Sopenharmony_ci		uint64_t soft_clr_bist:1;
9662306a36Sopenharmony_ci		uint64_t warm_clr_bist:1;
9762306a36Sopenharmony_ci		uint64_t cntl_clr_bist:1;
9862306a36Sopenharmony_ci		uint64_t reserved_3_5:3;
9962306a36Sopenharmony_ci		uint64_t bist_delay:58;
10062306a36Sopenharmony_ci#endif
10162306a36Sopenharmony_ci	} s;
10262306a36Sopenharmony_ci};
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ciunion cvmx_rst_ckill {
10562306a36Sopenharmony_ci	uint64_t u64;
10662306a36Sopenharmony_ci	struct cvmx_rst_ckill_s {
10762306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
10862306a36Sopenharmony_ci		uint64_t reserved_47_63:17;
10962306a36Sopenharmony_ci		uint64_t timer:47;
11062306a36Sopenharmony_ci#else
11162306a36Sopenharmony_ci		uint64_t timer:47;
11262306a36Sopenharmony_ci		uint64_t reserved_47_63:17;
11362306a36Sopenharmony_ci#endif
11462306a36Sopenharmony_ci	} s;
11562306a36Sopenharmony_ci};
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ciunion cvmx_rst_ctlx {
11862306a36Sopenharmony_ci	uint64_t u64;
11962306a36Sopenharmony_ci	struct cvmx_rst_ctlx_s {
12062306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
12162306a36Sopenharmony_ci		uint64_t reserved_10_63:54;
12262306a36Sopenharmony_ci		uint64_t prst_link:1;
12362306a36Sopenharmony_ci		uint64_t rst_done:1;
12462306a36Sopenharmony_ci		uint64_t rst_link:1;
12562306a36Sopenharmony_ci		uint64_t host_mode:1;
12662306a36Sopenharmony_ci		uint64_t reserved_4_5:2;
12762306a36Sopenharmony_ci		uint64_t rst_drv:1;
12862306a36Sopenharmony_ci		uint64_t rst_rcv:1;
12962306a36Sopenharmony_ci		uint64_t rst_chip:1;
13062306a36Sopenharmony_ci		uint64_t rst_val:1;
13162306a36Sopenharmony_ci#else
13262306a36Sopenharmony_ci		uint64_t rst_val:1;
13362306a36Sopenharmony_ci		uint64_t rst_chip:1;
13462306a36Sopenharmony_ci		uint64_t rst_rcv:1;
13562306a36Sopenharmony_ci		uint64_t rst_drv:1;
13662306a36Sopenharmony_ci		uint64_t reserved_4_5:2;
13762306a36Sopenharmony_ci		uint64_t host_mode:1;
13862306a36Sopenharmony_ci		uint64_t rst_link:1;
13962306a36Sopenharmony_ci		uint64_t rst_done:1;
14062306a36Sopenharmony_ci		uint64_t prst_link:1;
14162306a36Sopenharmony_ci		uint64_t reserved_10_63:54;
14262306a36Sopenharmony_ci#endif
14362306a36Sopenharmony_ci	} s;
14462306a36Sopenharmony_ci};
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ciunion cvmx_rst_delay {
14762306a36Sopenharmony_ci	uint64_t u64;
14862306a36Sopenharmony_ci	struct cvmx_rst_delay_s {
14962306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
15062306a36Sopenharmony_ci		uint64_t reserved_32_63:32;
15162306a36Sopenharmony_ci		uint64_t warm_rst_dly:16;
15262306a36Sopenharmony_ci		uint64_t soft_rst_dly:16;
15362306a36Sopenharmony_ci#else
15462306a36Sopenharmony_ci		uint64_t soft_rst_dly:16;
15562306a36Sopenharmony_ci		uint64_t warm_rst_dly:16;
15662306a36Sopenharmony_ci		uint64_t reserved_32_63:32;
15762306a36Sopenharmony_ci#endif
15862306a36Sopenharmony_ci	} s;
15962306a36Sopenharmony_ci};
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ciunion cvmx_rst_eco {
16262306a36Sopenharmony_ci	uint64_t u64;
16362306a36Sopenharmony_ci	struct cvmx_rst_eco_s {
16462306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
16562306a36Sopenharmony_ci		uint64_t reserved_32_63:32;
16662306a36Sopenharmony_ci		uint64_t eco_rw:32;
16762306a36Sopenharmony_ci#else
16862306a36Sopenharmony_ci		uint64_t eco_rw:32;
16962306a36Sopenharmony_ci		uint64_t reserved_32_63:32;
17062306a36Sopenharmony_ci#endif
17162306a36Sopenharmony_ci	} s;
17262306a36Sopenharmony_ci};
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ciunion cvmx_rst_int {
17562306a36Sopenharmony_ci	uint64_t u64;
17662306a36Sopenharmony_ci	struct cvmx_rst_int_s {
17762306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
17862306a36Sopenharmony_ci		uint64_t reserved_12_63:52;
17962306a36Sopenharmony_ci		uint64_t perst:4;
18062306a36Sopenharmony_ci		uint64_t reserved_4_7:4;
18162306a36Sopenharmony_ci		uint64_t rst_link:4;
18262306a36Sopenharmony_ci#else
18362306a36Sopenharmony_ci		uint64_t rst_link:4;
18462306a36Sopenharmony_ci		uint64_t reserved_4_7:4;
18562306a36Sopenharmony_ci		uint64_t perst:4;
18662306a36Sopenharmony_ci		uint64_t reserved_12_63:52;
18762306a36Sopenharmony_ci#endif
18862306a36Sopenharmony_ci	} s;
18962306a36Sopenharmony_ci	struct cvmx_rst_int_cn70xx {
19062306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
19162306a36Sopenharmony_ci		uint64_t reserved_11_63:53;
19262306a36Sopenharmony_ci		uint64_t perst:3;
19362306a36Sopenharmony_ci		uint64_t reserved_3_7:5;
19462306a36Sopenharmony_ci		uint64_t rst_link:3;
19562306a36Sopenharmony_ci#else
19662306a36Sopenharmony_ci		uint64_t rst_link:3;
19762306a36Sopenharmony_ci		uint64_t reserved_3_7:5;
19862306a36Sopenharmony_ci		uint64_t perst:3;
19962306a36Sopenharmony_ci		uint64_t reserved_11_63:53;
20062306a36Sopenharmony_ci#endif
20162306a36Sopenharmony_ci	} cn70xx;
20262306a36Sopenharmony_ci};
20362306a36Sopenharmony_ci
20462306a36Sopenharmony_ciunion cvmx_rst_ocx {
20562306a36Sopenharmony_ci	uint64_t u64;
20662306a36Sopenharmony_ci	struct cvmx_rst_ocx_s {
20762306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
20862306a36Sopenharmony_ci		uint64_t reserved_3_63:61;
20962306a36Sopenharmony_ci		uint64_t rst_link:3;
21062306a36Sopenharmony_ci#else
21162306a36Sopenharmony_ci		uint64_t rst_link:3;
21262306a36Sopenharmony_ci		uint64_t reserved_3_63:61;
21362306a36Sopenharmony_ci#endif
21462306a36Sopenharmony_ci	} s;
21562306a36Sopenharmony_ci};
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ciunion cvmx_rst_power_dbg {
21862306a36Sopenharmony_ci	uint64_t u64;
21962306a36Sopenharmony_ci	struct cvmx_rst_power_dbg_s {
22062306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
22162306a36Sopenharmony_ci		uint64_t reserved_3_63:61;
22262306a36Sopenharmony_ci		uint64_t str:3;
22362306a36Sopenharmony_ci#else
22462306a36Sopenharmony_ci		uint64_t str:3;
22562306a36Sopenharmony_ci		uint64_t reserved_3_63:61;
22662306a36Sopenharmony_ci#endif
22762306a36Sopenharmony_ci	} s;
22862306a36Sopenharmony_ci};
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ciunion cvmx_rst_pp_power {
23162306a36Sopenharmony_ci	uint64_t u64;
23262306a36Sopenharmony_ci	struct cvmx_rst_pp_power_s {
23362306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
23462306a36Sopenharmony_ci		uint64_t reserved_48_63:16;
23562306a36Sopenharmony_ci		uint64_t gate:48;
23662306a36Sopenharmony_ci#else
23762306a36Sopenharmony_ci		uint64_t gate:48;
23862306a36Sopenharmony_ci		uint64_t reserved_48_63:16;
23962306a36Sopenharmony_ci#endif
24062306a36Sopenharmony_ci	} s;
24162306a36Sopenharmony_ci	struct cvmx_rst_pp_power_cn70xx {
24262306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
24362306a36Sopenharmony_ci		uint64_t reserved_4_63:60;
24462306a36Sopenharmony_ci		uint64_t gate:4;
24562306a36Sopenharmony_ci#else
24662306a36Sopenharmony_ci		uint64_t gate:4;
24762306a36Sopenharmony_ci		uint64_t reserved_4_63:60;
24862306a36Sopenharmony_ci#endif
24962306a36Sopenharmony_ci	} cn70xx;
25062306a36Sopenharmony_ci};
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_ciunion cvmx_rst_soft_prstx {
25362306a36Sopenharmony_ci	uint64_t u64;
25462306a36Sopenharmony_ci	struct cvmx_rst_soft_prstx_s {
25562306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
25662306a36Sopenharmony_ci		uint64_t reserved_1_63:63;
25762306a36Sopenharmony_ci		uint64_t soft_prst:1;
25862306a36Sopenharmony_ci#else
25962306a36Sopenharmony_ci		uint64_t soft_prst:1;
26062306a36Sopenharmony_ci		uint64_t reserved_1_63:63;
26162306a36Sopenharmony_ci#endif
26262306a36Sopenharmony_ci	} s;
26362306a36Sopenharmony_ci};
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ciunion cvmx_rst_soft_rst {
26662306a36Sopenharmony_ci	uint64_t u64;
26762306a36Sopenharmony_ci	struct cvmx_rst_soft_rst_s {
26862306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
26962306a36Sopenharmony_ci		uint64_t reserved_1_63:63;
27062306a36Sopenharmony_ci		uint64_t soft_rst:1;
27162306a36Sopenharmony_ci#else
27262306a36Sopenharmony_ci		uint64_t soft_rst:1;
27362306a36Sopenharmony_ci		uint64_t reserved_1_63:63;
27462306a36Sopenharmony_ci#endif
27562306a36Sopenharmony_ci	} s;
27662306a36Sopenharmony_ci};
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_ci#endif
279