Re: [PATCH net-next v13 2/2] ptp: ocp: add TAP CPLD firmware upload for ADVA TimeCard X1
From: Jakub Kicinski
Date: Fri Sep 11 2026 - 19:55:03 EST
On Tue, 8 Sep 2026 15:23:28 +0300 Sagi Maimon wrote:
> The Lattice MachXO3 CPLD on the ADVA TimeCard X1 is programmed over I2C
> using in-system programming (ISP). Build on the TMC bus arbitration
> added previously and expose the update path through the kernel
> firmware-upload subsystem.
>
> The framework acquires the bus, erases the configuration flash, programs
> the image page-by-page and activates it with the MachXO3 REFRESH
> command. The upload node is registered per card as adva-cpld.N, using
> the same index as the owning ocpN device, so a host with more than one
> X1 board gets one node each:
>
> /sys/class/firmware/adva-cpld.N/
>
> The whole prepare/write/poll_complete/cleanup sequence runs under
> cpld_lock and the i2c adapter lock, so an EEPROM read blocks for as long
> as programming takes; the alternative is reading the TMC bus instead.
> The upload is unregistered first on detach, which cancels and flushes an
> in-flight programming cycle while the I2C controller is still up.
>
> Select FW_LOADER and FW_UPLOAD, as the documented update path does not
> exist without them.
Why add another FW flashing interface when the device already supports
devlink flash? You can use component names to disambiguate which FW we
are targeting.