|
472 | 472 | #define I3C_BUS_TLOW_OD_MIN_NS 200
|
473 | 473 |
|
474 | 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 |
| 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 |
478 | 477 | */
|
479 |
| -#define I3C_TSCO_DEFAULT_NS 8 |
| 478 | +#define I3C_HD_PP_DEFAULT_NS 10 |
480 | 479 |
|
481 | 480 | /* Interrupt thresholds. */
|
482 | 481 | /* command response fifo threshold */
|
@@ -3058,16 +3057,18 @@ static enum i3c_bus_mode i3c_bus_mode(const struct i3c_dev_list *dev_list)
|
3058 | 3057 | /**
|
3059 | 3058 | * Determine THD_DEL value for CTRL register
|
3060 | 3059 | *
|
| 3060 | + * Should be MIN(t_cf, t_cr) + 3ns |
| 3061 | + * |
3061 | 3062 | * @param dev Pointer to device driver instance.
|
3062 | 3063 | *
|
3063 | 3064 | * @return Value to be written to THD_DEL
|
3064 | 3065 | */
|
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) |
3066 | 3067 | {
|
3067 | 3068 | const struct cdns_i3c_config *config = dev->config;
|
3068 | 3069 | uint32_t input_clock_frequency = config->input_frequency;
|
3069 | 3070 | 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)); |
3071 | 3072 |
|
3072 | 3073 | if (thd_delay > THD_DELAY_MAX) {
|
3073 | 3074 | thd_delay = THD_DELAY_MAX;
|
@@ -3156,11 +3157,10 @@ static int cdns_i3c_bus_init(const struct device *dev)
|
3156 | 3157 | ctrl &= ~CTRL_MST_ACK;
|
3157 | 3158 |
|
3158 | 3159 | /*
|
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 |
3161 | 3161 | */
|
3162 | 3162 | 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)); |
3164 | 3164 | }
|
3165 | 3165 |
|
3166 | 3166 | /*
|
|
0 commit comments