Skip to content

Commit 5690088

Browse files
XenuIsWatchingcarlescufi
authored andcommitted
drivers: i3c: only configure tsco for rev 1p4 and above
Adjusting T_sco is only support by revision 1p4 and above. Also, correct the T_sco default time from 10ns to 8ns. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 853f306 commit 5690088

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/i3c/i3c_cdns.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,12 @@
471471
/* Target T_LOW period in open-drain mode. */
472472
#define I3C_BUS_TLOW_OD_MIN_NS 200
473473

474-
/* MIPI I3C v1.1.1 Spec defines tsco max as 12ns */
475-
#define I3C_TSCO_DEFAULT_NS 10
474+
/*
475+
* MIPI I3C v1.1.1 Spec defines tsco max as 12ns, but the default for devices is 8ns
476+
* TODO: this should be configurable by the value with in maxRd from the CCC GETMXDS
477+
* for individual devices
478+
*/
479+
#define I3C_TSCO_DEFAULT_NS 8
476480

477481
/* Interrupt thresholds. */
478482
/* command response fifo threshold */
@@ -3115,11 +3119,18 @@ static int cdns_i3c_bus_init(const struct device *dev)
31153119
*
31163120
* Set the I3C Bus Mode based on the LVR of the I2C devices
31173121
*/
3118-
uint32_t ctrl = CTRL_HJ_DISEC | CTRL_MCS_EN | (CTRL_BUS_MODE_MASK & cdns_mode) |
3119-
CTRL_THD_DELAY(cdns_i3c_clk_to_data_turnaround(dev));
3122+
uint32_t ctrl = CTRL_HJ_DISEC | CTRL_MCS_EN | (CTRL_BUS_MODE_MASK & cdns_mode);
31203123
/* Disable Controllership requests as it is not supported yet by the driver */
31213124
ctrl &= ~CTRL_MST_ACK;
31223125

3126+
/*
3127+
* Cadence I3C release r104v1p0 and above support configuration of the clock to data
3128+
* turnaround time.
3129+
*/
3130+
if (REV_ID_REV(data->hw_cfg.rev_id) >= REV_ID_VERSION(1, 4)) {
3131+
ctrl |= CTRL_THD_DELAY(cdns_i3c_clk_to_data_turnaround(dev));
3132+
}
3133+
31233134
/*
31243135
* Cadence I3C release r105v1p0 and above support I3C v1.1 timing change
31253136
* for tCASHr_min = tCAS_min / 2, otherwise tCASr_min = tCAS_min (as

0 commit comments

Comments
 (0)