[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43f20230-1e13-4952-8069-bbcb9d966a0f@bootlin.com>
Date: Sat, 25 Oct 2025 18:43:12 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Daniel Golle <daniel@...rotopia.org>, Hauke Mehrtens <hauke@...ke-m.de>,
Andrew Lunn <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Simon Horman <horms@...nel.org>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Andreas Schirm <andreas.schirm@...mens.com>,
Lukas Stockmann <lukas.stockmann@...mens.com>,
Alexander Sverdlin <alexander.sverdlin@...mens.com>,
Peter Christen <peter.christen@...mens.com>,
Avinash Jayaraman <ajayaraman@...linear.com>, Bing tao Xu
<bxu@...linear.com>, Liang Xu <lxu@...linear.com>,
Juraj Povazanec <jpovazanec@...linear.com>,
"Fanni (Fang-Yi) Chan" <fchan@...linear.com>,
"Benny (Ying-Tsan) Weng" <yweng@...linear.com>,
"Livia M. Rosu" <lrosu@...linear.com>, John Crispin <john@...ozen.org>
Subject: Re: [PATCH net-next v2 13/13] net: dsa: add driver for MaxLinear
GSW1xx switch family
Hi Daniel,
On 25/10/2025 16:51, Daniel Golle wrote:
> Add driver for the MaxLinear GSW1xx family of Ethernet switch ICs which
> are based on the same IP as the Lantiq/Intel GSWIP found in the Lantiq VR9
> and Intel GRX MIPS router SoCs. The main difference is that instead of
> using memory-mapped I/O to communicate with the host CPU these ICs are
> connected via MDIO (or SPI, which isn't supported by this driver).
> Implement the regmap API to access the switch registers over MDIO to allow
> reusing lantiq_gswip_common for all core functionality.
>
> The GSW1xx also comes with a SerDes port capable of 1000Base-X, SGMII and
> 2500Base-X, which can either be used to connect an external PHY or SFP
> cage, or as the CPU port. Support for the SerDes interface is implemented
> in this driver using the phylink_pcs interface.
>
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
[...]
> +static int gsw1xx_sgmii_pcs_config(struct phylink_pcs *pcs,
> + unsigned int neg_mode,
> + phy_interface_t interface,
> + const unsigned long *advertising,
> + bool permit_pause_to_mac)
> +{
> + struct gsw1xx_priv *priv = sgmii_pcs_to_gsw1xx(pcs);
> + bool sgmii_mac_mode = dsa_is_user_port(priv->gswip.ds, GSW1XX_SGMII_PORT);
> + u16 txaneg, anegctl, val, nco_ctrl;
> + int ret;
> +
> + /* Assert and deassert SGMII shell reset */
> + ret = regmap_set_bits(priv->shell, GSW1XX_SHELL_RST_REQ,
> + GSW1XX_RST_REQ_SGMII_SHELL);
> + if (ret < 0)
> + return ret;
> +
> + ret = regmap_clear_bits(priv->shell, GSW1XX_SHELL_RST_REQ,
> + GSW1XX_RST_REQ_SGMII_SHELL);
> + if (ret < 0)
> + return ret;
> +
> + /* Hardware Bringup FSM Enable */
> + ret = regmap_write(priv->sgmii, GSW1XX_SGMII_PHY_HWBU_CTRL,
> + GSW1XX_SGMII_PHY_HWBU_CTRL_EN_HWBU_FSM |
> + GSW1XX_SGMII_PHY_HWBU_CTRL_HW_FSM_EN);
> + if (ret < 0)
> + return ret;
> +
> + /* Configure SGMII PHY Receiver */
> + val = FIELD_PREP(GSW1XX_SGMII_PHY_RX0_CFG2_EQ,
> + GSW1XX_SGMII_PHY_RX0_CFG2_EQ_DEF) |
> + GSW1XX_SGMII_PHY_RX0_CFG2_LOS_EN |
> + GSW1XX_SGMII_PHY_RX0_CFG2_TERM_EN |
> + FIELD_PREP(GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT,
> + GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT_DEF);
> +
> + // if (!priv->dts.sgmii_rx_invert)
> + val |= GSW1XX_SGMII_PHY_RX0_CFG2_INVERT;
There's a leftover commented-out line here :)
Maxime
Powered by blists - more mailing lists