Bharat Gooty | 66b0bb4 | 2020-09-24 12:29:00 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 - 2021, Broadcom |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef I2C_REGS |
| 8 | #define I2C_REGS |
| 9 | |
| 10 | /* SMBUS Config register */ |
| 11 | #define SMB_CFG_REG 0x0U |
| 12 | |
| 13 | #define SMB_CFG_RST_MASK 0x80000000U |
| 14 | #define SMB_CFG_RST_SHIFT 31U |
| 15 | |
| 16 | #define SMB_CFG_SMBEN_MASK 0x40000000U |
| 17 | #define SMB_CFG_SMBEN_SHIFT 30U |
| 18 | |
| 19 | #define SMB_CFG_BITBANGEN_MASK 0x20000000U |
| 20 | #define SMB_CFG_BITBANGEN_SHIFT 29U |
| 21 | |
| 22 | #define SMB_CFG_EN_NIC_SMBADDR0_MASK 0x10000000U |
| 23 | #define SMB_CFG_EN_NIC_SMBADDR0_SHIFT 28U |
| 24 | |
| 25 | #define SMB_CFG_PROMISCMODE_MASK 0x08000000U |
| 26 | #define SMB_CFG_PROMISCMODE_SHIFT 27U |
| 27 | |
| 28 | #define SMB_CFG_TSTMPCNTEN_MASK 0x04000000U |
| 29 | #define SMB_CFG_TSTMPCNTEN_SHIFT 26U |
| 30 | |
| 31 | #define SMB_CFG_MSTRRTRYCNT_MASK 0x000F0000U |
| 32 | #define SMB_CFG_MSTRRTRYCNT_SHIFT 16U |
| 33 | |
| 34 | /* SMBUS Timing config register */ |
| 35 | #define SMB_TIMGCFG_REG 0x4U |
| 36 | |
| 37 | #define SMB_TIMGCFG_MODE400_MASK 0x80000000U |
| 38 | #define SMB_TIMGCFG_MODE400_SHIFT 31U |
| 39 | |
| 40 | #define SMB_TIMGCFG_RNDSLVSTR_MASK 0x7F000000U |
| 41 | #define SMB_TIMGCFG_RNDSLVSTR_SHIFT 24U |
| 42 | |
| 43 | #define SMB_TIMGCFG_PERSLVSTR_MASK 0x00FF0000U |
| 44 | #define SMB_TIMGCFG_PERSLVSTR_SHIFT 16U |
| 45 | |
| 46 | #define SMB_TIMGCFG_IDLTIME_MASK 0x0000FF00U |
| 47 | #define SMB_TIMGCFG_IDLTIME_SHIFT 8U |
| 48 | |
| 49 | /* SMBUS Slave address register */ |
| 50 | #define SMB_ADDR_REG 0x8U |
| 51 | |
| 52 | #define SMB_EN_NIC_SMBADDR3_MASK 0x80000000U |
| 53 | #define SMB_EN_NIC_SMBADDR3_SHIFT 31U |
| 54 | |
| 55 | #define SMB_NIC_SMBADDR3_MASK 0x7F000000U |
| 56 | #define SMB_NIC_SMBADDR3_SHIFT 24U |
| 57 | |
| 58 | #define SMB_EN_NIC_SMBADDR2_MASK 0x00800000U |
| 59 | #define SMB_EN_NIC_SMBADDR2_SHIFT 23U |
| 60 | |
| 61 | #define SMB_NIC_SMBADDR2_MASK 0x007F0000U |
| 62 | #define SMB_NIC_SMBADDR2_SHIFT 16U |
| 63 | |
| 64 | #define SMB_EN_NIC_SMBADDR1_MASK 0x00008000U |
| 65 | #define SMB_EN_NIC_SMBADDR1_SHIFT 15U |
| 66 | |
| 67 | #define SMB_NIC_SMBADDR1_MASK 0x00007F00U |
| 68 | #define SMB_NIC_SMBADDR1_SHIFT 8U |
| 69 | |
| 70 | #define SMB_EN_NIC_SMBADDR0_MASK 0x00000080U |
| 71 | #define SMB_EN_NIC_SMBADDR0_SHIFT 7U |
| 72 | |
| 73 | #define SMB_NIC_SMBADDR0_MASK 0x0000007FU |
| 74 | #define SMB_NIC_SMBADDR0_SHIFT 0U |
| 75 | |
| 76 | /* SMBUS Master FIFO control register */ |
| 77 | #define SMB_MSTRFIFOCTL_REG 0xCU |
| 78 | |
| 79 | #define SMB_MSTRRXFIFOFLSH_MASK 0x80000000U |
| 80 | #define SMB_MSTRRXFIFOFLSH_SHIFT 31U |
| 81 | |
| 82 | #define SMB_MSTRTXFIFOFLSH_MASK 0x40000000U |
| 83 | #define SMB_MSTRTXFIFOFLSH_SHIFT 30U |
| 84 | |
| 85 | #define SMB_MSTRRXPKTCNT_MASK 0x007F0000U |
| 86 | #define SMB_MSTRRXPKTCNT_SHIFT 16U |
| 87 | |
| 88 | #define SMB_MSTRRXFIFOTHR_MASK 0x00003F00U |
| 89 | #define SMB_MSTRRXFIFOTHR_SHIFT 8U |
| 90 | |
| 91 | /* SMBUS Slave FIFO control register */ |
| 92 | #define SMB_SLVFIFOCTL_REG 0x10U |
| 93 | |
| 94 | #define SMB_SLVRXFIFOFLSH_MASK 0x80000000U |
| 95 | #define SMB_SLVRXFIFOFLSH_SHIFT 31U |
| 96 | |
| 97 | #define SMB_SLVTXFIFOFLSH_MASK 0x40000000U |
| 98 | #define SMB_SLVTXFIFOFLSH_SHIFT 30U |
| 99 | |
| 100 | #define SMB_SLVRXPKTCNT_MASK 0x007F0000U |
| 101 | #define SMB_SLVRXPKTCNT_SHIFT 16U |
| 102 | |
| 103 | #define SMB_SLVRXFIFOTHR_MASK 0x00003F00U |
| 104 | #define SMB_SLVRXFIFOTHR_SHIFT 8U |
| 105 | |
| 106 | /* SMBUS Bit-bang mode control register */ |
| 107 | #define SMB_BITBANGCTL_REG 0x14U |
| 108 | |
| 109 | #define SMB_SMBCLKIN_MASK 0x80000000U |
| 110 | #define SMB_SMBCLKIN_SHIFT 31U |
| 111 | |
| 112 | #define SMB_SMBCLKOUTEN_MASK 0x40000000U |
| 113 | #define SMB_SMBCLKOUTEN_SHIFT 30U |
| 114 | |
| 115 | #define SMB_SMBDATAIN_MASK 0x20000000U |
| 116 | #define SMB_SMBDATAIN_SHIFT 29U |
| 117 | |
| 118 | #define SMB_SMBDATAOUTEN_MASK 0x10000000U |
| 119 | #define SMB_SMBDATAOUTEN_SHIFT 28U |
| 120 | |
| 121 | /* SMBUS Master command register */ |
| 122 | #define SMB_MSTRCMD_REG 0x30U |
| 123 | |
| 124 | #define SMB_MSTRSTARTBUSYCMD_MASK 0x80000000U |
| 125 | #define SMB_MSTRSTARTBUSYCMD_SHIFT 31U |
| 126 | |
| 127 | #define SMB_MSTRABORT_MASK 0x40000000U |
| 128 | #define SMB_MSTRABORT_SHIFT 30U |
| 129 | |
| 130 | #define SMB_MSTRSTS_MASK 0x0E000000U |
| 131 | #define SMB_MSTRSTS_SHIFT 25U |
| 132 | |
| 133 | #define SMB_MSTRSMBUSPROTO_MASK 0x00001E00U |
| 134 | #define SMB_MSTRSMBUSPROTO_SHIFT 9U |
| 135 | |
| 136 | #define SMB_MSTRPEC_MASK 0x00000100U |
| 137 | #define SMB_MSTRPEC_SHIFT 8U |
| 138 | |
| 139 | #define SMB_MSTRRDBYTECNT_MASK 0x000000FFU |
| 140 | #define SMB_MSTRRDBYTECNT_SHIFT 0U |
| 141 | |
| 142 | /* SMBUS Slave command register */ |
| 143 | #define SMB_SLVCMD_REG 0x34U |
| 144 | |
| 145 | #define SMB_SLVSTARTBUSYCMD_MASK 0x80000000U |
| 146 | #define SMB_SLVSTARTBUSYCMD_SHIFT 31U |
| 147 | |
| 148 | #define SMB_SLVABORT_MASK 0x40000000U |
| 149 | #define SMB_SLVABORT_SHIFT 30U |
| 150 | |
| 151 | #define SMB_SLVSTS_MASK 0x03800000U |
| 152 | #define SMB_SLVSTS_SHIFT 23U |
| 153 | |
| 154 | #define SMB_SLVPEC_MASK 0x00000100U |
| 155 | #define SMB_SLVPEC_SHIFT 8U |
| 156 | |
| 157 | /* SMBUS Event enable register */ |
| 158 | #define SMB_EVTEN_REG 0x38U |
| 159 | |
| 160 | #define SMB_MSTRRXFIFOFULLEN_MASK 0x80000000U |
| 161 | #define SMB_MSTRRXFIFOFULLEN_SHIFT 31U |
| 162 | |
| 163 | #define SMB_MSTRRXFIFOTHRHITEN_MASK 0x40000000U |
| 164 | #define SMB_MSTRRXFIFOTHRHITEN_SHIFT 30U |
| 165 | |
| 166 | #define SMB_MSTRRXEVTEN_MASK 0x20000000U |
| 167 | #define SMB_MSTRRXEVTEN_SHIFT 29U |
| 168 | |
| 169 | #define SMB_MSTRSTARTBUSYEN_MASK 0x10000000U |
| 170 | #define SMB_MSTRSTARTBUSYEN_SHIFT 28U |
| 171 | |
| 172 | #define SMB_MSTRTXUNDEN_MASK 0x08000000U |
| 173 | #define SMB_MSTRTXUNDEN_SHIFT 27U |
| 174 | |
| 175 | #define SMB_SLVRXFIFOFULLEN_MASK 0x04000000U |
| 176 | #define SMB_SLVRXFIFOFULLEN_SHIFT 26U |
| 177 | |
| 178 | #define SMB_SLVRXFIFOTHRHITEN_MASK 0x02000000U |
| 179 | #define SMB_SLVRXFIFOTHRHITEN_SHIFT 25U |
| 180 | |
| 181 | #define SMB_SLVRXEVTEN_MASK 0x01000000U |
| 182 | #define SMB_SLVRXEVTEN_SHIFT 24U |
| 183 | |
| 184 | #define SMB_SLVSTARTBUSYEN_MASK 0x00800000U |
| 185 | #define SMB_SLVSTARTBUSYEN_SHIFT 23U |
| 186 | |
| 187 | #define SMB_SLVTXUNDEN_MASK 0x00400000U |
| 188 | #define SMB_SLVTXUNDEN_SHIFT 22U |
| 189 | |
| 190 | #define SMB_SLVRDEVTEN_MASK 0x00200000U |
| 191 | #define SMB_SLVRDEVTEN_SHIFT 21U |
| 192 | |
| 193 | /* SMBUS Event status register */ |
| 194 | #define SMB_EVTSTS_REG 0x3CU |
| 195 | |
| 196 | #define SMB_MSTRRXFIFOFULLSTS_MASK 0x80000000U |
| 197 | #define SMB_MSTRRXFIFOFULLSTS_SHIFT 31U |
| 198 | |
| 199 | #define SMB_MSTRRXFIFOTHRHITSTS_MASK 0x40000000U |
| 200 | #define SMB_MSTRRXFIFOTHRHITSTS_SHIFT 30U |
| 201 | |
| 202 | #define SMB_MSTRRXEVTSTS_MASK 0x20000000U |
| 203 | #define SMB_MSTRRXEVTSTS_SHIFT 29U |
| 204 | |
| 205 | #define SMB_MSTRSTARTBUSYSTS_MASK 0x10000000U |
| 206 | #define SMB_MSTRSTARTBUSYSTS_SHIFT 28U |
| 207 | |
| 208 | #define SMB_MSTRTXUNDSTS_MASK 0x08000000U |
| 209 | #define SMB_MSTRTXUNDSTS_SHIFT 27U |
| 210 | |
| 211 | #define SMB_SLVRXFIFOFULLSTS_MASK 0x04000000U |
| 212 | #define SMB_SLVRXFIFOFULLSTS_SHIFT 26U |
| 213 | |
| 214 | #define SMB_SLVRXFIFOTHRHITSTS_MASK 0x02000000U |
| 215 | #define SMB_SLVRXFIFOTHRHITSTS_SHIFT 25U |
| 216 | |
| 217 | #define SMB_SLVRXEVTSTS_MASK 0x01000000U |
| 218 | #define SMB_SLVRXEVTSTS_SHIFT 24U |
| 219 | |
| 220 | #define SMB_SLVSTARTBUSYSTS_MASK 0x00800000U |
| 221 | #define SMB_SLVSTARTBUSYSTS_SHIFT 23U |
| 222 | |
| 223 | #define SMB_SLVTXUNDSTS_MASK 0x00400000U |
| 224 | #define SMB_SLVTXUNDSTS_SHIFT 22U |
| 225 | |
| 226 | #define SMB_SLVRDEVTSTS_MASK 0x00200000U |
| 227 | #define SMB_SLVRDEVTSTS_SHIFT 21U |
| 228 | |
| 229 | /* SMBUS Master data write register */ |
| 230 | #define SMB_MSTRDATAWR_REG 0x40U |
| 231 | |
| 232 | #define SMB_MSTRWRSTS_MASK 0x80000000U |
| 233 | #define SMB_MSTRWRSTS_SHIFT 31U |
| 234 | |
| 235 | #define SMB_MSTRWRDATA_MASK 0x000000FFU |
| 236 | #define SMB_MSTRWRDATA_SHIFT 0U |
| 237 | |
| 238 | /* SMBUS Master data read register */ |
| 239 | #define SMB_MSTRDATARD_REG 0x44U |
| 240 | |
| 241 | #define SMB_MSTRRDSTS_MASK 0xC0000000U |
| 242 | #define SMB_MSTRRDSTS_SHIFT 30U |
| 243 | |
| 244 | #define SMB_MSTRRDPECERR_MASK 0x20000000U |
| 245 | #define SMB_MSTRRDPECERR_SHIFT 29U |
| 246 | |
| 247 | #define SMB_MSTRRDDATA_MASK 0x000000FFU |
| 248 | #define SMB_MSTRRDDATA_SHIFT 0U |
| 249 | |
| 250 | /* SMBUS Slave data write register */ |
| 251 | #define SMB_SLVDATAWR_REG 0x48U |
| 252 | |
| 253 | #define SMB_SLVWRSTS_MASK 0x80000000U |
| 254 | #define SMB_SLVWRSTS_SHIFT 31U |
| 255 | |
| 256 | #define SMB_SLVWRDATA_MASK 0x000000FFU |
| 257 | #define SMB_SLVWRDATA_SHIFT 0U |
| 258 | |
| 259 | /* SMBUS Slave data read register */ |
| 260 | #define SMB_SLVDATARD_REG 0x4CU |
| 261 | |
| 262 | #define SMB_SLVRDSTS_MASK 0xC0000000U |
| 263 | #define SMB_SLVRDSTS_SHIFT 30U |
| 264 | |
| 265 | #define SMB_SLVRDERRSTS_MASK 0x30000000U |
| 266 | #define SMB_SLVRDERRSTS_SHIFT 28U |
| 267 | |
| 268 | #define SMB_SLVRDDATA_MASK 0x000000FFU |
| 269 | #define SMB_SLVRDDATA_SHIFT 0U |
| 270 | |
| 271 | #endif /* I2C_REGS */ |