dpll/ice: Add TXC DPLL type and full TX reference clock control for E825
Subsystems (6)
v5 cover dpll/ice: Add TXC DPLL type and full TX reference clock control for E825
NOTE: This series is intentionally submitted on net-next (not intel-wired-lan) as early feedback of DPLL subsystem changes is welcomed. In the past possible approaches were discussed in [1].
This series adds TX reference clock support for E825 devices and exposes TX clock selection and synchronization status via the Linux DPLL subsystem.
E825 hardware contains a dedicated Tx clock (TXC) domain that is distinct
from PPS and EEC. TX reference clock selection is device‑wide, shared across ports, and mediated by firmware as part of the link bring‑up process. As a result, TX clock selection intent may differ from the effective hardware configuration, and software must verify the outcome after link‑up.
To support this, the series introduces TXC support incrementally across the DPLL core and the ice driver:
- add a new DPLL type (TXC) to represent transmit clock generators;
- relax DPLL pin registration rules for firmware‑described shared pins and extend pin notifications with a source identifier;
- allow dynamic state control of SyncE reference pins where hardware supports it;
- add CPI infrastructure for PHY‑side TX clock control on E825C;
- introduce a TXC DPLL device and TX reference clock pins (EXT_EREF0 and SYNCE) in the ice driver;
- extend the Restart Auto‑Negotiation command to carry a TX reference clock index;
- implement hardware‑backed TX reference clock switching, post‑link
- verification, and TX synchronization reporting.
TXCLK pins report TX reference topology only. Actual synchronization success is reported via the TXC DPLL lock status, which is updated after hardware verification: external Tx references report LOCKED, while the internal ENET/TXCO source reports UNLOCKED.
This provides reliable TX reference selection and observability on E825 devices using standard DPLL interfaces, without conflating user intent with effective hardware behavior.
[1] https://lore.kernel.org/netdev/[email protected]/
Changes in v5:
- rebased
- reworded cover letter
- replace 'ntfy_src' new argument name with 'src_clk_id' and use it consistently in DPLL notification calls (patch 3/8)
- reworded commit message (patch 5/8)
- use FIELD_PREP/GENMSK macros instead of struct bitfields (patch 6/8)
- reworded commit message (patch 5/8, patch 8/8)
- refactor the code to avoid sleeping while DPLL mutex is held (using work_queue, patch 8/8)
- added TXCLK pins and TXC DPLL notifications (patch 8/8)
- removed 'unused clock disable' mechanism from the scope of this series
Changes in v4:
- rebased
- edited, shortened the commit message in 3/8 patch
- moved ice_get_ctrl_pf to the header file (patch 8/8) and removed duplicated static definitions from ice_ptp and ice_txlck modules
- add NULL/invalid pointer checker for returned pointer from ice_get_ctrl_pf (patch 8/8)
- edited error message in case AN restart failure (patch 8/8)
Changes in v3:
- improved commit message (patch 1/8, AI review comment)
- improved deinitialization path in ice_dpll_deinit_txclk_pins to avoid potential NULL dereference. NULL checking moved to ice_dpll_unregister_pins (patch 5/8, found by AI review)
- removed redundant semicolon (patch 6/8)
Changes in v2:
- rebased
- added autogenerated DPLL files (patch 1/8)
- fixed checkpatch 'parenthesis alignment' warning (patch 2/8)
- fixed error path in ice_dpll_init_txclk_pins (AI warning, patch 5/8)
- fixed kdoc warnings (patch 6/8, patch 8/8)
Grzegorz Nitka (8):
dpll: add new DPLL type for transmit clock (TXC) usage
dpll: allow registering FW-identified pin with a different DPLL
dpll: extend pin notifier and netlink events with notification source
ID
dpll: zl3073x: allow SyncE_Ref pin state change
ice: introduce TXC DPLL device and TX ref clock pin framework for E825
ice: implement CPI support for E825C
ice: add Tx reference clock index handling to AN restart command
ice: implement E825 TX ref clock control and TXC hardware sync status
Documentation/netlink/specs/dpll.yaml | 3 + drivers/dpll/dpll_core.c | 32 +- drivers/dpll/dpll_core.h | 3 +- drivers/dpll/dpll_netlink.c | 10 +- drivers/dpll/dpll_netlink.h | 4 +- drivers/dpll/dpll_nl.c | 2 +- drivers/dpll/zl3073x/prop.c | 9 + drivers/net/ethernet/intel/ice/Makefile | 2 +- drivers/net/ethernet/intel/ice/ice.h | 12 + .../net/ethernet/intel/ice/ice_adminq_cmd.h | 2 + drivers/net/ethernet/intel/ice/ice_common.c | 5 +- drivers/net/ethernet/intel/ice/ice_common.h | 2 +- drivers/net/ethernet/intel/ice/ice_cpi.c | 337 ++++++++++++++++ drivers/net/ethernet/intel/ice/ice_cpi.h | 61 +++ drivers/net/ethernet/intel/ice/ice_dpll.c | 380 ++++++++++++++++-- drivers/net/ethernet/intel/ice/ice_dpll.h | 10 + drivers/net/ethernet/intel/ice/ice_lib.c | 3 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 26 +- drivers/net/ethernet/intel/ice/ice_ptp.h | 7 + drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 37 ++ drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 34 ++ drivers/net/ethernet/intel/ice/ice_sbq_cmd.h | 5 +- drivers/net/ethernet/intel/ice/ice_txclk.c | 241 +++++++++++ drivers/net/ethernet/intel/ice/ice_txclk.h | 38 ++ include/linux/dpll.h | 1 + include/uapi/linux/dpll.h | 2 + 26 files changed, 1215 insertions(+), 53 deletions(-) create mode 100644 drivers/net/ethernet/intel/ice/ice_cpi.c create mode 100644 drivers/net/ethernet/intel/ice/ice_cpi.h create mode 100644 drivers/net/ethernet/intel/ice/ice_txclk.c create mode 100644 drivers/net/ethernet/intel/ice/ice_txclk.h
base-commit: f35340f2d653f1003602878403c901396ab03c17
Signature · 1 line
2.39.3
PATCH v5 1/8 dpll: add new DPLL type for transmit clock (TXC) usage
Extend the DPLL subsystem with a new DPLL type, DPLL_TYPE_TXC, representing devices that drive a transmit reference clock. Certain PHYs, MACs and SerDes blocks use a dedicated TX reference clock for link operation, and this clock domain is distinct from PPS- and EEC-driven synchronization sources. Defining a dedicated type allows user space and drivers to correctly classify and configure DPLLs intended for TX clock generation.
The corresponding netlink specification is updated to expose "txc".
--- Documentation/netlink/specs/dpll.yaml | 3 +++ drivers/dpll/dpll_nl.c | 2 +- include/uapi/linux/dpll.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-)
Documentation/netlink/specs/dpll.yaml +3 -0
@@ -138,6 +138,9 @@ definitions: - name: eec doc: dpll drives the Ethernet Equipment Clock + - + name: txc + doc: dpll drives Tx reference clock render-max: true - type: enum
drivers/dpll/dpll_nl.c +1 -1
@@ -34,7 +34,7 @@ const struct nla_policy dpll_reference_sync_nl_policy[DPLL_A_PIN_STATE + 1] = {static const struct nla_policy dpll_device_id_get_nl_policy[DPLL_A_TYPE +1 ] = { [DPLL_A_MODULE_NAME ] = { .type =NLA_NUL_STRING , }, [DPLL_A_CLOCK_ID ] = { .type =NLA_U64 , }, - [DPLL_A_TYPE ] =NLA_POLICY_RANGE (NLA_U32 ,1 ,2 ), + [DPLL_A_TYPE ] =NLA_POLICY_RANGE (NLA_U32 ,1 ,3 ), };/* DPLL_CMD_DEVICE_GET - do */
include/uapi/linux/dpll.h +2 -0
@@ -109,10 +109,12 @@ enum dpll_clock_quality_level {* enum dpll_type - type of dpll, valid values for DPLL_A_TYPE attribute * @DPLL_TYPE_PPS: dpll produces Pulse-Per-Second signal * @DPLL_TYPE_EEC: dpll drives the Ethernet Equipment Clock +* @DPLL_TYPE_TXC: dpll drives Tx reference clock */ enum dpll_type {DPLL_TYPE_PPS =1 ,DPLL_TYPE_EEC , +DPLL_TYPE_TXC ,/* private: */ __DPLL_TYPE_MAX,
Signature · 1 line
2.39.3
PATCH v5 2/8 dpll: allow registering FW-identified pin with a different DPLL
In reply to Grzegorz NitkaRelax the (module, clock_id) equality requirement when registering a pin identified by firmware (pin->fwnode). Some platforms associate a FW-described pin with a DPLL instance that differs from the pin's (module, clock_id) tuple. For such pins, permit registration without requiring the strict match. Non-FW pins still require equality.
--- drivers/dpll/dpll_core.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/dpll/dpll_core.c +14 -4
@@ -880,11 +880,21 @@ dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,return -EINVAL ;mutex_lock (&dpll_lock); -if (WARN_ON (!(dpll->module == pin->module && - dpll->clock_id == pin->clock_id))) + +/* +* For pins identified via firmware (pin->fwnode), allow registration +* even if the pin's (module, clock_id) differs from the target DPLL. +* For non-fwnode pins, require a strict (module, clock_id) match. +*/ +if (!pin->fwnode && +WARN_ON_ONCE (dpll->module != pin->module || + dpll->clock_id != pin->clock_id)) { ret = -EINVAL ; -else - ret =__dpll_pin_register (dpll, pin, ops, priv,NULL ); + goto out_unlock; + } + + ret =__dpll_pin_register (dpll, pin, ops, priv,NULL ); +out_unlock:mutex_unlock (&dpll_lock);return ret;
Signature · 1 line
2.39.3
PATCH v5 3/8 dpll: extend pin notifier and netlink events with notification source ID
In reply to Grzegorz NitkaExtend the DPLL pin notification API to include a source identifier indicating where the notification originates. This allows notifier consumers and netlink listeners to distinguish between notifications coming from an associated DPLL instance, a parent pin, or the pin itself.
A new field, src_id, is added to struct dpll_pin_notifier_info and is passed through all pin-related notification paths. Callers of dpll_pin_notify() are updated to provide a meaningful source identifier based on their context:
- pin registration/unregistration uses the DPLL's clock_id,
- pin-on-pin operations use the parent pin's clock_id,
- pin changes use the pin's own clock_id.
As introduced in the commit ("dpll: allow registering FW-identified pin with a different DPLL"), it is possible to share the same physical pin via firmware description (fwnode) with DPLL objects from different kernel modules. This means that a given pin can be registered multiple times.
Driver such as ICE (E825 devices) rely on this mechanism when listening for the event where a shared-fwnode pin appears, while avoiding reacting to events triggered by their own registration logic.
This change only extends the notification metadata and does not alter existing semantics for drivers that do not use the new field.
--- drivers/dpll/dpll_core.c | 14 ++++++++------ drivers/dpll/dpll_core.h | 3 ++- drivers/dpll/dpll_netlink.c | 10 +++++----- drivers/dpll/dpll_netlink.h | 4 ++-- include/linux/dpll.h | 1 + 5 files changed, 18 insertions(+), 14 deletions(-)
drivers/dpll/dpll_core.c +8 -6
@@ -71,7 +71,8 @@ void dpll_device_notify(struct dpll_device *dpll, unsigned long action)call_dpll_notifiers (action, &info); } -void dpll_pin_notify (struct dpll_pin *pin,unsigned long action) +void dpll_pin_notify (struct dpll_pin *pin,u64 src_clock_id, +unsigned long action) {struct dpll_pin_notifier_info info = { .pin = pin,
@@ -80,6 +81,7 @@ void dpll_pin_notify(struct dpll_pin *pin, unsigned long action) .clock_id = pin->clock_id, .fwnode = pin->fwnode, .prop = &pin->prop, + .src_clock_id = src_clock_id, };call_dpll_notifiers (action, &info);
@@ -847,7 +849,7 @@ __dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,if (ret) goto ref_pin_del;xa_set_mark (&dpll_pin_xa, pin->id,DPLL_REGISTERED ); -dpll_pin_create_ntf (pin); +dpll_pin_create_ntf (pin, dpll->clock_id);return ret;
@@ -946,7 +948,7 @@ void dpll_pin_unregister(struct dpll_device *dpll, struct dpll_pin *pin,return ;mutex_lock (&dpll_lock); -dpll_pin_delete_ntf (pin); +dpll_pin_delete_ntf (pin, dpll->clock_id);__dpll_pin_unregister (dpll, pin, ops, priv,NULL );mutex_unlock (&dpll_lock); }
@@ -992,7 +994,7 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin, stop = i; goto dpll_unregister; } -dpll_pin_create_ntf (pin); +dpll_pin_create_ntf (pin, parent->clock_id); }mutex_unlock (&dpll_lock);
@@ -1003,7 +1005,7 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin,if (i < stop) {__dpll_pin_unregister (ref->dpll, pin, ops, priv, parent); -dpll_pin_delete_ntf (pin); +dpll_pin_delete_ntf (pin, parent->clock_id); }dpll_xa_ref_pin_del (&pin->parent_refs, parent, ops, priv, pin); unlock:
@@ -1029,7 +1031,7 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin,unsigned long i;mutex_lock (&dpll_lock); -dpll_pin_delete_ntf (pin); +dpll_pin_delete_ntf (pin, parent->clock_id);dpll_xa_ref_pin_del (&pin->parent_refs, parent, ops, priv, pin);xa_for_each (&pin->dpll_refs, i, ref)__dpll_pin_unregister (ref->dpll, pin, ops, priv, parent);
drivers/dpll/dpll_core.h +2 -1
@@ -98,6 +98,7 @@ extern struct xarray dpll_pin_xa;extern struct mutex dpll_lock;void dpll_device_notify (struct dpll_device *dpll,unsigned long action); -void dpll_pin_notify (struct dpll_pin *pin,unsigned long action); +void dpll_pin_notify (struct dpll_pin *pin,u64 src_clock_id, +unsigned long action);#endif
drivers/dpll/dpll_netlink.c +5 -5
@@ -830,21 +830,21 @@ dpll_pin_event_send(enum dpll_cmd event, struct dpll_pin *pin)return ret; } -int dpll_pin_create_ntf (struct dpll_pin *pin) +int dpll_pin_create_ntf (struct dpll_pin *pin,u64 src_clock_id) { -dpll_pin_notify (pin,DPLL_PIN_CREATED ); +dpll_pin_notify (pin, src_clock_id,DPLL_PIN_CREATED );return dpll_pin_event_send (DPLL_CMD_PIN_CREATE_NTF , pin); } -int dpll_pin_delete_ntf (struct dpll_pin *pin) +int dpll_pin_delete_ntf (struct dpll_pin *pin,u64 src_clock_id) { -dpll_pin_notify (pin,DPLL_PIN_DELETED ); +dpll_pin_notify (pin, src_clock_id,DPLL_PIN_DELETED );return dpll_pin_event_send (DPLL_CMD_PIN_DELETE_NTF , pin); }int __dpll_pin_change_ntf (struct dpll_pin *pin) { -dpll_pin_notify (pin,DPLL_PIN_CHANGED ); +dpll_pin_notify (pin, pin->clock_id,DPLL_PIN_CHANGED );return dpll_pin_event_send (DPLL_CMD_PIN_CHANGE_NTF , pin); }
drivers/dpll/dpll_netlink.h +2 -2
@@ -8,8 +8,8 @@ int dpll_device_create_ntf(struct dpll_device *dpll);int dpll_device_delete_ntf (struct dpll_device *dpll); -int dpll_pin_create_ntf (struct dpll_pin *pin); +int dpll_pin_create_ntf (struct dpll_pin *pin,u64 src_clock_id); -int dpll_pin_delete_ntf (struct dpll_pin *pin); +int dpll_pin_delete_ntf (struct dpll_pin *pin,u64 src_clock_id);int __dpll_pin_change_ntf (struct dpll_pin *pin);
include/linux/dpll.h +1 -0
@@ -202,6 +202,7 @@ struct dpll_pin_notifier_info {u64 clock_id;const struct fwnode_handle *fwnode;const struct dpll_pin_properties *prop; +u64 src_clock_id; };#if IS_ENABLED (CONFIG_DPLL )
Signature · 1 line
2.39.3
Re: [PATCH v5 net-next 3/8] dpll: extend pin notifier and netlink events with notification source ID
Quoted 24 lines · Fri, Apr 03, 2026 at 01:06:21AM +0200, [email protected] wrote:
Extend the DPLL pin notification API to include a source identifier indicating where the notification originates. This allows notifier consumers and netlink listeners to distinguish between notifications coming from an associated DPLL instance, a parent pin, or the pin itself.
A new field,
src_id, is added to structdpll_pin_notifier_infoand is passed through all pin-related notification paths. Callers ofdpll_pin_notify()are updated to provide a meaningful source identifier based on their context:
- pin registration/unregistration uses the DPLL'sclock_id,
- pin-on-pin operations use the parent pin'sclock_id,
- pin changes use the pin's ownclock_id.As introduced in the commit ("dpll: allow registering FW-identified pin with a different DPLL"), it is possible to share the same physical pin via firmware description (fwnode) with DPLL objects from different kernel modules. This means that a given pin can be registered multiple times.
Driver such as ICE (E825 devices) rely on this mechanism when listening for the event where a shared-fwnode pin appears, while avoiding reacting to events triggered by their own registration logic.
Quoted 6 lines
This change only extends the notification metadata and does not alter existing semantics for drivers that do not use the new field.
Reviewed-by Arkadiusz Kubalewski <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Grzegorz Nitka <[email protected]>
PATCH v5 4/8 dpll: zl3073x: allow SyncE_Ref pin state change
In reply to Grzegorz NitkaThe SyncE_Ref pin may operate as either an active or inactive reference depending on board design and system configuration. Some platforms need to disable the SyncE reference dynamically (e.g., when selecting a different recovered clock input). The hardware supports toggling this pin, therefore advertise the STATE_CAN_CHANGE capability.
--- drivers/dpll/zl3073x/prop.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/dpll/zl3073x/prop.c +9 -0
@@ -215,6 +215,15 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, props->dpll_props.type =DPLL_PIN_TYPE_GNSS ; +/* +* The SyncE_Ref pin supports enabling/disabling dynamically. +* Some platforms may choose to expose this through firmware +* configuration later. For now, advertise this capability +* universally since the hardware allows state toggling. +*/ + props->dpll_props.capabilities |= +DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE ; +/* The output pin phase adjustment granularity equals half of * the synth frequency count. */
Signature · 1 line
2.39.3
Re: [PATCH v5 net-next 4/8] dpll: zl3073x: allow SyncE_Ref pin state change
Quoted 23 lines · Grzegorz Nitka
The
SyncE_Refpin may operate as either an active or inactive reference depending on board design and system configuration. Some platforms need to disable the SyncE reference dynamically (e.g., when selecting a different recovered clock input). The hardware supports toggling this pin, therefore advertise theSTATE_CAN_CHANGEcapability.Reviewed-by Arkadiusz Kubalewski <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Grzegorz Nitka <[email protected]>--- drivers/dpll/zl3073x/prop.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/dpll/zl3073x/prop.c +2
-0@@ -215,6 +215,15 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, props->dpll_props.type =DPLL_PIN_TYPE_GNSS ; +/* +* The SyncE_Ref pin supports enabling/disabling dynamically.
drivers/dpll/zl3073x/prop.c struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, · line 229
Quoted 10 lines
drivers/dpll/zl3073x/prop.c +7
-0+* Some platforms may choose to expose this through firmware +* configuration later. For now, advertise this capability +* universally since the hardware allows state toggling. +*/ + props->dpll_props.capabilities |= +DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE ; +/* The output pin phase adjustment granularity equals half of * the synth frequency count. */
PATCH v5 5/8 ice: introduce TXC DPLL device and TX ref clock pin framework for E825
In reply to Grzegorz NitkaE825 devices provide a dedicated TX clock (TXC) domain which may be driven by multiple reference clock sources, including external board references and port-derived SyncE. To support future TX clock control and observability through the Linux DPLL subsystem, introduce a separate TXC DPLL device and a framework for representing TX reference clock inputs.
This change adds a new DPLL pin type (TXCLK) and registers TX reference clock pins for E825-based devices:
- EXT_EREF0: a board-level external electrical reference
- SYNCE: a port-derived SyncE reference described via firmware nodes
The TXC DPLL device is created and managed alongside the existing PPS and EEC DPLL instances. TXCLK pins are registered directly or deferred via a notifier when backed by fwnode-described firmware pins. A per-pin attribute encodes the TX reference source associated with each TXCLK pin.
At this stage, TXCLK pin state callbacks and TXC DPLL lock status reporting are implemented as placeholders. Pin state getters always return DISCONNECTED, and the TXC DPLL is initialized in the UNLOCKED state. No hardware configuration or TX reference switching is performed yet.
This patch establishes the structural groundwork required for hardware-backed TX reference selection, verification, and synchronization
status reporting, which will be implemented in subsequent patches.
--- drivers/net/ethernet/intel/ice/ice_dpll.c | 296 ++++++++++++++++++-- drivers/net/ethernet/intel/ice/ice_dpll.h | 6 + drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 7 + 3 files changed, 286 insertions(+), 23 deletions(-)
drivers/net/ethernet/intel/ice/ice_dpll.c +273 -23
@@ -19,6 +19,11 @@#define ICE_DPLL_SW_PIN_INPUT_BASE_QSFP 6#define ICE_DPLL_SW_PIN_OUTPUT_BASE 0 +#define E825_EXT_EREF_PIN_IDX 0 +#define E825_EXT_SYNCE_PIN_IDX 1 +#define E825_RCLK_PARENT_0_PIN_IDX 0 +#define E825_RCLK_PARENT_1_PIN_IDX 1 +#define ICE_DPLL_PIN_SW_INPUT_ABS (in_idx) \ (ICE_DPLL_SW_PIN_INPUT_BASE_SFP + (in_idx))
@@ -57,6 +62,7 @@* @ICE_DPLL_PIN_TYPE_OUTPUT: output pin * @ICE_DPLL_PIN_TYPE_RCLK_INPUT: recovery clock input pin * @ICE_DPLL_PIN_TYPE_SOFTWARE: software controlled SMA/U.FL pins +* @ICE_DPLL_PIN_TYPE_TXCLK: transmit clock reference input pin */ enum ice_dpll_pin_type {ICE_DPLL_PIN_INVALID ,
@@ -64,6 +70,7 @@ enum ice_dpll_pin_type {ICE_DPLL_PIN_TYPE_OUTPUT ,ICE_DPLL_PIN_TYPE_RCLK_INPUT ,ICE_DPLL_PIN_TYPE_SOFTWARE , + ICE_DPLL_PIN_TYPE_TXCLK, }; static const char * const pin_type_name[] = {
@@ -71,10 +78,13 @@ static const char * const pin_type_name[] = { [ICE_DPLL_PIN_TYPE_OUTPUT] = "output", [ICE_DPLL_PIN_TYPE_RCLK_INPUT] = "rclk-input", [ICE_DPLL_PIN_TYPE_SOFTWARE] = "software", + [ICE_DPLL_PIN_TYPE_TXCLK] = "txclk-input", };static const char *const ice_dpll_sw_pin_sma[] = {"SMA1" ,"SMA2" };static const char *const ice_dpll_sw_pin_ufl[] = {"U.FL1" ,"U.FL2" }; +static const char *const ice_dpll_ext_eref_pin ="EXT_EREF0" ; +static const char *const ice_dpll_fwnode_ext_synce ="clk_ref_synce" ;static const struct dpll_pin_frequency ice_esync_range[] = {DPLL_PIN_FREQUENCY_RANGE (0 ,DPLL_PIN_FREQUENCY_1_HZ ),
@@ -2517,12 +2527,75 @@ ice_dpll_rclk_state_on_pin_get(const struct dpll_pin *pin, void *pin_priv,return ret; } +/** +* ice_dpll_txclk_state_on_dpll_set - set a state on TX clk pin +* @pin: pointer to a pin +* @pin_priv: private data pointer passed on pin registration +* @dpll: registered dpll pointer +* @dpll_priv: private data pointer passed on dpll registration +* @state: state to be set on pin +* @extack: error reporting +* +* Dpll subsystem callback, set a state of a Tx reference clock pin +* +* Return: +* * negative - failure +*/ +static int +ice_dpll_txclk_state_on_dpll_set (const struct dpll_pin *pin,void *pin_priv, +const struct dpll_device *dpll, +void *dpll_priv,enum dpll_pin_state state, +struct netlink_ext_ack *extack) +{ +/* +* TODO: set HW accordingly to selected TX reference clock. +* To be added in the follow up patches. +*/ +return -EOPNOTSUPP ; +} + +/** +* ice_dpll_txclk_state_on_dpll_get - get a state of Tx clk reference pin +* @pin: pointer to a pin +* @pin_priv: private data pointer passed on pin registration +* @dpll: registered dpll pointer +* @dpll_priv: private data pointer passed on dpll registration +* @state: on success holds pin state on parent pin +* @extack: error reporting +* +* dpll subsystem callback, get a state of a TX clock reference pin. +* +* Return: +* * 0 - success +*/ +static int +ice_dpll_txclk_state_on_dpll_get (const struct dpll_pin *pin,void *pin_priv, +const struct dpll_device *dpll, +void *dpll_priv, +enum dpll_pin_state *state, +struct netlink_ext_ack *extack) +{ +/* +* TODO: query HW status to determine if the TX reference is selected. +* To be added in the follow up patches. +*/ + *state =DPLL_PIN_STATE_DISCONNECTED ; + +return 0 ; +} +static const struct dpll_pin_ops ice_dpll_rclk_ops = { .state_on_pin_set = ice_dpll_rclk_state_on_pin_set, .state_on_pin_get = ice_dpll_rclk_state_on_pin_get, .direction_get = ice_dpll_input_direction, }; +static const struct dpll_pin_ops ice_dpll_txclk_ops = { + .state_on_dpll_set = ice_dpll_txclk_state_on_dpll_set, + .state_on_dpll_get = ice_dpll_txclk_state_on_dpll_get, + .direction_get = ice_dpll_input_direction, +}; +static const struct dpll_pin_ops ice_dpll_pin_sma_ops = { .state_on_dpll_set = ice_dpll_sma_pin_state_set, .state_on_dpll_get = ice_dpll_sw_pin_state_get,
@@ -3023,9 +3096,13 @@ ice_dpll_unregister_pins(struct dpll_device *dpll, struct ice_dpll_pin *pins, {int i; -for (i =0 ; i < count; i++) -if (!pins[i].hidden) -dpll_pin_unregister (dpll, pins[i].pin, ops, &pins[i]); +for (i =0 ; i < count; i++) { +if (pins[i].hidden) +continue ; +if (IS_ERR_OR_NULL (pins[i].pin)) +continue ; +dpll_pin_unregister (dpll, pins[i].pin, ops, &pins[i]); + } }/**
@@ -3199,19 +3276,40 @@ static bool ice_dpll_is_fwnode_pin(struct ice_dpll_pin *pin)return !IS_ERR_OR_NULL (pin->fwnode); } +static bool ice_dpll_fwnode_eq (const struct fwnode_handle *a, +const struct fwnode_handle *b) +{ +return a && b && a == b; +} +static void ice_dpll_pin_notify_work (struct work_struct *work) {struct ice_dpll_pin_work *w =container_of (work, struct ice_dpll_pin_work, work);struct ice_dpll_pin *pin, *parent = w->pin; +bool is_tx_synce_parent = false;struct ice_pf *pf = parent->pf; +bool is_rclk_parent = false;int ret;wait_for_completion (&pf->dplls.dpll_init);if (!test_bit (ICE_FLAG_DPLL , pf->flags)) goto out;/* DPLL initialization failed */ +/* Decide which parent we are handling, defensively checking FWNs */ + is_rclk_parent = +ice_dpll_fwnode_eq (parent->fwnode, + pf->dplls.inputs[E825_RCLK_PARENT_0_PIN_IDX ].fwnode) || +ice_dpll_fwnode_eq (parent->fwnode, + pf->dplls.inputs[E825_RCLK_PARENT_1_PIN_IDX ].fwnode); + + is_tx_synce_parent = +ice_dpll_fwnode_eq (parent->fwnode, + pf->dplls.txclks[E825_EXT_SYNCE_PIN_IDX ].fwnode); +if (!is_rclk_parent && !is_tx_synce_parent) + goto out; +switch (w->action) {case DPLL_PIN_CREATED :if (!IS_ERR_OR_NULL (parent->pin)) {
@@ -3228,16 +3326,28 @@ static void ice_dpll_pin_notify_work(struct work_struct *work) goto out; } -/* Register rclk pin */ - pin = &pf->dplls.rclk; - ret =dpll_pin_on_pin_register (parent->pin, pin->pin, - &ice_dpll_rclk_ops, pin); -if (ret) { -dev_err (ice_pf_to_dev (pf), -"Failed to register pin: %pe\n" ,ERR_PTR (ret)); -dpll_pin_put (parent->pin, &parent->tracker); - parent->pin =NULL ; - goto out; +if (is_rclk_parent) { +/* Register rclk pin via on-pin relationship */ + pin = &pf->dplls.rclk; + ret =dpll_pin_on_pin_register (parent->pin, pin->pin, + &ice_dpll_rclk_ops, pin); +if (ret) { +dev_err (ice_pf_to_dev (pf), +"RCLK pin register failed: %pe\n" , +ERR_PTR (ret)); + goto drop_parent_ref; + } + }else if (is_tx_synce_parent) { +/* Register TX-CLK SYNCE pin directly to TXC DPLL */ + pin = &pf->dplls.txclks[E825_EXT_SYNCE_PIN_IDX ]; + ret =dpll_pin_register (pf->dplls.txc.dpll, pin->pin, + &ice_dpll_txclk_ops, pin); +if (ret) { +dev_err (ice_pf_to_dev (pf), +"TX SYNCE pin register failed: %pe\n" , +ERR_PTR (ret)); + goto drop_parent_ref; + } }break ;case DPLL_PIN_DELETED :
@@ -3246,11 +3356,18 @@ static void ice_dpll_pin_notify_work(struct work_struct *work) goto out; } -/* Unregister rclk pin */ - pin = &pf->dplls.rclk; -dpll_pin_on_pin_unregister (parent->pin, pin->pin, - &ice_dpll_rclk_ops, pin); - +if (is_rclk_parent) { +/* Unregister rclk pin */ + pin = &pf->dplls.rclk; +dpll_pin_on_pin_unregister (parent->pin, pin->pin, + &ice_dpll_rclk_ops, pin); + }else if (is_tx_synce_parent) { +/* Unregister TX-CLK SYNCE pin from TXC DPLL */ + pin = &pf->dplls.txclks[E825_EXT_SYNCE_PIN_IDX ]; +dpll_pin_unregister (pf->dplls.txc.dpll, pin->pin, + &ice_dpll_txclk_ops, pin); + } +drop_parent_ref:/* Drop fwnode pin reference */ dpll_pin_put (parent->pin, &parent->tracker); parent->pin =NULL ;
@@ -3276,6 +3393,12 @@ static int ice_dpll_pin_notify(struct notifier_block *nb, unsigned long action,if (pin->fwnode != info->fwnode)return NOTIFY_DONE ;/* Not this pin */ +/* Ignore notification which are the outcome of internal pin +* registration/unregistration calls - synce pin case. +*/ +if (info->src_clock_id == pin->pf->dplls.clock_id) +return NOTIFY_DONE ; + work =kzalloc_obj (*work);if (!work)return NOTIFY_DONE ;
@@ -3401,6 +3524,19 @@ ice_dpll_deinit_fwnode_pins(struct ice_pf *pf, struct ice_dpll_pin *pins,destroy_workqueue (pf->dplls.wq); } +static int ice_dpll_deinit_txclk_pins (struct ice_pf *pf) +{ +struct ice_dpll_pin *synce_pin = &pf->dplls.txclks[E825_EXT_SYNCE_PIN_IDX ]; +struct ice_dpll *dt = &pf->dplls.txc; + +ice_dpll_unregister_pins (dt->dpll, pf->dplls.txclks, + &ice_dpll_txclk_ops, +ARRAY_SIZE (pf->dplls.txclks)); +ice_dpll_release_pins (&pf->dplls.txclks[E825_EXT_EREF_PIN_IDX ],1 ); +ice_dpll_deinit_fwnode_pin (synce_pin); +return 0 ; +} +/** * ice_dpll_deinit_pins - deinitialize direct pins * @pf: board private structure
@@ -3420,8 +3556,10 @@ static void ice_dpll_deinit_pins(struct ice_pf *pf, bool cgu)struct ice_dpll *dp = &d->pps;ice_dpll_deinit_rclk_pin (pf); -if (pf->hw.mac_type ==ICE_MAC_GENERIC_3K_E825 ) +if (pf->hw.mac_type ==ICE_MAC_GENERIC_3K_E825 ) { +ice_dpll_deinit_txclk_pins (pf);ice_dpll_deinit_fwnode_pins (pf, pf->dplls.inputs,0 ); + }if (cgu) {ice_dpll_unregister_pins (dp->dpll, inputs, &ice_dpll_input_ops, num_inputs);
@@ -3552,6 +3690,58 @@ ice_dpll_init_fwnode_pins(struct ice_pf *pf, struct ice_dpll_pin *pins,return ret; } +static int ice_dpll_init_txclk_pins (struct ice_pf *pf,int start_idx) +{ +struct ice_dpll_pin *ref_pin = pf->dplls.txclks; +struct ice_dpll *txc = &pf->dplls.txc; +int ret; + +/* Configure EXT_EREF0 pin */ + ret =ice_dpll_get_pins (pf, ref_pin, start_idx,1 , pf->dplls.clock_id); +if (ret) +return ret; + ret =dpll_pin_register (txc->dpll, ref_pin->pin, &ice_dpll_txclk_ops, + ref_pin); +if (ret) + goto err_release_ext_eref; + +/* +* Configure EXT_SYNCE pin (fwnode-backed). +* The pin may not yet be available; in that case registration +* will be deferred via the notifier path. +*/ + ref_pin++; + ret =ice_dpll_init_fwnode_pin (ref_pin, ice_dpll_fwnode_ext_synce); +if (ret) + goto err_unregister_ext_eref; + +if (IS_ERR_OR_NULL (ref_pin->pin)) { +dev_dbg (ice_pf_to_dev (pf), +"Tx-clk SYNCE pin not registered yet\n" ); +return 0 ; + } + + ret =dpll_pin_register (txc->dpll, ref_pin->pin, &ice_dpll_txclk_ops, + ref_pin); +if (ret) + goto err_deinit_synce; + +return 0 ; + +err_deinit_synce: +ice_dpll_deinit_fwnode_pin (ref_pin); +err_unregister_ext_eref: +dpll_pin_unregister (txc->dpll, + pf->dplls.txclks[E825_EXT_EREF_PIN_IDX ].pin, + &ice_dpll_txclk_ops, + &pf->dplls.txclks[E825_EXT_EREF_PIN_IDX ]); + +err_release_ext_eref: +ice_dpll_release_pins (&pf->dplls.txclks[E825_EXT_EREF_PIN_IDX ],1 ); + +return ret; +} +/** * ice_dpll_init_pins_e825 - init pins and register pins with a dplls * @pf: board private structure
@@ -3574,6 +3764,15 @@ static int ice_dpll_init_pins_e825(struct ice_pf *pf) ret =ice_dpll_init_rclk_pin (pf,DPLL_PIN_IDX_UNSPEC , &ice_dpll_rclk_ops); + +if (ret) + goto unregister_pins; + + ret =ice_dpll_init_txclk_pins (pf,0 ); +if (ret) +ice_dpll_deinit_rclk_pin (pf); + +unregister_pins:if (ret) {/* Inform DPLL notifier works that DPLL init was finished * unsuccessfully (ICE_DPLL_FLAG not set).
@@ -3692,7 +3891,7 @@ static int ice_dpll_init_pins(struct ice_pf *pf, bool cgu)static void ice_dpll_deinit_dpll (struct ice_pf *pf,struct ice_dpll *d,bool cgu) { -if (cgu) +if (cgu || pf->hw.mac_type ==ICE_MAC_GENERIC_3K_E825 )dpll_device_unregister (d->dpll, d->ops, d);dpll_device_put (d->dpll, &d->tracker); }
@@ -3727,12 +3926,13 @@ ice_dpll_init_dpll(struct ice_pf *pf, struct ice_dpll *d, bool cgu,return ret; } d->pf = pf; -if (cgu) { +if (cgu || pf->hw.mac_type ==ICE_MAC_GENERIC_3K_E825 ) {const struct dpll_device_ops *ops = &ice_dpll_ops;if (type ==DPLL_TYPE_PPS &&ice_dpll_is_pps_phase_monitor (pf)) ops = &ice_dpll_pom_ops; -ice_dpll_update_state (pf, d, true); +if (cgu) +ice_dpll_update_state (pf, d, true); ret =dpll_device_register (d->dpll, type, ops, d);if (ret) {dpll_device_put (d->dpll, &d->tracker);
@@ -4081,6 +4281,36 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf)return 0 ; } +/** +* ice_dpll_init_info_txclk_pins_e825c - initializes tx-clk pins information +* @pf: board private structure +* +* Init information for tx-clks pin, cache them in pf->dplls.txclks +* +* Return: +* * 0 - success +*/ +static int ice_dpll_init_info_txclk_pins_e825c (struct ice_pf *pf) +{ +struct ice_dpll_pin *tx_pin; + +for (int i =0 ; i <ICE_DPLL_TXCLK_NUM_MAX ; i++) { + tx_pin = &pf->dplls.txclks[i]; + tx_pin->prop.type =DPLL_PIN_TYPE_EXT ; + tx_pin->prop.capabilities |= +DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE ; + tx_pin->pf = pf; +if (i ==E825_EXT_EREF_PIN_IDX ) { + tx_pin->prop.board_label = ice_dpll_ext_eref_pin; + tx_pin->tx_ref_src =ICE_REF_CLK_EREF0 ; + }else if (i ==E825_EXT_SYNCE_PIN_IDX ) { + tx_pin->tx_ref_src =ICE_REF_CLK_SYNCE ; + } + } + +return 0 ; +} +/** * ice_dpll_init_pins_info - init pins info wrapper * @pf: board private structure
@@ -4106,6 +4336,9 @@ ice_dpll_init_pins_info(struct ice_pf *pf, enum ice_dpll_pin_type pin_type)return ice_dpll_init_info_rclk_pin (pf);case ICE_DPLL_PIN_TYPE_SOFTWARE :return ice_dpll_init_info_sw_pins (pf); + +case ICE_DPLL_PIN_TYPE_TXCLK : +return ice_dpll_init_info_txclk_pins_e825c (pf);default :return -EINVAL ; }
@@ -4139,11 +4372,15 @@ static void ice_dpll_deinit_info(struct ice_pf *pf)static int ice_dpll_init_info_e825c (struct ice_pf *pf) {struct ice_dplls *d = &pf->dplls; +struct ice_dpll *dt = &d->txc;int ret =0 ;int i; d->clock_id =ice_generate_clock_id (pf); d->num_inputs =ICE_SYNCE_CLK_NUM ; + dt->dpll_state =DPLL_LOCK_STATUS_UNLOCKED ; + dt->mode =DPLL_MODE_MANUAL ; + dt->dpll_idx = pf->ptp.port.port_num; d->inputs =kzalloc_objs (*d->inputs, d->num_inputs);if (!d->inputs)
@@ -4160,6 +4397,11 @@ static int ice_dpll_init_info_e825c(struct ice_pf *pf) ret =ice_dpll_init_pins_info (pf,ICE_DPLL_PIN_TYPE_RCLK_INPUT );if (ret) goto deinit_info; + + ret =ice_dpll_init_pins_info (pf,ICE_DPLL_PIN_TYPE_TXCLK ); +if (ret) + goto deinit_info; +dev_dbg (ice_pf_to_dev (pf),"%s - success, inputs: %u, outputs: %u, rclk-parents: %u\n" , __func__, d->num_inputs, d->num_outputs, d->rclk.num_parents);
@@ -4292,6 +4534,9 @@ void ice_dpll_deinit(struct ice_pf *pf)ice_dpll_deinit_dpll (pf, &pf->dplls.pps, cgu);if (!IS_ERR_OR_NULL (pf->dplls.eec.dpll))ice_dpll_deinit_dpll (pf, &pf->dplls.eec, cgu); +if (!IS_ERR_OR_NULL (pf->dplls.txc.dpll)) +ice_dpll_deinit_dpll (pf, &pf->dplls.txc, false); +ice_dpll_deinit_info (pf);mutex_destroy (&pf->dplls.lock); }
@@ -4317,14 +4562,19 @@ static void ice_dpll_init_e825(struct ice_pf *pf) err =ice_dpll_init_info_e825c (pf);if (err) goto err_exit; - err =ice_dpll_init_pins_e825 (pf); + err =ice_dpll_init_dpll (pf, &pf->dplls.txc, false,DPLL_TYPE_TXC );if (err) goto deinit_info; + err =ice_dpll_init_pins_e825 (pf); +if (err) + goto deinit_txclk;set_bit (ICE_FLAG_DPLL , pf->flags);complete_all (&d->dpll_init);return ; +deinit_txclk: +ice_dpll_deinit_dpll (pf, &pf->dplls.txc, false); deinit_info:ice_dpll_deinit_info (pf); err_exit:
drivers/net/ethernet/intel/ice/ice_dpll.h +6 -0
@@ -7,6 +7,7 @@#include "ice.h" #define ICE_DPLL_RCLK_NUM_MAX 4 +#define ICE_DPLL_TXCLK_NUM_MAX 2/** * enum ice_dpll_pin_sw - enumerate ice software pin indices:
@@ -63,6 +64,7 @@ struct ice_dpll_pin {u8 ref_sync;bool active;bool hidden; +enum ice_e825c_ref_clk tx_ref_src; };/** ice_dpll - store info required for DPLL control
@@ -111,9 +113,11 @@ struct ice_dpll {* @lock: locks access to configuration of a dpll * @eec: pointer to EEC dpll dev * @pps: pointer to PPS dpll dev +* @txc: pointer to TXC dpll dev * @inputs: input pins pointer * @outputs: output pins pointer * @rclk: recovered pins pointer +* @txclks: TX clock reference pins pointer * @num_inputs: number of input pins available on dpll * @num_outputs: number of output pins available on dpll * @cgu_state_acq_err_num: number of errors returned during periodic work
@@ -131,11 +135,13 @@ struct ice_dplls {struct completion dpll_init;struct ice_dpll eec;struct ice_dpll pps; +struct ice_dpll txc;struct ice_dpll_pin *inputs;struct ice_dpll_pin *outputs;struct ice_dpll_pin sma[ICE_DPLL_PIN_SW_NUM ];struct ice_dpll_pin ufl[ICE_DPLL_PIN_SW_NUM ];struct ice_dpll_pin rclk; +struct ice_dpll_pin txclks[ICE_DPLL_TXCLK_NUM_MAX ];u8 num_inputs;u8 num_outputs;u8 sma_data;
drivers/net/ethernet/intel/ice/ice_ptp_hw.h +7 -0
@@ -265,6 +265,13 @@ struct ice_cgu_pin_desc {struct dpll_pin_frequency *freq_supp; }; +enum ice_e825c_ref_clk { +ICE_REF_CLK_ENET , +ICE_REF_CLK_SYNCE , +ICE_REF_CLK_EREF0 , +ICE_REF_CLK_MAX , +}; +#define E810C_QSFP_C827_0_HANDLE 2#define E810C_QSFP_C827_1_HANDLE 3
Signature · 1 line
2.39.3
PATCH v5 6/8 ice: implement CPI support for E825C
In reply to Grzegorz NitkaAdd full CPI (Converged PHY Interface) command handling required for E825C devices. The CPI interface allows the driver to interact with PHY-side control logic through the LM/PHY command registers, including enabling/disabling/selection of PHY reference clock.
This patch introduces:
- a new CPI subsystem (ice_cpi.c / ice_cpi.h) implementing the CPI request/acknowledge state machine, including REQ/ACK protocol, command execution, and response handling
- helper functions for reading/writing PHY registers over Sideband Queue
- CPI command execution API (ice_cpi_exec) and a helper for enabling or disabling Tx reference clocks (CPI 0xF1 opcode 'Config PHY clocking')
- addition of the non-posted write opcode (wr_np) to SBQ
- Makefile integration to build CPI support together with the PTP stack
This provides the infrastructure necessary to support PHY-side configuration flows on E825C and is required for advanced link control and Tx reference clock management.
--- drivers/net/ethernet/intel/ice/Makefile | 2 +- drivers/net/ethernet/intel/ice/ice_cpi.c | 337 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_cpi.h | 61 ++++ drivers/net/ethernet/intel/ice/ice_sbq_cmd.h | 5 +- 4 files changed, 402 insertions(+), 3 deletions(-) create mode 100644 drivers/net/ethernet/intel/ice/ice_cpi.c create mode 100644 drivers/net/ethernet/intel/ice/ice_cpi.h
drivers/net/ethernet/intel/ice/Makefile +1 -1
@@ -54,7 +54,7 @@ ice-$(CONFIG_PCI_IOV) += \ ice_vf_mbx.o \ ice_vf_vsi_vlan_ops.o \ ice_vf_lib.o -ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o ice_dpll.o ice_tspll.o +ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o ice_dpll.o ice_tspll.o ice_cpi.o ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
drivers/net/ethernet/intel/ice/ice_cpi.c new file +337 -0
337 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_cpi.h new file +61 -0
61 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_sbq_cmd.h +3 -2
@@ -54,8 +54,9 @@ enum ice_sbq_dev_id { };enum ice_sbq_msg_opcode { - ice_sbq_msg_rd =0x00 , - ice_sbq_msg_wr =0x01 + ice_sbq_msg_rd =0x00 , + ice_sbq_msg_wr =0x01 , + ice_sbq_msg_wr_np =0x02 };#define ICE_SBQ_MSG_FLAGS 0x40
Signature · 1 line
2.39.3
PATCH v5 7/8 ice: add Tx reference clock index handling to AN restart command
In reply to Grzegorz NitkaExtend the Restart Auto-Negotiation (AN) AdminQ command with a new parameter allowing software to specify the Tx reference clock index to be used during link restart.
This patch:
- adds REFCLK field definitions to ice_aqc_restart_an
- updates ice_aq_set_link_restart_an() to take a new refclk parameter and properly encode it into the command
- keeps legacy behavior by passing REFCLK_NOCHANGE where appropriate
This prepares the driver for configurations requiring dynamic selection of the Tx reference clock as part of the AN flow.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 ++ drivers/net/ethernet/intel/ice/ice_common.c | 5 ++++- drivers/net/ethernet/intel/ice/ice_common.h | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +2 -0
@@ -1169,6 +1169,8 @@ struct ice_aqc_restart_an {u8 cmd_flags;#define ICE_AQC_RESTART_AN_LINK_RESTART BIT(1)#define ICE_AQC_RESTART_AN_LINK_ENABLE BIT(2) +#define ICE_AQC_RESTART_AN_REFCLK_M GENMASK(4, 3) +#define ICE_AQC_RESTART_AN_REFCLK_NOCHANGE 0u8 reserved2[13 ]; };
drivers/net/ethernet/intel/ice/ice_common.c +4 -1
@@ -4126,12 +4126,13 @@ int ice_get_link_status(struct ice_port_info *pi, bool *link_up)* @pi: pointer to the port information structure * @ena_link: if true: enable link, if false: disable link * @cd: pointer to command details structure or NULL +* @refclk: the new TX reference clock, 0 if no change * * Sets up the link and restarts the Auto-Negotiation over the link. */ int ice_aq_set_link_restart_an (struct ice_port_info *pi,bool ena_link, -struct ice_sq_cd *cd) +struct ice_sq_cd *cd,u8 refclk) {struct ice_aqc_restart_an *cmd;struct libie_aq_desc desc;
@@ -4147,6 +4148,8 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,else cmd->cmd_flags &= ~ICE_AQC_RESTART_AN_LINK_ENABLE ; + cmd->cmd_flags |=FIELD_PREP (ICE_AQC_RESTART_AN_REFCLK_M , refclk); +return ice_aq_send_cmd (pi->hw, &desc,NULL ,0 , cd); }
drivers/net/ethernet/intel/ice/ice_common.h +1 -1
@@ -215,7 +215,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, enum ice_fec_mode fec);int ice_aq_set_link_restart_an (struct ice_port_info *pi,bool ena_link, -struct ice_sq_cd *cd); +struct ice_sq_cd *cd,u8 refclk);int ice_aq_set_mac_cfg (struct ice_hw *hw,u16 max_frame_size,struct ice_sq_cd *cd);int
drivers/net/ethernet/intel/ice/ice_lib.c +2 -1
@@ -3769,7 +3769,8 @@ int ice_set_link(struct ice_vsi *vsi, bool ena)if (vsi->type !=ICE_VSI_PF )return -EINVAL ; - status =ice_aq_set_link_restart_an (pi, ena,NULL ); + status =ice_aq_set_link_restart_an (pi, ena,NULL , +ICE_AQC_RESTART_AN_REFCLK_NOCHANGE );/* if link is owned by manageability, FW will return LIBIE_AQ_RC_EMODE. * this is not a fatal error, so print a warning message and return
Signature · 1 line
2.39.3
PATCH v5 8/8 ice: implement E825 TX ref clock control and TXC hardware sync status
In reply to Grzegorz NitkaBuild on the previously introduced TXC DPLL framework and implement full TX reference clock control and hardware-backed synchronization status reporting for E825 devices.
E825 firmware may accept or override TX reference clock requests based on device-wide routing constraints and link conditions. For this reason, TX reference selection and synchronization status must be observed from hardware rather than inferred from user intent.
This change implements TX reference switching using a deferred worker, triggered by DPLL TXCLK pin operations. Pin set callbacks express selection intent and schedule the operation asynchronously; firmware commands and autonegotiation restarts are executed outside of DPLL context.
After link-up, the effective TX reference clock is read back from hardware and software state is reconciled accordingly. TXCLK pin state reflects only the selected reference clock topology:
- External references (SYNCE, EREF0) are represented as TXCLK pins
- The internal ENET/TXCO clock has no pin representation; when selected, all TXCLK pins are reported DISCONNECTED
Actual hardware synchronization result is reported exclusively via the TXC DPLL lock status:
- LOCKED when an external TX reference is in use
- UNLOCKED when falling back to ENET/TXCO
This separation allows userspace to distinguish between TX reference selection and successful synchronization, matching the DPLL subsystem model where pin state describes topology and device lock status describes signal quality.
The implementation also tracks TX reference usage per PHY across all PFs to ensure shared TX clock resources are not disabled while still in use by peer ports.
With this change, TX reference clocks on E825 devices can be reliably selected, verified against hardware state, and monitored for effective synchronization via standard DPLL interfaces.
--- drivers/net/ethernet/intel/ice/Makefile | 2 +- drivers/net/ethernet/intel/ice/ice.h | 12 + drivers/net/ethernet/intel/ice/ice_dpll.c | 110 +++++++-- drivers/net/ethernet/intel/ice/ice_dpll.h | 4 + drivers/net/ethernet/intel/ice/ice_ptp.c | 26 ++- drivers/net/ethernet/intel/ice/ice_ptp.h | 7 + drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 37 +++ drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 27 +++ drivers/net/ethernet/intel/ice/ice_txclk.c | 241 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_txclk.h | 38 +++ 10 files changed, 485 insertions(+), 19 deletions(-) create mode 100644 drivers/net/ethernet/intel/ice/ice_txclk.c create mode 100644 drivers/net/ethernet/intel/ice/ice_txclk.h
drivers/net/ethernet/intel/ice/Makefile +1 -1
@@ -54,7 +54,7 @@ ice-$(CONFIG_PCI_IOV) += \ ice_vf_mbx.o \ ice_vf_vsi_vlan_ops.o \ ice_vf_lib.o -ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o ice_dpll.o ice_tspll.o ice_cpi.o +ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o ice_dpll.o ice_tspll.o ice_cpi.o ice_txclk.o ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
drivers/net/ethernet/intel/ice/ice.h +12 -0
@@ -1155,4 +1155,16 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_get_ctrl_pf - Get pointer to Control PF of the adapter +* @pf: pointer to the current PF structure +* +* Return: A pointer to ice_pf structure which is Control PF, +* NULL if it's not initialized yet. +*/ +static inline struct ice_pf *ice_get_ctrl_pf (struct ice_pf *pf) +{ +return !pf->adapter ?NULL : pf->adapter->ctrl_pf; +}#endif /* _ICE_H_ */
drivers/net/ethernet/intel/ice/ice_dpll.c +97 -13
168 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_dpll.h +4 -0
@@ -8,6 +8,8 @@#define ICE_DPLL_RCLK_NUM_MAX 4#define ICE_DPLL_TXCLK_NUM_MAX 2 +#define E825_EXT_EREF_PIN_IDX 0 +#define E825_EXT_SYNCE_PIN_IDX 1/** * enum ice_dpll_pin_sw - enumerate ice software pin indices:
@@ -152,6 +154,8 @@ struct ice_dplls {s32 output_phase_adj_max;u32 periodic_counter;bool generic; +struct work_struct txclk_work; +bool txclk_switch_requested; };#if IS_ENABLED (CONFIG_PTP_1588_CLOCK )
drivers/net/ethernet/intel/ice/ice_ptp.c +21 -5
@@ -4,6 +4,7 @@#include "ice.h" #include "ice_lib.h" #include "ice_trace.h" +#include "ice_txclk.h" static const char ice_pin_names[][64 ] = {"SDP0" ,
@@ -54,11 +55,6 @@ static const struct ice_ptp_pin_desc ice_pin_desc_dpll[] = { { SDP3, { 3, -1 }, { 0, 0 }}, }; -static struct ice_pf *ice_get_ctrl_pf (struct ice_pf *pf) -{ -return !pf->adapter ?NULL : pf->adapter->ctrl_pf; -} -static struct ice_ptp *ice_get_ctrl_ptp (struct ice_pf *pf) {struct ice_pf *ctrl_pf =ice_get_ctrl_pf (pf);
@@ -1326,6 +1322,9 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup) } }mutex_unlock (&pf->dplls.lock); + +if (linkup) +ice_txclk_update_and_notify (pf); }switch (hw->mac_type) {
@@ -3079,6 +3078,7 @@ static int ice_ptp_setup_pf(struct ice_pf *pf) {struct ice_ptp *ctrl_ptp =ice_get_ctrl_ptp (pf);struct ice_ptp *ptp = &pf->ptp; +u8 port_num, phy;if (WARN_ON (!ctrl_ptp) || pf->hw.mac_type ==ICE_MAC_UNKNOWN )return -ENODEV ;
@@ -3090,6 +3090,10 @@ static int ice_ptp_setup_pf(struct ice_pf *pf) &pf->adapter->ports.ports);mutex_unlock (&pf->adapter->ports.lock); + port_num = ptp->port.port_num; + phy = port_num / pf->hw.ptp.ports_per_phy; +set_bit (port_num, &ctrl_ptp->tx_refclks[phy][pf->ptp.port.tx_clk]); +return 0 ; }
@@ -3290,6 +3294,7 @@ static void ice_ptp_init_tx_interrupt_mode(struct ice_pf *pf)*/ void ice_ptp_init (struct ice_pf *pf) { +enum ice_e825c_ref_clk tx_ref_clk;struct ice_ptp *ptp = &pf->ptp;struct ice_hw *hw = &pf->hw;int err;
@@ -3318,6 +3323,17 @@ void ice_ptp_init(struct ice_pf *pf) goto err_exit; } + ptp->port.tx_clk =ICE_REF_CLK_ENET ; + ptp->port.tx_clk_req =ICE_REF_CLK_ENET ; +if (hw->mac_type ==ICE_MAC_GENERIC_3K_E825 ) { + err =ice_get_serdes_ref_sel_e825c (hw, ptp->port.port_num, + &tx_ref_clk); +if (!err) { + ptp->port.tx_clk = tx_ref_clk; + ptp->port.tx_clk_req = tx_ref_clk; + } + } + err =ice_ptp_setup_pf (pf);if (err) goto err_exit;
drivers/net/ethernet/intel/ice/ice_ptp.h +7 -0
@@ -144,6 +144,8 @@ struct ice_ptp_tx {* @link_up: indicates whether the link is up * @tx_fifo_busy_cnt: number of times the Tx FIFO was busy * @port_num: the port number this structure represents +* @tx_clk: currently active Tx reference clock source +* @tx_clk_req: requested Tx reference clock source (new target) */ struct ice_ptp_port {struct list_head list_node;
@@ -153,6 +155,8 @@ struct ice_ptp_port {bool link_up;u8 tx_fifo_busy_cnt;u8 port_num; +enum ice_e825c_ref_clk tx_clk; +enum ice_e825c_ref_clk tx_clk_req; };enum ice_ptp_tx_interrupt {
@@ -236,6 +240,7 @@ struct ice_ptp_pin_desc {* @info: structure defining PTP hardware capabilities * @clock: pointer to registered PTP clock device * @tstamp_config: hardware timestamping configuration +* @tx_refclks: bitmaps table to store the information about TX reference clocks * @reset_time: kernel time after clock stop on reset * @tx_hwtstamp_good: number of completed Tx timestamp requests * @tx_hwtstamp_skipped: number of Tx time stamp requests skipped
@@ -261,6 +266,8 @@ struct ice_ptp {struct ptp_clock_info info;struct ptp_clock *clock;struct kernel_hwtstamp_config tstamp_config; +#define ICE_E825_MAX_PHYS 2 +unsigned long tx_refclks[ICE_E825_MAX_PHYS ][ICE_REF_CLK_MAX ];u64 reset_time;u64 tx_hwtstamp_good;u32 tx_hwtstamp_skipped;
drivers/net/ethernet/intel/ice/ice_ptp_hw.c +37 -0
@@ -461,6 +461,43 @@ static int ice_read_phy_eth56g(struct ice_hw *hw, u8 port, u32 addr, u32 *val)return err; } +/** +* ice_get_serdes_ref_sel_e825c - Read current Tx ref clock source +* @hw: pointer to the HW struct +* @port: port number for which Tx reference clock is read +* @clk: Tx reference clock value (output) +* +* Return: 0 on success, other error codes when failed to read from PHY +*/ +int ice_get_serdes_ref_sel_e825c (struct ice_hw *hw,u8 port, +enum ice_e825c_ref_clk *clk) +{ +u8 lane = port % hw->ptp.ports_per_phy; +u32 serdes_rx_nt, serdes_tx_nt; +u32 val; +int ret; + + ret =ice_read_phy_eth56g (hw, port, +SERDES_IP_IF_LN_FLXM_GENERAL (lane,0 ), + &val); +if (ret) +return ret; + + serdes_rx_nt =FIELD_GET (CFG_ICTL_PCS_REF_SEL_RX_NT , val); + serdes_tx_nt =FIELD_GET (CFG_ICTL_PCS_REF_SEL_TX_NT , val); + +if (serdes_tx_nt ==REF_SEL_NT_SYNCE && + serdes_rx_nt ==REF_SEL_NT_SYNCE ) + *clk =ICE_REF_CLK_SYNCE ; +else if (serdes_tx_nt ==REF_SEL_NT_EREF0 && + serdes_rx_nt ==REF_SEL_NT_EREF0 ) + *clk =ICE_REF_CLK_EREF0 ; +else + *clk =ICE_REF_CLK_ENET ; + +return 0 ; +} +/** * ice_phy_res_address_eth56g - Calculate a PHY port register address * @hw: pointer to the HW struct
drivers/net/ethernet/intel/ice/ice_ptp_hw.h +27 -0
@@ -381,6 +381,8 @@ int ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset);int ice_start_phy_timer_eth56g (struct ice_hw *hw,u8 port);int ice_phy_cfg_intr_eth56g (struct ice_hw *hw,u8 port,bool ena,u8 threshold);int ice_phy_cfg_ptp_1step_eth56g (struct ice_hw *hw,u8 port); +int ice_get_serdes_ref_sel_e825c (struct ice_hw *hw,u8 port, +enum ice_e825c_ref_clk *clk);#define ICE_ETH56G_NOMINAL_INCVAL 0x140000000ULL#define ICE_ETH56G_NOMINAL_PCS_REF_TUS 0x100000000ULL
@@ -790,4 +792,29 @@ static inline u64 ice_get_base_incval(struct ice_hw *hw)#define PHY_PTP_1STEP_PD_DELAY_M GENMASK(30, 1)#define PHY_PTP_1STEP_PD_DLY_V_M BIT(31) +#define SERDES_IP_IF_LN_FLXM_GENERAL (n, m) \ + (0x32B800 + (m) * 0x100000 + (n) * 0x8000) +#define CFG_RESERVED0_1 GENMASK(1, 0) +#define CFG_ICTL_PCS_MODE_NT BIT(2) +#define CFG_ICTL_PCS_RCOMP_SLAVE_EN_NT BIT(3) +#define CFG_ICTL_PCS_CMN_FORCE_PUP_A BIT(4) +#define CFG_ICTL_PCS_RCOMP_SLAVE_VALID_A BIT(5) +#define CFG_ICTL_PCS_REF_SEL_RX_NT GENMASK(9, 6) +#define REF_SEL_NT_ENET 0 +#define REF_SEL_NT_EREF0 1 +#define REF_SEL_NT_SYNCE 2 +#define CFG_IDAT_DFX_OBS_DIG_ GENMASK(11, 10) +#define CFG_IRST_APB_MEM_B BIT(12) +#define CFG_ICTL_PCS_DISCONNECT_NT BIT(13) +#define CFG_ICTL_PCS_ISOLATE_NT BIT(14) +#define CFG_RESERVED15_15 BIT(15) +#define CFG_IRST_PCS_TSTBUS_B_A BIT(16) +#define CFG_ICTL_PCS_REF_TERM_HIZ_EN_NT BIT(17) +#define CFG_RESERVED18_19 GENMASK(19, 18) +#define CFG_ICTL_PCS_SYNTHLCSLOW_FORCE_PUP_A BIT(20) +#define CFG_ICTL_PCS_SYNTHLCFAST_FORCE_PUP_A BIT(21) +#define CFG_RESERVED22_24 GENMASK(24, 22) +#define CFG_ICTL_PCS_REF_SEL_TX_NT GENMASK(28, 25) +#define CFG_RESERVED29_31 GENMASK(31, 29) +#endif /* _ICE_PTP_HW_H_ */
drivers/net/ethernet/intel/ice/ice_txclk.c new file +241 -0
241 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_txclk.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2026 Intel Corporation */ + +#ifndef _ICE_TXCLK_H_ +#define _ICE_TXCLK_H_ + +/** +* ice_txclk_any_port_uses - check if any port on a PHY uses this TX refclk +* @ctrl_pf: control PF (owner of the shared tx_refclks map) +* @phy: PHY index +* @clk: TX reference clock +* +* Return: true if any bit (port) is set for this clock on this PHY +*/ +static inline bool +ice_txclk_any_port_uses (const struct ice_pf *ctrl_pf,u8 phy, +enum ice_e825c_ref_clk clk) +{ +return find_first_bit (&ctrl_pf->ptp.tx_refclks[phy][clk], +BITS_PER_LONG ) <BITS_PER_LONG ; +} + +static inline enum dpll_lock_status +ice_txclk_lock_status (enum ice_e825c_ref_clk clk) +{ +switch (clk) { +case ICE_REF_CLK_SYNCE : +case ICE_REF_CLK_EREF0 : +return DPLL_LOCK_STATUS_LOCKED ; +case ICE_REF_CLK_ENET : +default : +return DPLL_LOCK_STATUS_UNLOCKED ; + } +} + +int ice_txclk_set_clk (struct ice_pf *pf,enum ice_e825c_ref_clk clk); +void ice_txclk_update_and_notify (struct ice_pf *pf); +#endif /* _ICE_TXCLK_H_ */
Signature · 1 line
2.39.3
Jakub Kicinski
maintainerQuoted 13 lines · On Fri, 3 Apr 2026 01:06:18 +0200 Grzegorz Nitka wrote:
This series adds TX reference clock support for E825 devices and exposes TX clock selection and synchronization status via the Linux DPLL subsystem.
E825 hardware contains a dedicated Tx clock (TXC) domain that is distinct
from PPS and EEC. TX reference clock selection is device‑wide, shared across ports, and mediated by firmware as part of the link bring‑up process. As a result, TX clock selection intent may differ from the effective hardware configuration, and software must verify the outcome after link‑up.
To support this, the series introduces TXC support incrementally across the DPLL core and the ice driver:
Quoted 1 line
- add a new DPLL type (TXC) to represent transmit clock generators;
I'm not grasping why this is needed, isn't it part of any EEC system that the DPLL can drive the TXC? Is your system going to expose multiple DPLLs now for one NIC?
Quoted 19 lines
- relax DPLL pin registration rules for firmware‑described shared pins and extend pin notifications with a source identifier;
- allow dynamic state control of SyncE reference pins where hardware supports it;
- add CPI infrastructure for PHY‑side TX clock control on E825C;
- introduce a TXC DPLL device and TX reference clock pins (EXT_EREF0and SYNCE) in the ice driver;
- extend the Restart Auto‑Negotiation command to carry a TX reference clock index;
- implement hardware‑backed TX reference clock switching, post‑link
- verification, and TX synchronization reporting.TXCLK pins report TX reference topology only. Actual synchronization success is reported via the TXC DPLL lock status, which is updated after hardware verification: external Tx references report LOCKED, while the internal ENET/TXCO source reports UNLOCKED.
This provides reliable TX reference selection and observability on E825 devices using standard DPLL interfaces, without conflating user intent with effective hardware behavior.
Quoted 32 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, April 7, 2026 4:23 AM
To: Nitka, Grzegorz <[email protected]>
Cc: [email protected]; [email protected]; intel-wired- [email protected]; Oros, Petr <[email protected]>; [email protected]; [email protected]; Kitszel, Przemyslaw <[email protected]>; Nguyen, Anthony L <[email protected]>; [email protected]; Vecera, Ivan <[email protected]>; [email protected]; Kubalewski, Arkadiusz <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v5 net-next 0/8] dpll/ice: Add TXC DPLL type and full TX reference clock control for E825Quoted 13 lines · On Fri, 3 Apr 2026 01:06:18 +0200 Grzegorz Nitka wrote:
This series adds TX reference clock support for E825 devices and exposes TX clock selection and synchronization status via the Linux DPLL subsystem.
E825 hardware contains a dedicated Tx clock (TXC) domain that is distinct
from PPS and EEC. TX reference clock selection is device‑wide, shared across ports, and mediated by firmware as part of the link bring‑up process. As a result, TX clock selection intent may differ from the effective hardware configuration, and software must verify the outcome after link‑up.
To support this, the series introduces TXC support incrementally across the DPLL core and the ice driver:
Quoted 6 lines
Quoted 1 line
- add a new DPLL type (TXC) to represent transmit clock generators;
I'm not grasping why this is needed, isn't it part of any EEC system that the DPLL can drive the TXC? Is your system going to expose multiple DPLLs now for one NIC?
Hello Jakub,
For E825 device, the short answer is yes. We have platform EEC now and we want to add:
- TXC DPLLs per port, and
- PPS DPLL for TSPLL config purposes (in the near future)
EEC (Ethernet Equipment Clock) type DPLL is designed to control multiple source signals (internal-NIC or external), where one drives the dpll device, where multiple outputs are possible, each could drive various components as well as propagate signal to external devices.
TXC is specific dpll device that associated with single ETH port to control it's source, there is no need to declare any outputs as the single output is already determined. Basically, having TXC DPLL indicates per port control over SyncE (or some external) clock source.
Quoted 19 lines
Quoted 19 lines
- relax DPLL pin registration rules for firmware‑described shared pins and extend pin notifications with a source identifier;
- allow dynamic state control of SyncE reference pins where hardware supports it;
- add CPI infrastructure for PHY‑side TX clock control on E825C;
- introduce a TXC DPLL device and TX reference clock pins (EXT_EREF0and SYNCE) in the ice driver;
- extend the Restart Auto‑Negotiation command to carry a TX reference clock index;
- implement hardware‑backed TX reference clock switching, post‑link
- verification, and TX synchronization reporting.TXCLK pins report TX reference topology only. Actual synchronization success is reported via the TXC DPLL lock status, which is updated after hardware verification: external Tx references report LOCKED, while the internal ENET/TXCO source reports UNLOCKED.
This provides reliable TX reference selection and observability on E825 devices using standard DPLL interfaces, without conflating user intent with effective hardware behavior.
Jakub Kicinski
maintainerQuoted 26 lines · Grzegorz
Quoted 14 lines · On Fri, 3 Apr 2026 01:06:18 +0200 Grzegorz Nitka wrote:
Quoted 13 lines
This series adds TX reference clock support for E825 devices and exposes TX clock selection and synchronization status via the Linux DPLL subsystem.
E825 hardware contains a dedicated Tx clock (TXC) domain that is distinct
from PPS and EEC. TX reference clock selection is device‑wide, shared across ports, and mediated by firmware as part of the link bring‑up process. As a result, TX clock selection intent may differ from the effective hardware configuration, and software must verify the outcome after link‑up.
To support this, the series introduces TXC support incrementally across the DPLL core and the ice driver:Quoted 5 lines
Quoted 1 line
- add a new DPLL type (TXC) to represent transmit clock generators;
I'm not grasping why this is needed, isn't it part of any EEC system that the DPLL can drive the TXC? Is your system going to expose multiple DPLLs now for one NIC?
Hello Jakub,
For E825 device, the short answer is yes. We have platform EEC now and we want to add:
- TXC DPLLs per port, and
- PPS DPLL for TSPLL config purposes (in the near future)
Quoted 8 lines
EEC (Ethernet Equipment Clock) type DPLL is designed to control multiple source signals (internal-NIC or external), where one drives the dpll device, where multiple outputs are possible, each could drive various components as well as propagate signal to external devices.
TXC is specific dpll device that associated with single ETH port to control it's source, there is no need to declare any outputs as the single output is already determined. Basically, having TXC DPLL indicates per port control over SyncE (or some external) clock source.
Could you share a diagram of how things are wired up?
DPLL can have multiple outputs and multiple inputs. I'm not getting why a single device would have to have multiple actual DPLLs (which makes me worried this is just some "convenient use of the uAPI")
Quoted 55 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, April 10, 2026 3:11 AM
To: Nitka, Grzegorz <[email protected]>
Cc: [email protected]; [email protected]; intel-wired- [email protected]; Oros, Petr <[email protected]>; [email protected]; [email protected]; Kitszel, Przemyslaw <[email protected]>; Nguyen, Anthony L <[email protected]>; [email protected]; Vecera, Ivan <[email protected]>; [email protected]; Kubalewski, Arkadiusz <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v5 net-next 0/8] dpll/ice: Add TXC DPLL type and full TX reference clock control for E825Quoted 2 lines · Grzegorz
Quoted 2 lines · On Fri, 3 Apr 2026 01:06:18 +0200 Grzegorz Nitka wrote:
Quoted 1 line
This series adds TX reference clock support for E825 devices and
exposes
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
TX clock selection and synchronization status via the Linux DPLL subsystem.
E825 hardware contains a dedicated Tx clock (TXC) domain that is distinct
from PPS and EEC. TX reference clock selection is device‑wide, shared across ports, and mediated by firmware as part of the link bring‑up process. As a result, TX clock selection intent may differ from the effective hardware configuration, and software must verify theoutcome
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
after link‑up.
To support this, the series introduces TXC support incrementally across the DPLL core and the ice driver:- add a new DPLL type (TXC) to represent transmit clock generators;
I'm not grasping why this is needed, isn't it part of any EEC system that the DPLL can drive the TXC? Is your system going to expose multiple DPLLs now for one NIC?
Hello Jakub,
For E825 device, the short answer is yes. We have platform EEC now and we want to add:
- TXC DPLLs per port, and
- PPS DPLL for TSPLL config purposes (in the near future)Quoted 5 lines
EEC (Ethernet Equipment Clock) type DPLL is designed to control multiple source signals (internal-NIC or external), where one drives the dpll device, where multiple outputs are possible, each could drive various components as well as propagate signal to external devices.
TXC is specific dpll device that associated with single ETH port to control it'ssource,
Quoted 1 line
there is no need to declare any outputs as the single output is already
determined.
Quoted 8 lines
Quoted 1 line
Basically, having TXC DPLL indicates per port control over SyncE (or some
external)
Quoted 1 line
clock source.
Could you share a diagram of how things are wired up?
DPLL can have multiple outputs and multiple inputs. I'm not getting why a single device would have to have multiple actual DPLLs (which makes me worried this is just some "convenient use of the uAPI")
Hello Jakub,
Here is the high-level connection diagram for E825 device. I hope you find it helpful:
+------------------------------------------------------------------+ | | | +-----------------------------+ | | | | | | | MAC | | | |+------------+-----+ | | | ||RX/1588 |PHC|tspll<----\ | | +---+----+ ||MUX +---+-^---| | | | | E | RX >---------------------> | >--\ | | | | T | | /----------------> | >-\| | | | | H |----+ | |+---------+----^---+ || | | | | 1 | TX <----|----------------+TX MUX < OCXO | || | | | | |PLL | | || |--------| || | | | +---+----+ | /----+ <-ext_ref<-||-|----|---------ext_ref | E | RX >----/ | || |--------+ || | | | | T | | | || < SyncE | || | | | | H |----+ | |+-----------^------+ || | | | | 2 | TX <----------------/ | | /------||-/ | | | |PLL | +------------|-|------||------+ | +---+----+ /--/ | || | | . | RX >--- | | || | | . | | +----------|----|------||--+ | | . |----+ | +-^-+--^+ || | | | | TX <--- | |EEC|PPS| || | | | |PLL | | +-------+ || | | +---+----+ | | <-CLK0/| | | | E | RX >--- | | DPLL | | | | | T | | | | <-CLK1-/ | | | H |----+ | | | | | | X | TX <--- | | <---SMA---< | | |PLL | | | | | | +---+----+ | | <---GPS---< | | | | | | | | | | <---...---< | | | | | | | | | +-------+ | | | | External timing module | | | +--------------------------+ | +-------------------------------------------------------------------+
Before this series, we tried different approaches.
One of them was to create MUX pin associated with netdev interface. EXT_REF and SYNCE pins were registered with this MUX pin.
However I recall there were at least two issues with this solution:
- when using DPLL subsystem not all the connections/relations were visible from DPLL pin-get perspective. RT netlink was required
- due to mixing pins from different modules (like fwnode based pin from zl driver and the pins from ice), we were not able to safely clean the references between pins and dpll (basicaly .. we observed crashes)
Proposed solution just seems to be clean and fully reflects current connection topology.
What's actually your biggest concern?
The fact we introduce a new DPLL type? Or multiply DPLL instances? Or both? Do you prefer to see "one big" DPLL with 16 pins in our case (8 ports x 2 tx-clk pins)? Each pin with the name like, for example, PF0-SyncE/PF0-eRef etc.?
Jakub Kicinski
maintainerQuoted 2 lines · Grzegorz
Here is the high-level connection diagram for E825 device. I hope you find it helpful:
[..]
It does thanks a lot.
Quoted 10 lines
Before this series, we tried different approaches.
One of them was to create MUX pin associated with netdev interface.EXT_REFand SYNCE pins were registered with this MUX pin.
However I recall there were at least two issues with this solution:
- when using DPLL subsystem not all the connections/relations were visible from DPLL pin-get perspective. RT netlink was required
- due to mixing pins from different modules (like fwnode based pin from zl driver and the pins from ice), we were not able to safely clean the references between pins and dpll (basicaly .. we observed crashes)
Quoted 2 lines
Proposed solution just seems to be clean and fully reflects current connection topology.
Do you have the link to the old proposal that was adding stuff to rtnetlink? I remember some discussion long-ish ago, maybe I was wrong.
Quoted 4 lines
What's actually your biggest concern?
The fact we introduce a new DPLL type? Or multiply DPLL instances? Or both? Do you prefer to see "one big" DPLL with 16 pins in our case (8 ports x 2 tx-clk pins)? Each pin with the name like, for example, PF0-SyncE/PF0-eRef etc.?
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Quoted 34 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, April 10, 2026 10:38 PM
To: Nitka, Grzegorz <[email protected]>
Cc: [email protected]; [email protected]; intel-wired- [email protected]; Oros, Petr <[email protected]>; [email protected]; [email protected]; Kitszel, Przemyslaw <[email protected]>; Nguyen, Anthony L <[email protected]>; [email protected]; Vecera, Ivan <[email protected]>; [email protected]; Kubalewski, Arkadiusz <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v5 net-next 0/8] dpll/ice: Add TXC DPLL type and full TX reference clock control for E825Quoted 1 line · Grzegorz
Here is the high-level connection diagram for E825 device. I hope you find it
helpful:
Quoted 1 line
[..]
It does thanks a lot.
Quoted 7 lines
Before this series, we tried different approaches.
One of them was to create MUX pin associated with netdev interface.EXT_REFand SYNCE pins were registered with this MUX pin. However I recall there were at least two issues with this solution:
- when using DPLL subsystem not all the connections/relations were visible from DPLL pin-get perspective. RT netlink was required
- due to mixing pins from different modules (like fwnode based pin from zldriver
Quoted 1 line
and the pins from ice), we were not able to safely clean the references
Quoted 9 lines
between
Quoted 4 lines
pins and dpll (basicaly .. we observed crashes)
Proposed solution just seems to be clean and fully reflects current connection topology.
Do you have the link to the old proposal that was adding stuff to rtnetlink? I remember some discussion long-ish ago, maybe I was wrong.
Hello Jakub,
This is the patch from the discussion I put the link in the cover letter:
https://lore.kernel.org/netdev/[email protected]/
Regards
Grzegorz
Quoted 10 lines
Quoted 2 lines
What's actually your biggest concern?
The fact we introduce a new DPLL type? Or multiply DPLL instances? Orboth?
Quoted 1 line
Do you prefer to see "one big" DPLL with 16 pins in our case (8 ports x 2 tx-
clk pins)?
Quoted 1 line
Each pin with the name like, for example, PF0-SyncE/PF0-eRef etc.?
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Jakub Kicinski
maintainerQuoted 8 lines · Grzegorz
Quoted 5 lines
Quoted 2 lines
Proposed solution just seems to be clean and fully reflects current connection topology.
Do you have the link to the old proposal that was adding stuff to rtnetlink? I remember some discussion long-ish ago, maybe I was wrong.
This is the patch from the discussion I put the link in the cover letter:
https://lore.kernel.org/netdev/[email protected]/
Let's go back to something like that. But leave the OC info out of the XO, just ext-ref, dpll, xo? We can add the xo types later if really needed. Sorry for the flip flop.
Kubalewski, Arkadiusz
maintainerQuoted 36 lines
From: Jakub Kicinski <[email protected]>
Sent: Friday, April 10, 2026 10:38 PMQuoted 3 lines · Grzegorz
Here is the high-level connection diagram for E825 device. I hope you find it helpful:
[..]It does thanks a lot.
Quoted 13 lines
Before this series, we tried different approaches.
One of them was to create MUX pin associated with netdev interface.EXT_REFand SYNCE pins were registered with this MUX pin. However I recall there were at least two issues with this solution:
- when using DPLL subsystem not all the connections/relations were visible
from DPLL pin-get perspective. RT netlink was required
- due to mixing pins from different modules (like fwnode based pin from zl driver
and the pins from ice), we were not able to safely clean the
references between
pins and dpll (basicaly .. we observed crashes)Quoted 2 lines
Proposed solution just seems to be clean and fully reflects current connection topology.
Do you have the link to the old proposal that was adding stuff to rtnetlink? I remember some discussion long-ish ago, maybe I was wrong.
Quoted 6 lines
What's actually your biggest concern?
The fact we introduce a new DPLL type? Or multiply DPLL instances? Or both?
Do you prefer to see "one big" DPLL with 16 pins in our case (8 ports x 2 tx-clk pins)?
Each pin with the name like, for example, PF0-SyncE/PF0-eRef etc.?
Quoted 3 lines
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
A mentioned try of adding per port MUX-type pin, just to give some control to the user, is where we wanted to simplify things, but in the end the API would have to be modified in significant way, various paths related to pin registration and keeping correct references, just to make working case for the pin_on_pin_register and it's internals. We decided that the burden and impact for existing design was to high.
And that is why the TXC approach emerged, the change of DPLL is minimal, The model is still correct from user perspective, SyncE SW controller shall anticipate possibility that per-port TXC dpll is there
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use EEC type instead of new one TXC - since we share pins from external dpll driver, which is EEC type, and our DPLL device would have different clock_id and module. But, further designs, where a single NIC is having control over both a EEC DPLL and ability to control each source per-port this would be problematic. At least one NIC Port driver would have to have 2 EEC-type DPLLs leaving user with extra confusion.
Thanks,
Arkadiusz
Jakub Kicinski
maintainerQuoted 11 lines · Arkadiusz
Quoted 3 lines
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
Let me dig around and see if I can find any docs for PLL IPs that get integrated into ASICs. The DPLL subsystem has implicitly focused on standalone, timing related PLLs. Every ASIC out there has a bunch of PLLs to generate the clock signals. It's not clear to me that DPLL subsystem is the right fit for this. Ping me if I don't get back to this by the end of the week please. I'll need to wrap up net-next and send the PR first..
Quoted 19 lines
A mentioned try of adding per port MUX-type pin, just to give some control to the user, is where we wanted to simplify things, but in the end the API would have to be modified in significant way, various paths related to pin registration and keeping correct references, just to make working case for the
pin_on_pin_registerand it's internals. We decided that the burden and impact for existing design was to high.And that is why the TXC approach emerged, the change of DPLL is minimal, The model is still correct from user perspective, SyncE SW controller shall anticipate possibility that per-port TXC dpll is there
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use EEC type instead of new one TXC - since we share pins from external dpll driver, which is EEC type, and our DPLL device would have different
clock_idand module. But, further designs, where a single NIC is having control over both a EEC DPLL and ability to control each source per-port this would be problematic. At least one NIC Port driver would have to have 2 EEC-type DPLLs leaving user with extra confusion.
Jakub Kicinski
maintainerQuoted 11 lines · Arkadiusz
Quoted 3 lines
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
Don't we put that MAC PLL into bypass mode if we feed a clock from the EEC DPLL?
Quoted 10 lines
A mentioned try of adding per port MUX-type pin, just to give some control to the user, is where we wanted to simplify things, but in the end the API would have to be modified in significant way, various paths related to pin registration and keeping correct references, just to make working case for the
pin_on_pin_registerand it's internals. We decided that the burden and impact for existing design was to high.And that is why the TXC approach emerged, the change of DPLL is minimal, The model is still correct from user perspective, SyncE SW controller shall anticipate possibility that per-port TXC dpll is there
We are starting to push into what was previously the domain of drivers/clk, tho. IIUC the "ASIC PLL"s are usually integrated with clock dividers. And cannot be "configured" after chip init / async reset (which is why I presume you whack a reset in patch 7?).
Quoted 8 lines
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use EEC type instead of new one TXC - since we share pins from external dpll driver, which is EEC type, and our DPLL device would have different
clock_idand module. But, further designs, where a single NIC is having control over both a EEC DPLL and ability to control each source per-port this would be problematic. At least one NIC Port driver would have to have 2 EEC-type DPLLs leaving user with extra confusion.
The distinction between TXC and EEC dpll is confusing.
I thought EEC one _was_supposed_to_ drive the Tx clock? What PPS means is obvious, what EEC means if not driving Tx clock is unclear to me..
Let me summarize my concerns - we need to navigate the split between drivers/clk and dpll. We need a distinction on what goes where, because every ASIC has a bunch of PLLs which until now have been controlled by device tree (if at all). If the main question we want to answer is "which clock ref is used to drive internal clock" all we need is a MUX. If we want to make dpll cover also ASIC PLLs for platforms without device tree we need a more generic name than TXC, IMHO.
Kubalewski, Arkadiusz
maintainerQuoted 11 lines
From: Jakub Kicinski <[email protected]>
Sent: Tuesday, April 14, 2026 11:59 PMQuoted 7 lines · Arkadiusz
Quoted 3 lines
My concern is that I think this is a pretty run of the mill SyncE design. If we need to pretend we have two DPLLs here if we really only have one and a mux - then our APIs are mis-designed :(
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
Quoted 7 lines
Quoted 4 lines
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
Don't we put that MAC PLL into bypass mode if we feed a clock from the EEC DPLL?
This HW doesn't use EEC DPLL signal to feed MAC clock, as DPLL is external from NIC point of view. Only 2 signals from such external DPLL device are used by NIC:
- synce (a single source for all those TXC per-port DPLL device)
- time_ref (a source for the TS_PLL - which drives PTP timer)
Grzegorz is now working on submitting the patches for later one.
Quoted 17 lines
Quoted 12 lines
A mentioned try of adding per port MUX-type pin, just to give some control
to the user, is where we wanted to simplify things, but in the end the API
would have to be modified in significant way, various paths related to pin
registration and keeping correct references, just to make working case for thepin_on_pin_registerand it's internals. We decided that the burden
and impact for existing design was to high.Quoted 4 lines
And that is why the TXC approach emerged, the change of DPLL is minimal, The model is still correct from user perspective, SyncE SW controller shall
anticipate possibility that per-port TXC dpll is there
Quoted 4 lines
We are starting to push into what was previously the domain of
drivers/clk, tho. IIUC the "ASIC PLL"s are usually integrated with clock dividers. And cannot be "configured" after chip init / async reset (which is why I presume you whack a reset in patch 7?).
Well, we need CGU-dividers change for a frequency-compliance with lower link speeds, the link reset which is required as part of tx-clk switch and link establishment on a new clock.
Quoted 15 lines
Quoted 14 lines
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use
EEC type instead of new one TXC - since we share pins from external dpll driver, which is EEC type, and our DPLL device would have differentclock_id
and module. But, further designs, where a single NIC is having control over
both a EEC DPLL and ability to control each source per-port this would be
problematic. At least one NIC Port driver would have to have 2 EEC-type DPLLs
leaving user with extra confusion.
Quoted 5 lines
The distinction between TXC and EEC dpll is confusing.
I thought EEC one _was_supposed_to_ drive the Tx clock? What PPS means is obvious, what EEC means if not driving Tx clock is unclear to me..
Yes, correct, EEC DPLL main task would be to drive TX clocks of NIC ports, but if there is a per-port control something extra is required.
Quoted 7 lines
Let me summarize my concerns - we need to navigate the split between
drivers/clkand dpll. We need a distinction on what goes where, because every ASIC has a bunch of PLLs which until now have been controlled by device tree (if at all). If the main question we want to answer is "which clock ref is used to drive internal clock" all we need is a MUX. If we want to make dpll cover also ASIC PLLs for platforms without device tree we need a more generic name than TXC, IMHO.
Well, 'floating' MUX type pin not connected to any dpll would require a lot of additional implementations, just to allow source selection, as we have tried it already.
Wouldn't more generic name cause a DPLL purpose problem?
We still want to make sure that given DPLL device would serve the role of source selection for particular port where a source pin should be an output either on EEC dpll or some external signal generator but somehow related to SyncE or similar solutions.
Thanks,
Arkadiusz
Jakub Kicinski
maintainerQuoted 8 lines · Arkadiusz
Quoted 8 lines
Quoted 7 lines
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
Quoted 8 lines
Quoted 2 lines
Don't we put that MAC PLL into bypass mode if we feed a clock from the EEC DPLL?
This HW doesn't use EEC DPLL signal to feed MAC clock, as DPLL is external from NIC point of view. Only 2 signals from such external DPLL device are used by NIC:
- synce (a single source for all those TXC per-port DPLL device)
-time_ref(a source for theTS_PLL- which drives PTP timer)
No bypass? The PLL is actually in the loop? oof, this is beyond my understanding of clocks and signals :S
Quoted 57 lines
Quoted 16 lines
Quoted 11 lines
A mentioned try of adding per port MUX-type pin, just to give some control
to the user, is where we wanted to simplify things, but in the end the API
would have to be modified in significant way, various paths related to pin
registration and keeping correct references, just to make working case for thepin_on_pin_registerand it's internals. We decided that the burden
and impact for existing design was to high.Quoted 4 lines
And that is why the TXC approach emerged, the change of DPLL is minimal, The model is still correct from user perspective, SyncE SW controller shall
anticipate possibility that per-port TXC dpll is thereQuoted 4 lines
We are starting to push into what was previously the domain of
drivers/clk, tho. IIUC the "ASIC PLL"s are usually integrated with clock dividers. And cannot be "configured" after chip init / async reset (which is why I presume you whack a reset in patch 7?).Well, we need CGU-dividers change for a frequency-compliance with lower link speeds, the link reset which is required as part of tx-clk switch and link establishment on a new clock.
Quoted 15 lines
Quoted 14 lines
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use
EEC type instead of new one TXC - since we share pins from external dpll driver, which is EEC type, and our DPLL device would have differentclock_id
and module. But, further designs, where a single NIC is having control over
both a EEC DPLL and ability to control each source per-port this would be
problematic. At least one NIC Port driver would have to have 2 EEC-type DPLLs
leaving user with extra confusion.Quoted 5 lines
The distinction between TXC and EEC dpll is confusing.
I thought EEC one _was_supposed_to_ drive the Tx clock? What PPS means is obvious, what EEC means if not driving Tx clock is unclear to me..Yes, correct, EEC DPLL main task would be to drive TX clocks of NIC ports, but if there is a per-port control something extra is required.
Quoted 7 lines
Let me summarize my concerns - we need to navigate the split between
drivers/clkand dpll. We need a distinction on what goes where, because every ASIC has a bunch of PLLs which until now have been controlled by device tree (if at all). If the main question we want to answer is "which clock ref is used to drive internal clock" all we need is a MUX. If we want to make dpll cover also ASIC PLLs for platforms without device tree we need a more generic name than TXC, IMHO.
Quoted 5 lines
Well, 'floating' MUX type pin not connected to any dpll would require a lot of additional implementations, just to allow source selection, as we have tried it already.
Wouldn't more generic name cause a DPLL purpose problem?
The old proposal in netdev family was to to have source selection without creating a real mux. Not saying I'm dead set on that direction.
Quoted 4 lines
We still want to make sure that given DPLL device would serve the role of source selection for particular port where a source pin should be an output either on EEC dpll or some external signal generator but somehow related to SyncE or similar solutions.
Right, but adding a new "type" per location of the PLL (especially if we lean into covering any ASIC PLL) may not scale, and opens us up to "vendor X calls it Y" and "in design A clock is fed by pll type X and in design B by type Y".
IIUC you do provide "linking" of the pins? netdev will have the MAC pin assigned. Is the pin that connects the PLLs also annotated so that user knows what's on the "other side"? Maybe the topology would be clear enough from just that, and we don't have to add a TXC type. Call the PLL "integrated" or something generic. User should be able to trace the path of the signals?
Kubalewski, Arkadiusz
maintainerQuoted 17 lines
From: Intel-wired-lan <[email protected]> On Behalf Of Jakub Kicinski
Sent: Thursday, April 16, 2026 5:28 PMQuoted 12 lines · Arkadiusz
Quoted 11 lines
Quoted 8 lines
Well, the true is that we did not anticipated per-port control of the TX clock source, as a single DPLL device could drive multiple of such.
This is not true, that we pretend there is a second PLL - there is a PLL on each TX clock, maybe not a full DPLL, but still the loop with a control over it's sources is there and it has the same 2 external sources + default XO.
Don't we put that MAC PLL into bypass mode if we feed a clock from the EEC DPLL?
Quoted 9 lines
Quoted 5 lines
This HW doesn't use EEC DPLL signal to feed MAC clock, as DPLL is external from NIC point of view. Only 2 signals from such external DPLL device are used by NIC:
- synce (a single source for all those TXC per-port DPLL device)
-time_ref(a source for theTS_PLL- which drives PTP timer)No bypass? The PLL is actually in the loop? oof, this is beyond my understanding of clocks and signals :S
TBH, I am not entirely sure what do you mean with MAC PLL into bypass mode, but the HW description I have provided is still true, the MAC is not fed with any DPLL provided signal here. Only port tx clocks PLLs and a timer PLL can use those.
Quoted 65 lines
Quoted 65 lines
Quoted 20 lines
Quoted 14 lines
A mentioned try of adding per port MUX-type pin, just to give some control
to the user, is where we wanted to simplify things, but in the end the
API
would have to be modified in significant way, various paths related to
pin
registration and keeping correct references, just to make working case
for thepin_on_pin_registerand it's internals. We decided that the burden
and impact for existing design was to high.Quoted 5 lines
And that is why the TXC approach emerged, the change of DPLL is minimal,
The model is still correct from user perspective, SyncE SW controller shall
anticipate possibility that per-port TXC dpll is thereQuoted 4 lines
We are starting to push into what was previously the domain of
drivers/clk, tho. IIUC the "ASIC PLL"s are usually integrated with clock dividers. And cannot be "configured" after chip init / async reset (which is why I presume you whack a reset in patch 7?).Well, we need CGU-dividers change for a frequency-compliance with lower link speeds, the link reset which is required as part of tx-clk switch and link establishment on a new clock.
Quoted 19 lines
Quoted 10 lines
This particular device and driver doesn't implement any EEC-type DPLL device, the one could think that we can just change the type here and use
EEC type instead of new one TXC - since we share pins from external dpll
driver, which is EEC type, and our DPLL device would have differentclock_id
and module. But, further designs, where a single NIC is having controlQuoted 8 lines
over
both a EEC DPLL and ability to control each source per-port this would
be
problematic. At least one NIC Port driver would have to have 2 EEC- type
DPLLs
leaving user with extra confusion.Quoted 5 lines
The distinction between TXC and EEC dpll is confusing.
I thought EEC one _was_supposed_to_ drive the Tx clock? What PPS means is obvious, what EEC means if not driving Tx clock is unclear to me..Yes, correct, EEC DPLL main task would be to drive TX clocks of NIC ports, but if there is a per-port control something extra is required.
Quoted 7 lines
Let me summarize my concerns - we need to navigate the split between
drivers/clkand dpll. We need a distinction on what goes where, because every ASIC has a bunch of PLLs which until now have been controlled by device tree (if at all). If the main question we want to answer is "which clock ref is used to drive internal clock" all we need is a MUX. If we want to make dpll cover also ASIC PLLs for platforms without device tree we need a more generic name than TXC, IMHO.
Quoted 9 lines
Quoted 5 lines
Well, 'floating' MUX type pin not connected to any dpll would require a lot of additional implementations, just to allow source selection, as we have tried it already.
Wouldn't more generic name cause a DPLL purpose problem?
The old proposal in netdev family was to to have source selection without creating a real mux. Not saying I'm dead set on that direction.
Yes, correct, it kept the list of dpll pins valid for source selection of tx clock within the netdev and control over it through RT netlink. That solution was rather simple but you requested to hack into dpll so we did here.
IMHO this is cleanest and simplest solution we could find to keep it within DPLL subsystem.
Quoted 10 lines
Quoted 4 lines
We still want to make sure that given DPLL device would serve the role of source selection for particular port where a source pin should be an output either on EEC dpll or some external signal generator but somehow related to SyncE or similar solutions.
Right, but adding a new "type" per location of the PLL (especially if we lean into covering any ASIC PLL) may not scale, and opens us up to "vendor X calls it Y" and "in design A clock is fed by pll type X and in design B by type Y".
I was thinking that this is more like a purpose specific DPLL device, if someone would want something similar we would have to review it, right?
Quoted 6 lines
IIUC you do provide "linking" of the pins? netdev will have the MAC pin assigned. Is the pin that connects the PLLs also annotated so that user knows what's on the "other side"? Maybe the topology would be clear enough from just that, and we don't have to add a TXC type. Call the PLL "integrated" or something generic. User should be able to trace the path of the signals?
It depends, TX clock has one of external pins connected to external DPLL, but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?
I mean 'generic' type is something we could do, but as already mentioned, thought that we want a DPLL types specified/designed for some particular functions/tasks.
Thank you!
Arkadiusz
Jakub Kicinski
maintainerQuoted 6 lines · Arkadiusz
Quoted 6 lines
Quoted 5 lines
This HW doesn't use EEC DPLL signal to feed MAC clock, as DPLL is external from NIC point of view. Only 2 signals from such external DPLL device are used by NIC:
- synce (a single source for all those TXC per-port DPLL device)
-time_ref(a source for theTS_PLL- which drives PTP timer)
Quoted 7 lines
Quoted 2 lines
No bypass? The PLL is actually in the loop? oof, this is beyond my understanding of clocks and signals :S
TBH, I am not entirely sure what do you mean with MAC PLL into bypass mode, but the HW description I have provided is still true, the MAC is not fed with any DPLL provided signal here. Only port tx clocks PLLs and a timer PLL can use those.
The ASIC PLL IPs I managed to find had a bypass mode where the reference / input frequency still goes thru the dividers but the PLL circuit is bypassed. I assumed that if we want to distribute a syntonized clock across the network we would want as few PLL circuits in the paths as possible and we'd use bypass (which would be relevant here since for the target use case we wouldn't engage the PLL of the TXC). But this is 100% guesswork so I'm probably speaking gibberish.
Quoted 22 lines
Quoted 8 lines
Quoted 5 lines
Well, 'floating' MUX type pin not connected to any dpll would require a lot of additional implementations, just to allow source selection, as we have tried it already.
Wouldn't more generic name cause a DPLL purpose problem?
The old proposal in netdev family was to to have source selection without creating a real mux. Not saying I'm dead set on that direction.
Yes, correct, it kept the list of dpll pins valid for source selection of tx clock within the netdev and control over it through RT netlink. That solution was rather simple but you requested to hack into dpll so we did here.
IMHO this is cleanest and simplest solution we could find to keep it within DPLL subsystem.
Quoted 5 lines
Quoted 4 lines
We still want to make sure that given DPLL device would serve the role of source selection for particular port where a source pin should be an output either on EEC dpll or some external signal generator but somehow related to SyncE or similar solutions.
Quoted 7 lines
Quoted 4 lines
Right, but adding a new "type" per location of the PLL (especially if we lean into covering any ASIC PLL) may not scale, and opens us up to "vendor X calls it Y" and "in design A clock is fed by pll type X and in design B by type Y".
I was thinking that this is more like a purpose specific DPLL device, if someone would want something similar we would have to review it, right?
We would if it was a Ethernet MAC PLL, but if someone wanted to expose whether some random PLL in their ASIC locks - are we adding a new type for each one of those?
Quoted 7 lines
Quoted 6 lines
IIUC you do provide "linking" of the pins? netdev will have the MAC pin assigned. Is the pin that connects the PLLs also annotated so that user knows what's on the "other side"? Maybe the topology would be clear enough from just that, and we don't have to add a TXC type. Call the PLL "integrated" or something generic. User should be able to trace the path of the signals?
Quoted 6 lines
It depends, TX clock has one of external pins connected to external DPLL, but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?
Not sure I follow, TBH. To me the function of the "MAC PLL" is fairly obvious from the fact that it has a pin exposed via rtnetlink. So it's obviously a DPLL which can drive the Tx clock?
It's the function / relation / linking to the EEC DPLL that may not be obvious. But user can see how the pins connect they can get some LLM to draw a diagram of a live system.. et voila :)
Quoted 3 lines
I mean 'generic' type is something we could do, but as already mentioned, thought that we want a DPLL types specified/designed for some particular functions/tasks.
I feel like we often get labels wrong the first time around, so if we can defer adding them until later that'd make me happy..
Kubalewski, Arkadiusz
maintainerQuoted 19 lines
From: Jakub Kicinski <[email protected]>
Sent: Friday, April 17, 2026 3:05 AMQuoted 7 lines · Arkadiusz
Quoted 7 lines
Quoted 6 lines
This HW doesn't use EEC DPLL signal to feed MAC clock, as DPLL is external from NIC point of view. Only 2 signals from such external DPLL
device are used by NIC:
- synce (a single source for all those TXC per-port DPLL device)
-time_ref(a source for theTS_PLL- which drives PTP timer)Quoted 7 lines
Quoted 2 lines
No bypass? The PLL is actually in the loop? oof, this is beyond my understanding of clocks and signals :S
TBH, I am not entirely sure what do you mean with MAC PLL into bypass mode, but the HW description I have provided is still true, the MAC is not fed with any DPLL provided signal here. Only port tx clocks PLLs and a timer PLL can use those.
Quoted 8 lines
The ASIC PLL IPs I managed to find had a bypass mode where the reference / input frequency still goes thru the dividers but the PLL circuit is bypassed. I assumed that if we want to distribute a syntonized clock across the network we would want as few PLL circuits in the paths as possible and we'd use bypass (which would be relevant here since for the target use case we wouldn't engage the PLL of the TXC). But this is 100% guesswork so I'm probably speaking gibberish.
OK, thanks for explanation. I don't have such details about it, I have seen only high level design drawings.
Quoted 34 lines
Quoted 34 lines
Quoted 10 lines
Quoted 7 lines
Well, 'floating' MUX type pin not connected to any dpll would require a
lot of additional implementations, just to allow source selection, as we
have tried it already.Wouldn't more generic name cause a DPLL purpose problem?
The old proposal in netdev family was to to have source selection without creating a real mux. Not saying I'm dead set on that direction.
Yes, correct, it kept the list of dpll pins valid for source selection of
tx clock within the netdev and control over it through RT netlink. That solution was rather simple but you requested to hack into dpll so we
did here.IMHO this is cleanest and simplest solution we could find to keep it within DPLL subsystem.
Quoted 12 lines
Quoted 7 lines
We still want to make sure that given DPLL device would serve the role
of source selection for particular port where a source pin should be an
output either on EEC dpll or some external signal generator but somehow
related to SyncE or similar solutions.Right, but adding a new "type" per location of the PLL (especially if we lean into covering any ASIC PLL) may not scale, and opens us up to "vendor X calls it Y" and "in design A clock is fed by pll type X and in design B by type Y".
Quoted 6 lines
Quoted 2 lines
I was thinking that this is more like a purpose specific DPLL device, if someone would want something similar we would have to review it, right?
We would if it was a Ethernet MAC PLL, but if someone wanted to expose whether some random PLL in their ASIC locks - are we adding a new type for each one of those?
Yes, that was the implicit intention within those patches, if other purpose specific PLL would have to be present for whatever HW design and user control over it would be required, then that would be the easiest to maintain in the long term? Multiple types and each have own function/purpose.
It would be good as long as there is one PLL for a function per board, once there could be multiple ones for single function, we would have to add some enumeration (labels, etc.)
Quoted 16 lines
Quoted 8 lines
Quoted 7 lines
IIUC you do provide "linking" of the pins? netdev will have the MAC pin assigned. Is the pin that connects the PLLs also annotated so that user knows what's on the "other side"? Maybe the topology would be clear enough from just that, and we don't have to add a TXC type. Call the PLL "integrated" or something generic. User should be able to trace the path of the signals?
Quoted 7 lines
It depends, TX clock has one of external pins connected to external DPLL,
but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?
Quoted 4 lines
Not sure I follow, TBH. To me the function of the "MAC PLL" is fairly obvious from the fact that it has a pin exposed via rtnetlink. So it's obviously a DPLL which can drive the Tx clock?
I am lost a bit now too. You mean clock recovery pin? And EEC type dpll? In this solution the 'MAC'/EEC is external and it doesn't drive TX clocks directly.
Quoted 4 lines
It's the function / relation / linking to the EEC DPLL that may not be obvious. But user can see how the pins connect they can get some LLM to draw a diagram of a live system.. et voila :)
Yes, correct it would work for this particular HW, but adding a variant without a external EEC-connected pin in the picture would be problematic to understand 'generic' dpll purpose, pointing to the labels later.
Just to make it clear. I believe that generic type dpll could be used in any HW and for any purpose, so after all each such usage could possibly introduce entropy and confusion on the user side.
But if you are fine with that, then sure, we can live with generic purpose dpll.
Quoted 7 lines
Quoted 4 lines
I mean 'generic' type is something we could do, but as already mentioned,
thought that we want a DPLL types specified/designed for some particular functions/tasks.I feel like we often get labels wrong the first time around, so if we can defer adding them until later that'd make me happy..
Sure something like it later would be required.
Thank you!
Arkadiusz
Jakub Kicinski
maintainerQuoted 7 lines · Arkadiusz
Quoted 6 lines
Quoted 2 lines
I was thinking that this is more like a purpose specific DPLL device, if someone would want something similar we would have to review it, right?
We would if it was a Ethernet MAC PLL, but if someone wanted to expose whether some random PLL in their ASIC locks - are we adding a new type for each one of those?
Quoted 8 lines
Yes, that was the implicit intention within those patches, if other purpose specific PLL would have to be present for whatever HW design and user control over it would be required, then that would be the easiest to maintain in the long term? Multiple types and each have own function/purpose.
It would be good as long as there is one PLL for a function per board, once there could be multiple ones for single function, we would have to add some enumeration (labels, etc.)
Defer on adding identifiers. User knows which driver and bus device spawned the pll and more importantly what the pin topology is. Naming in the kernel is rarely a good idea.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
It depends, TX clock has one of external pins connected to external DPLL,
but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?
Quoted 7 lines
Quoted 3 lines
Not sure I follow, TBH. To me the function of the "MAC PLL" is fairly obvious from the fact that it has a pin exposed via rtnetlink. So it's obviously a DPLL which can drive the Tx clock?
I am lost a bit now too. You mean clock recovery pin? And EEC type dpll? In this solution the 'MAC'/EEC is external and it doesn't drive TX clocks directly.
MAC == "tspll" == TXC in this series. On Grzegorz's diagram the new PLL was in the MAC, which makes sense since it's a pll in the same ASIC as the MAC.
I'm saying that the function of that pll is obvious since its pin will plug into the netdev / rtnetlink.
Quoted 7 lines
Quoted 3 lines
It's the function / relation / linking to the EEC DPLL that may not be obvious. But user can see how the pins connect they can get some LLM to draw a diagram of a live system.. et voila :)
Yes, correct it would work for this particular HW, but adding a variant without a external EEC-connected pin in the picture would be problematic to understand 'generic' dpll purpose, pointing to the labels later.
The function of the "MAC/tspll" is still obvious. The clarity of the external PLL is not helped by naming the "MAC/tspll".
Quoted 6 lines
Just to make it clear. I believe that generic type dpll could be used in any HW and for any purpose, so after all each such usage could possibly introduce entropy and confusion on the user side.
But if you are fine with that, then sure, we can live with generic purpose dpll.
Considering all the imperfect options - generic / unnamed type would be my preference.
Kubalewski, Arkadiusz
maintainerQuoted 26 lines
From: Jakub Kicinski <[email protected]>
Sent: Saturday, April 18, 2026 9:26 PMQuoted 16 lines · Arkadiusz
Quoted 8 lines
Quoted 4 lines
I was thinking that this is more like a purpose specific DPLL device, if
someone would want something similar we would have to review it, right?We would if it was a Ethernet MAC PLL, but if someone wanted to expose whether some random PLL in their ASIC locks - are we adding a new type for each one of those?
Yes, that was the implicit intention within those patches, if other purpose
specific PLL would have to be present for whatever HW design and user control over it would be required, then that would be the easiest to maintain in the long term? Multiple types and each have own function/purpose.Quoted 5 lines
It would be good as long as there is one PLL for a function per board, once
there could be multiple ones for single function, we would have to add some
enumeration (labels, etc.)
Quoted 3 lines
Defer on adding identifiers. User knows which driver and bus device spawned the pll and more importantly what the pin topology is. Naming in the kernel is rarely a good idea.
Sure.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 9 lines
It depends, TX clock has one of external pins connected to external DPLL,
but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based
on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?Not sure I follow, TBH. To me the function of the "MAC PLL" is fairly obvious from the fact that it has a pin exposed via rtnetlink. So it's obviously a DPLL which can drive the Tx clock?
Quoted 9 lines
Quoted 4 lines
I am lost a bit now too. You mean clock recovery pin? And EEC type dpll? In this solution the 'MAC'/EEC is external and it doesn't drive TX clocks
directly.MAC == "tspll" == TXC in this series. On Grzegorz's diagram the new PLL was in the MAC, which makes sense since it's a pll in the same ASIC as the MAC.
We wanted the TSPLL from the picture to be PPS type as it drives the PHC timer within the MAC.
Quoted 3 lines
I'm saying that the function of that pll is obvious since its pin will plug into the netdev / rtnetlink.
Yeah I got it, just saying it will work for now :)
Quoted 15 lines
Quoted 7 lines
Quoted 3 lines
It's the function / relation / linking to the EEC DPLL that may not be obvious. But user can see how the pins connect they can get some LLM to draw a diagram of a live system.. et voila :)
Yes, correct it would work for this particular HW, but adding a variant without a external EEC-connected pin in the picture would be problematic to understand 'generic' dpll purpose, pointing to the labels later.
The function of the "MAC/tspll" is still obvious. The clarity of the external PLL is not helped by naming the "MAC/tspll".
Quoted 4 lines
Just to make it clear. I believe that generic type dpll could be used in any HW and for any purpose, so after all each such usage could possibly introduce entropy and confusion on the user side.
Quoted 5 lines
Quoted 2 lines
But if you are fine with that, then sure, we can live with generic purpose dpll.
Considering all the imperfect options - generic / unnamed type would be my preference.
Ok, sounds good.
Thank you!
Arkadiusz
Quoted 100 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kubalewski, Arkadiusz
Sent: Monday, April 20, 2026 4:52 PM
To: Jakub Kicinski <[email protected]>
Cc: Vecera, Ivan <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; intel-wired- [email protected]; [email protected]; Kitszel, Przemyslaw <[email protected]>; Nguyen, Anthony L <[email protected]>; [email protected]; [email protected]
Subject: Re: [Intel-wired-lan] [PATCH v5 net-next 0/8] dpll/ice: Add TXC DPLL type and full TX reference clock control for E825Quoted 26 lines
From: Jakub Kicinski <[email protected]>
Sent: Saturday, April 18, 2026 9:26 PMQuoted 16 lines · Arkadiusz
Quoted 8 lines
Quoted 4 lines
I was thinking that this is more like a purpose specific DPLL device, if
someone would want something similar we would have to review it, right?We would if it was a Ethernet MAC PLL, but if someone wanted to expose whether some random PLL in their ASIC locks - are we adding a new type for each one of those?
Yes, that was the implicit intention within those patches, if other purpose
specific PLL would have to be present for whatever HW design and user control over it would be required, then that would be the easiest to maintain in the long term? Multiple types and each have own function/purpose.Quoted 5 lines
It would be good as long as there is one PLL for a function per board, once
there could be multiple ones for single function, we would have to add some
enumeration (labels, etc.)Quoted 3 lines
Defer on adding identifiers. User knows which driver and bus device spawned the pll and more importantly what the pin topology is. Naming in the kernel is rarely a good idea.
Sure.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 9 lines
It depends, TX clock has one of external pins connected to external DPLL,
but second is a board-level pin with ability to provide some external clock signal, the user would have to determine that purpose just based
on the topology of one of the pins, which seems a bit problematic? I.e. if at some point there would be HW with only external non-DPLL connected pins?Not sure I follow, TBH. To me the function of the "MAC PLL" is fairly obvious from the fact that it has a pin exposed via rtnetlink. So it's obviously a DPLL which can drive the Tx clock?
Quoted 9 lines
Quoted 4 lines
I am lost a bit now too. You mean clock recovery pin? And EEC type dpll? In this solution the 'MAC'/EEC is external and it doesn't drive TX clocks
directly.MAC == "tspll" == TXC in this series. On Grzegorz's diagram the new PLL was in the MAC, which makes sense since it's a pll in the same ASIC as the MAC.
We wanted the TSPLL from the picture to be PPS type as it drives the PHC timer within the MAC.
Quoted 3 lines
I'm saying that the function of that pll is obvious since its pin will plug into the netdev / rtnetlink.
Yeah I got it, just saying it will work for now :)
Quoted 18 lines
Quoted 7 lines
Quoted 3 lines
It's the function / relation / linking to the EEC DPLL that may not be obvious. But user can see how the pins connect they can get some LLM to draw a diagram of a live system.. et voila :)
Yes, correct it would work for this particular HW, but adding a variant without a external EEC-connected pin in the picture would be problematic to understand 'generic' dpll purpose, pointing to the labels later.
The function of the "MAC/tspll" is still obvious. The clarity of the external PLL is not helped by naming the "MAC/tspll".
Quoted 6 lines
Just to make it clear. I believe that generic type dpll could be used in any HW and for any purpose, so after all each such usage could possibly introduce entropy and confusion on the user side.
But if you are fine with that, then sure, we can live with generic purpose dpll.
Quoted 7 lines
Quoted 2 lines
Considering all the imperfect options - generic / unnamed type would be my preference.
Ok, sounds good.
Thank you!
Arkadiusz
Thanks for the fruitful discussion. Just submitted v7 in which DPLL_TYPE_GENERIC Has been introduced (instead of DPLL_TYPE_TXC).
Regards
Grzegorz