[PATCH net-next v12 0/2] ptp: ocp: add TAP CPLD support for ADVA TimeCard X1

From: Sagi Maimon

Date: Wed Sep 02 2026 - 00:42:42 EST


The ADVA TimeCard X1 (PCI device 0x0410) carries a Lattice MachXO3 CPLD
on the TMC I2C bus. This series adds access to it and an update path
through the kernel firmware-upload subsystem.

The card has two I2C controllers. Linux registers only the one at
0x00150000, normally routed to the config EEPROMs; the one at 0x00120000
belongs to the on-card MicroBlaze and is routed to the TMC or M.2 bus as
its firmware selects. A request/grant handshake re-routes the host
controller onto the TMC bus, where the PCA9548 and the CPLD behind its
channel 0 live. Everything here is built on that handshake.

Patch 1 adds the arbitration and the read-only interfaces on top of it.
Patch 2 adds the flashing.

v11: https://lore.kernel.org/netdev/20260811135720.109580-1-maimon.sagi@xxxxxxxxx/T/#u

Changes since v11 - all from Vadim's review of the ISC command path:

- adva_x1_i2c_xfer() takes the opcode as its own argument and assembles
the message in a scratch buffer taken once per bus claim, so the
opcode and its arguments are copied exactly once and a firmware upload
costs one allocation instead of one per 16-byte page. The bound check
lives here now, against the scratch size. Patch 1.
- adva_x1_cpld_write() takes just the opcode; the per-command argument
bytes come from adva_x1_cpld_args(), a switch-case helper returning a
pointer to the static data. This drops the seven per-caller argument
arrays, including the dis_args duplicated between prepare() and
cleanup(). Patch 2.
- Commands whose arguments are all zero (RESET_ADDR, SET_DONE, DIS_CFG,
REFRESH) pass NULL and the transfer sends zeros, so the zero3 arrays
are gone.
- Comment fix: the LCMXO3LF-2100 IDCODE is 0xe12bc043 (0x612bc043 is the
4300-LUT part). Patch 1.

No functional change: the byte sequences on the wire are unchanged, and
CPLD programming was verified on an ADVA TimeCard X1.

Sagi Maimon (2):
ptp: ocp: add TAP CPLD access for ADVA TimeCard X1
ptp: ocp: add TAP CPLD firmware upload for ADVA TimeCard X1

Documentation/ABI/testing/sysfs-timecard | 24 +
drivers/ptp/Kconfig | 2 +
drivers/ptp/ptp_ocp.c | 693 ++++++++++++++++++++++-
3 files changed, 715 insertions(+), 4 deletions(-)


base-commit: c29b37ed7a4d9856ed758a82282456d69cee2ed1
--
2.47.0