Skip to content

Commit aa874cd

Browse files
Tharun Kumar Pwsakernel
authored andcommitted
i2c: mchp-pci1xxxx: Update Timing registers
Update I2C timing registers based on latest hardware design. This fix does not break functionality of chips with older design and existing users will not be affected. Fixes: 3616936 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch") Signed-off-by: Tharun Kumar P <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 197b6b6 commit aa874cd

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

drivers/i2c/busses/i2c-mchp-pci1xxxx.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
* SR_HOLD_TIME_XK_TICKS field will indicate the number of ticks of the
4949
* baud clock required to program 'Hold Time' at X KHz.
5050
*/
51-
#define SR_HOLD_TIME_100K_TICKS 133
52-
#define SR_HOLD_TIME_400K_TICKS 20
53-
#define SR_HOLD_TIME_1000K_TICKS 11
51+
#define SR_HOLD_TIME_100K_TICKS 150
52+
#define SR_HOLD_TIME_400K_TICKS 20
53+
#define SR_HOLD_TIME_1000K_TICKS 12
5454

5555
#define SMB_CORE_COMPLETION_REG_OFF3 (SMBUS_MAST_CORE_ADDR_BASE + 0x23)
5656

@@ -65,17 +65,17 @@
6565
* the baud clock required to program 'fair idle delay' at X KHz. Fair idle
6666
* delay establishes the MCTP T(IDLE_DELAY) period.
6767
*/
68-
#define FAIR_BUS_IDLE_MIN_100K_TICKS 969
69-
#define FAIR_BUS_IDLE_MIN_400K_TICKS 157
70-
#define FAIR_BUS_IDLE_MIN_1000K_TICKS 157
68+
#define FAIR_BUS_IDLE_MIN_100K_TICKS 992
69+
#define FAIR_BUS_IDLE_MIN_400K_TICKS 500
70+
#define FAIR_BUS_IDLE_MIN_1000K_TICKS 500
7171

7272
/*
7373
* FAIR_IDLE_DELAY_XK_TICKS field will indicate the number of ticks of the
7474
* baud clock required to satisfy the fairness protocol at X KHz.
7575
*/
76-
#define FAIR_IDLE_DELAY_100K_TICKS 1000
77-
#define FAIR_IDLE_DELAY_400K_TICKS 500
78-
#define FAIR_IDLE_DELAY_1000K_TICKS 500
76+
#define FAIR_IDLE_DELAY_100K_TICKS 963
77+
#define FAIR_IDLE_DELAY_400K_TICKS 156
78+
#define FAIR_IDLE_DELAY_1000K_TICKS 156
7979

8080
#define SMB_IDLE_SCALING_100K \
8181
((FAIR_IDLE_DELAY_100K_TICKS << 16) | FAIR_BUS_IDLE_MIN_100K_TICKS)
@@ -105,7 +105,7 @@
105105
*/
106106
#define BUS_CLK_100K_LOW_PERIOD_TICKS 156
107107
#define BUS_CLK_400K_LOW_PERIOD_TICKS 41
108-
#define BUS_CLK_1000K_LOW_PERIOD_TICKS 15
108+
#define BUS_CLK_1000K_LOW_PERIOD_TICKS 15
109109

110110
/*
111111
* BUS_CLK_XK_HIGH_PERIOD_TICKS field defines the number of I2C Baud Clock
@@ -131,7 +131,7 @@
131131
*/
132132
#define CLK_SYNC_100K 4
133133
#define CLK_SYNC_400K 4
134-
#define CLK_SYNC_1000K 4
134+
#define CLK_SYNC_1000K 4
135135

136136
#define SMB_CORE_DATA_TIMING_REG_OFF (SMBUS_MAST_CORE_ADDR_BASE + 0x40)
137137

@@ -142,25 +142,25 @@
142142
* determines the SCLK hold time following SDAT driven low during the first
143143
* START bit in a transfer.
144144
*/
145-
#define FIRST_START_HOLD_100K_TICKS 22
146-
#define FIRST_START_HOLD_400K_TICKS 16
147-
#define FIRST_START_HOLD_1000K_TICKS 6
145+
#define FIRST_START_HOLD_100K_TICKS 23
146+
#define FIRST_START_HOLD_400K_TICKS 8
147+
#define FIRST_START_HOLD_1000K_TICKS 12
148148

149149
/*
150150
* STOP_SETUP_XK_TICKS will indicate the number of ticks of the baud clock
151151
* required to program 'STOP_SETUP' timer at X KHz. This timer determines the
152152
* SDAT setup time from the rising edge of SCLK for a STOP condition.
153153
*/
154-
#define STOP_SETUP_100K_TICKS 157
154+
#define STOP_SETUP_100K_TICKS 150
155155
#define STOP_SETUP_400K_TICKS 20
156-
#define STOP_SETUP_1000K_TICKS 12
156+
#define STOP_SETUP_1000K_TICKS 12
157157

158158
/*
159159
* RESTART_SETUP_XK_TICKS will indicate the number of ticks of the baud clock
160160
* required to program 'RESTART_SETUP' timer at X KHz. This timer determines the
161161
* SDAT setup time from the rising edge of SCLK for a repeated START condition.
162162
*/
163-
#define RESTART_SETUP_100K_TICKS 157
163+
#define RESTART_SETUP_100K_TICKS 156
164164
#define RESTART_SETUP_400K_TICKS 20
165165
#define RESTART_SETUP_1000K_TICKS 12
166166

@@ -169,7 +169,7 @@
169169
* required to program 'DATA_HOLD' timer at X KHz. This timer determines the
170170
* SDAT hold time following SCLK driven low.
171171
*/
172-
#define DATA_HOLD_100K_TICKS 2
172+
#define DATA_HOLD_100K_TICKS 12
173173
#define DATA_HOLD_400K_TICKS 2
174174
#define DATA_HOLD_1000K_TICKS 2
175175

@@ -190,35 +190,35 @@
190190
* Bus Idle Minimum time = BUS_IDLE_MIN[7:0] x Baud_Clock_Period x
191191
* (BUS_IDLE_MIN_XK_TICKS[7] ? 4,1)
192192
*/
193-
#define BUS_IDLE_MIN_100K_TICKS 167UL
194-
#define BUS_IDLE_MIN_400K_TICKS 139UL
195-
#define BUS_IDLE_MIN_1000K_TICKS 133UL
193+
#define BUS_IDLE_MIN_100K_TICKS 36UL
194+
#define BUS_IDLE_MIN_400K_TICKS 10UL
195+
#define BUS_IDLE_MIN_1000K_TICKS 4UL
196196

197197
/*
198198
* CTRL_CUM_TIME_OUT_XK_TICKS defines SMBus Controller Cumulative Time-Out.
199199
* SMBus Controller Cumulative Time-Out duration =
200200
* CTRL_CUM_TIME_OUT_XK_TICKS[7:0] x Baud_Clock_Period x 2048
201201
*/
202-
#define CTRL_CUM_TIME_OUT_100K_TICKS 159
203-
#define CTRL_CUM_TIME_OUT_400K_TICKS 159
204-
#define CTRL_CUM_TIME_OUT_1000K_TICKS 159
202+
#define CTRL_CUM_TIME_OUT_100K_TICKS 76
203+
#define CTRL_CUM_TIME_OUT_400K_TICKS 76
204+
#define CTRL_CUM_TIME_OUT_1000K_TICKS 76
205205

206206
/*
207207
* TARGET_CUM_TIME_OUT_XK_TICKS defines SMBus Target Cumulative Time-Out duration.
208208
* SMBus Target Cumulative Time-Out duration = TARGET_CUM_TIME_OUT_XK_TICKS[7:0] x
209209
* Baud_Clock_Period x 4096
210210
*/
211-
#define TARGET_CUM_TIME_OUT_100K_TICKS 199
212-
#define TARGET_CUM_TIME_OUT_400K_TICKS 199
213-
#define TARGET_CUM_TIME_OUT_1000K_TICKS 199
211+
#define TARGET_CUM_TIME_OUT_100K_TICKS 95
212+
#define TARGET_CUM_TIME_OUT_400K_TICKS 95
213+
#define TARGET_CUM_TIME_OUT_1000K_TICKS 95
214214

215215
/*
216216
* CLOCK_HIGH_TIME_OUT_XK defines Clock High time out period.
217217
* Clock High time out period = CLOCK_HIGH_TIME_OUT_XK[7:0] x Baud_Clock_Period x 8
218218
*/
219-
#define CLOCK_HIGH_TIME_OUT_100K_TICKS 204
220-
#define CLOCK_HIGH_TIME_OUT_400K_TICKS 204
221-
#define CLOCK_HIGH_TIME_OUT_1000K_TICKS 204
219+
#define CLOCK_HIGH_TIME_OUT_100K_TICKS 97
220+
#define CLOCK_HIGH_TIME_OUT_400K_TICKS 97
221+
#define CLOCK_HIGH_TIME_OUT_1000K_TICKS 97
222222

223223
#define TO_SCALING_100K \
224224
((BUS_IDLE_MIN_100K_TICKS << 24) | (CTRL_CUM_TIME_OUT_100K_TICKS << 16) | \

0 commit comments

Comments
 (0)