Skip to content

Commit 9c48f7e

Browse files
XenuIsWatchingnashif
authored andcommitted
drivers: i3c: cdns: correct sda push pull hold time
correct the comments and timing for the sda push-pull hold time configuration. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 9403b08 commit 9c48f7e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/i3c/i3c_cdns.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,10 @@
472472
#define I3C_BUS_TLOW_OD_MIN_NS 200
473473

474474
/*
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
475+
* MIPI I3C v1.1.1 Spec defines SDA Signal Data Hold in Push Pull max as the
476+
* minimum of the clock rise and fall time plus 3ns
478477
*/
479-
#define I3C_TSCO_DEFAULT_NS 8
478+
#define I3C_HD_PP_DEFAULT_NS 10
480479

481480
/* Interrupt thresholds. */
482481
/* command response fifo threshold */
@@ -3058,16 +3057,18 @@ static enum i3c_bus_mode i3c_bus_mode(const struct i3c_dev_list *dev_list)
30583057
/**
30593058
* Determine THD_DEL value for CTRL register
30603059
*
3060+
* Should be MIN(t_cf, t_cr) + 3ns
3061+
*
30613062
* @param dev Pointer to device driver instance.
30623063
*
30633064
* @return Value to be written to THD_DEL
30643065
*/
3065-
static uint8_t cdns_i3c_clk_to_data_turnaround(const struct device *dev)
3066+
static uint8_t cdns_i3c_sda_data_hold(const struct device *dev)
30663067
{
30673068
const struct cdns_i3c_config *config = dev->config;
30683069
uint32_t input_clock_frequency = config->input_frequency;
30693070
uint8_t thd_delay =
3070-
DIV_ROUND_UP(I3C_TSCO_DEFAULT_NS, (NSEC_PER_SEC / input_clock_frequency));
3071+
DIV_ROUND_UP(I3C_HD_PP_DEFAULT_NS, (NSEC_PER_SEC / input_clock_frequency));
30713072

30723073
if (thd_delay > THD_DELAY_MAX) {
30733074
thd_delay = THD_DELAY_MAX;
@@ -3156,11 +3157,10 @@ static int cdns_i3c_bus_init(const struct device *dev)
31563157
ctrl &= ~CTRL_MST_ACK;
31573158

31583159
/*
3159-
* Cadence I3C release r104v1p0 and above support configuration of the clock to data
3160-
* turnaround time.
3160+
* Cadence I3C release r104v1p0 and above support configuration of the sda data hold time
31613161
*/
31623162
if (REV_ID_REV(data->hw_cfg.rev_id) >= REV_ID_VERSION(1, 4)) {
3163-
ctrl |= CTRL_THD_DELAY(cdns_i3c_clk_to_data_turnaround(dev));
3163+
ctrl |= CTRL_THD_DELAY(cdns_i3c_sda_data_hold(dev));
31643164
}
31653165

31663166
/*

0 commit comments

Comments
 (0)