1 /***********************license start*************** 2 * Author: Cavium Networks 3 * 4 * Contact: support@caviumnetworks.com 5 * This file is part of the OCTEON SDK 6 * 7 * Copyright (c) 2003-2017 Cavium, Inc. 8 * 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. 12 * 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 17 * details. 18 * 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/. 23 * 24 * This file may also be available under a different license from Cavium. 25 * Contact Cavium Networks for more information 26 ***********************license end**************************************/ 27 28 #ifndef __CVMX_L2C_DEFS_H__ 29 #define __CVMX_L2C_DEFS_H__ 30 31 #include <uapi/asm/bitfield.h> 32 33 #define CVMX_L2C_DBG (CVMX_ADD_IO_SEG(0x0001180080000030ull)) 34 #define CVMX_L2C_CFG (CVMX_ADD_IO_SEG(0x0001180080000000ull)) 35 #define CVMX_L2C_CTL (CVMX_ADD_IO_SEG(0x0001180080800000ull)) 36 #define CVMX_L2C_LCKBASE (CVMX_ADD_IO_SEG(0x0001180080000058ull)) 37 #define CVMX_L2C_LCKOFF (CVMX_ADD_IO_SEG(0x0001180080000060ull)) 38 #define CVMX_L2C_PFCTL (CVMX_ADD_IO_SEG(0x0001180080000090ull)) 39 #define CVMX_L2C_PFCX(offset) (CVMX_ADD_IO_SEG(0x0001180080000098ull) + \ 40 ((offset) & 3) * 8) 41 #define CVMX_L2C_PFC0 CVMX_L2C_PFCX(0) 42 #define CVMX_L2C_PFC1 CVMX_L2C_PFCX(1) 43 #define CVMX_L2C_PFC2 CVMX_L2C_PFCX(2) 44 #define CVMX_L2C_PFC3 CVMX_L2C_PFCX(3) 45 #define CVMX_L2C_SPAR0 (CVMX_ADD_IO_SEG(0x0001180080000068ull)) 46 #define CVMX_L2C_SPAR1 (CVMX_ADD_IO_SEG(0x0001180080000070ull)) 47 #define CVMX_L2C_SPAR2 (CVMX_ADD_IO_SEG(0x0001180080000078ull)) 48 #define CVMX_L2C_SPAR3 (CVMX_ADD_IO_SEG(0x0001180080000080ull)) 49 #define CVMX_L2C_SPAR4 (CVMX_ADD_IO_SEG(0x0001180080000088ull)) 50 #define CVMX_L2C_TADX_PFCX(offset, block_id) \ 51 (CVMX_ADD_IO_SEG(0x0001180080A00400ull) + (((offset) & 3) + \ 52 ((block_id) & 7) * 0x8000ull) * 8) 53 #define CVMX_L2C_TADX_PFC0(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00400ull) + \ 54 ((block_id) & 3) * 0x40000ull) 55 #define CVMX_L2C_TADX_PFC1(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00408ull) + \ 56 ((block_id) & 3) * 0x40000ull) 57 #define CVMX_L2C_TADX_PFC2(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00410ull) + \ 58 ((block_id) & 3) * 0x40000ull) 59 #define CVMX_L2C_TADX_PFC3(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00418ull) + \ 60 ((block_id) & 3) * 0x40000ull) 61 #define CVMX_L2C_TADX_PRF(offset) (CVMX_ADD_IO_SEG(0x0001180080A00008ull) + \ 62 ((offset) & 7) * 0x40000ull) 63 #define CVMX_L2C_TADX_TAG(block_id) (CVMX_ADD_IO_SEG(0x0001180080A00010ull) + \ 64 ((block_id) & 3) * 0x40000ull) 65 #define CVMX_L2C_WPAR_IOBX(offset) (CVMX_ADD_IO_SEG(0x0001180080840200ull) + \ 66 ((offset) & 1) * 8) 67 #define CVMX_L2C_WPAR_PPX(offset) (CVMX_ADD_IO_SEG(0x0001180080840000ull) + \ 68 ((offset) & 31) * 8) 69 #define CVMX_L2D_FUS3 (CVMX_ADD_IO_SEG(0x00011800800007B8ull)) 70 71 72 union cvmx_l2c_cfg { 73 uint64_t u64; 74 struct cvmx_l2c_cfg_s { 75 __BITFIELD_FIELD(uint64_t reserved_20_63:44, 76 __BITFIELD_FIELD(uint64_t bstrun:1, 77 __BITFIELD_FIELD(uint64_t lbist:1, 78 __BITFIELD_FIELD(uint64_t xor_bank:1, 79 __BITFIELD_FIELD(uint64_t dpres1:1, 80 __BITFIELD_FIELD(uint64_t dpres0:1, 81 __BITFIELD_FIELD(uint64_t dfill_dis:1, 82 __BITFIELD_FIELD(uint64_t fpexp:4, 83 __BITFIELD_FIELD(uint64_t fpempty:1, 84 __BITFIELD_FIELD(uint64_t fpen:1, 85 __BITFIELD_FIELD(uint64_t idxalias:1, 86 __BITFIELD_FIELD(uint64_t mwf_crd:4, 87 __BITFIELD_FIELD(uint64_t rsp_arb_mode:1, 88 __BITFIELD_FIELD(uint64_t rfb_arb_mode:1, 89 __BITFIELD_FIELD(uint64_t lrf_arb_mode:1, 90 ;))))))))))))))) 91 } s; 92 }; 93 94 union cvmx_l2c_ctl { 95 uint64_t u64; 96 struct cvmx_l2c_ctl_s { 97 __BITFIELD_FIELD(uint64_t reserved_30_63:34, 98 __BITFIELD_FIELD(uint64_t sepcmt:1, 99 __BITFIELD_FIELD(uint64_t rdf_fast:1, 100 __BITFIELD_FIELD(uint64_t disstgl2i:1, 101 __BITFIELD_FIELD(uint64_t l2dfsbe:1, 102 __BITFIELD_FIELD(uint64_t l2dfdbe:1, 103 __BITFIELD_FIELD(uint64_t discclk:1, 104 __BITFIELD_FIELD(uint64_t maxvab:4, 105 __BITFIELD_FIELD(uint64_t maxlfb:4, 106 __BITFIELD_FIELD(uint64_t rsp_arb_mode:1, 107 __BITFIELD_FIELD(uint64_t xmc_arb_mode:1, 108 __BITFIELD_FIELD(uint64_t ef_ena:1, 109 __BITFIELD_FIELD(uint64_t ef_cnt:7, 110 __BITFIELD_FIELD(uint64_t vab_thresh:4, 111 __BITFIELD_FIELD(uint64_t disecc:1, 112 __BITFIELD_FIELD(uint64_t disidxalias:1, 113 ;)))))))))))))))) 114 } s; 115 }; 116 117 union cvmx_l2c_dbg { 118 uint64_t u64; 119 struct cvmx_l2c_dbg_s { 120 __BITFIELD_FIELD(uint64_t reserved_15_63:49, 121 __BITFIELD_FIELD(uint64_t lfb_enum:4, 122 __BITFIELD_FIELD(uint64_t lfb_dmp:1, 123 __BITFIELD_FIELD(uint64_t ppnum:4, 124 __BITFIELD_FIELD(uint64_t set:3, 125 __BITFIELD_FIELD(uint64_t finv:1, 126 __BITFIELD_FIELD(uint64_t l2d:1, 127 __BITFIELD_FIELD(uint64_t l2t:1, 128 ;)))))))) 129 } s; 130 }; 131 132 union cvmx_l2c_pfctl { 133 uint64_t u64; 134 struct cvmx_l2c_pfctl_s { 135 __BITFIELD_FIELD(uint64_t reserved_36_63:28, 136 __BITFIELD_FIELD(uint64_t cnt3rdclr:1, 137 __BITFIELD_FIELD(uint64_t cnt2rdclr:1, 138 __BITFIELD_FIELD(uint64_t cnt1rdclr:1, 139 __BITFIELD_FIELD(uint64_t cnt0rdclr:1, 140 __BITFIELD_FIELD(uint64_t cnt3ena:1, 141 __BITFIELD_FIELD(uint64_t cnt3clr:1, 142 __BITFIELD_FIELD(uint64_t cnt3sel:6, 143 __BITFIELD_FIELD(uint64_t cnt2ena:1, 144 __BITFIELD_FIELD(uint64_t cnt2clr:1, 145 __BITFIELD_FIELD(uint64_t cnt2sel:6, 146 __BITFIELD_FIELD(uint64_t cnt1ena:1, 147 __BITFIELD_FIELD(uint64_t cnt1clr:1, 148 __BITFIELD_FIELD(uint64_t cnt1sel:6, 149 __BITFIELD_FIELD(uint64_t cnt0ena:1, 150 __BITFIELD_FIELD(uint64_t cnt0clr:1, 151 __BITFIELD_FIELD(uint64_t cnt0sel:6, 152 ;))))))))))))))))) 153 } s; 154 }; 155 156 union cvmx_l2c_tadx_prf { 157 uint64_t u64; 158 struct cvmx_l2c_tadx_prf_s { 159 __BITFIELD_FIELD(uint64_t reserved_32_63:32, 160 __BITFIELD_FIELD(uint64_t cnt3sel:8, 161 __BITFIELD_FIELD(uint64_t cnt2sel:8, 162 __BITFIELD_FIELD(uint64_t cnt1sel:8, 163 __BITFIELD_FIELD(uint64_t cnt0sel:8, 164 ;))))) 165 } s; 166 }; 167 168 union cvmx_l2c_tadx_tag { 169 uint64_t u64; 170 struct cvmx_l2c_tadx_tag_s { 171 __BITFIELD_FIELD(uint64_t reserved_46_63:18, 172 __BITFIELD_FIELD(uint64_t ecc:6, 173 __BITFIELD_FIELD(uint64_t reserved_36_39:4, 174 __BITFIELD_FIELD(uint64_t tag:19, 175 __BITFIELD_FIELD(uint64_t reserved_4_16:13, 176 __BITFIELD_FIELD(uint64_t use:1, 177 __BITFIELD_FIELD(uint64_t valid:1, 178 __BITFIELD_FIELD(uint64_t dirty:1, 179 __BITFIELD_FIELD(uint64_t lock:1, 180 ;))))))))) 181 } s; 182 }; 183 184 union cvmx_l2c_lckbase { 185 uint64_t u64; 186 struct cvmx_l2c_lckbase_s { 187 __BITFIELD_FIELD(uint64_t reserved_31_63:33, 188 __BITFIELD_FIELD(uint64_t lck_base:27, 189 __BITFIELD_FIELD(uint64_t reserved_1_3:3, 190 __BITFIELD_FIELD(uint64_t lck_ena:1, 191 ;)))) 192 } s; 193 }; 194 195 union cvmx_l2c_lckoff { 196 uint64_t u64; 197 struct cvmx_l2c_lckoff_s { 198 __BITFIELD_FIELD(uint64_t reserved_10_63:54, 199 __BITFIELD_FIELD(uint64_t lck_offset:10, 200 ;)) 201 } s; 202 }; 203 204 #endif 205