Re: [PATCH net-next v9 11/12] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC

Philipp Zabel <[email protected]>
Newsgroups org.infradead.lists.linux-mediatek,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Fr, 2026-07-17 at 08:54 +0200, Christian Marangi wrote:
> Add PCS driver for Airoha AN7581 SoC for Ethernet/PON/PCIe/USB SERDES
> and permit usage of external PHY or connected SFP cage. Supported modes
> are USXGMII, 10G-BASER, 2500BASE-X, 1000BASE-X and SGMII.
> 
> The driver probe and register the various needed registers and register as
> a PCS provider for fwnode usage.
> 
> Signed-off-by: Christian Marangi <[email protected]>
> ---
>  drivers/net/pcs/Kconfig                    |    2 +
>  drivers/net/pcs/Makefile                   |    2 +
>  drivers/net/pcs/airoha/Kconfig             |   12 +
>  drivers/net/pcs/airoha/Makefile            |    7 +
>  drivers/net/pcs/airoha/pcs-airoha-common.c | 1324 +++++++++++++
>  drivers/net/pcs/airoha/pcs-airoha.h        | 1311 ++++++++++++
>  drivers/net/pcs/airoha/pcs-an7581.c        | 2093 ++++++++++++++++++++
>  7 files changed, 4751 insertions(+)
>  create mode 100644 drivers/net/pcs/airoha/Kconfig
>  create mode 100644 drivers/net/pcs/airoha/Makefile
>  create mode 100644 drivers/net/pcs/airoha/pcs-airoha-common.c
>  create mode 100644 drivers/net/pcs/airoha/pcs-airoha.h
>  create mode 100644 drivers/net/pcs/airoha/pcs-an7581.c
> 
[...]
> diff --git a/drivers/net/pcs/airoha/pcs-airoha-common.c b/drivers/net/pcs/airoha/pcs-airoha-common.c
> new file mode 100644
> index 000000000000..781f89adf3ab
> --- /dev/null
> +++ b/drivers/net/pcs/airoha/pcs-airoha-common.c
> @@ -0,0 +1,1324 @@
[...]
> +static int airoha_pcs_setup_scu(struct airoha_pcs_priv *priv,
> +				int index, phy_interface_t interface)
> +{
> +	const struct airoha_pcs_match_data *data = priv->data;
> +	int ret;
> +
> +	switch (data->port_type) {
> +	case AIROHA_PCS_ETH:
> +		airoha_pcs_setup_scu_eth(priv, interface);
> +		break;
> +	case AIROHA_PCS_PON:
> +		airoha_pcs_setup_scu_pon(priv, interface);
> +		break;
> +	case AIROHA_PCS_PCIE:
> +		airoha_pcs_setup_scu_pcie(priv, index, interface);
> +		break;
> +	case AIROHA_PCS_USB:
> +		break;
> +	}
> +
> +	/* TODO better handle reset from MAC */

What does this mean? There's a "mac" and a "phy" control in rsts.
Should the "mac" reset be handled differently? Or is there a separate
reset line that is controlled by the MAC itself?

> +	ret = reset_control_bulk_assert(ARRAY_SIZE(priv->rsts),
> +					priv->rsts);
> +	if (ret)
> +		return ret;
> +
> +	ret = reset_control_bulk_deassert(ARRAY_SIZE(priv->rsts),
> +					  priv->rsts);
> +	if (ret)
> +		return ret;
> +
> +	return 0;
> +}

regards
Philipp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.