1 /* 2 * Broadcom SiliconBackplane hardware register definitions. 3 * 4 * Copyright (C) 1999-2019, Broadcom. 5 * 6 * Unless you and Broadcom execute a separate written software license 7 * agreement governing use of this software, this software is licensed to you 8 * under the terms of the GNU General Public License version 2 (the "GPL"), 9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 10 * following added to such license: 11 * 12 * As a special exception, the copyright holders of this software give you 13 * permission to link this software with independent modules, and to copy and 14 * distribute the resulting executable under terms of your choice, provided that 15 * you also meet, for each linked independent module, the terms and conditions 16 * of the license of that module. An independent module is a module which is 17 * not derived from this software. The special exception does not apply to any 18 * modifications of the software. 19 * 20 * Notwithstanding the above, under no circumstances may you combine this 21 * software in any way with any other Broadcom software provided under a license 22 * other than the GPL, without Broadcom's express prior written consent. 23 * 24 * 25 * <<Broadcom-WL-IPTag/Open:>> 26 * 27 * $Id: sbconfig.h 654158 2016-08-11 09:30:01Z $ 28 */ 29 30 #ifndef _SBCONFIG_H 31 #define _SBCONFIG_H 32 33 /* cpp contortions to concatenate w/arg prescan */ 34 #ifndef PAD 35 #define _PADLINE(line) pad##line 36 #define _XSTR(line) _PADLINE(line) 37 #define PAD _XSTR(__LINE__) 38 #endif // endif 39 40 /* enumeration in SB is based on the premise that cores are contiguous in the 41 * enumeration space. 42 */ 43 #define SB_BUS_SIZE 0x10000 /**< Each bus gets 64Kbytes for cores */ 44 #define SB_BUS_BASE(sih, b) (SI_ENUM_BASE(sih) + (b)*SB_BUS_SIZE) 45 #define SB_BUS_MAXCORES (SB_BUS_SIZE / SI_CORE_SIZE) /**< Max cores per bus */ 46 47 /* 48 * Sonics Configuration Space Registers. 49 */ 50 #define SBCONFIGOFF 0xf00 /**< core sbconfig regs are top 256bytes of regs */ 51 #define SBCONFIGSIZE 256 /**< sizeof (sbconfig_t) */ 52 53 #define SBIPSFLAG 0x08 54 #define SBTPSFLAG 0x18 55 #define SBTMERRLOGA 0x48 /**< sonics >= 2.3 */ 56 #define SBTMERRLOG 0x50 /**< sonics >= 2.3 */ 57 #define SBADMATCH3 0x60 58 #define SBADMATCH2 0x68 59 #define SBADMATCH1 0x70 60 #define SBIMSTATE 0x90 61 #define SBINTVEC 0x94 62 #define SBTMSTATELOW 0x98 63 #define SBTMSTATEHIGH 0x9c 64 #define SBBWA0 0xa0 65 #define SBIMCONFIGLOW 0xa8 66 #define SBIMCONFIGHIGH 0xac 67 #define SBADMATCH0 0xb0 68 #define SBTMCONFIGLOW 0xb8 69 #define SBTMCONFIGHIGH 0xbc 70 #define SBBCONFIG 0xc0 71 #define SBBSTATE 0xc8 72 #define SBACTCNFG 0xd8 73 #define SBFLAGST 0xe8 74 #define SBIDLOW 0xf8 75 #define SBIDHIGH 0xfc 76 77 /* All the previous registers are above SBCONFIGOFF, but with Sonics 2.3, we 78 * have a few registers *below* that line. I think it would be very confusing to 79 * try and change the value of SBCONFIGOFF, so I'm definig them as absolute 80 * offsets here, 81 */ 82 83 #define SBIMERRLOGA 0xea8 84 #define SBIMERRLOG 0xeb0 85 #define SBTMPORTCONNID0 0xed8 86 #define SBTMPORTLOCK0 0xef8 87 88 #if !defined(_LANGUAGE_ASSEMBLY) && !defined(__ASSEMBLY__) 89 90 typedef volatile struct _sbconfig { 91 uint32 PAD[2]; 92 uint32 sbipsflag; /**< initiator port ocp slave flag */ 93 uint32 PAD[3]; 94 uint32 sbtpsflag; /**< target port ocp slave flag */ 95 uint32 PAD[11]; 96 uint32 sbtmerrloga; /**< (sonics >= 2.3) */ 97 uint32 PAD; 98 uint32 sbtmerrlog; /**< (sonics >= 2.3) */ 99 uint32 PAD[3]; 100 uint32 sbadmatch3; /**< address match3 */ 101 uint32 PAD; 102 uint32 sbadmatch2; /**< address match2 */ 103 uint32 PAD; 104 uint32 sbadmatch1; /**< address match1 */ 105 uint32 PAD[7]; 106 uint32 sbimstate; /**< initiator agent state */ 107 uint32 sbintvec; /**< interrupt mask */ 108 uint32 sbtmstatelow; /**< target state */ 109 uint32 sbtmstatehigh; /**< target state */ 110 uint32 sbbwa0; /**< bandwidth allocation table0 */ 111 uint32 PAD; 112 uint32 sbimconfiglow; /**< initiator configuration */ 113 uint32 sbimconfighigh; /**< initiator configuration */ 114 uint32 sbadmatch0; /**< address match0 */ 115 uint32 PAD; 116 uint32 sbtmconfiglow; /**< target configuration */ 117 uint32 sbtmconfighigh; /**< target configuration */ 118 uint32 sbbconfig; /**< broadcast configuration */ 119 uint32 PAD; 120 uint32 sbbstate; /**< broadcast state */ 121 uint32 PAD[3]; 122 uint32 sbactcnfg; /**< activate configuration */ 123 uint32 PAD[3]; 124 uint32 sbflagst; /**< current sbflags */ 125 uint32 PAD[3]; 126 uint32 sbidlow; /**< identification */ 127 uint32 sbidhigh; /**< identification */ 128 } sbconfig_t; 129 130 #endif /* !_LANGUAGE_ASSEMBLY && !__ASSEMBLY__ */ 131 132 /* sbipsflag */ 133 #define SBIPS_INT1_MASK \ 134 0x3f /**< which sbflags get routed to mips interrupt 1 */ 135 #define SBIPS_INT1_SHIFT 0 136 #define SBIPS_INT2_MASK \ 137 0x3f00 /**< which sbflags get routed to mips interrupt 2 */ 138 #define SBIPS_INT2_SHIFT 8 139 #define SBIPS_INT3_MASK \ 140 0x3f0000 /**< which sbflags get routed to mips interrupt 3 */ 141 #define SBIPS_INT3_SHIFT 16 142 #define SBIPS_INT4_MASK \ 143 0x3f000000 /**< which sbflags get routed to mips interrupt 4 */ 144 #define SBIPS_INT4_SHIFT 24 145 146 /* sbtpsflag */ 147 #define SBTPS_NUM0_MASK 0x3f /**< interrupt sbFlag # generated by this core */ 148 #define SBTPS_F0EN0 0x40 /**< interrupt is always sent on the backplane */ 149 150 /* sbtmerrlog */ 151 #define SBTMEL_CM 0x00000007 /**< command */ 152 #define SBTMEL_CI 0x0000ff00 /**< connection id */ 153 #define SBTMEL_EC 0x0f000000 /**< error code */ 154 #define SBTMEL_ME 0x80000000 /**< multiple error */ 155 156 /* sbimstate */ 157 #define SBIM_PC 0xf /**< pipecount */ 158 #define SBIM_AP_MASK 0x30 /**< arbitration policy */ 159 #define SBIM_AP_BOTH 0x00 /**< use both timeslaces and token */ 160 #define SBIM_AP_TS 0x10 /**< use timesliaces only */ 161 #define SBIM_AP_TK 0x20 /**< use token only */ 162 #define SBIM_AP_RSV 0x30 /**< reserved */ 163 #define SBIM_IBE 0x20000 /**< inbanderror */ 164 #define SBIM_TO 0x40000 /**< timeout */ 165 #define SBIM_BY 0x01800000 /**< busy (sonics >= 2.3) */ 166 #define SBIM_RJ 0x02000000 /**< reject (sonics >= 2.3) */ 167 168 /* sbtmstatelow */ 169 #define SBTML_RESET 0x0001 /**< reset */ 170 #define SBTML_REJ_MASK 0x0006 /**< reject field */ 171 #define SBTML_REJ 0x0002 /**< reject */ 172 #define SBTML_TMPREJ 0x0004 /**< temporary reject, for error recovery */ 173 174 #define SBTML_SICF_SHIFT \ 175 16 /**< Shift to locate the SI control flags in sbtml */ 176 177 /* sbtmstatehigh */ 178 #define SBTMH_SERR 0x0001 /**< serror */ 179 #define SBTMH_INT 0x0002 /**< interrupt */ 180 #define SBTMH_BUSY 0x0004 /**< busy */ 181 #define SBTMH_TO 0x0020 /**< timeout (sonics >= 2.3) */ 182 183 #define SBTMH_SISF_SHIFT 16 /**< Shift to locate the SI status flags in sbtmh \ 184 */ 185 186 /* sbbwa0 */ 187 #define SBBWA_TAB0_MASK 0xffff /**< lookup table 0 */ 188 #define SBBWA_TAB1_MASK 0xffff /**< lookup table 1 */ 189 #define SBBWA_TAB1_SHIFT 16 190 191 /* sbimconfiglow */ 192 #define SBIMCL_STO_MASK 0x7 /**< service timeout */ 193 #define SBIMCL_RTO_MASK 0x70 /**< request timeout */ 194 #define SBIMCL_RTO_SHIFT 4 195 #define SBIMCL_CID_MASK 0xff0000 /**< connection id */ 196 #define SBIMCL_CID_SHIFT 16 197 198 /* sbimconfighigh */ 199 #define SBIMCH_IEM_MASK 0xc /**< inband error mode */ 200 #define SBIMCH_TEM_MASK 0x30 /**< timeout error mode */ 201 #define SBIMCH_TEM_SHIFT 4 202 #define SBIMCH_BEM_MASK 0xc0 /**< bus error mode */ 203 #define SBIMCH_BEM_SHIFT 6 204 205 /* sbadmatch0 */ 206 #define SBAM_TYPE_MASK 0x3 /**< address type */ 207 #define SBAM_AD64 0x4 /**< reserved */ 208 #define SBAM_ADINT0_MASK 0xf8 /**< type0 size */ 209 #define SBAM_ADINT0_SHIFT 3 210 #define SBAM_ADINT1_MASK 0x1f8 /**< type1 size */ 211 #define SBAM_ADINT1_SHIFT 3 212 #define SBAM_ADINT2_MASK 0x1f8 /**< type2 size */ 213 #define SBAM_ADINT2_SHIFT 3 214 #define SBAM_ADEN 0x400 /**< enable */ 215 #define SBAM_ADNEG 0x800 /**< negative decode */ 216 #define SBAM_BASE0_MASK 0xffffff00 /**< type0 base address */ 217 #define SBAM_BASE0_SHIFT 8 218 #define SBAM_BASE1_MASK 0xfffff000 /**< type1 base address for the core */ 219 #define SBAM_BASE1_SHIFT 12 220 #define SBAM_BASE2_MASK 0xffff0000 /**< type2 base address for the core */ 221 #define SBAM_BASE2_SHIFT 16 222 223 /* sbtmconfiglow */ 224 #define SBTMCL_CD_MASK 0xff /**< clock divide */ 225 #define SBTMCL_CO_MASK 0xf800 /**< clock offset */ 226 #define SBTMCL_CO_SHIFT 11 227 #define SBTMCL_IF_MASK 0xfc0000 /**< interrupt flags */ 228 #define SBTMCL_IF_SHIFT 18 229 #define SBTMCL_IM_MASK 0x3000000 /**< interrupt mode */ 230 #define SBTMCL_IM_SHIFT 24 231 232 /* sbtmconfighigh */ 233 #define SBTMCH_BM_MASK 0x3 /**< busy mode */ 234 #define SBTMCH_RM_MASK 0x3 /**< retry mode */ 235 #define SBTMCH_RM_SHIFT 2 236 #define SBTMCH_SM_MASK 0x30 /**< stop mode */ 237 #define SBTMCH_SM_SHIFT 4 238 #define SBTMCH_EM_MASK 0x300 /**< sb error mode */ 239 #define SBTMCH_EM_SHIFT 8 240 #define SBTMCH_IM_MASK 0xc00 /**< int mode */ 241 #define SBTMCH_IM_SHIFT 10 242 243 /* sbbconfig */ 244 #define SBBC_LAT_MASK 0x3 /**< sb latency */ 245 #define SBBC_MAX0_MASK 0xf0000 /**< maxccntr0 */ 246 #define SBBC_MAX0_SHIFT 16 247 #define SBBC_MAX1_MASK 0xf00000 /**< maxccntr1 */ 248 #define SBBC_MAX1_SHIFT 20 249 250 /* sbbstate */ 251 #define SBBS_SRD 0x1 /**< st reg disable */ 252 #define SBBS_HRD 0x2 /**< hold reg disable */ 253 254 /* sbidlow */ 255 #define SBIDL_CS_MASK 0x3 /**< config space */ 256 #define SBIDL_AR_MASK 0x38 /**< # address ranges supported */ 257 #define SBIDL_AR_SHIFT 3 258 #define SBIDL_SYNCH 0x40 /**< sync */ 259 #define SBIDL_INIT 0x80 /**< initiator */ 260 #define SBIDL_MINLAT_MASK 0xf00 /**< minimum backplane latency */ 261 #define SBIDL_MINLAT_SHIFT 8 262 #define SBIDL_MAXLAT 0xf000 /**< maximum backplane latency */ 263 #define SBIDL_MAXLAT_SHIFT 12 264 #define SBIDL_FIRST 0x10000 /**< this initiator is first */ 265 #define SBIDL_CW_MASK 0xc0000 /**< cycle counter width */ 266 #define SBIDL_CW_SHIFT 18 267 #define SBIDL_TP_MASK 0xf00000 /**< target ports */ 268 #define SBIDL_TP_SHIFT 20 269 #define SBIDL_IP_MASK 0xf000000 /**< initiator ports */ 270 #define SBIDL_IP_SHIFT 24 271 #define SBIDL_RV_MASK 0xf0000000 /**< sonics backplane revision code */ 272 #define SBIDL_RV_SHIFT 28 273 #define SBIDL_RV_2_2 0x00000000 /**< version 2.2 or earlier */ 274 #define SBIDL_RV_2_3 0x10000000 /**< version 2.3 */ 275 276 /* sbidhigh */ 277 #define SBIDH_RC_MASK 0x000f /**< revision code */ 278 #define SBIDH_RCE_MASK 0x7000 /**< revision code extension field */ 279 #define SBIDH_RCE_SHIFT 8 280 #define SBCOREREV(sbidh) \ 281 ((((sbidh)&SBIDH_RCE_MASK) >> SBIDH_RCE_SHIFT) | ((sbidh)&SBIDH_RC_MASK)) 282 #define SBIDH_CC_MASK 0x8ff0 /**< core code */ 283 #define SBIDH_CC_SHIFT 4 284 #define SBIDH_VC_MASK 0xffff0000 /**< vendor code */ 285 #define SBIDH_VC_SHIFT 16 286 287 #define SB_COMMIT 0xfd8 /**< update buffered registers value */ 288 289 /* vendor codes */ 290 #define SB_VEND_BCM 0x4243 /**< Broadcom's SB vendor code */ 291 292 #endif /* _SBCONFIG_H */ 293