[Intel-wired-lan] [PATCH v6 net-next 6/8] ice: implement CPI support for E825C
Loktionov, Aleksandr
aleksandr.loktionov at intel.com
Thu Apr 30 11:40:42 UTC 2026
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf
> Of Grzegorz Nitka
> Sent: Friday, April 10, 2026 1:51 AM
> To: netdev at vger.kernel.org
> Cc: Vecera, Ivan <ivecera at redhat.com>; vadim.fedorenko at linux.dev;
> kuba at kernel.org; jiri at resnulli.us; edumazet at google.com; Kitszel,
> Przemyslaw <przemyslaw.kitszel at intel.com>; richardcochran at gmail.com;
> donald.hunter at gmail.com; linux-kernel at vger.kernel.org; Kubalewski,
> Arkadiusz <arkadiusz.kubalewski at intel.com>; andrew+netdev at lunn.ch;
> intel-wired-lan at lists.osuosl.org; horms at kernel.org;
> Prathosh.Satish at microchip.com; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; pabeni at redhat.com; davem at davemloft.net
> Subject: [Intel-wired-lan] [PATCH v6 net-next 6/8] ice: implement CPI
> support for E825C
>
> Add 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')
> - assurance of CPI transaction serialization into the CPI core.
> CPI REQ/ACK is a multi-step handshake and must be executed
> atomically per PHY. Centralize the lock in ice_cpi_exec() and
> use adapter-scoped per-PHY mutexes, which match the hardware
> sharing
> model across PFs.
> - 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.
>
> Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski at intel.com>
> Signed-off-by: Grzegorz Nitka <grzegorz.nitka at intel.com>
> ---
> drivers/net/ethernet/intel/ice/Makefile | 2 +-
> drivers/net/ethernet/intel/ice/ice_adapter.c | 4 +
> drivers/net/ethernet/intel/ice/ice_adapter.h | 7 +
> drivers/net/ethernet/intel/ice/ice_cpi.c | 364
> +++++++++++++++++++
> drivers/net/ethernet/intel/ice/ice_cpi.h | 61 ++++
> drivers/net/ethernet/intel/ice/ice_sbq_cmd.h | 5 +-
> drivers/net/ethernet/intel/ice/ice_type.h | 2 +
> 7 files changed, 442 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
>
> diff --git a/drivers/net/ethernet/intel/ice/Makefile
> b/drivers/net/ethernet/intel/ice/Makefile
> index 5b2c666496e7..38db476ab2ec 100644
> --- a/drivers/net/ethernet/intel/ice/Makefile
> +++ b/drivers/net/ethernet/intel/ice/Makefile
> @@ -54,7 +54,7 @@ ice-$(CONFIG_PCI_IOV) += \
> ice_vf_mbx.o \
> ice_vf_vsi_vlan_ops.o \
> ice_vf_lib.o
...
> diff --git a/drivers/net/ethernet/intel/ice/ice_cpi.h
> b/drivers/net/ethernet/intel/ice/ice_cpi.h
> new file mode 100644
> index 000000000000..932fe0c0824a
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/ice_cpi.h
> @@ -0,0 +1,61 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (C) 2018-2025 Intel Corporation */
Shouldn't the 2025 year be updated to 2026?
> +
> +#ifndef _ICE_CPI_H_
> +#define _ICE_CPI_H_
> +
> +#define CPI0_PHY1_CMD_DATA 0x7FD028
> +#define CPI0_LM1_CMD_DATA 0x7FD024
> +#define CPI_RETRIES_COUNT 10
> +#define CPI_RETRIES_CADENCE_MS 100
> +
> +/* CPI PHY CMD DATA register (CPI0_PHY1_CMD_DATA) */
> +#define CPI_PHY_CMD_DATA_M GENMASK(15, 0)
> +#define CPI_PHY_CMD_OPCODE_M GENMASK(23, 16)
> +#define CPI_PHY_CMD_PORTLANE_M GENMASK(26, 24)
> +#define CPI_PHY_CMD_RSVD_M GENMASK(29, 27)
> +#define CPI_PHY_CMD_ERROR_M BIT(30)
> +#define CPI_PHY_CMD_ACK_M BIT(31)
> +
> +/* CPI LM CMD DATA register (CPI0_LM1_CMD_DATA) */
> +#define CPI_LM_CMD_DATA_M GENMASK(15, 0)
> +#define CPI_LM_CMD_OPCODE_M GENMASK(23, 16)
> +#define CPI_LM_CMD_PORTLANE_M GENMASK(26, 24)
> +#define CPI_LM_CMD_RSVD_M GENMASK(28, 27)
> +#define CPI_LM_CMD_GET_SET_M BIT(29)
> +#define CPI_LM_CMD_RESET_M BIT(30)
> +#define CPI_LM_CMD_REQ_M BIT(31)
> +
> +#define CPI_OPCODE_PHY_CLK 0xF1
> +#define CPI_OPCODE_PHY_CLK_PHY_SEL_M GENMASK(9, 6)
> +#define CPI_OPCODE_PHY_CLK_REF_CTRL_M GENMASK(5, 4)
> +#define CPI_OPCODE_PHY_CLK_PORT_SEL 0
> +#define CPI_OPCODE_PHY_CLK_DISABLE 1
> +#define CPI_OPCODE_PHY_CLK_ENABLE 2
> +#define CPI_OPCODE_PHY_CLK_REF_SEL_M GENMASK(3, 0)
> +
> +#define CPI_OPCODE_PHY_PCS_RESET 0xF0
> +#define CPI_OPCODE_PHY_PCS_ONPI_RESET_VAL 0x3F
> +
> +#define CPI_LM_CMD_REQ 1
> +#define CPI_LM_CMD_SET 1
CPI_LM_CMD_SET is defined but not used in the patches
> +
...
> /* Port hardware description */
> struct ice_hw {
> u8 __iomem *hw_addr;
> --
> 2.39.3
More information about the Intel-wired-lan
mailing list