Netdev List
 help / color / mirror / Atom feed
From: Sagi Maimon <maimon.sagi@gmail.com>
To: netdev@vger.kernel.org
Cc: vadim.fedorenko@linux.dev, richardcochran@gmail.com,
	kuba@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, Sagi Maimon <maimon.sagi@gmail.com>
Subject: [PATCH net-next v12 0/2] ptp: ocp: add TAP CPLD support for ADVA TimeCard X1
Date: Wed,  2 Sep 2026 07:42:30 +0300	[thread overview]
Message-ID: <20260902044232.21188-1-maimon.sagi@gmail.com> (raw)

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@gmail.com/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


             reply	other threads:[~2026-09-02  4:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  4:42 Sagi Maimon [this message]
2026-09-02  4:42 ` [PATCH net-next v12 1/2] ptp: ocp: add TAP CPLD access for ADVA TimeCard X1 Sagi Maimon
2026-09-04  7:46   ` netdev-bot+sashiko
2026-09-02  4:42 ` [PATCH net-next v12 2/2] ptp: ocp: add TAP CPLD firmware upload " Sagi Maimon
2026-09-04  7:46   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902044232.21188-1-maimon.sagi@gmail.com \
    --to=maimon.sagi@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox