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-2017 Cavium, Inc.
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_L2C_DEFS_H__
298c2ecf20Sopenharmony_ci#define __CVMX_L2C_DEFS_H__
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#include <uapi/asm/bitfield.h>
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define CVMX_L2C_DBG (CVMX_ADD_IO_SEG(0x0001180080000030ull))
348c2ecf20Sopenharmony_ci#define CVMX_L2C_CFG (CVMX_ADD_IO_SEG(0x0001180080000000ull))
358c2ecf20Sopenharmony_ci#define CVMX_L2C_CTL (CVMX_ADD_IO_SEG(0x0001180080800000ull))
368c2ecf20Sopenharmony_ci#define CVMX_L2C_ERR_TDTX(block_id)					       \
378c2ecf20Sopenharmony_ci	(CVMX_ADD_IO_SEG(0x0001180080A007E0ull) + ((block_id) & 3) * 0x40000ull)
388c2ecf20Sopenharmony_ci#define CVMX_L2C_ERR_TTGX(block_id)					       \
398c2ecf20Sopenharmony_ci	(CVMX_ADD_IO_SEG(0x0001180080A007E8ull) + ((block_id) & 3) * 0x40000ull)
408c2ecf20Sopenharmony_ci#define CVMX_L2C_LCKBASE (CVMX_ADD_IO_SEG(0x0001180080000058ull))
418c2ecf20Sopenharmony_ci#define CVMX_L2C_LCKOFF (CVMX_ADD_IO_SEG(0x0001180080000060ull))
428c2ecf20Sopenharmony_ci#define CVMX_L2C_PFCTL (CVMX_ADD_IO_SEG(0x0001180080000090ull))
438c2ecf20Sopenharmony_ci#define CVMX_L2C_PFCX(offset) (CVMX_ADD_IO_SEG(0x0001180080000098ull) +	       \
448c2ecf20Sopenharmony_ci		((offset) & 3) * 8)
458c2ecf20Sopenharmony_ci#define CVMX_L2C_PFC0 CVMX_L2C_PFCX(0)
468c2ecf20Sopenharmony_ci#define CVMX_L2C_PFC1 CVMX_L2C_PFCX(1)
478c2ecf20Sopenharmony_ci#define CVMX_L2C_PFC2 CVMX_L2C_PFCX(2)
488c2ecf20Sopenharmony_ci#define CVMX_L2C_PFC3 CVMX_L2C_PFCX(3)
498c2ecf20Sopenharmony_ci#define CVMX_L2C_SPAR0 (CVMX_ADD_IO_SEG(0x0001180080000068ull))
508c2ecf20Sopenharmony_ci#define CVMX_L2C_SPAR1 (CVMX_ADD_IO_SEG(0x0001180080000070ull))
518c2ecf20Sopenharmony_ci#define CVMX_L2C_SPAR2 (CVMX_ADD_IO_SEG(0x0001180080000078ull))
528c2ecf20Sopenharmony_ci#define CVMX_L2C_SPAR3 (CVMX_ADD_IO_SEG(0x0001180080000080ull))
538c2ecf20Sopenharmony_ci#define CVMX_L2C_SPAR4 (CVMX_ADD_IO_SEG(0x0001180080000088ull))
548c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PFCX(offset, block_id)				       \
558c2ecf20Sopenharmony_ci		(CVMX_ADD_IO_SEG(0x0001180080A00400ull) + (((offset) & 3) +    \
568c2ecf20Sopenharmony_ci		((block_id) & 7) * 0x8000ull) * 8)
578c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PFC0(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00400ull) + \
588c2ecf20Sopenharmony_ci		((block_id) & 3) * 0x40000ull)
598c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PFC1(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00408ull) + \
608c2ecf20Sopenharmony_ci		((block_id) & 3) * 0x40000ull)
618c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PFC2(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00410ull) + \
628c2ecf20Sopenharmony_ci		((block_id) & 3) * 0x40000ull)
638c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PFC3(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00418ull) + \
648c2ecf20Sopenharmony_ci		((block_id) & 3) * 0x40000ull)
658c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_PRF(offset) (CVMX_ADD_IO_SEG(0x0001180080A00008ull)    + \
668c2ecf20Sopenharmony_ci		((offset) & 7) * 0x40000ull)
678c2ecf20Sopenharmony_ci#define CVMX_L2C_TADX_TAG(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00010ull)  + \
688c2ecf20Sopenharmony_ci		((block_id) & 3) * 0x40000ull)
698c2ecf20Sopenharmony_ci#define CVMX_L2C_WPAR_IOBX(offset) (CVMX_ADD_IO_SEG(0x0001180080840200ull)   + \
708c2ecf20Sopenharmony_ci		((offset) & 1) * 8)
718c2ecf20Sopenharmony_ci#define CVMX_L2C_WPAR_PPX(offset) (CVMX_ADD_IO_SEG(0x0001180080840000ull)    + \
728c2ecf20Sopenharmony_ci		((offset) & 31) * 8)
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciunion cvmx_l2c_err_tdtx {
768c2ecf20Sopenharmony_ci	uint64_t u64;
778c2ecf20Sopenharmony_ci	struct cvmx_l2c_err_tdtx_s {
788c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dbe:1,
798c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t sbe:1,
808c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t vdbe:1,
818c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t vsbe:1,
828c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t syn:10,
838c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_22_49:28,
848c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t wayidx:18,
858c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_2_3:2,
868c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t type:2,
878c2ecf20Sopenharmony_ci		;)))))))))
888c2ecf20Sopenharmony_ci	} s;
898c2ecf20Sopenharmony_ci};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciunion cvmx_l2c_err_ttgx {
928c2ecf20Sopenharmony_ci	uint64_t u64;
938c2ecf20Sopenharmony_ci	struct cvmx_l2c_err_ttgx_s {
948c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dbe:1,
958c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t sbe:1,
968c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t noway:1,
978c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_56_60:5,
988c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t syn:6,
998c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_22_49:28,
1008c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t wayidx:15,
1018c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_2_6:5,
1028c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t type:2,
1038c2ecf20Sopenharmony_ci		;)))))))))
1048c2ecf20Sopenharmony_ci	} s;
1058c2ecf20Sopenharmony_ci};
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ciunion cvmx_l2c_cfg {
1088c2ecf20Sopenharmony_ci	uint64_t u64;
1098c2ecf20Sopenharmony_ci	struct cvmx_l2c_cfg_s {
1108c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_20_63:44,
1118c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t bstrun:1,
1128c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lbist:1,
1138c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t xor_bank:1,
1148c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dpres1:1,
1158c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dpres0:1,
1168c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dfill_dis:1,
1178c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t fpexp:4,
1188c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t fpempty:1,
1198c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t fpen:1,
1208c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t idxalias:1,
1218c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t mwf_crd:4,
1228c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t rsp_arb_mode:1,
1238c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t rfb_arb_mode:1,
1248c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lrf_arb_mode:1,
1258c2ecf20Sopenharmony_ci		;)))))))))))))))
1268c2ecf20Sopenharmony_ci	} s;
1278c2ecf20Sopenharmony_ci};
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ciunion cvmx_l2c_ctl {
1308c2ecf20Sopenharmony_ci	uint64_t u64;
1318c2ecf20Sopenharmony_ci	struct cvmx_l2c_ctl_s {
1328c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_30_63:34,
1338c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t sepcmt:1,
1348c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t rdf_fast:1,
1358c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t disstgl2i:1,
1368c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t l2dfsbe:1,
1378c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t l2dfdbe:1,
1388c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t discclk:1,
1398c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t maxvab:4,
1408c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t maxlfb:4,
1418c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t rsp_arb_mode:1,
1428c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t xmc_arb_mode:1,
1438c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t ef_ena:1,
1448c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t ef_cnt:7,
1458c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t vab_thresh:4,
1468c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t disecc:1,
1478c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t disidxalias:1,
1488c2ecf20Sopenharmony_ci		;))))))))))))))))
1498c2ecf20Sopenharmony_ci	} s;
1508c2ecf20Sopenharmony_ci};
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ciunion cvmx_l2c_dbg {
1538c2ecf20Sopenharmony_ci	uint64_t u64;
1548c2ecf20Sopenharmony_ci	struct cvmx_l2c_dbg_s {
1558c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_15_63:49,
1568c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lfb_enum:4,
1578c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lfb_dmp:1,
1588c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t ppnum:4,
1598c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t set:3,
1608c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t finv:1,
1618c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t l2d:1,
1628c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t l2t:1,
1638c2ecf20Sopenharmony_ci		;))))))))
1648c2ecf20Sopenharmony_ci	} s;
1658c2ecf20Sopenharmony_ci};
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ciunion cvmx_l2c_pfctl {
1688c2ecf20Sopenharmony_ci	uint64_t u64;
1698c2ecf20Sopenharmony_ci	struct cvmx_l2c_pfctl_s {
1708c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_36_63:28,
1718c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt3rdclr:1,
1728c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt2rdclr:1,
1738c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt1rdclr:1,
1748c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt0rdclr:1,
1758c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt3ena:1,
1768c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt3clr:1,
1778c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt3sel:6,
1788c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt2ena:1,
1798c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt2clr:1,
1808c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt2sel:6,
1818c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt1ena:1,
1828c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt1clr:1,
1838c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt1sel:6,
1848c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt0ena:1,
1858c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt0clr:1,
1868c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt0sel:6,
1878c2ecf20Sopenharmony_ci		;)))))))))))))))))
1888c2ecf20Sopenharmony_ci	} s;
1898c2ecf20Sopenharmony_ci};
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ciunion cvmx_l2c_tadx_prf {
1928c2ecf20Sopenharmony_ci	uint64_t u64;
1938c2ecf20Sopenharmony_ci	struct cvmx_l2c_tadx_prf_s {
1948c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_32_63:32,
1958c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt3sel:8,
1968c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt2sel:8,
1978c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt1sel:8,
1988c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t cnt0sel:8,
1998c2ecf20Sopenharmony_ci		;)))))
2008c2ecf20Sopenharmony_ci	} s;
2018c2ecf20Sopenharmony_ci};
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ciunion cvmx_l2c_tadx_tag {
2048c2ecf20Sopenharmony_ci	uint64_t u64;
2058c2ecf20Sopenharmony_ci	struct cvmx_l2c_tadx_tag_s {
2068c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_46_63:18,
2078c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t ecc:6,
2088c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_36_39:4,
2098c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t tag:19,
2108c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_4_16:13,
2118c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t use:1,
2128c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t valid:1,
2138c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t dirty:1,
2148c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lock:1,
2158c2ecf20Sopenharmony_ci		;)))))))))
2168c2ecf20Sopenharmony_ci	} s;
2178c2ecf20Sopenharmony_ci};
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ciunion cvmx_l2c_lckbase {
2208c2ecf20Sopenharmony_ci	uint64_t u64;
2218c2ecf20Sopenharmony_ci	struct cvmx_l2c_lckbase_s {
2228c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_31_63:33,
2238c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lck_base:27,
2248c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_1_3:3,
2258c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lck_ena:1,
2268c2ecf20Sopenharmony_ci		;))))
2278c2ecf20Sopenharmony_ci	} s;
2288c2ecf20Sopenharmony_ci};
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ciunion cvmx_l2c_lckoff {
2318c2ecf20Sopenharmony_ci	uint64_t u64;
2328c2ecf20Sopenharmony_ci	struct cvmx_l2c_lckoff_s {
2338c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t reserved_10_63:54,
2348c2ecf20Sopenharmony_ci		__BITFIELD_FIELD(uint64_t lck_offset:10,
2358c2ecf20Sopenharmony_ci		;))
2368c2ecf20Sopenharmony_ci	} s;
2378c2ecf20Sopenharmony_ci};
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci#endif
240