154293ec3SDavid Daney /***********************license start*************** 254293ec3SDavid Daney * Author: Cavium Networks 354293ec3SDavid Daney * 454293ec3SDavid Daney * Contact: support@caviumnetworks.com 554293ec3SDavid Daney * This file is part of the OCTEON SDK 654293ec3SDavid Daney * 715f68479SSteven J. Hill * Copyright (c) 2003-2017 Cavium, Inc. 854293ec3SDavid Daney * 954293ec3SDavid Daney * This file is free software; you can redistribute it and/or modify 1054293ec3SDavid Daney * it under the terms of the GNU General Public License, Version 2, as 1154293ec3SDavid Daney * published by the Free Software Foundation. 1254293ec3SDavid Daney * 1354293ec3SDavid Daney * This file is distributed in the hope that it will be useful, but 1454293ec3SDavid Daney * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 1554293ec3SDavid Daney * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or 1654293ec3SDavid Daney * NONINFRINGEMENT. See the GNU General Public License for more 1754293ec3SDavid Daney * details. 1854293ec3SDavid Daney * 1954293ec3SDavid Daney * You should have received a copy of the GNU General Public License 2054293ec3SDavid Daney * along with this file; if not, write to the Free Software 2154293ec3SDavid Daney * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2254293ec3SDavid Daney * or visit http://www.gnu.org/licenses/. 2354293ec3SDavid Daney * 2454293ec3SDavid Daney * This file may also be available under a different license from Cavium. 2554293ec3SDavid Daney * Contact Cavium Networks for more information 2654293ec3SDavid Daney ***********************license end**************************************/ 2754293ec3SDavid Daney 2854293ec3SDavid Daney #ifndef __CVMX_L2C_DEFS_H__ 2954293ec3SDavid Daney #define __CVMX_L2C_DEFS_H__ 3054293ec3SDavid Daney 3115f68479SSteven J. Hill #include <uapi/asm/bitfield.h> 3215f68479SSteven J. Hill 33aa32a955SDavid Daney #define CVMX_L2C_DBG (CVMX_ADD_IO_SEG(0x0001180080000030ull)) 3415f68479SSteven J. Hill #define CVMX_L2C_CFG (CVMX_ADD_IO_SEG(0x0001180080000000ull)) 3515f68479SSteven J. Hill #define CVMX_L2C_CTL (CVMX_ADD_IO_SEG(0x0001180080800000ull)) 36*81a67e52SSteven J. Hill #define CVMX_L2C_ERR_TDTX(block_id) \ 37*81a67e52SSteven J. Hill (CVMX_ADD_IO_SEG(0x0001180080A007E0ull) + ((block_id) & 3) * 0x40000ull) 38*81a67e52SSteven J. Hill #define CVMX_L2C_ERR_TTGX(block_id) \ 39*81a67e52SSteven J. Hill (CVMX_ADD_IO_SEG(0x0001180080A007E8ull) + ((block_id) & 3) * 0x40000ull) 40aa32a955SDavid Daney #define CVMX_L2C_LCKBASE (CVMX_ADD_IO_SEG(0x0001180080000058ull)) 41aa32a955SDavid Daney #define CVMX_L2C_LCKOFF (CVMX_ADD_IO_SEG(0x0001180080000060ull)) 4215f68479SSteven J. Hill #define CVMX_L2C_PFCTL (CVMX_ADD_IO_SEG(0x0001180080000090ull)) 4315f68479SSteven J. Hill #define CVMX_L2C_PFCX(offset) (CVMX_ADD_IO_SEG(0x0001180080000098ull) + \ 4415f68479SSteven J. Hill ((offset) & 3) * 8) 45aa32a955SDavid Daney #define CVMX_L2C_PFC0 CVMX_L2C_PFCX(0) 46aa32a955SDavid Daney #define CVMX_L2C_PFC1 CVMX_L2C_PFCX(1) 47aa32a955SDavid Daney #define CVMX_L2C_PFC2 CVMX_L2C_PFCX(2) 48aa32a955SDavid Daney #define CVMX_L2C_PFC3 CVMX_L2C_PFCX(3) 49aa32a955SDavid Daney #define CVMX_L2C_SPAR0 (CVMX_ADD_IO_SEG(0x0001180080000068ull)) 50aa32a955SDavid Daney #define CVMX_L2C_SPAR1 (CVMX_ADD_IO_SEG(0x0001180080000070ull)) 51aa32a955SDavid Daney #define CVMX_L2C_SPAR2 (CVMX_ADD_IO_SEG(0x0001180080000078ull)) 52aa32a955SDavid Daney #define CVMX_L2C_SPAR3 (CVMX_ADD_IO_SEG(0x0001180080000080ull)) 53aa32a955SDavid Daney #define CVMX_L2C_SPAR4 (CVMX_ADD_IO_SEG(0x0001180080000088ull)) 5415f68479SSteven J. Hill #define CVMX_L2C_TADX_PFCX(offset, block_id) \ 5515f68479SSteven J. Hill (CVMX_ADD_IO_SEG(0x0001180080A00400ull) + (((offset) & 3) + \ 5615f68479SSteven J. Hill ((block_id) & 7) * 0x8000ull) * 8) 5715f68479SSteven J. Hill #define CVMX_L2C_TADX_PFC0(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00400ull) + \ 5815f68479SSteven J. Hill ((block_id) & 3) * 0x40000ull) 5915f68479SSteven J. Hill #define CVMX_L2C_TADX_PFC1(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00408ull) + \ 6015f68479SSteven J. Hill ((block_id) & 3) * 0x40000ull) 6115f68479SSteven J. Hill #define CVMX_L2C_TADX_PFC2(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00410ull) + \ 6215f68479SSteven J. Hill ((block_id) & 3) * 0x40000ull) 6315f68479SSteven J. Hill #define CVMX_L2C_TADX_PFC3(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00418ull) + \ 6415f68479SSteven J. Hill ((block_id) & 3) * 0x40000ull) 6515f68479SSteven J. Hill #define CVMX_L2C_TADX_PRF(offset) (CVMX_ADD_IO_SEG(0x0001180080A00008ull) + \ 6615f68479SSteven J. Hill ((offset) & 7) * 0x40000ull) 6715f68479SSteven J. Hill #define CVMX_L2C_TADX_TAG(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00010ull) + \ 6815f68479SSteven J. Hill ((block_id) & 3) * 0x40000ull) 6915f68479SSteven J. Hill #define CVMX_L2C_WPAR_IOBX(offset) (CVMX_ADD_IO_SEG(0x0001180080840200ull) + \ 7015f68479SSteven J. Hill ((offset) & 1) * 8) 7115f68479SSteven J. Hill #define CVMX_L2C_WPAR_PPX(offset) (CVMX_ADD_IO_SEG(0x0001180080840000ull) + \ 7215f68479SSteven J. Hill ((offset) & 31) * 8) 73aa32a955SDavid Daney 74aa32a955SDavid Daney 75*81a67e52SSteven J. Hill union cvmx_l2c_err_tdtx { 76*81a67e52SSteven J. Hill uint64_t u64; 77*81a67e52SSteven J. Hill struct cvmx_l2c_err_tdtx_s { 78*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t dbe:1, 79*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t sbe:1, 80*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t vdbe:1, 81*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t vsbe:1, 82*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t syn:10, 83*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_22_49:28, 84*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t wayidx:18, 85*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_2_3:2, 86*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t type:2, 87*81a67e52SSteven J. Hill ;))))))))) 88*81a67e52SSteven J. Hill } s; 89*81a67e52SSteven J. Hill }; 90*81a67e52SSteven J. Hill 91*81a67e52SSteven J. Hill union cvmx_l2c_err_ttgx { 92*81a67e52SSteven J. Hill uint64_t u64; 93*81a67e52SSteven J. Hill struct cvmx_l2c_err_ttgx_s { 94*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t dbe:1, 95*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t sbe:1, 96*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t noway:1, 97*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_56_60:5, 98*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t syn:6, 99*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_22_49:28, 100*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t wayidx:15, 101*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_2_6:5, 102*81a67e52SSteven J. Hill __BITFIELD_FIELD(uint64_t type:2, 103*81a67e52SSteven J. Hill ;))))))))) 104*81a67e52SSteven J. Hill } s; 105*81a67e52SSteven J. Hill }; 106*81a67e52SSteven J. Hill 10754293ec3SDavid Daney union cvmx_l2c_cfg { 10854293ec3SDavid Daney uint64_t u64; 10954293ec3SDavid Daney struct cvmx_l2c_cfg_s { 11015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_20_63:44, 11115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t bstrun:1, 11215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lbist:1, 11315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t xor_bank:1, 11415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t dpres1:1, 11515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t dpres0:1, 11615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t dfill_dis:1, 11715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t fpexp:4, 11815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t fpempty:1, 11915f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t fpen:1, 12015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t idxalias:1, 12115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t mwf_crd:4, 12215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t rsp_arb_mode:1, 12315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t rfb_arb_mode:1, 12415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lrf_arb_mode:1, 12515f68479SSteven J. Hill ;))))))))))))))) 12654293ec3SDavid Daney } s; 127aa32a955SDavid Daney }; 128aa32a955SDavid Daney 129aa32a955SDavid Daney union cvmx_l2c_ctl { 130aa32a955SDavid Daney uint64_t u64; 131aa32a955SDavid Daney struct cvmx_l2c_ctl_s { 13215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_30_63:34, 13315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t sepcmt:1, 13415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t rdf_fast:1, 13515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t disstgl2i:1, 13615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t l2dfsbe:1, 13715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t l2dfdbe:1, 13815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t discclk:1, 13915f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t maxvab:4, 14015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t maxlfb:4, 14115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t rsp_arb_mode:1, 14215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t xmc_arb_mode:1, 14315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t ef_ena:1, 14415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t ef_cnt:7, 14515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t vab_thresh:4, 14615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t disecc:1, 14715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t disidxalias:1, 14815f68479SSteven J. Hill ;)))))))))))))))) 149c5aa59e8SDavid Daney } s; 150aa32a955SDavid Daney }; 151aa32a955SDavid Daney 15254293ec3SDavid Daney union cvmx_l2c_dbg { 15354293ec3SDavid Daney uint64_t u64; 15454293ec3SDavid Daney struct cvmx_l2c_dbg_s { 15515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_15_63:49, 15615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lfb_enum:4, 15715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lfb_dmp:1, 15815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t ppnum:4, 15915f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t set:3, 16015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t finv:1, 16115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t l2d:1, 16215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t l2t:1, 16315f68479SSteven J. Hill ;)))))))) 16454293ec3SDavid Daney } s; 16554293ec3SDavid Daney }; 16654293ec3SDavid Daney 16754293ec3SDavid Daney union cvmx_l2c_pfctl { 16854293ec3SDavid Daney uint64_t u64; 16954293ec3SDavid Daney struct cvmx_l2c_pfctl_s { 17015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_36_63:28, 17115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt3rdclr:1, 17215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt2rdclr:1, 17315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt1rdclr:1, 17415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt0rdclr:1, 17515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt3ena:1, 17615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt3clr:1, 17715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt3sel:6, 17815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt2ena:1, 17915f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt2clr:1, 18015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt2sel:6, 18115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt1ena:1, 18215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt1clr:1, 18315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt1sel:6, 18415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt0ena:1, 18515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt0clr:1, 18615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt0sel:6, 18715f68479SSteven J. Hill ;))))))))))))))))) 18854293ec3SDavid Daney } s; 189aa32a955SDavid Daney }; 190aa32a955SDavid Daney 191aa32a955SDavid Daney union cvmx_l2c_tadx_prf { 192aa32a955SDavid Daney uint64_t u64; 193aa32a955SDavid Daney struct cvmx_l2c_tadx_prf_s { 19415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_32_63:32, 19515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt3sel:8, 19615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt2sel:8, 19715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt1sel:8, 19815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t cnt0sel:8, 19915f68479SSteven J. Hill ;))))) 200aa32a955SDavid Daney } s; 201aa32a955SDavid Daney }; 202aa32a955SDavid Daney 203aa32a955SDavid Daney union cvmx_l2c_tadx_tag { 204aa32a955SDavid Daney uint64_t u64; 205aa32a955SDavid Daney struct cvmx_l2c_tadx_tag_s { 20615f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_46_63:18, 20715f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t ecc:6, 20815f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_36_39:4, 20915f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t tag:19, 21015f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_4_16:13, 21115f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t use:1, 21215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t valid:1, 21315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t dirty:1, 21415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lock:1, 21515f68479SSteven J. Hill ;))))))))) 216aa32a955SDavid Daney } s; 217aa32a955SDavid Daney }; 218aa32a955SDavid Daney 21915f68479SSteven J. Hill union cvmx_l2c_lckbase { 220aa32a955SDavid Daney uint64_t u64; 22115f68479SSteven J. Hill struct cvmx_l2c_lckbase_s { 22215f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_31_63:33, 22315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lck_base:27, 22415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_1_3:3, 22515f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lck_ena:1, 22615f68479SSteven J. Hill ;)))) 227aa32a955SDavid Daney } s; 228aa32a955SDavid Daney }; 229aa32a955SDavid Daney 23015f68479SSteven J. Hill union cvmx_l2c_lckoff { 231aa32a955SDavid Daney uint64_t u64; 23215f68479SSteven J. Hill struct cvmx_l2c_lckoff_s { 23315f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t reserved_10_63:54, 23415f68479SSteven J. Hill __BITFIELD_FIELD(uint64_t lck_offset:10, 23515f68479SSteven J. Hill ;)) 236c5aa59e8SDavid Daney } s; 237aa32a955SDavid Daney }; 238aa32a955SDavid Daney 23954293ec3SDavid Daney #endif 240