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