From: Sagi Maimon <maimon.sagi@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Simon Horman <horms@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jonathan Corbet <corbet@lwn.net>,
Randy Dunlap <rdunlap@infradead.org>,
Shuah Khan <skhan@linuxfoundation.org>,
netdev@vger.kernel.org
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sagi Maimon <maimon.sagi@gmail.com>
Subject: [PATCH net-next v14 0/4] ptp: ocp: add TAP CPLD support for ADVA TimeCard X1
Date: Mon, 14 Sep 2026 10:15:51 +0300 [thread overview]
Message-ID: <20260914071555.11684-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 devlink flash.
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.
Patches 1 and 2 are pre-existing probe-error-path bugs that were buried
in the feature commit in v13; they are split out with Fixes: tags, as
requested. Patch 1 is also a prerequisite: patch 3 adds a mutex that
ptp_ocp_detach() destroys, so devlink has to be unregistered first.
Patch 3 adds the bus arbitration and the read-only interfaces, patch 4
the flashing.
v13: https://lore.kernel.org/netdev/20260908122328.52641-1-maimon.sagi@gmail.com/T/#u
Changes since v13:
- The CPLD is no longer flashed through the firmware-upload subsystem.
It is a devlink flash component instead:
devlink dev flash pci/0000:02:00.0 file cpld.bin component fw.cpld
->info_get() reports fw.cpld as a running version with
DEVLINK_INFO_VERSION_TYPE_COMPONENT, carrying the USERCODE of the
image in the part, which is also what makes the core accept the
component name. No component still means the card flash. This
removed fw_upload_ops, the adva-cpld.N node, the FW_LOADER/FW_UPLOAD
selects and the cancellation state machine - and with it a race where
a cancel arriving after one upload finished could abort the next.
Patch 4. (Jakub Kicinski)
- cpld_status now contains the names of the flags that are set, space
separated, and an empty line when none is, instead of
"done=<0|1> busy=<0|1> failed=<0|1>". Patch 3. (Jakub Kicinski)
- The commit was split; the two pre-existing fixes it contained are
patches 1 and 2 with Fixes: tags. (Jakub Kicinski)
- The flash path now validates the state after REFRESH - DONE set, not
busy, and no sysCONFIG error - and fails the devlink command rather
than reporting success for an image that did not come back. Patch 4.
- adva_x1_mblaze_release() waits for the firmware to drop the grant
instead of writing RELEASE and returning, and warns if it does not.
Patch 3.
- The i2c bus notifier only caches the adapter number for the card's
own controller, not for an i2c-mux child registered on it. The
adapter is also resolved once from probe, because the notifier fires
from inside platform_device_register() - before bp->i2c_ctrl is
assigned - whenever the i2c controller driver is already loaded.
Patch 3.
- ptp_ocp_devlink_info_get() checks bp->has_cpld explicitly rather than
relying on cpld_id being zero on boards without one. Patch 3.
- ptp_ocp_sync_work() no longer latches the one-shot ID read on -EBUSY,
so a read that collided with a CPLD operation is retried. Patch 3.
- Documentation/networking/devlink/ptp_ocp.rst documents the flash
components and states the accepted image format: a raw bitstream, a
whole number of 16-byte pages; .jed and other containers are
rejected. Patch 4.
Tested on an ADVA TimeCard X1: a full erase/program/refresh cycle of a
6526-page image through "devlink dev flash ... component fw.cpld", the
CPLD reporting done afterwards and still done across a reboot, and both
rejection paths (a .jed image, and an unknown component name).
Sagi Maimon (4):
ptp: ocp: unregister devlink before detach on probe error
ptp: ocp: fix dpll cleanup on probe error
ptp: ocp: add TAP CPLD access for ADVA TimeCard X1
ptp: ocp: add TAP CPLD flashing via devlink
Documentation/ABI/testing/sysfs-timecard | 28 +
Documentation/networking/devlink/index.rst | 1 +
Documentation/networking/devlink/ptp_ocp.rst | 70 ++
MAINTAINERS | 1 +
drivers/ptp/ptp_ocp.c | 774 ++++++++++++++++++-
5 files changed, 868 insertions(+), 6 deletions(-)
create mode 100644 Documentation/networking/devlink/ptp_ocp.rst
base-commit: 879e280b8486d4612ad1aa050d6fada2dd80cf1c
--
2.47.0
next reply other threads:[~2026-09-14 7:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 7:15 Sagi Maimon [this message]
2026-09-14 7:15 ` [PATCH net-next v14 1/4] ptp: ocp: unregister devlink before detach on probe error Sagi Maimon
2026-09-14 7:15 ` [PATCH net-next v14 2/4] ptp: ocp: fix dpll cleanup " Sagi Maimon
2026-09-14 7:15 ` [PATCH net-next v14 3/4] ptp: ocp: add TAP CPLD access for ADVA TimeCard X1 Sagi Maimon
2026-09-14 7:15 ` [PATCH net-next v14 4/4] ptp: ocp: add TAP CPLD flashing via devlink Sagi Maimon
-- strict thread matches above, loose matches on Subject: below --
2026-09-14 7:15 [PATCH net-next v14 0/4] ptp: ocp: add TAP CPLD support for ADVA TimeCard X1 Sagi Maimon
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=20260914071555.11684-1-maimon.sagi@gmail.com \
--to=maimon.sagi@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=skhan@linuxfoundation.org \
--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
all inboxes | Powered by JetHome®