| 1 | #ifndef __BDK_CSRS_MIO_TWS_H__ |
| 2 | #define __BDK_CSRS_MIO_TWS_H__ |
| 3 | /* This file is auto-generated. Do not edit */ |
| 4 | |
| 5 | /***********************license start*************** |
| 6 | * Copyright (c) 2003-2017 Cavium Inc. ([email protected]). All rights |
| 7 | * reserved. |
| 8 | * |
| 9 | * |
| 10 | * Redistribution and use in source and binary forms, with or without |
| 11 | * modification, are permitted provided that the following conditions are |
| 12 | * met: |
| 13 | * |
| 14 | * * Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions and the following disclaimer. |
| 16 | * |
| 17 | * * Redistributions in binary form must reproduce the above |
| 18 | * copyright notice, this list of conditions and the following |
| 19 | * disclaimer in the documentation and/or other materials provided |
| 20 | * with the distribution. |
| 21 | |
| 22 | * * Neither the name of Cavium Inc. nor the names of |
| 23 | * its contributors may be used to endorse or promote products |
| 24 | * derived from this software without specific prior written |
| 25 | * permission. |
| 26 | |
| 27 | * This Software, including technical data, may be subject to U.S. export control |
| 28 | * laws, including the U.S. Export Administration Act and its associated |
| 29 | * regulations, and may be subject to export or import regulations in other |
| 30 | * countries. |
| 31 | |
| 32 | * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
| 33 | * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR |
| 34 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
| 35 | * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR |
| 36 | * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM |
| 37 | * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, |
| 38 | * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF |
| 39 | * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR |
| 40 | * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR |
| 41 | * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. |
| 42 | ***********************license end**************************************/ |
| 43 | |
| 44 | |
| 45 | /** |
| 46 | * @file |
| 47 | * |
| 48 | * Configuration and status register (CSR) address and type definitions for |
| 49 | * Cavium MIO_TWS. |
| 50 | * |
| 51 | * This file is auto generated. Do not edit. |
| 52 | * |
| 53 | */ |
| 54 | |
| 55 | /** |
| 56 | * Enumeration mio_tws_bar_e |
| 57 | * |
| 58 | * TWSI Base Address Register Enumeration |
| 59 | * Enumerates the base address registers. |
| 60 | */ |
| 61 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR0_CN8(a) (0x87e0d0000000ll + 0x1000000ll * (a)) |
| 62 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR0_CN8_SIZE 0x800000ull |
| 63 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR0_CN9(a) (0x87e0d0000000ll + 0x1000000ll * (a)) |
| 64 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR0_CN9_SIZE 0x10000ull |
| 65 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR4(a) (0x87e0d0f00000ll + 0x1000000ll * (a)) |
| 66 | #define BDK_MIO_TWS_BAR_E_MIO_TWSX_PF_BAR4_SIZE 0x100000ull |
| 67 | |
| 68 | /** |
| 69 | * Enumeration mio_tws_int_vec_e |
| 70 | * |
| 71 | * TWSI MSI-X Vector Enumeration |
| 72 | * Enumerates the MSI-X interrupt vectors. |
| 73 | */ |
| 74 | #define BDK_MIO_TWS_INT_VEC_E_INT_ST (0) |
| 75 | |
| 76 | /** |
| 77 | * Register (RSL) mio_tws#_access_wdog |
| 78 | * |
| 79 | * TWSI Watch Dog Register |
| 80 | * This register contains the watch dog control register. |
| 81 | */ |
| 82 | union bdk_mio_twsx_access_wdog |
| 83 | { |
| 84 | uint64_t u; |
| 85 | struct bdk_mio_twsx_access_wdog_s |
| 86 | { |
| 87 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 88 | uint64_t reserved_32_63 : 32; |
| 89 | uint64_t wdog_cnt : 32; /**< [ 31: 0](R/W) Number of maximum TCLK clocks (defined by TWSI_CLK control THP) allowed for the |
| 90 | TWSI high-level controller (HLC) to stay in one state other than idle |
| 91 | state. Hardware will halt the operation if HLC is stuck longer than this delay |
| 92 | and MIO_TWS()_INT[ST_INT] interrupt will be generated and error code 0xF0 also |
| 93 | reported by MIO_TWS()_SW_TWSI[DATA]. Setting [WDOG_CNT] to 0x0 disables the |
| 94 | watch dog function. */ |
| 95 | #else /* Word 0 - Little Endian */ |
| 96 | uint64_t wdog_cnt : 32; /**< [ 31: 0](R/W) Number of maximum TCLK clocks (defined by TWSI_CLK control THP) allowed for the |
| 97 | TWSI high-level controller (HLC) to stay in one state other than idle |
| 98 | state. Hardware will halt the operation if HLC is stuck longer than this delay |
| 99 | and MIO_TWS()_INT[ST_INT] interrupt will be generated and error code 0xF0 also |
| 100 | reported by MIO_TWS()_SW_TWSI[DATA]. Setting [WDOG_CNT] to 0x0 disables the |
| 101 | watch dog function. */ |
| 102 | uint64_t reserved_32_63 : 32; |
| 103 | #endif /* Word 0 - End */ |
| 104 | } s; |
| 105 | /* struct bdk_mio_twsx_access_wdog_s cn; */ |
| 106 | }; |
| 107 | typedef union bdk_mio_twsx_access_wdog bdk_mio_twsx_access_wdog_t; |
| 108 | |
| 109 | static inline uint64_t BDK_MIO_TWSX_ACCESS_WDOG(unsigned long a) __attribute__ ((pure, always_inline)); |
| 110 | static inline uint64_t BDK_MIO_TWSX_ACCESS_WDOG(unsigned long a) |
| 111 | { |
| 112 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 113 | return 0x87e0d0001040ll + 0x1000000ll * ((a) & 0x7); |
| 114 | __bdk_csr_fatal("MIO_TWSX_ACCESS_WDOG", 1, a, 0, 0, 0); |
| 115 | } |
| 116 | |
| 117 | #define typedef_BDK_MIO_TWSX_ACCESS_WDOG(a) bdk_mio_twsx_access_wdog_t |
| 118 | #define bustype_BDK_MIO_TWSX_ACCESS_WDOG(a) BDK_CSR_TYPE_RSL |
| 119 | #define basename_BDK_MIO_TWSX_ACCESS_WDOG(a) "MIO_TWSX_ACCESS_WDOG" |
| 120 | #define device_bar_BDK_MIO_TWSX_ACCESS_WDOG(a) 0x0 /* PF_BAR0 */ |
| 121 | #define busnum_BDK_MIO_TWSX_ACCESS_WDOG(a) (a) |
| 122 | #define arguments_BDK_MIO_TWSX_ACCESS_WDOG(a) (a),-1,-1,-1 |
| 123 | |
| 124 | /** |
| 125 | * Register (RSL) mio_tws#_clken |
| 126 | * |
| 127 | * MIO Clock Enable Register |
| 128 | * This register controls conditional clocks. |
| 129 | */ |
| 130 | union bdk_mio_twsx_clken |
| 131 | { |
| 132 | uint64_t u; |
| 133 | struct bdk_mio_twsx_clken_s |
| 134 | { |
| 135 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 136 | uint64_t reserved_1_63 : 63; |
| 137 | uint64_t clken : 1; /**< [ 0: 0](R/W) Force the TWSI interface conditional clocking to be always on. For diagnostic use only. */ |
| 138 | #else /* Word 0 - Little Endian */ |
| 139 | uint64_t clken : 1; /**< [ 0: 0](R/W) Force the TWSI interface conditional clocking to be always on. For diagnostic use only. */ |
| 140 | uint64_t reserved_1_63 : 63; |
| 141 | #endif /* Word 0 - End */ |
| 142 | } s; |
| 143 | /* struct bdk_mio_twsx_clken_s cn; */ |
| 144 | }; |
| 145 | typedef union bdk_mio_twsx_clken bdk_mio_twsx_clken_t; |
| 146 | |
| 147 | static inline uint64_t BDK_MIO_TWSX_CLKEN(unsigned long a) __attribute__ ((pure, always_inline)); |
| 148 | static inline uint64_t BDK_MIO_TWSX_CLKEN(unsigned long a) |
| 149 | { |
| 150 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 151 | return 0x87e0d0001078ll + 0x1000000ll * ((a) & 0x7); |
| 152 | __bdk_csr_fatal("MIO_TWSX_CLKEN", 1, a, 0, 0, 0); |
| 153 | } |
| 154 | |
| 155 | #define typedef_BDK_MIO_TWSX_CLKEN(a) bdk_mio_twsx_clken_t |
| 156 | #define bustype_BDK_MIO_TWSX_CLKEN(a) BDK_CSR_TYPE_RSL |
| 157 | #define basename_BDK_MIO_TWSX_CLKEN(a) "MIO_TWSX_CLKEN" |
| 158 | #define device_bar_BDK_MIO_TWSX_CLKEN(a) 0x0 /* PF_BAR0 */ |
| 159 | #define busnum_BDK_MIO_TWSX_CLKEN(a) (a) |
| 160 | #define arguments_BDK_MIO_TWSX_CLKEN(a) (a),-1,-1,-1 |
| 161 | |
| 162 | /** |
| 163 | * Register (RSL) mio_tws#_const |
| 164 | * |
| 165 | * TWSI Constants Register |
| 166 | * This register contains constants for software discovery. |
| 167 | */ |
| 168 | union bdk_mio_twsx_const |
| 169 | { |
| 170 | uint64_t u; |
| 171 | struct bdk_mio_twsx_const_s |
| 172 | { |
| 173 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 174 | uint64_t reserved_4_63 : 60; |
| 175 | uint64_t ver : 4; /**< [ 3: 0](RO) TWSI version. |
| 176 | Internal: |
| 177 | FIXME spec values. Make 8 bits? */ |
| 178 | #else /* Word 0 - Little Endian */ |
| 179 | uint64_t ver : 4; /**< [ 3: 0](RO) TWSI version. |
| 180 | Internal: |
| 181 | FIXME spec values. Make 8 bits? */ |
| 182 | uint64_t reserved_4_63 : 60; |
| 183 | #endif /* Word 0 - End */ |
| 184 | } s; |
| 185 | /* struct bdk_mio_twsx_const_s cn; */ |
| 186 | }; |
| 187 | typedef union bdk_mio_twsx_const bdk_mio_twsx_const_t; |
| 188 | |
| 189 | static inline uint64_t BDK_MIO_TWSX_CONST(unsigned long a) __attribute__ ((pure, always_inline)); |
| 190 | static inline uint64_t BDK_MIO_TWSX_CONST(unsigned long a) |
| 191 | { |
| 192 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 193 | return 0x87e0d0000000ll + 0x1000000ll * ((a) & 0x7); |
| 194 | __bdk_csr_fatal("MIO_TWSX_CONST", 1, a, 0, 0, 0); |
| 195 | } |
| 196 | |
| 197 | #define typedef_BDK_MIO_TWSX_CONST(a) bdk_mio_twsx_const_t |
| 198 | #define bustype_BDK_MIO_TWSX_CONST(a) BDK_CSR_TYPE_RSL |
| 199 | #define basename_BDK_MIO_TWSX_CONST(a) "MIO_TWSX_CONST" |
| 200 | #define device_bar_BDK_MIO_TWSX_CONST(a) 0x0 /* PF_BAR0 */ |
| 201 | #define busnum_BDK_MIO_TWSX_CONST(a) (a) |
| 202 | #define arguments_BDK_MIO_TWSX_CONST(a) (a),-1,-1,-1 |
| 203 | |
| 204 | /** |
| 205 | * Register (RSL) mio_tws#_int |
| 206 | * |
| 207 | * TWSI Interrupt Register |
| 208 | * This register contains the TWSI interrupt-source bits and SDA/SCL override bits. |
| 209 | */ |
| 210 | union bdk_mio_twsx_int |
| 211 | { |
| 212 | uint64_t u; |
| 213 | struct bdk_mio_twsx_int_s |
| 214 | { |
| 215 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 216 | uint64_t reserved_12_63 : 52; |
| 217 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 218 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 219 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 220 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 221 | 1 = Pull SCL low. */ |
| 222 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 223 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 224 | 1 = Pull SDA low. */ |
| 225 | uint64_t reserved_4_7 : 4; |
| 226 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) BLOCK transaction threshold interrupt. Interrupt fires when the remaining |
| 227 | bytes to be sent/received is less than threshold MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_THRESH]. |
| 228 | Only valid in HLC BlOCK_MODE. Ignored when BLOCK mode is disabled. */ |
| 229 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. */ |
| 230 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Ignored when the HLC is disabled. */ |
| 231 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Ignored when the HLC is disabled. */ |
| 232 | #else /* Word 0 - Little Endian */ |
| 233 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Ignored when the HLC is disabled. */ |
| 234 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Ignored when the HLC is disabled. */ |
| 235 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. */ |
| 236 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) BLOCK transaction threshold interrupt. Interrupt fires when the remaining |
| 237 | bytes to be sent/received is less than threshold MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_THRESH]. |
| 238 | Only valid in HLC BlOCK_MODE. Ignored when BLOCK mode is disabled. */ |
| 239 | uint64_t reserved_4_7 : 4; |
| 240 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 241 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 242 | 1 = Pull SDA low. */ |
| 243 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 244 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 245 | 1 = Pull SCL low. */ |
| 246 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 247 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 248 | uint64_t reserved_12_63 : 52; |
| 249 | #endif /* Word 0 - End */ |
| 250 | } s; |
| 251 | struct bdk_mio_twsx_int_cn8 |
| 252 | { |
| 253 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 254 | uint64_t reserved_12_63 : 52; |
| 255 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 256 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 257 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 258 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 259 | 1 = Pull SCL low. */ |
| 260 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 261 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 262 | 1 = Pull SDA low. */ |
| 263 | uint64_t reserved_3_7 : 5; |
| 264 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. */ |
| 265 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Ignored when the HLC is disabled. */ |
| 266 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Ignored when the HLC is disabled. */ |
| 267 | #else /* Word 0 - Little Endian */ |
| 268 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Ignored when the HLC is disabled. */ |
| 269 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Ignored when the HLC is disabled. */ |
| 270 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. */ |
| 271 | uint64_t reserved_3_7 : 5; |
| 272 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 273 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 274 | 1 = Pull SDA low. */ |
| 275 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 276 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 277 | 1 = Pull SCL low. */ |
| 278 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 279 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 280 | uint64_t reserved_12_63 : 52; |
| 281 | #endif /* Word 0 - End */ |
| 282 | } cn8; |
| 283 | struct bdk_mio_twsx_int_cn9 |
| 284 | { |
| 285 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 286 | uint64_t reserved_12_63 : 52; |
| 287 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 288 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 289 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 290 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 291 | 1 = Pull SCL low. */ |
| 292 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 293 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 294 | 1 = Pull SDA low. */ |
| 295 | uint64_t reserved_4_7 : 4; |
| 296 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) BLOCK transaction threshold interrupt. Interrupt fires when the remaining |
| 297 | bytes to be sent/received is less than threshold MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_THRESH]. |
| 298 | Only valid in HLC BlOCK_MODE. Ignored when BLOCK mode is disabled. */ |
| 299 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. |
| 300 | In order to clear [CORE_INT], software needs to write 0 to TWSI_CTL[IFLG]. */ |
| 301 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Only valid in HLC mode. |
| 302 | Ignored when HLC is disabled. */ |
| 303 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Only valid in HLC mode. |
| 304 | Ignored when HLC is disabled. */ |
| 305 | #else /* Word 0 - Little Endian */ |
| 306 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) MIO_TWS()_SW_TWSI register-update interrupt. Only valid in HLC mode. |
| 307 | Ignored when HLC is disabled. */ |
| 308 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) MIO_TWS()_TWSI_SW register-update interrupt. Only valid in HLC mode. |
| 309 | Ignored when HLC is disabled. */ |
| 310 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) TWSI core interrupt, whenever IFLG is set. Ignored when the HLC is enabled. |
| 311 | In order to clear [CORE_INT], software needs to write 0 to TWSI_CTL[IFLG]. */ |
| 312 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) BLOCK transaction threshold interrupt. Interrupt fires when the remaining |
| 313 | bytes to be sent/received is less than threshold MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_THRESH]. |
| 314 | Only valid in HLC BlOCK_MODE. Ignored when BLOCK mode is disabled. */ |
| 315 | uint64_t reserved_4_7 : 4; |
| 316 | uint64_t sda_ovr : 1; /**< [ 8: 8](R/W) SDA testing override: |
| 317 | 0 = Normal operation, SDA bus controlled by TWSI core. |
| 318 | 1 = Pull SDA low. */ |
| 319 | uint64_t scl_ovr : 1; /**< [ 9: 9](R/W) SCL testing override: |
| 320 | 0 = Normal operation, SCL bus controlled by TWSI core. |
| 321 | 1 = Pull SCL low. */ |
| 322 | uint64_t sda : 1; /**< [ 10: 10](RO/H) SDA signal. */ |
| 323 | uint64_t scl : 1; /**< [ 11: 11](RO/H) SCL signal. */ |
| 324 | uint64_t reserved_12_63 : 52; |
| 325 | #endif /* Word 0 - End */ |
| 326 | } cn9; |
| 327 | }; |
| 328 | typedef union bdk_mio_twsx_int bdk_mio_twsx_int_t; |
| 329 | |
| 330 | static inline uint64_t BDK_MIO_TWSX_INT(unsigned long a) __attribute__ ((pure, always_inline)); |
| 331 | static inline uint64_t BDK_MIO_TWSX_INT(unsigned long a) |
| 332 | { |
| 333 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 334 | return 0x87e0d0001010ll + 0x1000000ll * ((a) & 0x1); |
| 335 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 336 | return 0x87e0d0001010ll + 0x1000000ll * ((a) & 0x1); |
| 337 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 338 | return 0x87e0d0001010ll + 0x1000000ll * ((a) & 0x7); |
| 339 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 340 | return 0x87e0d0001010ll + 0x1000000ll * ((a) & 0x7); |
| 341 | __bdk_csr_fatal("MIO_TWSX_INT", 1, a, 0, 0, 0); |
| 342 | } |
| 343 | |
| 344 | #define typedef_BDK_MIO_TWSX_INT(a) bdk_mio_twsx_int_t |
| 345 | #define bustype_BDK_MIO_TWSX_INT(a) BDK_CSR_TYPE_RSL |
| 346 | #define basename_BDK_MIO_TWSX_INT(a) "MIO_TWSX_INT" |
| 347 | #define device_bar_BDK_MIO_TWSX_INT(a) 0x0 /* PF_BAR0 */ |
| 348 | #define busnum_BDK_MIO_TWSX_INT(a) (a) |
| 349 | #define arguments_BDK_MIO_TWSX_INT(a) (a),-1,-1,-1 |
| 350 | |
| 351 | /** |
| 352 | * Register (RSL) mio_tws#_int_ena_w1c |
| 353 | * |
| 354 | * TWSI Interrupt Enable Clear Register |
| 355 | */ |
| 356 | union bdk_mio_twsx_int_ena_w1c |
| 357 | { |
| 358 | uint64_t u; |
| 359 | struct bdk_mio_twsx_int_ena_w1c_s |
| 360 | { |
| 361 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 362 | uint64_t reserved_4_63 : 60; |
| 363 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) Reads or clears MIO_TWS()_INT[BLOCK_INT]. */ |
| 364 | uint64_t core_int : 1; /**< [ 2: 2](R/W1C/H) Reads or clears MIO_TWS()_INT[CORE_INT]. */ |
| 365 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) Reads or clears MIO_TWS()_INT[TS_INT]. */ |
| 366 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) Reads or clears MIO_TWS()_INT[ST_INT]. */ |
| 367 | #else /* Word 0 - Little Endian */ |
| 368 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) Reads or clears MIO_TWS()_INT[ST_INT]. */ |
| 369 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) Reads or clears MIO_TWS()_INT[TS_INT]. */ |
| 370 | uint64_t core_int : 1; /**< [ 2: 2](R/W1C/H) Reads or clears MIO_TWS()_INT[CORE_INT]. */ |
| 371 | uint64_t block_int : 1; /**< [ 3: 3](R/W1C/H) Reads or clears MIO_TWS()_INT[BLOCK_INT]. */ |
| 372 | uint64_t reserved_4_63 : 60; |
| 373 | #endif /* Word 0 - End */ |
| 374 | } s; |
| 375 | struct bdk_mio_twsx_int_ena_w1c_cn8 |
| 376 | { |
| 377 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 378 | uint64_t reserved_3_63 : 61; |
| 379 | uint64_t core_int : 1; /**< [ 2: 2](R/W1C/H) Reads or clears MIO_TWS()_INT[CORE_INT]. */ |
| 380 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) Reads or clears MIO_TWS()_INT[TS_INT]. */ |
| 381 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) Reads or clears MIO_TWS()_INT[ST_INT]. */ |
| 382 | #else /* Word 0 - Little Endian */ |
| 383 | uint64_t st_int : 1; /**< [ 0: 0](R/W1C/H) Reads or clears MIO_TWS()_INT[ST_INT]. */ |
| 384 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1C/H) Reads or clears MIO_TWS()_INT[TS_INT]. */ |
| 385 | uint64_t core_int : 1; /**< [ 2: 2](R/W1C/H) Reads or clears MIO_TWS()_INT[CORE_INT]. */ |
| 386 | uint64_t reserved_3_63 : 61; |
| 387 | #endif /* Word 0 - End */ |
| 388 | } cn8; |
| 389 | /* struct bdk_mio_twsx_int_ena_w1c_s cn9; */ |
| 390 | }; |
| 391 | typedef union bdk_mio_twsx_int_ena_w1c bdk_mio_twsx_int_ena_w1c_t; |
| 392 | |
| 393 | static inline uint64_t BDK_MIO_TWSX_INT_ENA_W1C(unsigned long a) __attribute__ ((pure, always_inline)); |
| 394 | static inline uint64_t BDK_MIO_TWSX_INT_ENA_W1C(unsigned long a) |
| 395 | { |
| 396 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 397 | return 0x87e0d0001028ll + 0x1000000ll * ((a) & 0x1); |
| 398 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 399 | return 0x87e0d0001028ll + 0x1000000ll * ((a) & 0x1); |
| 400 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 401 | return 0x87e0d0001028ll + 0x1000000ll * ((a) & 0x7); |
| 402 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 403 | return 0x87e0d0001028ll + 0x1000000ll * ((a) & 0x7); |
| 404 | __bdk_csr_fatal("MIO_TWSX_INT_ENA_W1C", 1, a, 0, 0, 0); |
| 405 | } |
| 406 | |
| 407 | #define typedef_BDK_MIO_TWSX_INT_ENA_W1C(a) bdk_mio_twsx_int_ena_w1c_t |
| 408 | #define bustype_BDK_MIO_TWSX_INT_ENA_W1C(a) BDK_CSR_TYPE_RSL |
| 409 | #define basename_BDK_MIO_TWSX_INT_ENA_W1C(a) "MIO_TWSX_INT_ENA_W1C" |
| 410 | #define device_bar_BDK_MIO_TWSX_INT_ENA_W1C(a) 0x0 /* PF_BAR0 */ |
| 411 | #define busnum_BDK_MIO_TWSX_INT_ENA_W1C(a) (a) |
| 412 | #define arguments_BDK_MIO_TWSX_INT_ENA_W1C(a) (a),-1,-1,-1 |
| 413 | |
| 414 | /** |
| 415 | * Register (RSL) mio_tws#_int_ena_w1s |
| 416 | * |
| 417 | * TWSI Interrupt Enable Set Register |
| 418 | */ |
| 419 | union bdk_mio_twsx_int_ena_w1s |
| 420 | { |
| 421 | uint64_t u; |
| 422 | struct bdk_mio_twsx_int_ena_w1s_s |
| 423 | { |
| 424 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 425 | uint64_t reserved_4_63 : 60; |
| 426 | uint64_t block_int : 1; /**< [ 3: 3](R/W1S/H) Enables reporting of MIO_TWS()_INT[BLOCK_INT]. */ |
| 427 | uint64_t core_int : 1; /**< [ 2: 2](R/W1S/H) Enables reporting of MIO_TWS()_INT[CORE_INT]. */ |
| 428 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Enables reporting of MIO_TWS()_INT[TS_INT]. */ |
| 429 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Enables reporting of MIO_TWS()_INT[ST_INT]. */ |
| 430 | #else /* Word 0 - Little Endian */ |
| 431 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Enables reporting of MIO_TWS()_INT[ST_INT]. */ |
| 432 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Enables reporting of MIO_TWS()_INT[TS_INT]. */ |
| 433 | uint64_t core_int : 1; /**< [ 2: 2](R/W1S/H) Enables reporting of MIO_TWS()_INT[CORE_INT]. */ |
| 434 | uint64_t block_int : 1; /**< [ 3: 3](R/W1S/H) Enables reporting of MIO_TWS()_INT[BLOCK_INT]. */ |
| 435 | uint64_t reserved_4_63 : 60; |
| 436 | #endif /* Word 0 - End */ |
| 437 | } s; |
| 438 | struct bdk_mio_twsx_int_ena_w1s_cn8 |
| 439 | { |
| 440 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 441 | uint64_t reserved_3_63 : 61; |
| 442 | uint64_t core_int : 1; /**< [ 2: 2](R/W1S/H) Enables reporting of MIO_TWS()_INT[CORE_INT]. */ |
| 443 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Enables reporting of MIO_TWS()_INT[TS_INT]. */ |
| 444 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Enables reporting of MIO_TWS()_INT[ST_INT]. */ |
| 445 | #else /* Word 0 - Little Endian */ |
| 446 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Enables reporting of MIO_TWS()_INT[ST_INT]. */ |
| 447 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Enables reporting of MIO_TWS()_INT[TS_INT]. */ |
| 448 | uint64_t core_int : 1; /**< [ 2: 2](R/W1S/H) Enables reporting of MIO_TWS()_INT[CORE_INT]. */ |
| 449 | uint64_t reserved_3_63 : 61; |
| 450 | #endif /* Word 0 - End */ |
| 451 | } cn8; |
| 452 | /* struct bdk_mio_twsx_int_ena_w1s_s cn9; */ |
| 453 | }; |
| 454 | typedef union bdk_mio_twsx_int_ena_w1s bdk_mio_twsx_int_ena_w1s_t; |
| 455 | |
| 456 | static inline uint64_t BDK_MIO_TWSX_INT_ENA_W1S(unsigned long a) __attribute__ ((pure, always_inline)); |
| 457 | static inline uint64_t BDK_MIO_TWSX_INT_ENA_W1S(unsigned long a) |
| 458 | { |
| 459 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 460 | return 0x87e0d0001030ll + 0x1000000ll * ((a) & 0x1); |
| 461 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 462 | return 0x87e0d0001030ll + 0x1000000ll * ((a) & 0x1); |
| 463 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 464 | return 0x87e0d0001030ll + 0x1000000ll * ((a) & 0x7); |
| 465 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 466 | return 0x87e0d0001030ll + 0x1000000ll * ((a) & 0x7); |
| 467 | __bdk_csr_fatal("MIO_TWSX_INT_ENA_W1S", 1, a, 0, 0, 0); |
| 468 | } |
| 469 | |
| 470 | #define typedef_BDK_MIO_TWSX_INT_ENA_W1S(a) bdk_mio_twsx_int_ena_w1s_t |
| 471 | #define bustype_BDK_MIO_TWSX_INT_ENA_W1S(a) BDK_CSR_TYPE_RSL |
| 472 | #define basename_BDK_MIO_TWSX_INT_ENA_W1S(a) "MIO_TWSX_INT_ENA_W1S" |
| 473 | #define device_bar_BDK_MIO_TWSX_INT_ENA_W1S(a) 0x0 /* PF_BAR0 */ |
| 474 | #define busnum_BDK_MIO_TWSX_INT_ENA_W1S(a) (a) |
| 475 | #define arguments_BDK_MIO_TWSX_INT_ENA_W1S(a) (a),-1,-1,-1 |
| 476 | |
| 477 | /** |
| 478 | * Register (RSL) mio_tws#_int_w1s |
| 479 | * |
| 480 | * TWSI Interrupt Set Register |
| 481 | */ |
| 482 | union bdk_mio_twsx_int_w1s |
| 483 | { |
| 484 | uint64_t u; |
| 485 | struct bdk_mio_twsx_int_w1s_s |
| 486 | { |
| 487 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 488 | uint64_t reserved_4_63 : 60; |
| 489 | uint64_t block_int : 1; /**< [ 3: 3](R/W1S/H) Reads or sets MIO_TWS()_INT[BLOCK_INT]. */ |
| 490 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) Reads MIO_TWS()_INT[CORE_INT]. */ |
| 491 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Reads or sets MIO_TWS()_INT[TS_INT]. */ |
| 492 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Reads or sets MIO_TWS()_INT[ST_INT]. */ |
| 493 | #else /* Word 0 - Little Endian */ |
| 494 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Reads or sets MIO_TWS()_INT[ST_INT]. */ |
| 495 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Reads or sets MIO_TWS()_INT[TS_INT]. */ |
| 496 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) Reads MIO_TWS()_INT[CORE_INT]. */ |
| 497 | uint64_t block_int : 1; /**< [ 3: 3](R/W1S/H) Reads or sets MIO_TWS()_INT[BLOCK_INT]. */ |
| 498 | uint64_t reserved_4_63 : 60; |
| 499 | #endif /* Word 0 - End */ |
| 500 | } s; |
| 501 | struct bdk_mio_twsx_int_w1s_cn8 |
| 502 | { |
| 503 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 504 | uint64_t reserved_3_63 : 61; |
| 505 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) Reads MIO_TWS()_INT[CORE_INT]. */ |
| 506 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Reads or sets MIO_TWS()_INT[TS_INT]. */ |
| 507 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Reads or sets MIO_TWS()_INT[ST_INT]. */ |
| 508 | #else /* Word 0 - Little Endian */ |
| 509 | uint64_t st_int : 1; /**< [ 0: 0](R/W1S/H) Reads or sets MIO_TWS()_INT[ST_INT]. */ |
| 510 | uint64_t ts_int : 1; /**< [ 1: 1](R/W1S/H) Reads or sets MIO_TWS()_INT[TS_INT]. */ |
| 511 | uint64_t core_int : 1; /**< [ 2: 2](RO/H) Reads MIO_TWS()_INT[CORE_INT]. */ |
| 512 | uint64_t reserved_3_63 : 61; |
| 513 | #endif /* Word 0 - End */ |
| 514 | } cn8; |
| 515 | /* struct bdk_mio_twsx_int_w1s_s cn9; */ |
| 516 | }; |
| 517 | typedef union bdk_mio_twsx_int_w1s bdk_mio_twsx_int_w1s_t; |
| 518 | |
| 519 | static inline uint64_t BDK_MIO_TWSX_INT_W1S(unsigned long a) __attribute__ ((pure, always_inline)); |
| 520 | static inline uint64_t BDK_MIO_TWSX_INT_W1S(unsigned long a) |
| 521 | { |
| 522 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 523 | return 0x87e0d0001020ll + 0x1000000ll * ((a) & 0x1); |
| 524 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 525 | return 0x87e0d0001020ll + 0x1000000ll * ((a) & 0x1); |
| 526 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 527 | return 0x87e0d0001020ll + 0x1000000ll * ((a) & 0x7); |
| 528 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 529 | return 0x87e0d0001020ll + 0x1000000ll * ((a) & 0x7); |
| 530 | __bdk_csr_fatal("MIO_TWSX_INT_W1S", 1, a, 0, 0, 0); |
| 531 | } |
| 532 | |
| 533 | #define typedef_BDK_MIO_TWSX_INT_W1S(a) bdk_mio_twsx_int_w1s_t |
| 534 | #define bustype_BDK_MIO_TWSX_INT_W1S(a) BDK_CSR_TYPE_RSL |
| 535 | #define basename_BDK_MIO_TWSX_INT_W1S(a) "MIO_TWSX_INT_W1S" |
| 536 | #define device_bar_BDK_MIO_TWSX_INT_W1S(a) 0x0 /* PF_BAR0 */ |
| 537 | #define busnum_BDK_MIO_TWSX_INT_W1S(a) (a) |
| 538 | #define arguments_BDK_MIO_TWSX_INT_W1S(a) (a),-1,-1,-1 |
| 539 | |
| 540 | /** |
| 541 | * Register (RSL) mio_tws#_io_ctl |
| 542 | * |
| 543 | * MIO TWSI IO Control Register |
| 544 | * This register control the TWSI IO drive strength and slew rates. Index {a} of zero |
| 545 | * (MIO_TWS(0)_IO_CTL) is used to control all TWSI outputs on CNXXXX; other index |
| 546 | * values have no effect. |
| 547 | */ |
| 548 | union bdk_mio_twsx_io_ctl |
| 549 | { |
| 550 | uint64_t u; |
| 551 | struct bdk_mio_twsx_io_ctl_s |
| 552 | { |
| 553 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 554 | uint64_t reserved_4_63 : 60; |
| 555 | uint64_t drive : 2; /**< [ 3: 2](R/W) TWSI bus pin output drive strength. |
| 556 | 0x0 = 2 mA. |
| 557 | 0x1 = 4 mA. |
| 558 | 0x2 = 8 mA. |
| 559 | 0x3 = 16 mA. */ |
| 560 | uint64_t reserved_1 : 1; |
| 561 | uint64_t slew : 1; /**< [ 0: 0](R/W) TWSI bus pins output slew rate control. |
| 562 | 0 = Low slew rate. |
| 563 | 1 = High slew rate. */ |
| 564 | #else /* Word 0 - Little Endian */ |
| 565 | uint64_t slew : 1; /**< [ 0: 0](R/W) TWSI bus pins output slew rate control. |
| 566 | 0 = Low slew rate. |
| 567 | 1 = High slew rate. */ |
| 568 | uint64_t reserved_1 : 1; |
| 569 | uint64_t drive : 2; /**< [ 3: 2](R/W) TWSI bus pin output drive strength. |
| 570 | 0x0 = 2 mA. |
| 571 | 0x1 = 4 mA. |
| 572 | 0x2 = 8 mA. |
| 573 | 0x3 = 16 mA. */ |
| 574 | uint64_t reserved_4_63 : 60; |
| 575 | #endif /* Word 0 - End */ |
| 576 | } s; |
| 577 | /* struct bdk_mio_twsx_io_ctl_s cn; */ |
| 578 | }; |
| 579 | typedef union bdk_mio_twsx_io_ctl bdk_mio_twsx_io_ctl_t; |
| 580 | |
| 581 | static inline uint64_t BDK_MIO_TWSX_IO_CTL(unsigned long a) __attribute__ ((pure, always_inline)); |
| 582 | static inline uint64_t BDK_MIO_TWSX_IO_CTL(unsigned long a) |
| 583 | { |
| 584 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 585 | return 0x87e0d0001070ll + 0x1000000ll * ((a) & 0x7); |
| 586 | __bdk_csr_fatal("MIO_TWSX_IO_CTL", 1, a, 0, 0, 0); |
| 587 | } |
| 588 | |
| 589 | #define typedef_BDK_MIO_TWSX_IO_CTL(a) bdk_mio_twsx_io_ctl_t |
| 590 | #define bustype_BDK_MIO_TWSX_IO_CTL(a) BDK_CSR_TYPE_RSL |
| 591 | #define basename_BDK_MIO_TWSX_IO_CTL(a) "MIO_TWSX_IO_CTL" |
| 592 | #define device_bar_BDK_MIO_TWSX_IO_CTL(a) 0x0 /* PF_BAR0 */ |
| 593 | #define busnum_BDK_MIO_TWSX_IO_CTL(a) (a) |
| 594 | #define arguments_BDK_MIO_TWSX_IO_CTL(a) (a),-1,-1,-1 |
| 595 | |
| 596 | /** |
| 597 | * Register (RSL) mio_tws#_mode |
| 598 | * |
| 599 | * TWSI Mode and Control Register |
| 600 | */ |
| 601 | union bdk_mio_twsx_mode |
| 602 | { |
| 603 | uint64_t u; |
| 604 | struct bdk_mio_twsx_mode_s |
| 605 | { |
| 606 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 607 | uint64_t reserved_5_63 : 59; |
| 608 | uint64_t refclk_src : 1; /**< [ 4: 4](R/W) Reference clock source used to generate TWSI clock. See TWSI_CLK and TWSI_CLKCTL for |
| 609 | details. |
| 610 | 0 = 100 MHz input reference generates TWSI clock. |
| 611 | 1 = Coprocessor clock generates TWSI clock. */ |
| 612 | uint64_t bus_mon_rst : 1; /**< [ 3: 3](WO/H) Reset the TWSI bus monitor for both HLC and non-HLC mode. |
| 613 | When TWSI bus in hang state with a timeout interrupt, it is possible that the TWSI bus |
| 614 | monitor still waiting for STP on the bus before accepting any new commands. |
| 615 | Write 1 to send a pulse to reset interface monitor back to the initial condition. */ |
| 616 | uint64_t block_mode : 1; /**< [ 2: 2](R/W) Block transfer mode in HLC, only valid in HLC mode. |
| 617 | When device is enabled to block transfer mode, software can access TWSI data through a |
| 618 | FIFO interface. Software needs to write to MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE] with |
| 619 | the number of bytes to be transfered/received. */ |
| 620 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 621 | When enabled and device in master mode, it allows slave device |
| 622 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 623 | master device is disabled. */ |
| 624 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 625 | |
| 626 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 627 | OSCL output frequency divisor is 10. |
| 628 | |
| 629 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 630 | but disabled after each repeated start condition |
| 631 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 632 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 633 | OSCL output frequency divisor is 15. */ |
| 634 | #else /* Word 0 - Little Endian */ |
| 635 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 636 | |
| 637 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 638 | OSCL output frequency divisor is 10. |
| 639 | |
| 640 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 641 | but disabled after each repeated start condition |
| 642 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 643 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 644 | OSCL output frequency divisor is 15. */ |
| 645 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 646 | When enabled and device in master mode, it allows slave device |
| 647 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 648 | master device is disabled. */ |
| 649 | uint64_t block_mode : 1; /**< [ 2: 2](R/W) Block transfer mode in HLC, only valid in HLC mode. |
| 650 | When device is enabled to block transfer mode, software can access TWSI data through a |
| 651 | FIFO interface. Software needs to write to MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE] with |
| 652 | the number of bytes to be transfered/received. */ |
| 653 | uint64_t bus_mon_rst : 1; /**< [ 3: 3](WO/H) Reset the TWSI bus monitor for both HLC and non-HLC mode. |
| 654 | When TWSI bus in hang state with a timeout interrupt, it is possible that the TWSI bus |
| 655 | monitor still waiting for STP on the bus before accepting any new commands. |
| 656 | Write 1 to send a pulse to reset interface monitor back to the initial condition. */ |
| 657 | uint64_t refclk_src : 1; /**< [ 4: 4](R/W) Reference clock source used to generate TWSI clock. See TWSI_CLK and TWSI_CLKCTL for |
| 658 | details. |
| 659 | 0 = 100 MHz input reference generates TWSI clock. |
| 660 | 1 = Coprocessor clock generates TWSI clock. */ |
| 661 | uint64_t reserved_5_63 : 59; |
| 662 | #endif /* Word 0 - End */ |
| 663 | } s; |
| 664 | struct bdk_mio_twsx_mode_cn8 |
| 665 | { |
| 666 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 667 | uint64_t reserved_2_63 : 62; |
| 668 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 669 | When enabled and device in master mode, it allows slave device |
| 670 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 671 | master device is disabled. */ |
| 672 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 673 | |
| 674 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 675 | OSCL output frequency divisor is 10. |
| 676 | |
| 677 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 678 | but disabled after each repeated start condition |
| 679 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 680 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 681 | OSCL output frequency divisor is 15. */ |
| 682 | #else /* Word 0 - Little Endian */ |
| 683 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 684 | |
| 685 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 686 | OSCL output frequency divisor is 10. |
| 687 | |
| 688 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 689 | but disabled after each repeated start condition |
| 690 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 691 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 692 | OSCL output frequency divisor is 15. */ |
| 693 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 694 | When enabled and device in master mode, it allows slave device |
| 695 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 696 | master device is disabled. */ |
| 697 | uint64_t reserved_2_63 : 62; |
| 698 | #endif /* Word 0 - End */ |
| 699 | } cn8; |
| 700 | struct bdk_mio_twsx_mode_cn9 |
| 701 | { |
| 702 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 703 | uint64_t reserved_5_63 : 59; |
| 704 | uint64_t refclk_src : 1; /**< [ 4: 4](R/W) Reference clock source used to generate TWSI clock. See TWSI_CLK and TWSI_CLKCTL for |
| 705 | details. |
| 706 | 0 = 100 MHz input reference generates TWSI clock. |
| 707 | 1 = Coprocessor clock generates TWSI clock. */ |
| 708 | uint64_t bus_mon_rst : 1; /**< [ 3: 3](WO/H) Reset the TWSI bus monitor for both HLC and non-HLC mode. |
| 709 | When TWSI bus in hang state with a timeout interrupt, it is possible that the TWSI bus |
| 710 | monitor still waiting for STP on the bus before accepting any new commands. |
| 711 | Write 1 to send a pulse to reset interface monitor back to the initial condition. */ |
| 712 | uint64_t block_mode : 1; /**< [ 2: 2](R/W) Block transfer mode in HLC, only valid in HLC mode. |
| 713 | When device is enabled to block transfer mode, software can access TWSI data through a |
| 714 | FIFO interface. Software needs to write to MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE] with |
| 715 | the number of bytes to be transfered/received. */ |
| 716 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 717 | When enabled and device in non-HLC master mode, it allows slave device |
| 718 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 719 | master device is disabled. */ |
| 720 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 721 | |
| 722 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 723 | OSCL output frequency divisor is 10. |
| 724 | |
| 725 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 726 | but disabled after each repeated start condition |
| 727 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 728 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 729 | OSCL output frequency divisor is 15. */ |
| 730 | #else /* Word 0 - Little Endian */ |
| 731 | uint64_t hs_mode : 1; /**< [ 0: 0](R/W) I2C bus high-speed mode. |
| 732 | |
| 733 | 0 = Open drain drive on TWS_SCL. TWS_SCL clock signal high-to-low ratio is 1 to 1. |
| 734 | OSCL output frequency divisor is 10. |
| 735 | |
| 736 | 1 = Current sourced circuit is used to drive TWS_SCL pin when device is in master mode, |
| 737 | but disabled after each repeated start condition |
| 738 | and after each ACK or NACK to give a slave a chance to stretch the clock. |
| 739 | TWS_SCL clock signal high-to-low ratio is 1 to 2. |
| 740 | OSCL output frequency divisor is 15. */ |
| 741 | uint64_t stretch : 1; /**< [ 1: 1](R/W) Clock stretching enable. |
| 742 | When enabled and device in non-HLC master mode, it allows slave device |
| 743 | to extend low period of the clock. During the clock extension period, the SCL output from |
| 744 | master device is disabled. */ |
| 745 | uint64_t block_mode : 1; /**< [ 2: 2](R/W) Block transfer mode in HLC, only valid in HLC mode. |
| 746 | When device is enabled to block transfer mode, software can access TWSI data through a |
| 747 | FIFO interface. Software needs to write to MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE] with |
| 748 | the number of bytes to be transfered/received. */ |
| 749 | uint64_t bus_mon_rst : 1; /**< [ 3: 3](WO/H) Reset the TWSI bus monitor for both HLC and non-HLC mode. |
| 750 | When TWSI bus in hang state with a timeout interrupt, it is possible that the TWSI bus |
| 751 | monitor still waiting for STP on the bus before accepting any new commands. |
| 752 | Write 1 to send a pulse to reset interface monitor back to the initial condition. */ |
| 753 | uint64_t refclk_src : 1; /**< [ 4: 4](R/W) Reference clock source used to generate TWSI clock. See TWSI_CLK and TWSI_CLKCTL for |
| 754 | details. |
| 755 | 0 = 100 MHz input reference generates TWSI clock. |
| 756 | 1 = Coprocessor clock generates TWSI clock. */ |
| 757 | uint64_t reserved_5_63 : 59; |
| 758 | #endif /* Word 0 - End */ |
| 759 | } cn9; |
| 760 | }; |
| 761 | typedef union bdk_mio_twsx_mode bdk_mio_twsx_mode_t; |
| 762 | |
| 763 | static inline uint64_t BDK_MIO_TWSX_MODE(unsigned long a) __attribute__ ((pure, always_inline)); |
| 764 | static inline uint64_t BDK_MIO_TWSX_MODE(unsigned long a) |
| 765 | { |
| 766 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 767 | return 0x87e0d0001038ll + 0x1000000ll * ((a) & 0x1); |
| 768 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 769 | return 0x87e0d0001038ll + 0x1000000ll * ((a) & 0x1); |
| 770 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 771 | return 0x87e0d0001038ll + 0x1000000ll * ((a) & 0x7); |
| 772 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 773 | return 0x87e0d0001038ll + 0x1000000ll * ((a) & 0x7); |
| 774 | __bdk_csr_fatal("MIO_TWSX_MODE", 1, a, 0, 0, 0); |
| 775 | } |
| 776 | |
| 777 | #define typedef_BDK_MIO_TWSX_MODE(a) bdk_mio_twsx_mode_t |
| 778 | #define bustype_BDK_MIO_TWSX_MODE(a) BDK_CSR_TYPE_RSL |
| 779 | #define basename_BDK_MIO_TWSX_MODE(a) "MIO_TWSX_MODE" |
| 780 | #define device_bar_BDK_MIO_TWSX_MODE(a) 0x0 /* PF_BAR0 */ |
| 781 | #define busnum_BDK_MIO_TWSX_MODE(a) (a) |
| 782 | #define arguments_BDK_MIO_TWSX_MODE(a) (a),-1,-1,-1 |
| 783 | |
| 784 | /** |
| 785 | * Register (RSL) mio_tws#_msix_pba# |
| 786 | * |
| 787 | * TWSI MSI-X Pending Bit Array Registers |
| 788 | * This register is the MSI-X PBA table, the bit number is indexed by the MIO_TWS_INT_VEC_E |
| 789 | * enumeration. |
| 790 | */ |
| 791 | union bdk_mio_twsx_msix_pbax |
| 792 | { |
| 793 | uint64_t u; |
| 794 | struct bdk_mio_twsx_msix_pbax_s |
| 795 | { |
| 796 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 797 | uint64_t pend : 64; /**< [ 63: 0](RO/H) Pending message for the associated MIO_TWS()_MSIX_VEC()_CTL, enumerated by |
| 798 | MIO_TWS_INT_VEC_E. Bits that have no associated MIO_TWS_INT_VEC_E are zero. */ |
| 799 | #else /* Word 0 - Little Endian */ |
| 800 | uint64_t pend : 64; /**< [ 63: 0](RO/H) Pending message for the associated MIO_TWS()_MSIX_VEC()_CTL, enumerated by |
| 801 | MIO_TWS_INT_VEC_E. Bits that have no associated MIO_TWS_INT_VEC_E are zero. */ |
| 802 | #endif /* Word 0 - End */ |
| 803 | } s; |
| 804 | /* struct bdk_mio_twsx_msix_pbax_s cn; */ |
| 805 | }; |
| 806 | typedef union bdk_mio_twsx_msix_pbax bdk_mio_twsx_msix_pbax_t; |
| 807 | |
| 808 | static inline uint64_t BDK_MIO_TWSX_MSIX_PBAX(unsigned long a, unsigned long b) __attribute__ ((pure, always_inline)); |
| 809 | static inline uint64_t BDK_MIO_TWSX_MSIX_PBAX(unsigned long a, unsigned long b) |
| 810 | { |
| 811 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && ((a<=1) && (b==0))) |
| 812 | return 0x87e0d0ff0000ll + 0x1000000ll * ((a) & 0x1) + 8ll * ((b) & 0x0); |
| 813 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && ((a<=1) && (b==0))) |
| 814 | return 0x87e0d0ff0000ll + 0x1000000ll * ((a) & 0x1) + 8ll * ((b) & 0x0); |
| 815 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && ((a<=5) && (b==0))) |
| 816 | return 0x87e0d0ff0000ll + 0x1000000ll * ((a) & 0x7) + 8ll * ((b) & 0x0); |
| 817 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && ((a<=5) && (b==0))) |
| 818 | return 0x87e0d0ff0000ll + 0x1000000ll * ((a) & 0x7) + 8ll * ((b) & 0x0); |
| 819 | __bdk_csr_fatal("MIO_TWSX_MSIX_PBAX", 2, a, b, 0, 0); |
| 820 | } |
| 821 | |
| 822 | #define typedef_BDK_MIO_TWSX_MSIX_PBAX(a,b) bdk_mio_twsx_msix_pbax_t |
| 823 | #define bustype_BDK_MIO_TWSX_MSIX_PBAX(a,b) BDK_CSR_TYPE_RSL |
| 824 | #define basename_BDK_MIO_TWSX_MSIX_PBAX(a,b) "MIO_TWSX_MSIX_PBAX" |
| 825 | #define device_bar_BDK_MIO_TWSX_MSIX_PBAX(a,b) 0x4 /* PF_BAR4 */ |
| 826 | #define busnum_BDK_MIO_TWSX_MSIX_PBAX(a,b) (a) |
| 827 | #define arguments_BDK_MIO_TWSX_MSIX_PBAX(a,b) (a),(b),-1,-1 |
| 828 | |
| 829 | /** |
| 830 | * Register (RSL) mio_tws#_msix_vec#_addr |
| 831 | * |
| 832 | * TWSI MSI-X Vector Table Address Registers |
| 833 | * This register is the MSI-X vector table, indexed by the MIO_TWS_INT_VEC_E enumeration. |
| 834 | */ |
| 835 | union bdk_mio_twsx_msix_vecx_addr |
| 836 | { |
| 837 | uint64_t u; |
| 838 | struct bdk_mio_twsx_msix_vecx_addr_s |
| 839 | { |
| 840 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 841 | uint64_t reserved_53_63 : 11; |
| 842 | uint64_t addr : 51; /**< [ 52: 2](R/W) IOVA to use for MSI-X delivery of this vector. */ |
| 843 | uint64_t reserved_1 : 1; |
| 844 | uint64_t secvec : 1; /**< [ 0: 0](SR/W) Secure vector. |
| 845 | 0 = This vector may be read or written by either secure or nonsecure states. |
| 846 | 1 = This vector's MIO_TWS()_MSIX_VEC()_ADDR, MIO_TWS()_MSIX_VEC()_CTL, and corresponding |
| 847 | bit of MIO_TWS()_MSIX_PBA() are RAZ/WI and does not cause a fault when accessed |
| 848 | by the nonsecure world. |
| 849 | |
| 850 | If PCCPF_MIO_TWS()_VSEC_SCTL[MSIX_SEC] (for documentation, see |
| 851 | PCCPF_XXX_VSEC_SCTL[MSIX_SEC]) is set, all vectors are secure and function as if [SECVEC] |
| 852 | was set. */ |
| 853 | #else /* Word 0 - Little Endian */ |
| 854 | uint64_t secvec : 1; /**< [ 0: 0](SR/W) Secure vector. |
| 855 | 0 = This vector may be read or written by either secure or nonsecure states. |
| 856 | 1 = This vector's MIO_TWS()_MSIX_VEC()_ADDR, MIO_TWS()_MSIX_VEC()_CTL, and corresponding |
| 857 | bit of MIO_TWS()_MSIX_PBA() are RAZ/WI and does not cause a fault when accessed |
| 858 | by the nonsecure world. |
| 859 | |
| 860 | If PCCPF_MIO_TWS()_VSEC_SCTL[MSIX_SEC] (for documentation, see |
| 861 | PCCPF_XXX_VSEC_SCTL[MSIX_SEC]) is set, all vectors are secure and function as if [SECVEC] |
| 862 | was set. */ |
| 863 | uint64_t reserved_1 : 1; |
| 864 | uint64_t addr : 51; /**< [ 52: 2](R/W) IOVA to use for MSI-X delivery of this vector. */ |
| 865 | uint64_t reserved_53_63 : 11; |
| 866 | #endif /* Word 0 - End */ |
| 867 | } s; |
| 868 | struct bdk_mio_twsx_msix_vecx_addr_cn8 |
| 869 | { |
| 870 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 871 | uint64_t reserved_49_63 : 15; |
| 872 | uint64_t addr : 47; /**< [ 48: 2](R/W) IOVA to use for MSI-X delivery of this vector. */ |
| 873 | uint64_t reserved_1 : 1; |
| 874 | uint64_t secvec : 1; /**< [ 0: 0](SR/W) Secure vector. |
| 875 | 0 = This vector may be read or written by either secure or nonsecure states. |
| 876 | 1 = This vector's MIO_TWS()_MSIX_VEC()_ADDR, MIO_TWS()_MSIX_VEC()_CTL, and corresponding |
| 877 | bit of MIO_TWS()_MSIX_PBA() are RAZ/WI and does not cause a fault when accessed |
| 878 | by the nonsecure world. |
| 879 | |
| 880 | If PCCPF_MIO_TWS()_VSEC_SCTL[MSIX_SEC] (for documentation, see |
| 881 | PCCPF_XXX_VSEC_SCTL[MSIX_SEC]) is set, all vectors are secure and function as if [SECVEC] |
| 882 | was set. */ |
| 883 | #else /* Word 0 - Little Endian */ |
| 884 | uint64_t secvec : 1; /**< [ 0: 0](SR/W) Secure vector. |
| 885 | 0 = This vector may be read or written by either secure or nonsecure states. |
| 886 | 1 = This vector's MIO_TWS()_MSIX_VEC()_ADDR, MIO_TWS()_MSIX_VEC()_CTL, and corresponding |
| 887 | bit of MIO_TWS()_MSIX_PBA() are RAZ/WI and does not cause a fault when accessed |
| 888 | by the nonsecure world. |
| 889 | |
| 890 | If PCCPF_MIO_TWS()_VSEC_SCTL[MSIX_SEC] (for documentation, see |
| 891 | PCCPF_XXX_VSEC_SCTL[MSIX_SEC]) is set, all vectors are secure and function as if [SECVEC] |
| 892 | was set. */ |
| 893 | uint64_t reserved_1 : 1; |
| 894 | uint64_t addr : 47; /**< [ 48: 2](R/W) IOVA to use for MSI-X delivery of this vector. */ |
| 895 | uint64_t reserved_49_63 : 15; |
| 896 | #endif /* Word 0 - End */ |
| 897 | } cn8; |
| 898 | /* struct bdk_mio_twsx_msix_vecx_addr_s cn9; */ |
| 899 | }; |
| 900 | typedef union bdk_mio_twsx_msix_vecx_addr bdk_mio_twsx_msix_vecx_addr_t; |
| 901 | |
| 902 | static inline uint64_t BDK_MIO_TWSX_MSIX_VECX_ADDR(unsigned long a, unsigned long b) __attribute__ ((pure, always_inline)); |
| 903 | static inline uint64_t BDK_MIO_TWSX_MSIX_VECX_ADDR(unsigned long a, unsigned long b) |
| 904 | { |
| 905 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && ((a<=1) && (b==0))) |
| 906 | return 0x87e0d0f00000ll + 0x1000000ll * ((a) & 0x1) + 0x10ll * ((b) & 0x0); |
| 907 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && ((a<=1) && (b==0))) |
| 908 | return 0x87e0d0f00000ll + 0x1000000ll * ((a) & 0x1) + 0x10ll * ((b) & 0x0); |
| 909 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && ((a<=5) && (b==0))) |
| 910 | return 0x87e0d0f00000ll + 0x1000000ll * ((a) & 0x7) + 0x10ll * ((b) & 0x0); |
| 911 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && ((a<=5) && (b==0))) |
| 912 | return 0x87e0d0f00000ll + 0x1000000ll * ((a) & 0x7) + 0x10ll * ((b) & 0x0); |
| 913 | __bdk_csr_fatal("MIO_TWSX_MSIX_VECX_ADDR", 2, a, b, 0, 0); |
| 914 | } |
| 915 | |
| 916 | #define typedef_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) bdk_mio_twsx_msix_vecx_addr_t |
| 917 | #define bustype_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) BDK_CSR_TYPE_RSL |
| 918 | #define basename_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) "MIO_TWSX_MSIX_VECX_ADDR" |
| 919 | #define device_bar_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) 0x4 /* PF_BAR4 */ |
| 920 | #define busnum_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) (a) |
| 921 | #define arguments_BDK_MIO_TWSX_MSIX_VECX_ADDR(a,b) (a),(b),-1,-1 |
| 922 | |
| 923 | /** |
| 924 | * Register (RSL) mio_tws#_msix_vec#_ctl |
| 925 | * |
| 926 | * TWSI MSI-X Vector Table Control and Data Registers |
| 927 | * This register is the MSI-X vector table, indexed by the MIO_TWS_INT_VEC_E enumeration. |
| 928 | */ |
| 929 | union bdk_mio_twsx_msix_vecx_ctl |
| 930 | { |
| 931 | uint64_t u; |
| 932 | struct bdk_mio_twsx_msix_vecx_ctl_s |
| 933 | { |
| 934 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 935 | uint64_t reserved_33_63 : 31; |
| 936 | uint64_t mask : 1; /**< [ 32: 32](R/W) When set, no MSI-X interrupts will be sent to this vector. */ |
| 937 | uint64_t data : 32; /**< [ 31: 0](R/W) Data to use for MSI-X delivery of this vector. */ |
| 938 | #else /* Word 0 - Little Endian */ |
| 939 | uint64_t data : 32; /**< [ 31: 0](R/W) Data to use for MSI-X delivery of this vector. */ |
| 940 | uint64_t mask : 1; /**< [ 32: 32](R/W) When set, no MSI-X interrupts will be sent to this vector. */ |
| 941 | uint64_t reserved_33_63 : 31; |
| 942 | #endif /* Word 0 - End */ |
| 943 | } s; |
| 944 | struct bdk_mio_twsx_msix_vecx_ctl_cn8 |
| 945 | { |
| 946 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 947 | uint64_t reserved_33_63 : 31; |
| 948 | uint64_t mask : 1; /**< [ 32: 32](R/W) When set, no MSI-X interrupts will be sent to this vector. */ |
| 949 | uint64_t reserved_20_31 : 12; |
| 950 | uint64_t data : 20; /**< [ 19: 0](R/W) Data to use for MSI-X delivery of this vector. */ |
| 951 | #else /* Word 0 - Little Endian */ |
| 952 | uint64_t data : 20; /**< [ 19: 0](R/W) Data to use for MSI-X delivery of this vector. */ |
| 953 | uint64_t reserved_20_31 : 12; |
| 954 | uint64_t mask : 1; /**< [ 32: 32](R/W) When set, no MSI-X interrupts will be sent to this vector. */ |
| 955 | uint64_t reserved_33_63 : 31; |
| 956 | #endif /* Word 0 - End */ |
| 957 | } cn8; |
| 958 | /* struct bdk_mio_twsx_msix_vecx_ctl_s cn9; */ |
| 959 | }; |
| 960 | typedef union bdk_mio_twsx_msix_vecx_ctl bdk_mio_twsx_msix_vecx_ctl_t; |
| 961 | |
| 962 | static inline uint64_t BDK_MIO_TWSX_MSIX_VECX_CTL(unsigned long a, unsigned long b) __attribute__ ((pure, always_inline)); |
| 963 | static inline uint64_t BDK_MIO_TWSX_MSIX_VECX_CTL(unsigned long a, unsigned long b) |
| 964 | { |
| 965 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && ((a<=1) && (b==0))) |
| 966 | return 0x87e0d0f00008ll + 0x1000000ll * ((a) & 0x1) + 0x10ll * ((b) & 0x0); |
| 967 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && ((a<=1) && (b==0))) |
| 968 | return 0x87e0d0f00008ll + 0x1000000ll * ((a) & 0x1) + 0x10ll * ((b) & 0x0); |
| 969 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && ((a<=5) && (b==0))) |
| 970 | return 0x87e0d0f00008ll + 0x1000000ll * ((a) & 0x7) + 0x10ll * ((b) & 0x0); |
| 971 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && ((a<=5) && (b==0))) |
| 972 | return 0x87e0d0f00008ll + 0x1000000ll * ((a) & 0x7) + 0x10ll * ((b) & 0x0); |
| 973 | __bdk_csr_fatal("MIO_TWSX_MSIX_VECX_CTL", 2, a, b, 0, 0); |
| 974 | } |
| 975 | |
| 976 | #define typedef_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) bdk_mio_twsx_msix_vecx_ctl_t |
| 977 | #define bustype_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) BDK_CSR_TYPE_RSL |
| 978 | #define basename_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) "MIO_TWSX_MSIX_VECX_CTL" |
| 979 | #define device_bar_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) 0x4 /* PF_BAR4 */ |
| 980 | #define busnum_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) (a) |
| 981 | #define arguments_BDK_MIO_TWSX_MSIX_VECX_CTL(a,b) (a),(b),-1,-1 |
| 982 | |
| 983 | /** |
| 984 | * Register (RSL) mio_tws#_sw_twsi |
| 985 | * |
| 986 | * TWSI Software to TWSI Register |
| 987 | * This register allows software to: |
| 988 | * * Initiate master-mode operations with a write operation, and read the result with a |
| 989 | * read operation. |
| 990 | * * Load four bytes for later retrieval (slave mode) with a write operation and check validity |
| 991 | * with a read operation. |
| 992 | * * Launch a configuration read/write operation with a write operation and read the result with |
| 993 | * a read operation. |
| 994 | * |
| 995 | * This register should be read or written by software, and read by the TWSI device. The TWSI |
| 996 | * device can use either two-byte or five-byte read operations to reference this register. |
| 997 | * The TWSI device considers this register valid when [V] = 1 and [SLONLY] = 1. |
| 998 | */ |
| 999 | union bdk_mio_twsx_sw_twsi |
| 1000 | { |
| 1001 | uint64_t u; |
| 1002 | struct bdk_mio_twsx_sw_twsi_s |
| 1003 | { |
| 1004 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1005 | uint64_t v : 1; /**< [ 63: 63](RC/W/H) Valid bit. Set on a write operation (should always be written with a 1). Cleared when a |
| 1006 | TWSI master-mode operation completes, a TWSI configuration register access completes, or |
| 1007 | when the TWSI device reads the register if [SLONLY] = 1. */ |
| 1008 | uint64_t slonly : 1; /**< [ 62: 62](R/W) Slave only mode. |
| 1009 | |
| 1010 | When this bit is set, no operations are initiated with a write operation. Only the D field |
| 1011 | is updated in this case. |
| 1012 | |
| 1013 | When this bit is clear, a write operation initiates either a master-mode operation or a |
| 1014 | TWSI configuration register access. */ |
| 1015 | uint64_t eia : 1; /**< [ 61: 61](R/W) Extended internal address. Sends an additional internal address byte (the MSB of [IA] is |
| 1016 | from MIO_TWS()_SW_TWSI_EXT[IA]). */ |
| 1017 | uint64_t op : 4; /**< [ 60: 57](R/W) Opcode field. When the register is written with [SLONLY] = 0, this field initiates one of |
| 1018 | the following read or write operations: |
| 1019 | 0x0 = 7-bit byte master-mode operation. |
| 1020 | 0x1 = 7-bit byte combined-read master-mode operation, 7-bit byte write-with-IA master-mode |
| 1021 | operation. |
| 1022 | 0x2 = 10-bit byte master-mode operation. |
| 1023 | 0x3 = 10-bit byte combined-read master-mode operation, 10-bit byte write-with-IA master- |
| 1024 | mode operation. |
| 1025 | 0x4 = TWSI master-clock register, TWSI_CLK in TWSI Master Clock Register. |
| 1026 | 0x6 = See [EOP_IA] field. |
| 1027 | 0x8 = 7-bit 4-byte master-mode operation. |
| 1028 | 0x9 = 7-bit 4-byte combined-read master-mode operation, 7-bit 4-byte write-with-IA master- |
| 1029 | mode operation. |
| 1030 | 0xA = 10-bit 4-byte master-mode operation. |
| 1031 | 0xB = 10-bit 4-byte combined-read master-mode operation, 10-bit 4-byte write-with-IA |
| 1032 | master-mode operation. */ |
| 1033 | uint64_t r : 1; /**< [ 56: 56](R/W/H) Read bit or result. If this bit is set on a CSR write when [SLONLY] = 0, the |
| 1034 | operation is a read operation (if clear, it is a write operation). |
| 1035 | On a CSR read, this bit returns the result indication for the most recent |
| 1036 | master-mode operation, 1 = success, 0 = failure. */ |
| 1037 | uint64_t sovr : 1; /**< [ 55: 55](R/W) Size override. If this bit is set, use the [SIZE] field to determine the master-mode |
| 1038 | operation size rather than what [OP] specifies. For operations greater than four bytes, the |
| 1039 | additional data is contained in MIO_TWS()_SW_TWSI_EXT[DATA]. */ |
| 1040 | uint64_t size : 3; /**< [ 54: 52](R/W) Size minus one. Specifies the size in bytes of the master-mode operation if |
| 1041 | [SOVR] = 1. (0 = 1 byte, 1 = 2 bytes, ... 7 = 8 bytes). */ |
| 1042 | uint64_t scr : 2; /**< [ 51: 50](R/W) Scratch. Unused, but retain state. */ |
| 1043 | uint64_t addr : 10; /**< [ 49: 40](R/W) Address field. The address of the remote device for a master-mode operation. ADDR\<9:7\> are |
| 1044 | only used for 10-bit addressing. |
| 1045 | |
| 1046 | Note that when mastering a 7-bit OP, ADDR\<6:0\> should not take any of the values 0x78, |
| 1047 | 0x79, 0x7A nor 0x7B. (These 7-bit addresses are reserved to extend to 10-bit addressing). */ |
| 1048 | uint64_t ia : 5; /**< [ 39: 35](R/W) Internal address. Used when launching a combined master-mode operation. The lower 3 |
| 1049 | address bits are contained in [EOP_IA]. */ |
| 1050 | uint64_t eop_ia : 3; /**< [ 34: 32](R/W) Extra opcode, used when OP\<3:0\> = 0x6 and [SLONLY] = 0. |
| 1051 | 0x0 = TWSI slave address register (TWSI_SLAVE_ADD). |
| 1052 | 0x1 = TWSI data register (TWSI_DATA). |
| 1053 | 0x2 = TWSI control register (TWSI_CTL). |
| 1054 | 0x3 = (when [R] = 0) TWSI clock control register (TWSI_CLKCTL). |
| 1055 | 0x3 = (when [R] = 1) TWSI status register (TWSI_STAT). |
| 1056 | 0x4 = TWSI extended slave register (TWSI_SLAVE_ADD_EXT). |
| 1057 | 0x7 = TWSI soft reset register (TWSI_RST). |
| 1058 | |
| 1059 | Also provides the lower three bits of internal address when launching a combined master-mode |
| 1060 | operation. */ |
| 1061 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Data field. |
| 1062 | Used on a write operation when: |
| 1063 | * Initiating a master-mode write operation ([SLONLY] = 0). |
| 1064 | * Writing a TWSI configuration register ([SLONLY] = 0). |
| 1065 | * A slave-mode write operation ([SLONLY] = 1). |
| 1066 | |
| 1067 | The read value is updated by: |
| 1068 | * A write operation to this register. |
| 1069 | * Master-mode completion (contains error code). |
| 1070 | * TWSI configuration-register read (contains result). */ |
| 1071 | #else /* Word 0 - Little Endian */ |
| 1072 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Data field. |
| 1073 | Used on a write operation when: |
| 1074 | * Initiating a master-mode write operation ([SLONLY] = 0). |
| 1075 | * Writing a TWSI configuration register ([SLONLY] = 0). |
| 1076 | * A slave-mode write operation ([SLONLY] = 1). |
| 1077 | |
| 1078 | The read value is updated by: |
| 1079 | * A write operation to this register. |
| 1080 | * Master-mode completion (contains error code). |
| 1081 | * TWSI configuration-register read (contains result). */ |
| 1082 | uint64_t eop_ia : 3; /**< [ 34: 32](R/W) Extra opcode, used when OP\<3:0\> = 0x6 and [SLONLY] = 0. |
| 1083 | 0x0 = TWSI slave address register (TWSI_SLAVE_ADD). |
| 1084 | 0x1 = TWSI data register (TWSI_DATA). |
| 1085 | 0x2 = TWSI control register (TWSI_CTL). |
| 1086 | 0x3 = (when [R] = 0) TWSI clock control register (TWSI_CLKCTL). |
| 1087 | 0x3 = (when [R] = 1) TWSI status register (TWSI_STAT). |
| 1088 | 0x4 = TWSI extended slave register (TWSI_SLAVE_ADD_EXT). |
| 1089 | 0x7 = TWSI soft reset register (TWSI_RST). |
| 1090 | |
| 1091 | Also provides the lower three bits of internal address when launching a combined master-mode |
| 1092 | operation. */ |
| 1093 | uint64_t ia : 5; /**< [ 39: 35](R/W) Internal address. Used when launching a combined master-mode operation. The lower 3 |
| 1094 | address bits are contained in [EOP_IA]. */ |
| 1095 | uint64_t addr : 10; /**< [ 49: 40](R/W) Address field. The address of the remote device for a master-mode operation. ADDR\<9:7\> are |
| 1096 | only used for 10-bit addressing. |
| 1097 | |
| 1098 | Note that when mastering a 7-bit OP, ADDR\<6:0\> should not take any of the values 0x78, |
| 1099 | 0x79, 0x7A nor 0x7B. (These 7-bit addresses are reserved to extend to 10-bit addressing). */ |
| 1100 | uint64_t scr : 2; /**< [ 51: 50](R/W) Scratch. Unused, but retain state. */ |
| 1101 | uint64_t size : 3; /**< [ 54: 52](R/W) Size minus one. Specifies the size in bytes of the master-mode operation if |
| 1102 | [SOVR] = 1. (0 = 1 byte, 1 = 2 bytes, ... 7 = 8 bytes). */ |
| 1103 | uint64_t sovr : 1; /**< [ 55: 55](R/W) Size override. If this bit is set, use the [SIZE] field to determine the master-mode |
| 1104 | operation size rather than what [OP] specifies. For operations greater than four bytes, the |
| 1105 | additional data is contained in MIO_TWS()_SW_TWSI_EXT[DATA]. */ |
| 1106 | uint64_t r : 1; /**< [ 56: 56](R/W/H) Read bit or result. If this bit is set on a CSR write when [SLONLY] = 0, the |
| 1107 | operation is a read operation (if clear, it is a write operation). |
| 1108 | On a CSR read, this bit returns the result indication for the most recent |
| 1109 | master-mode operation, 1 = success, 0 = failure. */ |
| 1110 | uint64_t op : 4; /**< [ 60: 57](R/W) Opcode field. When the register is written with [SLONLY] = 0, this field initiates one of |
| 1111 | the following read or write operations: |
| 1112 | 0x0 = 7-bit byte master-mode operation. |
| 1113 | 0x1 = 7-bit byte combined-read master-mode operation, 7-bit byte write-with-IA master-mode |
| 1114 | operation. |
| 1115 | 0x2 = 10-bit byte master-mode operation. |
| 1116 | 0x3 = 10-bit byte combined-read master-mode operation, 10-bit byte write-with-IA master- |
| 1117 | mode operation. |
| 1118 | 0x4 = TWSI master-clock register, TWSI_CLK in TWSI Master Clock Register. |
| 1119 | 0x6 = See [EOP_IA] field. |
| 1120 | 0x8 = 7-bit 4-byte master-mode operation. |
| 1121 | 0x9 = 7-bit 4-byte combined-read master-mode operation, 7-bit 4-byte write-with-IA master- |
| 1122 | mode operation. |
| 1123 | 0xA = 10-bit 4-byte master-mode operation. |
| 1124 | 0xB = 10-bit 4-byte combined-read master-mode operation, 10-bit 4-byte write-with-IA |
| 1125 | master-mode operation. */ |
| 1126 | uint64_t eia : 1; /**< [ 61: 61](R/W) Extended internal address. Sends an additional internal address byte (the MSB of [IA] is |
| 1127 | from MIO_TWS()_SW_TWSI_EXT[IA]). */ |
| 1128 | uint64_t slonly : 1; /**< [ 62: 62](R/W) Slave only mode. |
| 1129 | |
| 1130 | When this bit is set, no operations are initiated with a write operation. Only the D field |
| 1131 | is updated in this case. |
| 1132 | |
| 1133 | When this bit is clear, a write operation initiates either a master-mode operation or a |
| 1134 | TWSI configuration register access. */ |
| 1135 | uint64_t v : 1; /**< [ 63: 63](RC/W/H) Valid bit. Set on a write operation (should always be written with a 1). Cleared when a |
| 1136 | TWSI master-mode operation completes, a TWSI configuration register access completes, or |
| 1137 | when the TWSI device reads the register if [SLONLY] = 1. */ |
| 1138 | #endif /* Word 0 - End */ |
| 1139 | } s; |
| 1140 | /* struct bdk_mio_twsx_sw_twsi_s cn8; */ |
| 1141 | struct bdk_mio_twsx_sw_twsi_cn9 |
| 1142 | { |
| 1143 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1144 | uint64_t v : 1; /**< [ 63: 63](RC/W/H) Valid bit. Set on a write operation (should always be written with a 1). Cleared when a |
| 1145 | TWSI master-mode operation completes, a TWSI configuration register access completes, or |
| 1146 | when the TWSI device reads the register if [SLONLY] = 1. */ |
| 1147 | uint64_t slonly : 1; /**< [ 62: 62](R/W) Slave only mode. |
| 1148 | |
| 1149 | When this bit is set, no operations are initiated with a write operation. Only the D field |
| 1150 | is updated in this case. |
| 1151 | |
| 1152 | When this bit is clear, a write operation initiates either a master-mode operation or a |
| 1153 | TWSI configuration register access. */ |
| 1154 | uint64_t eia : 1; /**< [ 61: 61](R/W) Extended internal address. Sends an additional internal address byte (the MSB of [IA] is |
| 1155 | from MIO_TWS()_SW_TWSI_EXT[IA]). */ |
| 1156 | uint64_t op : 4; /**< [ 60: 57](R/W) Opcode field. When the register is written with [SLONLY] = 0, this field initiates one of |
| 1157 | the following read or write operations: |
| 1158 | 0x0 = 7-bit byte master-mode operation. |
| 1159 | 0x1 = 7-bit byte combined-read master-mode operation, 7-bit byte write-with-IA master-mode |
| 1160 | operation. |
| 1161 | 0x2 = 10-bit byte master-mode operation. |
| 1162 | 0x3 = 10-bit byte combined-read master-mode operation, 10-bit byte write-with-IA master- |
| 1163 | mode operation. |
| 1164 | 0x4 = TWSI master-clock register, TWSI_CLK in TWSI Master Clock Register. |
| 1165 | 0x6 = See [EOP_IA] field. |
| 1166 | 0x8 = 7-bit 4-byte master-mode operation. |
| 1167 | 0x9 = 7-bit 4-byte combined-read master-mode operation, 7-bit 4-byte write-with-IA master- |
| 1168 | mode operation. |
| 1169 | 0xA = 10-bit 4-byte master-mode operation. |
| 1170 | 0xB = 10-bit 4-byte combined-read master-mode operation, 10-bit 4-byte write-with-IA |
| 1171 | master-mode operation. */ |
| 1172 | uint64_t r : 1; /**< [ 56: 56](R/W/H) Read bit or result. If this bit is set on a CSR write when [SLONLY] = 0, the |
| 1173 | operation is a read operation (if clear, it is a write operation). |
| 1174 | On a CSR read, this bit returns the result indication for the most recent |
| 1175 | master-mode operation, 1 = success, 0 = failure. */ |
| 1176 | uint64_t sovr : 1; /**< [ 55: 55](R/W) Size override. If this bit is set, use the [SIZE] field to determine the master-mode |
| 1177 | operation size rather than what [OP] specifies. For operations greater than four bytes, the |
| 1178 | additional data is contained in MIO_TWS()_SW_TWSI_EXT[DATA]. In block mode, |
| 1179 | all data can be accessible from FIFO interface MIO_TWS()_TWSI_BLOCK_FIFO. */ |
| 1180 | uint64_t size : 3; /**< [ 54: 52](R/W) Size minus one for HLC non block mode. Specifies the size in bytes of the master-mode |
| 1181 | operation if [SOVR] = 1. (0 = 1 byte, 1 = 2 bytes, ... 7 = 8 bytes). |
| 1182 | block mode's block size is defined by MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE]. */ |
| 1183 | uint64_t scr : 2; /**< [ 51: 50](R/W) Scratch. Unused, but retain state. */ |
| 1184 | uint64_t addr : 10; /**< [ 49: 40](R/W) Address field. The address of the remote device for a master-mode operation. ADDR\<9:7\> are |
| 1185 | only used for 10-bit addressing. |
| 1186 | |
| 1187 | Note that when mastering a 7-bit OP, ADDR\<6:0\> should not take any of the values 0x78, |
| 1188 | 0x79, 0x7A nor 0x7B. (These 7-bit addresses are reserved to extend to 10-bit addressing). */ |
| 1189 | uint64_t ia : 5; /**< [ 39: 35](R/W) Internal address. Used when launching a combined master-mode operation. The lower 3 |
| 1190 | address bits are contained in [EOP_IA]. */ |
| 1191 | uint64_t eop_ia : 3; /**< [ 34: 32](R/W) Extra opcode, used when OP\<3:0\> = 0x6 and [SLONLY] = 0. |
| 1192 | 0x0 = TWSI slave address register (TWSI_SLAVE_ADD). |
| 1193 | 0x1 = TWSI data register (TWSI_DATA). |
| 1194 | 0x2 = TWSI control register (TWSI_CTL). |
| 1195 | 0x3 = (when [R] = 0) TWSI clock control register (TWSI_CLKCTL). |
| 1196 | 0x3 = (when [R] = 1) TWSI status register (TWSI_STAT). |
| 1197 | 0x4 = TWSI extended slave register (TWSI_SLAVE_ADD_EXT). |
| 1198 | 0x7 = TWSI soft reset register (TWSI_RST). |
| 1199 | |
| 1200 | Also provides the lower three bits of internal address when launching a combined master-mode |
| 1201 | operation. */ |
| 1202 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Data field, bytes 0-3. |
| 1203 | Used on a write operation when: |
| 1204 | * Initiating a master-mode write operation ([SLONLY] = 0). |
| 1205 | * Writing a TWSI configuration register ([SLONLY] = 0). |
| 1206 | * A slave-mode write operation ([SLONLY] = 1). |
| 1207 | |
| 1208 | The read value is updated by: |
| 1209 | * A write operation to this register. |
| 1210 | * Master-mode completion (contains error code). |
| 1211 | * TWSI configuration-register read (contains result). */ |
| 1212 | #else /* Word 0 - Little Endian */ |
| 1213 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Data field, bytes 0-3. |
| 1214 | Used on a write operation when: |
| 1215 | * Initiating a master-mode write operation ([SLONLY] = 0). |
| 1216 | * Writing a TWSI configuration register ([SLONLY] = 0). |
| 1217 | * A slave-mode write operation ([SLONLY] = 1). |
| 1218 | |
| 1219 | The read value is updated by: |
| 1220 | * A write operation to this register. |
| 1221 | * Master-mode completion (contains error code). |
| 1222 | * TWSI configuration-register read (contains result). */ |
| 1223 | uint64_t eop_ia : 3; /**< [ 34: 32](R/W) Extra opcode, used when OP\<3:0\> = 0x6 and [SLONLY] = 0. |
| 1224 | 0x0 = TWSI slave address register (TWSI_SLAVE_ADD). |
| 1225 | 0x1 = TWSI data register (TWSI_DATA). |
| 1226 | 0x2 = TWSI control register (TWSI_CTL). |
| 1227 | 0x3 = (when [R] = 0) TWSI clock control register (TWSI_CLKCTL). |
| 1228 | 0x3 = (when [R] = 1) TWSI status register (TWSI_STAT). |
| 1229 | 0x4 = TWSI extended slave register (TWSI_SLAVE_ADD_EXT). |
| 1230 | 0x7 = TWSI soft reset register (TWSI_RST). |
| 1231 | |
| 1232 | Also provides the lower three bits of internal address when launching a combined master-mode |
| 1233 | operation. */ |
| 1234 | uint64_t ia : 5; /**< [ 39: 35](R/W) Internal address. Used when launching a combined master-mode operation. The lower 3 |
| 1235 | address bits are contained in [EOP_IA]. */ |
| 1236 | uint64_t addr : 10; /**< [ 49: 40](R/W) Address field. The address of the remote device for a master-mode operation. ADDR\<9:7\> are |
| 1237 | only used for 10-bit addressing. |
| 1238 | |
| 1239 | Note that when mastering a 7-bit OP, ADDR\<6:0\> should not take any of the values 0x78, |
| 1240 | 0x79, 0x7A nor 0x7B. (These 7-bit addresses are reserved to extend to 10-bit addressing). */ |
| 1241 | uint64_t scr : 2; /**< [ 51: 50](R/W) Scratch. Unused, but retain state. */ |
| 1242 | uint64_t size : 3; /**< [ 54: 52](R/W) Size minus one for HLC non block mode. Specifies the size in bytes of the master-mode |
| 1243 | operation if [SOVR] = 1. (0 = 1 byte, 1 = 2 bytes, ... 7 = 8 bytes). |
| 1244 | block mode's block size is defined by MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE]. */ |
| 1245 | uint64_t sovr : 1; /**< [ 55: 55](R/W) Size override. If this bit is set, use the [SIZE] field to determine the master-mode |
| 1246 | operation size rather than what [OP] specifies. For operations greater than four bytes, the |
| 1247 | additional data is contained in MIO_TWS()_SW_TWSI_EXT[DATA]. In block mode, |
| 1248 | all data can be accessible from FIFO interface MIO_TWS()_TWSI_BLOCK_FIFO. */ |
| 1249 | uint64_t r : 1; /**< [ 56: 56](R/W/H) Read bit or result. If this bit is set on a CSR write when [SLONLY] = 0, the |
| 1250 | operation is a read operation (if clear, it is a write operation). |
| 1251 | On a CSR read, this bit returns the result indication for the most recent |
| 1252 | master-mode operation, 1 = success, 0 = failure. */ |
| 1253 | uint64_t op : 4; /**< [ 60: 57](R/W) Opcode field. When the register is written with [SLONLY] = 0, this field initiates one of |
| 1254 | the following read or write operations: |
| 1255 | 0x0 = 7-bit byte master-mode operation. |
| 1256 | 0x1 = 7-bit byte combined-read master-mode operation, 7-bit byte write-with-IA master-mode |
| 1257 | operation. |
| 1258 | 0x2 = 10-bit byte master-mode operation. |
| 1259 | 0x3 = 10-bit byte combined-read master-mode operation, 10-bit byte write-with-IA master- |
| 1260 | mode operation. |
| 1261 | 0x4 = TWSI master-clock register, TWSI_CLK in TWSI Master Clock Register. |
| 1262 | 0x6 = See [EOP_IA] field. |
| 1263 | 0x8 = 7-bit 4-byte master-mode operation. |
| 1264 | 0x9 = 7-bit 4-byte combined-read master-mode operation, 7-bit 4-byte write-with-IA master- |
| 1265 | mode operation. |
| 1266 | 0xA = 10-bit 4-byte master-mode operation. |
| 1267 | 0xB = 10-bit 4-byte combined-read master-mode operation, 10-bit 4-byte write-with-IA |
| 1268 | master-mode operation. */ |
| 1269 | uint64_t eia : 1; /**< [ 61: 61](R/W) Extended internal address. Sends an additional internal address byte (the MSB of [IA] is |
| 1270 | from MIO_TWS()_SW_TWSI_EXT[IA]). */ |
| 1271 | uint64_t slonly : 1; /**< [ 62: 62](R/W) Slave only mode. |
| 1272 | |
| 1273 | When this bit is set, no operations are initiated with a write operation. Only the D field |
| 1274 | is updated in this case. |
| 1275 | |
| 1276 | When this bit is clear, a write operation initiates either a master-mode operation or a |
| 1277 | TWSI configuration register access. */ |
| 1278 | uint64_t v : 1; /**< [ 63: 63](RC/W/H) Valid bit. Set on a write operation (should always be written with a 1). Cleared when a |
| 1279 | TWSI master-mode operation completes, a TWSI configuration register access completes, or |
| 1280 | when the TWSI device reads the register if [SLONLY] = 1. */ |
| 1281 | #endif /* Word 0 - End */ |
| 1282 | } cn9; |
| 1283 | }; |
| 1284 | typedef union bdk_mio_twsx_sw_twsi bdk_mio_twsx_sw_twsi_t; |
| 1285 | |
| 1286 | static inline uint64_t BDK_MIO_TWSX_SW_TWSI(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1287 | static inline uint64_t BDK_MIO_TWSX_SW_TWSI(unsigned long a) |
| 1288 | { |
| 1289 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 1290 | return 0x87e0d0001000ll + 0x1000000ll * ((a) & 0x1); |
| 1291 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 1292 | return 0x87e0d0001000ll + 0x1000000ll * ((a) & 0x1); |
| 1293 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 1294 | return 0x87e0d0001000ll + 0x1000000ll * ((a) & 0x7); |
| 1295 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1296 | return 0x87e0d0001000ll + 0x1000000ll * ((a) & 0x7); |
| 1297 | __bdk_csr_fatal("MIO_TWSX_SW_TWSI", 1, a, 0, 0, 0); |
| 1298 | } |
| 1299 | |
| 1300 | #define typedef_BDK_MIO_TWSX_SW_TWSI(a) bdk_mio_twsx_sw_twsi_t |
| 1301 | #define bustype_BDK_MIO_TWSX_SW_TWSI(a) BDK_CSR_TYPE_RSL |
| 1302 | #define basename_BDK_MIO_TWSX_SW_TWSI(a) "MIO_TWSX_SW_TWSI" |
| 1303 | #define device_bar_BDK_MIO_TWSX_SW_TWSI(a) 0x0 /* PF_BAR0 */ |
| 1304 | #define busnum_BDK_MIO_TWSX_SW_TWSI(a) (a) |
| 1305 | #define arguments_BDK_MIO_TWSX_SW_TWSI(a) (a),-1,-1,-1 |
| 1306 | |
| 1307 | /** |
| 1308 | * Register (RSL) mio_tws#_sw_twsi_ext |
| 1309 | * |
| 1310 | * TWSI Software to TWSI Extension Register |
| 1311 | * This register contains an additional byte of internal address and four additional bytes of |
| 1312 | * data to be used with TWSI master-mode operations. |
| 1313 | * |
| 1314 | * The IA field is sent as the first byte of internal address when performing master-mode |
| 1315 | * combined-read/write-with-IA operations and MIO_TWS()_SW_TWSI[EIA] is set. The D field |
| 1316 | * extends the data field of MIO_TWS()_SW_TWSI for a total of 8 bytes (SOVR must be set to |
| 1317 | * perform operations greater than four bytes). |
| 1318 | */ |
| 1319 | union bdk_mio_twsx_sw_twsi_ext |
| 1320 | { |
| 1321 | uint64_t u; |
| 1322 | struct bdk_mio_twsx_sw_twsi_ext_s |
| 1323 | { |
| 1324 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1325 | uint64_t reserved_40_63 : 24; |
| 1326 | uint64_t ia : 8; /**< [ 39: 32](R/W) Extended internal address. Sent as the first byte of internal address when performing |
| 1327 | master-mode combined-read/write-with-IA operations and MIO_TWS()_SW_TWSI[EIA] is set. */ |
| 1328 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Extended data. Extends the data field of MIO_TWS()_SW_TWSI for a total of eight bytes |
| 1329 | (MIO_TWS()_SW_TWSI[SOVR] must be set to 1 to perform operations greater than four |
| 1330 | bytes). */ |
| 1331 | #else /* Word 0 - Little Endian */ |
| 1332 | uint64_t data : 32; /**< [ 31: 0](R/W/H) Extended data. Extends the data field of MIO_TWS()_SW_TWSI for a total of eight bytes |
| 1333 | (MIO_TWS()_SW_TWSI[SOVR] must be set to 1 to perform operations greater than four |
| 1334 | bytes). */ |
| 1335 | uint64_t ia : 8; /**< [ 39: 32](R/W) Extended internal address. Sent as the first byte of internal address when performing |
| 1336 | master-mode combined-read/write-with-IA operations and MIO_TWS()_SW_TWSI[EIA] is set. */ |
| 1337 | uint64_t reserved_40_63 : 24; |
| 1338 | #endif /* Word 0 - End */ |
| 1339 | } s; |
| 1340 | /* struct bdk_mio_twsx_sw_twsi_ext_s cn; */ |
| 1341 | }; |
| 1342 | typedef union bdk_mio_twsx_sw_twsi_ext bdk_mio_twsx_sw_twsi_ext_t; |
| 1343 | |
| 1344 | static inline uint64_t BDK_MIO_TWSX_SW_TWSI_EXT(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1345 | static inline uint64_t BDK_MIO_TWSX_SW_TWSI_EXT(unsigned long a) |
| 1346 | { |
| 1347 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 1348 | return 0x87e0d0001018ll + 0x1000000ll * ((a) & 0x1); |
| 1349 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 1350 | return 0x87e0d0001018ll + 0x1000000ll * ((a) & 0x1); |
| 1351 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 1352 | return 0x87e0d0001018ll + 0x1000000ll * ((a) & 0x7); |
| 1353 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1354 | return 0x87e0d0001018ll + 0x1000000ll * ((a) & 0x7); |
| 1355 | __bdk_csr_fatal("MIO_TWSX_SW_TWSI_EXT", 1, a, 0, 0, 0); |
| 1356 | } |
| 1357 | |
| 1358 | #define typedef_BDK_MIO_TWSX_SW_TWSI_EXT(a) bdk_mio_twsx_sw_twsi_ext_t |
| 1359 | #define bustype_BDK_MIO_TWSX_SW_TWSI_EXT(a) BDK_CSR_TYPE_RSL |
| 1360 | #define basename_BDK_MIO_TWSX_SW_TWSI_EXT(a) "MIO_TWSX_SW_TWSI_EXT" |
| 1361 | #define device_bar_BDK_MIO_TWSX_SW_TWSI_EXT(a) 0x0 /* PF_BAR0 */ |
| 1362 | #define busnum_BDK_MIO_TWSX_SW_TWSI_EXT(a) (a) |
| 1363 | #define arguments_BDK_MIO_TWSX_SW_TWSI_EXT(a) (a),-1,-1,-1 |
| 1364 | |
| 1365 | /** |
| 1366 | * Register (RSL) mio_tws#_tstamp_rx |
| 1367 | * |
| 1368 | * MIO TWSI Receive Timestamp Register |
| 1369 | * This register contains the timestamp latched when TWSI device receives the first bit on TWSI |
| 1370 | * SCL falling edge. This function is only supported in non-block mode. |
| 1371 | */ |
| 1372 | union bdk_mio_twsx_tstamp_rx |
| 1373 | { |
| 1374 | uint64_t u; |
| 1375 | struct bdk_mio_twsx_tstamp_rx_s |
| 1376 | { |
| 1377 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1378 | uint64_t nanosec : 64; /**< [ 63: 0](RO/H) Timestamp in nanoseconds. */ |
| 1379 | #else /* Word 0 - Little Endian */ |
| 1380 | uint64_t nanosec : 64; /**< [ 63: 0](RO/H) Timestamp in nanoseconds. */ |
| 1381 | #endif /* Word 0 - End */ |
| 1382 | } s; |
| 1383 | /* struct bdk_mio_twsx_tstamp_rx_s cn; */ |
| 1384 | }; |
| 1385 | typedef union bdk_mio_twsx_tstamp_rx bdk_mio_twsx_tstamp_rx_t; |
| 1386 | |
| 1387 | static inline uint64_t BDK_MIO_TWSX_TSTAMP_RX(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1388 | static inline uint64_t BDK_MIO_TWSX_TSTAMP_RX(unsigned long a) |
| 1389 | { |
| 1390 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1391 | return 0x87e0d0001068ll + 0x1000000ll * ((a) & 0x7); |
| 1392 | __bdk_csr_fatal("MIO_TWSX_TSTAMP_RX", 1, a, 0, 0, 0); |
| 1393 | } |
| 1394 | |
| 1395 | #define typedef_BDK_MIO_TWSX_TSTAMP_RX(a) bdk_mio_twsx_tstamp_rx_t |
| 1396 | #define bustype_BDK_MIO_TWSX_TSTAMP_RX(a) BDK_CSR_TYPE_RSL |
| 1397 | #define basename_BDK_MIO_TWSX_TSTAMP_RX(a) "MIO_TWSX_TSTAMP_RX" |
| 1398 | #define device_bar_BDK_MIO_TWSX_TSTAMP_RX(a) 0x0 /* PF_BAR0 */ |
| 1399 | #define busnum_BDK_MIO_TWSX_TSTAMP_RX(a) (a) |
| 1400 | #define arguments_BDK_MIO_TWSX_TSTAMP_RX(a) (a),-1,-1,-1 |
| 1401 | |
| 1402 | /** |
| 1403 | * Register (RSL) mio_tws#_tstamp_tx |
| 1404 | * |
| 1405 | * MIO TWSI Transmit Timestamp Register |
| 1406 | * This register contains the timestamp latched when TWSI device drives the first bit on TWSI |
| 1407 | * SCL falling edge. This function is only supported in non-block mode. |
| 1408 | */ |
| 1409 | union bdk_mio_twsx_tstamp_tx |
| 1410 | { |
| 1411 | uint64_t u; |
| 1412 | struct bdk_mio_twsx_tstamp_tx_s |
| 1413 | { |
| 1414 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1415 | uint64_t nanosec : 64; /**< [ 63: 0](RO/H) Timestamp in nanoseconds. */ |
| 1416 | #else /* Word 0 - Little Endian */ |
| 1417 | uint64_t nanosec : 64; /**< [ 63: 0](RO/H) Timestamp in nanoseconds. */ |
| 1418 | #endif /* Word 0 - End */ |
| 1419 | } s; |
| 1420 | /* struct bdk_mio_twsx_tstamp_tx_s cn; */ |
| 1421 | }; |
| 1422 | typedef union bdk_mio_twsx_tstamp_tx bdk_mio_twsx_tstamp_tx_t; |
| 1423 | |
| 1424 | static inline uint64_t BDK_MIO_TWSX_TSTAMP_TX(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1425 | static inline uint64_t BDK_MIO_TWSX_TSTAMP_TX(unsigned long a) |
| 1426 | { |
| 1427 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1428 | return 0x87e0d0001060ll + 0x1000000ll * ((a) & 0x7); |
| 1429 | __bdk_csr_fatal("MIO_TWSX_TSTAMP_TX", 1, a, 0, 0, 0); |
| 1430 | } |
| 1431 | |
| 1432 | #define typedef_BDK_MIO_TWSX_TSTAMP_TX(a) bdk_mio_twsx_tstamp_tx_t |
| 1433 | #define bustype_BDK_MIO_TWSX_TSTAMP_TX(a) BDK_CSR_TYPE_RSL |
| 1434 | #define basename_BDK_MIO_TWSX_TSTAMP_TX(a) "MIO_TWSX_TSTAMP_TX" |
| 1435 | #define device_bar_BDK_MIO_TWSX_TSTAMP_TX(a) 0x0 /* PF_BAR0 */ |
| 1436 | #define busnum_BDK_MIO_TWSX_TSTAMP_TX(a) (a) |
| 1437 | #define arguments_BDK_MIO_TWSX_TSTAMP_TX(a) (a),-1,-1,-1 |
| 1438 | |
| 1439 | /** |
| 1440 | * Register (RSL) mio_tws#_twsi_block_ctl |
| 1441 | * |
| 1442 | * TWSI Block Mode Control Register |
| 1443 | * This register contains the control bits when TWSI is in block mode. Data can be written/read |
| 1444 | * from MIO_TWS()_TWSI_BLOCK_FIFO[DATA] sequentially in block mode. |
| 1445 | */ |
| 1446 | union bdk_mio_twsx_twsi_block_ctl |
| 1447 | { |
| 1448 | uint64_t u; |
| 1449 | struct bdk_mio_twsx_twsi_block_ctl_s |
| 1450 | { |
| 1451 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1452 | uint64_t reserved_33_63 : 31; |
| 1453 | uint64_t slave_vbyte : 1; /**< [ 32: 32](R/W) When this mode set to 1 in block mode, slave mode read response will include |
| 1454 | an extra V byte rest of the data transmission. The definition of V byte is compatible |
| 1455 | with 1 byte/4 byte slave response. */ |
| 1456 | uint64_t reserved_27_31 : 5; |
| 1457 | uint64_t block_thresh : 11; /**< [ 26: 16](R/W) Block mode interrupt threshold, from 0-1024, 0x0 disables the |
| 1458 | interrupt. MIO_TWS()_INT[BLOCK_INT] interrupt will fire when the number of |
| 1459 | remaining bytes to be sent/received is less than threshold. If the number of |
| 1460 | bytes to be sent/received is less than threshold [BLOCK_THRESH], the interrupt |
| 1461 | will fire immediately. This interrupt is enabled only in HLC block mode. */ |
| 1462 | uint64_t reserved_10_15 : 6; |
| 1463 | uint64_t block_size : 10; /**< [ 9: 0](R/W) Block mode FIFO transmission/receiving data size minus one, |
| 1464 | valid value from 0-1023, corresponding to 1-1024 bytes to be sent/received. */ |
| 1465 | #else /* Word 0 - Little Endian */ |
| 1466 | uint64_t block_size : 10; /**< [ 9: 0](R/W) Block mode FIFO transmission/receiving data size minus one, |
| 1467 | valid value from 0-1023, corresponding to 1-1024 bytes to be sent/received. */ |
| 1468 | uint64_t reserved_10_15 : 6; |
| 1469 | uint64_t block_thresh : 11; /**< [ 26: 16](R/W) Block mode interrupt threshold, from 0-1024, 0x0 disables the |
| 1470 | interrupt. MIO_TWS()_INT[BLOCK_INT] interrupt will fire when the number of |
| 1471 | remaining bytes to be sent/received is less than threshold. If the number of |
| 1472 | bytes to be sent/received is less than threshold [BLOCK_THRESH], the interrupt |
| 1473 | will fire immediately. This interrupt is enabled only in HLC block mode. */ |
| 1474 | uint64_t reserved_27_31 : 5; |
| 1475 | uint64_t slave_vbyte : 1; /**< [ 32: 32](R/W) When this mode set to 1 in block mode, slave mode read response will include |
| 1476 | an extra V byte rest of the data transmission. The definition of V byte is compatible |
| 1477 | with 1 byte/4 byte slave response. */ |
| 1478 | uint64_t reserved_33_63 : 31; |
| 1479 | #endif /* Word 0 - End */ |
| 1480 | } s; |
| 1481 | /* struct bdk_mio_twsx_twsi_block_ctl_s cn; */ |
| 1482 | }; |
| 1483 | typedef union bdk_mio_twsx_twsi_block_ctl bdk_mio_twsx_twsi_block_ctl_t; |
| 1484 | |
| 1485 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_CTL(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1486 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_CTL(unsigned long a) |
| 1487 | { |
| 1488 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1489 | return 0x87e0d0001048ll + 0x1000000ll * ((a) & 0x7); |
| 1490 | __bdk_csr_fatal("MIO_TWSX_TWSI_BLOCK_CTL", 1, a, 0, 0, 0); |
| 1491 | } |
| 1492 | |
| 1493 | #define typedef_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) bdk_mio_twsx_twsi_block_ctl_t |
| 1494 | #define bustype_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) BDK_CSR_TYPE_RSL |
| 1495 | #define basename_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) "MIO_TWSX_TWSI_BLOCK_CTL" |
| 1496 | #define device_bar_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) 0x0 /* PF_BAR0 */ |
| 1497 | #define busnum_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) (a) |
| 1498 | #define arguments_BDK_MIO_TWSX_TWSI_BLOCK_CTL(a) (a),-1,-1,-1 |
| 1499 | |
| 1500 | /** |
| 1501 | * Register (RSL) mio_tws#_twsi_block_fifo |
| 1502 | * |
| 1503 | * TWSI Block Mode Data Register |
| 1504 | * This register is only valid in HLC block mode. This register allows software to |
| 1505 | * push or pop block of data (up to 1024 bytes) to/from TWSI device through FIFO interface. |
| 1506 | * For TWSI writes, software does a serial of writes to fill up the FIFO before |
| 1507 | * starting the TWSI HLC transaction. For TWSI reads, software needs to do a serial of reads |
| 1508 | * after TWSI transaction finished indicated by MIO_TWS()_TWSI_BLOCK_STS[BUSY] or interrupt. |
| 1509 | * The order of data transmitted on TWSI bus is: |
| 1510 | * _ {D1, D2, D3, D4, D5, ...., D[block_size]}, with MSB of each byte transmitted first. |
| 1511 | * |
| 1512 | * The FIFO pointer needs to be reset by writing 1 to MIO_TWS()_TWSI_BLOCK_STS[RESET_PTR] before |
| 1513 | * software accesses. |
| 1514 | * The order of software writes or reads through MIO_TWS()_TWSI_BLOCK_FIFO[DATA] is: |
| 1515 | * _ 1st push/pop {D1, D2, D3, D4, D5, D6, D7}. |
| 1516 | * _ 2nd push/pop {D8, D9, D10, D11, D12, D13, D14, D15}. |
| 1517 | * _ 3rd .... |
| 1518 | * _ last push/pop {D[block_size-1], D[block_size], 0, 0, 0, 0, 0, 0}. |
| 1519 | * |
| 1520 | * Where block_size is MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE]. |
| 1521 | */ |
| 1522 | union bdk_mio_twsx_twsi_block_fifo |
| 1523 | { |
| 1524 | uint64_t u; |
| 1525 | struct bdk_mio_twsx_twsi_block_fifo_s |
| 1526 | { |
| 1527 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1528 | uint64_t data : 64; /**< [ 63: 0](R/W/H) Data field that linked to the entires in FIFO based on current software pointer. |
| 1529 | [DATA] contains 8 bytes, corresponding to {Dn, Dn+1, Dn+2, Dn+3, Dn+4, Dn+5, Dn+6, |
| 1530 | Dn+7}. In case of less than 8 bytes based on MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE], |
| 1531 | lower bits will be ignored. */ |
| 1532 | #else /* Word 0 - Little Endian */ |
| 1533 | uint64_t data : 64; /**< [ 63: 0](R/W/H) Data field that linked to the entires in FIFO based on current software pointer. |
| 1534 | [DATA] contains 8 bytes, corresponding to {Dn, Dn+1, Dn+2, Dn+3, Dn+4, Dn+5, Dn+6, |
| 1535 | Dn+7}. In case of less than 8 bytes based on MIO_TWS()_TWSI_BLOCK_CTL[BLOCK_SIZE], |
| 1536 | lower bits will be ignored. */ |
| 1537 | #endif /* Word 0 - End */ |
| 1538 | } s; |
| 1539 | /* struct bdk_mio_twsx_twsi_block_fifo_s cn; */ |
| 1540 | }; |
| 1541 | typedef union bdk_mio_twsx_twsi_block_fifo bdk_mio_twsx_twsi_block_fifo_t; |
| 1542 | |
| 1543 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_FIFO(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1544 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_FIFO(unsigned long a) |
| 1545 | { |
| 1546 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1547 | return 0x87e0d0001058ll + 0x1000000ll * ((a) & 0x7); |
| 1548 | __bdk_csr_fatal("MIO_TWSX_TWSI_BLOCK_FIFO", 1, a, 0, 0, 0); |
| 1549 | } |
| 1550 | |
| 1551 | #define typedef_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) bdk_mio_twsx_twsi_block_fifo_t |
| 1552 | #define bustype_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) BDK_CSR_TYPE_RSL |
| 1553 | #define basename_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) "MIO_TWSX_TWSI_BLOCK_FIFO" |
| 1554 | #define device_bar_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) 0x0 /* PF_BAR0 */ |
| 1555 | #define busnum_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) (a) |
| 1556 | #define arguments_BDK_MIO_TWSX_TWSI_BLOCK_FIFO(a) (a),-1,-1,-1 |
| 1557 | |
| 1558 | /** |
| 1559 | * Register (RSL) mio_tws#_twsi_block_sts |
| 1560 | * |
| 1561 | * TWSI Block Mode Stauts Register |
| 1562 | * This register contains maintenance and status in block mode. |
| 1563 | */ |
| 1564 | union bdk_mio_twsx_twsi_block_sts |
| 1565 | { |
| 1566 | uint64_t u; |
| 1567 | struct bdk_mio_twsx_twsi_block_sts_s |
| 1568 | { |
| 1569 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1570 | uint64_t reserved_20_63 : 44; |
| 1571 | uint64_t sw_ptr : 7; /**< [ 19: 13](RO/H) Latest software reading/writing pointer to MIO_TWS()_TWSI_BLOCK_FIFO, valid from 0-127. |
| 1572 | For debugging purpose. */ |
| 1573 | uint64_t count : 11; /**< [ 12: 2](RO/H) Remaining number of bytes waiting to be sent/received on TWSI bus in block mode. |
| 1574 | Value 0x0 is expected when no TWSI transaction pending. */ |
| 1575 | uint64_t busy : 1; /**< [ 1: 1](RO/H) Reading back with value '1' means TWSI BLOCK transaction is still in progress, and |
| 1576 | 0x0 is expected when no TWSI block transaction pending or in progress. */ |
| 1577 | uint64_t reset_ptr : 1; /**< [ 0: 0](R/W1/H) Reset software side. FIFO pointer that accessible by MIO_TWS()_TWSI_BLOCK_FIFO. |
| 1578 | This bit needs to be written with 1 before any software accesses to |
| 1579 | MIO_TWS()_TWSI_BLOCK_FIFO. Resetting the pointer won't affect the data |
| 1580 | stored in the FIFO as well as hardware side pointer. Reading back 0 indicates |
| 1581 | the software write/read pointers are reset to initial value zero. */ |
| 1582 | #else /* Word 0 - Little Endian */ |
| 1583 | uint64_t reset_ptr : 1; /**< [ 0: 0](R/W1/H) Reset software side. FIFO pointer that accessible by MIO_TWS()_TWSI_BLOCK_FIFO. |
| 1584 | This bit needs to be written with 1 before any software accesses to |
| 1585 | MIO_TWS()_TWSI_BLOCK_FIFO. Resetting the pointer won't affect the data |
| 1586 | stored in the FIFO as well as hardware side pointer. Reading back 0 indicates |
| 1587 | the software write/read pointers are reset to initial value zero. */ |
| 1588 | uint64_t busy : 1; /**< [ 1: 1](RO/H) Reading back with value '1' means TWSI BLOCK transaction is still in progress, and |
| 1589 | 0x0 is expected when no TWSI block transaction pending or in progress. */ |
| 1590 | uint64_t count : 11; /**< [ 12: 2](RO/H) Remaining number of bytes waiting to be sent/received on TWSI bus in block mode. |
| 1591 | Value 0x0 is expected when no TWSI transaction pending. */ |
| 1592 | uint64_t sw_ptr : 7; /**< [ 19: 13](RO/H) Latest software reading/writing pointer to MIO_TWS()_TWSI_BLOCK_FIFO, valid from 0-127. |
| 1593 | For debugging purpose. */ |
| 1594 | uint64_t reserved_20_63 : 44; |
| 1595 | #endif /* Word 0 - End */ |
| 1596 | } s; |
| 1597 | /* struct bdk_mio_twsx_twsi_block_sts_s cn; */ |
| 1598 | }; |
| 1599 | typedef union bdk_mio_twsx_twsi_block_sts bdk_mio_twsx_twsi_block_sts_t; |
| 1600 | |
| 1601 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_STS(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1602 | static inline uint64_t BDK_MIO_TWSX_TWSI_BLOCK_STS(unsigned long a) |
| 1603 | { |
| 1604 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1605 | return 0x87e0d0001050ll + 0x1000000ll * ((a) & 0x7); |
| 1606 | __bdk_csr_fatal("MIO_TWSX_TWSI_BLOCK_STS", 1, a, 0, 0, 0); |
| 1607 | } |
| 1608 | |
| 1609 | #define typedef_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) bdk_mio_twsx_twsi_block_sts_t |
| 1610 | #define bustype_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) BDK_CSR_TYPE_RSL |
| 1611 | #define basename_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) "MIO_TWSX_TWSI_BLOCK_STS" |
| 1612 | #define device_bar_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) 0x0 /* PF_BAR0 */ |
| 1613 | #define busnum_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) (a) |
| 1614 | #define arguments_BDK_MIO_TWSX_TWSI_BLOCK_STS(a) (a),-1,-1,-1 |
| 1615 | |
| 1616 | /** |
| 1617 | * Register (RSL) mio_tws#_twsi_sw |
| 1618 | * |
| 1619 | * TWSI to Software Register |
| 1620 | * This register allows the TWSI device to transfer data to software and later check that |
| 1621 | * software has received the information. |
| 1622 | * This register should be read or written by the TWSI device, and read by software. The TWSI |
| 1623 | * device can use one-byte or four-byte payload write operations, and two-byte payload read |
| 1624 | * operations. The TWSI device considers this register valid when [V] = 1. |
| 1625 | */ |
| 1626 | union bdk_mio_twsx_twsi_sw |
| 1627 | { |
| 1628 | uint64_t u; |
| 1629 | struct bdk_mio_twsx_twsi_sw_s |
| 1630 | { |
| 1631 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1632 | uint64_t v : 2; /**< [ 63: 62](RC/W/H) Valid bits. These bits are not directly writable. They are set to 11 on any write |
| 1633 | operation by the TWSI device. They are cleared to 00 on any read operation by software. */ |
| 1634 | uint64_t reserved_32_61 : 30; |
| 1635 | uint64_t data : 32; /**< [ 31: 0](RO/H) Data field. Updated on a write operation by the TWSI device. */ |
| 1636 | #else /* Word 0 - Little Endian */ |
| 1637 | uint64_t data : 32; /**< [ 31: 0](RO/H) Data field. Updated on a write operation by the TWSI device. */ |
| 1638 | uint64_t reserved_32_61 : 30; |
| 1639 | uint64_t v : 2; /**< [ 63: 62](RC/W/H) Valid bits. These bits are not directly writable. They are set to 11 on any write |
| 1640 | operation by the TWSI device. They are cleared to 00 on any read operation by software. */ |
| 1641 | #endif /* Word 0 - End */ |
| 1642 | } s; |
| 1643 | /* struct bdk_mio_twsx_twsi_sw_s cn8; */ |
| 1644 | struct bdk_mio_twsx_twsi_sw_cn9 |
| 1645 | { |
| 1646 | #if __BYTE_ORDER == __BIG_ENDIAN /* Word 0 - Big Endian */ |
| 1647 | uint64_t v : 2; /**< [ 63: 62](RC/W/H) Valid bits. These bits are not directly writable. They are set to 11 on any write |
| 1648 | operation by the TWSI device. They are cleared to 00 on any read operation by software. */ |
| 1649 | uint64_t reserved_32_61 : 30; |
| 1650 | uint64_t data : 32; /**< [ 31: 0](RO/H) Data field, bytes 3-7. Updated on a write operation by the TWSI device. */ |
| 1651 | #else /* Word 0 - Little Endian */ |
| 1652 | uint64_t data : 32; /**< [ 31: 0](RO/H) Data field, bytes 3-7. Updated on a write operation by the TWSI device. */ |
| 1653 | uint64_t reserved_32_61 : 30; |
| 1654 | uint64_t v : 2; /**< [ 63: 62](RC/W/H) Valid bits. These bits are not directly writable. They are set to 11 on any write |
| 1655 | operation by the TWSI device. They are cleared to 00 on any read operation by software. */ |
| 1656 | #endif /* Word 0 - End */ |
| 1657 | } cn9; |
| 1658 | }; |
| 1659 | typedef union bdk_mio_twsx_twsi_sw bdk_mio_twsx_twsi_sw_t; |
| 1660 | |
| 1661 | static inline uint64_t BDK_MIO_TWSX_TWSI_SW(unsigned long a) __attribute__ ((pure, always_inline)); |
| 1662 | static inline uint64_t BDK_MIO_TWSX_TWSI_SW(unsigned long a) |
| 1663 | { |
| 1664 | if (CAVIUM_IS_MODEL(CAVIUM_CN81XX) && (a<=1)) |
| 1665 | return 0x87e0d0001008ll + 0x1000000ll * ((a) & 0x1); |
| 1666 | if (CAVIUM_IS_MODEL(CAVIUM_CN83XX) && (a<=1)) |
| 1667 | return 0x87e0d0001008ll + 0x1000000ll * ((a) & 0x1); |
| 1668 | if (CAVIUM_IS_MODEL(CAVIUM_CN88XX) && (a<=5)) |
| 1669 | return 0x87e0d0001008ll + 0x1000000ll * ((a) & 0x7); |
| 1670 | if (CAVIUM_IS_MODEL(CAVIUM_CN9XXX) && (a<=5)) |
| 1671 | return 0x87e0d0001008ll + 0x1000000ll * ((a) & 0x7); |
| 1672 | __bdk_csr_fatal("MIO_TWSX_TWSI_SW", 1, a, 0, 0, 0); |
| 1673 | } |
| 1674 | |
| 1675 | #define typedef_BDK_MIO_TWSX_TWSI_SW(a) bdk_mio_twsx_twsi_sw_t |
| 1676 | #define bustype_BDK_MIO_TWSX_TWSI_SW(a) BDK_CSR_TYPE_RSL |
| 1677 | #define basename_BDK_MIO_TWSX_TWSI_SW(a) "MIO_TWSX_TWSI_SW" |
| 1678 | #define device_bar_BDK_MIO_TWSX_TWSI_SW(a) 0x0 /* PF_BAR0 */ |
| 1679 | #define busnum_BDK_MIO_TWSX_TWSI_SW(a) (a) |
| 1680 | #define arguments_BDK_MIO_TWSX_TWSI_SW(a) (a),-1,-1,-1 |
| 1681 | |
| 1682 | #endif /* __BDK_CSRS_MIO_TWS_H__ */ |