All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/10] i3c: mipi-i3c-hci: Add Aspeed AST2700 support
@ 2026-12-03  3:07 ` Billy Tsai
  0 siblings, 0 replies; 28+ messages in thread
From: Billy Tsai @ 2026-12-03  3:07 UTC (permalink / raw)
  To: Alexandre Belloni, Frank Li, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Joel Stanley, Andrew Jeffery, Philipp Zabel,
	Miquel Raynal, Ryan Chen
  Cc: tbevis, linux-i3c, devicetree, linux-arm-kernel, linux-aspeed,
	linux-kernel, Billy Tsai

The Aspeed AST2700 SoC integrates an I3C host controller based on the
MIPI I3C HCI v1.1 programming model, extended with an in-house control
block and a PHY programming window. Both extra register regions are
advertised through a standard HCI vendor extended capability. This
series teaches the existing mipi-i3c-hci driver to drive the AST2700
controller without forking the driver.

AST2700 specifics are expressed entirely as quirks in the match data:
the existing HCI_QUIRK_DMA_ABORT_REQUIRES_PIO_RESET, then four generic
quirks:

 - HCI_QUIRK_DAT_INDEX_IS_ADDR for address-indexed DAT slots,
 - HCI_QUIRK_DMA_64BIT to configure a 64-bit DMA mask,
 - HCI_QUIRK_TX_START_THLD to clear the TX start threshold in DMA mode, and
 - HCI_QUIRK_BOARD_PHY_TIMINGS to apply board-specific PHY timing from DT

plus six quirks for everything that depends on the ASPEED vendor
capability:

 - HCI_QUIRK_VENDOR_BUS_SETUP to bring up the bus
 - HCI_QUIRK_VENDOR_INTR_SUMMARY for ASPEED's interrupt roll-up
 - HCI_QUIRK_VENDOR_RESOURCES for further clocks and resets
 - HCI_QUIRK_VENDOR_DAA_INDEX for access to DAA index registers
 - HCI_QUIRK_IBI_PAYLOAD_THLD to bound IBI transfers at the controller
 - HCI_QUIRK_VENDOR_TX_AVAIL for precise ringbuffer operations

Generic MIPI I3C HCI controllers are unaffected.

The series is organised as follows:

 - Patch 1 defines timing properties for the devicetree to manage the
   impact of board design on bus operation.

 - Patch 2 documents the AST2700 devicetree binding.

 - Patches 3-5 add the generic HCI quirks AST2700 needs --
   address-indexed DAT slots, 64-bit DMA addressing, and clearing the
   TX start threshold in DMA mode -- with no AST2700-specific code yet;
   nothing sets these quirks until patch 7.

 - Patch 6 splits the generic IRQ handler's INTR_STATUS handling into
   its own function, reusable by a vendor-specific summary IRQ handler;
   no behavior changes.

 - Patch 7 adds support for the AST2700 I3C controller by implementing
   the controller-specific quirks and enabling all necessary quirks in
   the MIPI HCI driver to drive the AST2700 controller. It recognizes
   the ASPEED vendor extended capability, brings the controller up for
   transfers (master mode, PHY timing, reset/clock resources, the
   interrupt summary path, master clock stall), and enables all eleven
   quirks for the "aspeed,ast2700-i3c-hci" compatible.

 - Patch 8 adds the IBI termination threshold, a safeguard against a
   misbehaving device that never terminates a payload IBI on its own.

 - Patches 9-10 tune bus behaviour: PIO TX queue utilization, and the
   PHY's built-in pull-ups for boards without external resistors.

Tested on an AST2700 EVB: the controller probes in both DMA and PIO modes,
completes DAA, and runs CCC, IBI, and private transfers in DMA mode.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
Changes in v3:
- New patch: split i3c_hci_irq_handler()'s INTR_STATUS handling into
  i3c_hci_core_irq(), reusable by the AST2700 vendor summary IRQ
  handler, instead of bundling that refactor into the same patch that
  adds AST2700 support
- Simplify aspeed_i3c_ns_to_cnt() to use min()/max() instead of
  min_t()/max_t()
- Parse the ASPEED vendor extended capability only for controllers
  matched with HCI_QUIRK_VENDOR_RESOURCES, which allocates vendor_data,
  and leave a register base unset when its offset reads as zero
- Program the I2C Fast Mode and Fast Mode Plus ACK SCL low periods
  from the SCL low count instead of the high count
- Keep the IBI termination threshold in the vendor data and reprogram
  it after a controller reset, which clears the register
- Leave the existing init_name comment in i3c_hci_probe() unchanged;
  rewording it is unrelated to AST2700 support
- Add minimum: to i3c-pp-scl-high-period-ns, i3c-pp-scl-low-period-ns
  and i3c-od-scl-low-period-ns, matching their MIPI I3C Basic
  Specification v1.1.1 minima
- Link to v2: https://lore.kernel.org/r/20261111-b4-i3c-hci-ast2700-v2-0-4d8fff5c5196@aspeedtech.com

Changes in v2:
- Rebase onto the latest i3c/next
- New patch: move the AST2700 timing properties into the generic
  i3c.yaml binding, renamed to match its existing i3c-prefixed naming
  convention
- Remove is_aspeed(), replace it with seven discrete quirk bits
- Rename vendor_aspeed.{c,h} to aspeed.{c,h}; keep struct
  aspeed_i3c_vendor_data private to aspeed.c
- Add a probe-time check for the ASPEED vendor capability being
  missing, ahead of the first vendor register access
- Drop the NULL check in hci_extcap_vendor_ASPEED(); vendor_data is
  always allocated by the time it runs
- Fix aspeed_i3c_set_daa_index() to clear all four DAA index register
  banks, not just the one it is about to set
- Drop the dma_set_mask_and_coherent() return value check; it cannot
  fail for a 64-bit mask
- Revert the pio.h register split; add an accessor function instead
- Drop the unused HCI_DAT_ANY_ADDRESS macro
- Make the Open Drain PHY timing pair all-or-nothing, matching the
  Push-Pull pair
- Acquire the vendor clock as mandatory, matching the binding's
  required clocks
- Acquire the dma reset with
  devm_reset_control_get_optional_shared_deasserted(), instead of a
  manual deassert and cleanup action
- Pulse the core reset at probe instead of only deasserting it, and
  reassert it on driver detach.
- Limit the SDA hold time override (i3c-pp-sda-hold-ns) to Push-Pull
  timing; Open Drain always uses its hardware default
- Link to v1: https://lore.kernel.org/r/20260901-b4-i3c-hci-ast2700-v1-0-19909e7cbd7e@aspeedtech.com

---
Billy Tsai (10):
      dt-bindings: i3c: Document generic bus timing properties
      dt-bindings: i3c: Document the AST2700 I3C controller
      i3c: mipi-i3c-hci: Support address-indexed DAT slots
      i3c: mipi-i3c-hci: Add a quirk for 64-bit DMA addressing
      i3c: mipi-i3c-hci: Add a quirk to clear the TX start threshold
      i3c: mipi-i3c-hci: Split the core IRQ handling into its own function
      i3c: mipi-i3c-hci: Add support for the AST2700 I3C controller
      i3c: mipi-i3c-hci: Program AST2700 IBI termination threshold
      i3c: mipi-i3c-hci: Improve AST2700 PIO TX queue utilization
      i3c: mipi-i3c-hci: Support the AST2700 internal pull-ups

 .../bindings/i3c/aspeed,ast2700-i3c-hci.yaml       |  89 ++++
 Documentation/devicetree/bindings/i3c/i3c.yaml     |  89 ++++
 drivers/i3c/master/mipi-i3c-hci/Makefile           |   2 +-
 drivers/i3c/master/mipi-i3c-hci/aspeed.c           | 525 +++++++++++++++++++++
 drivers/i3c/master/mipi-i3c-hci/aspeed.h           | 178 +++++++
 drivers/i3c/master/mipi-i3c-hci/cmd_v1.c           |  38 +-
 drivers/i3c/master/mipi-i3c-hci/core.c             | 196 +++++++-
 drivers/i3c/master/mipi-i3c-hci/dat.h              |   6 +-
 drivers/i3c/master/mipi-i3c-hci/dat_v1.c           |  63 ++-
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c         |   2 +
 drivers/i3c/master/mipi-i3c-hci/ext_caps.h         |   1 +
 drivers/i3c/master/mipi-i3c-hci/hci.h              |  11 +
 drivers/i3c/master/mipi-i3c-hci/pio.c              |  32 +-
 13 files changed, 1184 insertions(+), 48 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260714-b4-i3c-hci-ast2700-bad726e20c01

Best regards,
-- 
Billy Tsai <billy_tsai@aspeedtech.com>


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2026-12-03  3:22 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  3:07 [PATCH v3 00/10] i3c: mipi-i3c-hci: Add Aspeed AST2700 support Billy Tsai
2026-12-03  3:07 ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 01/10] dt-bindings: i3c: Document generic bus timing properties Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:15   ` sashiko-bot
2026-12-03  3:15     ` sashiko-bot
2026-12-03  3:07 ` [PATCH v3 02/10] dt-bindings: i3c: Document the AST2700 I3C controller Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:14   ` sashiko-bot
2026-12-03  3:14     ` sashiko-bot
2026-12-03  3:07 ` [PATCH v3 03/10] i3c: mipi-i3c-hci: Support address-indexed DAT slots Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 04/10] i3c: mipi-i3c-hci: Add a quirk for 64-bit DMA addressing Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 05/10] i3c: mipi-i3c-hci: Add a quirk to clear the TX start threshold Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 06/10] i3c: mipi-i3c-hci: Split the core IRQ handling into its own function Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 07/10] i3c: mipi-i3c-hci: Add support for the AST2700 I3C controller Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:22   ` sashiko-bot
2026-12-03  3:22     ` sashiko-bot
2026-12-03  3:07 ` [PATCH v3 08/10] i3c: mipi-i3c-hci: Program AST2700 IBI termination threshold Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 09/10] i3c: mipi-i3c-hci: Improve AST2700 PIO TX queue utilization Billy Tsai
2026-12-03  3:07   ` Billy Tsai
2026-12-03  3:07 ` [PATCH v3 10/10] i3c: mipi-i3c-hci: Support the AST2700 internal pull-ups Billy Tsai
2026-12-03  3:07   ` Billy Tsai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.