[PATCH 0/3] i3c: mipi-i3c-hci: derive SAMA7D65 SCL timings from gclk
From: Manikandan Muralidharan
Date: Fri Dec 04 2026 - 03:35:07 EST
The Microchip SAMA7D65 I3C controller support merged in v7.2 [1] relies
on two AMD quirks: HCI_QUIRK_OD_PP_TIMING, which programs fixed OD/PP
timing values tuned for the AMD core clock, and HCI_QUIRK_RESP_BUF_THLD,
which clears the response buffer threshold once after the PIO init.
This series replaces both with Microchip specific handling:
- Patch 1 moves the OD/PP timing register offsets to hci.h so that both
vendor quirk files can use them. No functional change.
- Patch 2 adds hci_quirks_mchp.c, which derives the push-pull,
open-drain, SDR1..SDR4 extended low count and bus free timings from
the gclk rate and the configured I3C/I2C SCL rates. The gclk is the
second clock of the existing binding, taken from the clocks already
acquired in probe, so the device tree ABI is unchanged. The timings
are programmed in bus_init() and restored whenever the controller is
reset.
- Patch 3 selects the response buffer threshold in __hci_pio_init(), so
that it stays in sync with the cached QUEUE_THLD_CTRL value and is not
reverted by IBI threshold updates or a controller reset and restore.
Tested on the SAMA7D65 Curiosity board with an LSM6DSV IMU on the I3C
bus (SETDASA, private transfers through the IIO driver). With the
125 MHz gclk, the controller runs push-pull at 12.5 MHz and open-drain
at 1 MHz, and the bus keeps working after standby and suspend-to-RAM.
[1] https://lore.kernel.org/all/20260525092405.1514213-1-manikandan.m@xxxxxxxxxxxxx/
Manikandan Muralidharan (3):
i3c: mipi-i3c-hci: move shared SCL timing register offsets to hci.h
i3c: mipi-i3c-hci: add Microchip quirk to derive SCL timings from gclk
i3c: mipi-i3c-hci: add Microchip quirk to set response buffer
threshold
drivers/i3c/master/mipi-i3c-hci/Makefile | 2 +-
drivers/i3c/master/mipi-i3c-hci/core.c | 23 +++-
drivers/i3c/master/mipi-i3c-hci/hci.h | 9 ++
drivers/i3c/master/mipi-i3c-hci/hci_quirks.c | 3 -
.../i3c/master/mipi-i3c-hci/hci_quirks_mchp.c | 124 ++++++++++++++++++
drivers/i3c/master/mipi-i3c-hci/pio.c | 8 +-
6 files changed, 159 insertions(+), 10 deletions(-)
create mode 100644 drivers/i3c/master/mipi-i3c-hci/hci_quirks_mchp.c
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0