* [PATCH net-next v4 0/2] net: stmmac: add SL2610 ethernet support
@ 2026-12-02 15:15 Jisheng Zhang
2026-12-02 15:15 ` [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang
2026-12-02 15:15 ` [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang
0 siblings, 2 replies; 6+ messages in thread
From: Jisheng Zhang @ 2026-12-02 15:15 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: netdev, devicetree, linux-kernel, linux-arm-kernel
This series add Synaptics SL2610 ethernet support.
since v3:
- use test_and_set_bit() etc. instead of link list + mutex for mdio owner
since v2:
- remove sl2610 clk IDs, reset IDs dependency from dt-binding's example
- add mdio owner validation per Andrew suggestion
since v1:
- switch to one MDIO bus solution instead of MDIO demultiplexer
- remove patches to add eth nodes to dtsi and enable eth for rdk. They
will be sent separately
- add constraints for interrupts, clocks, resets and so on
- update dt-bindings example
- use .set_phy_intf_sel()
- use PHY_INTF_SEL_RGMII and PHY_INTF_SEL_RMII
A consolidated MAINTAINERS update will follow once the subsystem series
have merged, avoiding overlapping changes to the Synaptics entry.
Jisheng Zhang (2):
dt-bindings: net: Add Synaptics SL2610 DWMAC
net: stmmac: Add glue layer for Synaptics SL2610 SoC
.../devicetree/bindings/net/snps,dwmac.yaml | 1 +
.../bindings/net/syna,sl2610-dwmac.yaml | 124 +++++++++++++
drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-syna.c | 167 ++++++++++++++++++
5 files changed, 304 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml
create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
--
2.55.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC 2026-12-02 15:15 [PATCH net-next v4 0/2] net: stmmac: add SL2610 ethernet support Jisheng Zhang @ 2026-12-02 15:15 ` Jisheng Zhang 2026-12-03 15:37 ` sashiko-bot 2026-12-04 13:23 ` Rob Herring 2026-12-02 15:15 ` [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang 1 sibling, 2 replies; 6+ messages in thread From: Jisheng Zhang @ 2026-12-02 15:15 UTC (permalink / raw) To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue Cc: netdev, devicetree, linux-kernel, linux-arm-kernel Describe the Synaptics SL2610 integration of DWMAC 5.20. The PHY interface mode and the routing of the shared MDC/MDIO signals are controlled through system-controller registers. Add the compatible to the common DWMAC schema and show a PHY connected to MAC1's MDIO bus in the example. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> --- .../devicetree/bindings/net/snps,dwmac.yaml | 1 + .../bindings/net/syna,sl2610-dwmac.yaml | 124 ++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 69d88a9b1925..619c389d8838 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -120,6 +120,7 @@ properties: - sophgo,sg2044-dwmac - starfive,jh7100-dwmac - starfive,jh7110-dwmac + - syna,sl2610-dwmac - tesla,fsd-ethqos - thead,th1520-gmac - ultrarisc,dp1000-gmac diff --git a/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml new file mode 100644 index 000000000000..37f91fdfddb1 --- /dev/null +++ b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml @@ -0,0 +1,124 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/syna,sl2610-dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Synaptics SL2610 DesignWare Ethernet MAC + +maintainers: + - Jisheng Zhang <jszhang@kernel.org> + +description: | + The Ethernet controllers share one external MDC/MDIO interface. Only + one controller may contain an enabled MDIO child node, describing all + devices on the shared bus. Other controllers reference those devices + through phy-handle and omit or disable their MDIO child nodes. + +select: + properties: + compatible: + contains: + const: syna,sl2610-dwmac + required: + - compatible + +allOf: + - $ref: snps,dwmac.yaml# + +properties: + compatible: + items: + - const: syna,sl2610-dwmac + - const: snps,dwmac-5.20 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-names: + const: macirq + + clocks: + items: + - description: MAC clock + - description: Peripheral register interface clock + - description: PTP reference clock + + clock-names: + items: + - const: stmmaceth + - const: pclk + - const: ptp_ref + + resets: + maxItems: 1 + + reset-names: + const: stmmaceth + + power-domains: + maxItems: 1 + + syna,syscon: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: Phandle to the SL2610 system controller. + - description: Offset of the Ethernet interface control register. + description: + Phandle and register offset used to configure the Ethernet PHY + interface mode. + + phy-mode: + enum: + - rmii + - rgmii + - rgmii-id + - rgmii-rxid + - rgmii-txid + +required: + - compatible + - clocks + - clock-names + - syna,syscon + - phy-mode + +dependencies: + resets: [reset-names] + reset-names: [resets] + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + ethernet@f7a06000 { + compatible = "syna,sl2610-dwmac", "snps,dwmac-5.20"; + reg = <0xf7a06000 0x2000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "macirq"; + clocks = <&clk 13>, <&clk 45>, <&clk 15>; + clock-names = "stmmaceth", "pclk", "ptp_ref"; + resets = <&rst 6>; + reset-names = "stmmaceth"; + phy-mode = "rgmii-id"; + syna,syscon = <&chip 0xa3c>; + phy-handle = <&phy1>; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + phy1: ethernet-phy@2 { + reg = <2>; + }; + }; + }; +... -- 2.55.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC 2026-12-02 15:15 ` [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang @ 2026-12-03 15:37 ` sashiko-bot 2026-12-04 13:23 ` Rob Herring 1 sibling, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-12-03 15:37 UTC (permalink / raw) To: Jisheng Zhang; +Cc: devicetree, robh, conor+dt Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: net: non-canonical property order in syna,sl2610-dwmac.yaml -- commit 0cc8894344bffab71c7f1c74f0470990193e499a Author: Jisheng Zhang <jszhang@kernel.org> dt-bindings: net: Add Synaptics SL2610 DWMAC This commit adds a Device Tree binding schema for the Synaptics SL2610 DesignWare Ethernet MAC and registers its compatible string in the common DWMAC binding. > diff --git a/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml > new file mode 100644 > index 0000000000000..37f91fdfddb1e > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml > @@ -0,0 +1,124 @@ [ ... ] > +properties: > + compatible: > + items: > + - const: syna,sl2610-dwmac > + - const: snps,dwmac-5.20 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-names: > + const: macirq > + > + clocks: > + items: > + - description: MAC clock > + - description: Peripheral register interface clock > + - description: PTP reference clock > + > + clock-names: > + items: > + - const: stmmaceth > + - const: pclk > + - const: ptp_ref > + > + resets: > + maxItems: 1 > + > + reset-names: > + const: stmmaceth > + > + power-domains: > + maxItems: 1 > + > + syna,syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + - items: > + - description: Phandle to the SL2610 system controller. > + - description: Offset of the Ethernet interface control register. > + description: > + Phandle and register offset used to configure the Ethernet PHY > + interface mode. > + > + phy-mode: > + enum: > + - rmii > + - rgmii > + - rgmii-id > + - rgmii-rxid > + - rgmii-txid > + > +required: > + - compatible > + - clocks > + - clock-names > + - syna,syscon > + - phy-mode [ ... ] > +examples: > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/interrupt-controller/irq.h> > + > + ethernet@f7a06000 { > + compatible = "syna,sl2610-dwmac", "snps,dwmac-5.20"; > + reg = <0xf7a06000 0x2000>; > + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "macirq"; > + clocks = <&clk 13>, <&clk 45>, <&clk 15>; > + clock-names = "stmmaceth", "pclk", "ptp_ref"; > + resets = <&rst 6>; > + reset-names = "stmmaceth"; > + phy-mode = "rgmii-id"; > + syna,syscon = <&chip 0xa3c>; > + phy-handle = <&phy1>; [Severity: Low] In both properties and the example node, interrupts and interrupt-names are listed before clocks and clock-names, whereas the canonical DT binding order places clocks and clock-names before interrupts and interrupt-names. In addition, the vendor-specific syna,syscon property is placed before the standard phy-mode property in properties and required, and before phy-handle in the example node. -- Sashiko AI review · https://sashiko.dev/#/patchset/20261202151531.28480-1-jszhang@kernel.org?part=1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC 2026-12-02 15:15 ` [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang 2026-12-03 15:37 ` sashiko-bot @ 2026-12-04 13:23 ` Rob Herring 1 sibling, 0 replies; 6+ messages in thread From: Rob Herring @ 2026-12-04 13:23 UTC (permalink / raw) To: Jisheng Zhang Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev, devicetree, linux-kernel, linux-arm-kernel On Wed, Dec 02, 2026 at 11:15:30PM +0800, Jisheng Zhang wrote: > Describe the Synaptics SL2610 integration of DWMAC 5.20. The PHY > interface mode and the routing of the shared MDC/MDIO signals are > controlled through system-controller registers. > > Add the compatible to the common DWMAC schema and show a PHY connected > to MAC1's MDIO bus in the example. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > .../devicetree/bindings/net/snps,dwmac.yaml | 1 + > .../bindings/net/syna,sl2610-dwmac.yaml | 124 ++++++++++++++++++ > 2 files changed, 125 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml Please fix sashiko issues. > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > index 69d88a9b1925..619c389d8838 100644 > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > @@ -120,6 +120,7 @@ properties: > - sophgo,sg2044-dwmac > - starfive,jh7100-dwmac > - starfive,jh7110-dwmac > + - syna,sl2610-dwmac > - tesla,fsd-ethqos > - thead,th1520-gmac > - ultrarisc,dp1000-gmac > diff --git a/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml > new file mode 100644 > index 000000000000..37f91fdfddb1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/syna,sl2610-dwmac.yaml > @@ -0,0 +1,124 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/syna,sl2610-dwmac.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Synaptics SL2610 DesignWare Ethernet MAC > + > +maintainers: > + - Jisheng Zhang <jszhang@kernel.org> > + > +description: | Don't need '|'. > + The Ethernet controllers share one external MDC/MDIO interface. Only > + one controller may contain an enabled MDIO child node, describing all > + devices on the shared bus. Other controllers reference those devices > + through phy-handle and omit or disable their MDIO child nodes. > + > +select: > + properties: > + compatible: > + contains: > + const: syna,sl2610-dwmac > + required: > + - compatible > + > +allOf: > + - $ref: snps,dwmac.yaml# > + > +properties: > + compatible: > + items: > + - const: syna,sl2610-dwmac > + - const: snps,dwmac-5.20 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-names: > + const: macirq > + > + clocks: > + items: > + - description: MAC clock > + - description: Peripheral register interface clock > + - description: PTP reference clock > + > + clock-names: > + items: > + - const: stmmaceth > + - const: pclk > + - const: ptp_ref > + > + resets: > + maxItems: 1 > + > + reset-names: > + const: stmmaceth > + > + power-domains: > + maxItems: 1 > + > + syna,syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + - items: > + - description: Phandle to the SL2610 system controller. > + - description: Offset of the Ethernet interface control register. > + description: > + Phandle and register offset used to configure the Ethernet PHY > + interface mode. > + > + phy-mode: > + enum: > + - rmii > + - rgmii > + - rgmii-id > + - rgmii-rxid > + - rgmii-txid > + > +required: > + - compatible > + - clocks > + - clock-names > + - syna,syscon > + - phy-mode > + > +dependencies: > + resets: [reset-names] It's a bit odd the reset is optional. Either the SoC has resets or it doesn't. > + reset-names: [resets] The core schemas cover this dependency. Rob ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC 2026-12-02 15:15 [PATCH net-next v4 0/2] net: stmmac: add SL2610 ethernet support Jisheng Zhang 2026-12-02 15:15 ` [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang @ 2026-12-02 15:15 ` Jisheng Zhang 2026-12-03 15:37 ` sashiko-bot 1 sibling, 1 reply; 6+ messages in thread From: Jisheng Zhang @ 2026-12-02 15:15 UTC (permalink / raw) To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sebastian Hesselbarth, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue Cc: netdev, devicetree, linux-kernel, linux-arm-kernel Add dwmac glue driver to support the DesignWare-based GMAC controllers in the Synaptics SL2610 SoC. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + .../net/ethernet/stmicro/stmmac/dwmac-syna.c | 167 ++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index c6559e749c0c..79ffebcaba0e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -310,6 +310,17 @@ config DWMAC_SUN55I stmmac device driver. This driver is used for A523/T527 GMAC200 ethernet controller. +config DWMAC_SYNA + tristate "Synaptics SL2610 DWMAC support" + depends on OF && HAS_DMA && (ARCH_BERLIN || COMPILE_TEST) + select MFD_SYSCON + help + Support for the Synaptics SL2610 DesignWare Ethernet MAC glue. + This configures the PHY interface through the system controller. + + To compile this driver as a module, choose M here. The module + will be called dwmac-syna. + config DWMAC_THEAD tristate "T-HEAD dwmac support" depends on OF && (ARCH_THEAD || COMPILE_TEST) diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index b16a456b730e..d132353e9403 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o obj-$(CONFIG_DWMAC_SUN8I) += dwmac-sun8i.o obj-$(CONFIG_DWMAC_SUN55I) += dwmac-sun55i.o +obj-$(CONFIG_DWMAC_SYNA) += dwmac-syna.o obj-$(CONFIG_DWMAC_THEAD) += dwmac-thead.o obj-$(CONFIG_DWMAC_ULTRARISC) += dwmac-ultrarisc.o obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c new file mode 100644 index 000000000000..899b12842bff --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Synaptics DWMAC platform driver + * + * Copyright (C) 2026 Synaptics Incorporated + * Author: Jisheng Zhang <jszhang@kernel.org> + * + */ + +#include <linux/bitfield.h> +#include <linux/bitops.h> +#include <linux/module.h> +#include <linux/mfd/syscon.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_net.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +#include "stmmac_platform.h" + +#define CTL_PHY_INTF_SEL GENMASK(4, 1) +#define CTL_PHY_INTF_RGMII FIELD_PREP(CTL_PHY_INTF_SEL, PHY_INTF_SEL_RGMII) +#define CTL_PHY_INTF_RMII FIELD_PREP(CTL_PHY_INTF_SEL, PHY_INTF_SEL_RMII) + +#define SYNA_RGMII0_CTRL 0xa18 +#define SYNA_RGMII1_CTRL 0xa3c +#define SYNA_TW_PORT_CTRL 0xa04 +#define SYNA_MDIO_MASTER_SEL BIT(4) + +struct syna_dwmac { + struct plat_stmmacenet_data *plat; + struct regmap *regmap; + u32 rgmii_ctl; + struct device *dev; +}; + +/* Only one MAC can provide the shared external MDIO bus. */ +static unsigned long syna_mdio_claimed; + +static void syna_dwmac_release_mdio(void *data) +{ + clear_bit(0, &syna_mdio_claimed); +} + +static int syna_dwmac_claim_mdio(struct syna_dwmac *dwmac) +{ + if (!dwmac->plat->mdio_node || + !of_device_is_available(dwmac->plat->mdio_node)) + return 0; + + if (test_and_set_bit(0, &syna_mdio_claimed)) + return dev_err_probe(dwmac->dev, -EINVAL, + "Shared MDIO bus already claimed\n"); + + return devm_add_action_or_reset(dwmac->dev, syna_dwmac_release_mdio, NULL); +} + +static int syna_dwmac_set_phy_intf_sel(void *bsp_priv, u8 phy_intf_sel) +{ + struct syna_dwmac *dwmac = bsp_priv; + u32 phyif; + + switch (phy_intf_sel) { + case PHY_INTF_SEL_RMII: + phyif = CTL_PHY_INTF_RMII; + break; + case PHY_INTF_SEL_RGMII: + phyif = CTL_PHY_INTF_RGMII; + break; + default: + dev_err(dwmac->dev, "unsupported phy interface %s\n", + phy_modes(phy_intf_sel)); + return -EINVAL; + } + + return regmap_update_bits(dwmac->regmap, dwmac->rgmii_ctl, CTL_PHY_INTF_SEL, phyif); +} + +static int syna_dwmac_init(struct device *dev, void *priv) +{ + struct syna_dwmac *dwmac = priv; + u32 mdio_sel; + + /* Only the MAC providing the shared MDIO bus selects its master. */ + if (!dwmac->plat->mdio_node || + !of_device_is_available(dwmac->plat->mdio_node)) + return 0; + + /* Interface-control offsets identify the hardware MAC, unlike aliases. */ + switch (dwmac->rgmii_ctl) { + case SYNA_RGMII0_CTRL: + mdio_sel = 0; + break; + case SYNA_RGMII1_CTRL: + mdio_sel = SYNA_MDIO_MASTER_SEL; + break; + default: + return dev_err_probe(dev, -EINVAL, + "Unknown Ethernet interface register %#x\n", + dwmac->rgmii_ctl); + } + + return regmap_update_bits(dwmac->regmap, SYNA_TW_PORT_CTRL, + SYNA_MDIO_MASTER_SEL, mdio_sel); +} + +static int syna_dwmac_probe(struct platform_device *pdev) +{ + struct stmmac_resources stmmac_res; + struct plat_stmmacenet_data *plat; + struct syna_dwmac *dwmac; + int ret; + + ret = stmmac_get_platform_resources(pdev, &stmmac_res); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to get resources\n"); + + plat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat)) + return dev_err_probe(&pdev->dev, PTR_ERR(plat), + "dt configuration failed\n"); + + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); + if (!dwmac) + return -ENOMEM; + + dwmac->regmap = syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node, + "syna,syscon", 1, + &dwmac->rgmii_ctl); + if (IS_ERR(dwmac->regmap)) + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->regmap), + "Failed to get syscon regmap\n"); + + dwmac->dev = &pdev->dev; + dwmac->plat = plat; + plat->bsp_priv = dwmac; + plat->init = syna_dwmac_init; + plat->set_phy_intf_sel = syna_dwmac_set_phy_intf_sel; + + ret = syna_dwmac_claim_mdio(dwmac); + if (ret) + return ret; + + return devm_stmmac_pltfr_probe(pdev, plat, &stmmac_res); +} + +static const struct of_device_id syna_dwmac_match[] = { + { .compatible = "syna,sl2610-dwmac" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, syna_dwmac_match); + +static struct platform_driver syna_dwmac_driver = { + .probe = syna_dwmac_probe, + .driver = { + .name = "syna-dwmac", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = syna_dwmac_match, + }, +}; +module_platform_driver(syna_dwmac_driver); + +MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>"); +MODULE_DESCRIPTION("Synaptics DWMAC platform driver"); +MODULE_LICENSE("GPL"); -- 2.55.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC 2026-12-02 15:15 ` [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang @ 2026-12-03 15:37 ` sashiko-bot 0 siblings, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-12-03 15:37 UTC (permalink / raw) To: Jisheng Zhang; +Cc: devicetree, robh, conor+dt Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] net: stmmac: wrong enum passed to phy_modes() in syna_dwmac_set_phy_intf_sel() -- commit 63887fb668b097abce99c504daf5e0a59b68bd54 Author: Jisheng Zhang <jszhang@kernel.org> net: stmmac: Add glue layer for Synaptics SL2610 SoC This commit adds a platform glue driver for the DesignWare Ethernet MAC controllers in the Synaptics SL2610 SoC. > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c > new file mode 100644 > index 0000000000000..899b12842bffe > --- /dev/null > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c [ ... ] > +static int syna_dwmac_set_phy_intf_sel(void *bsp_priv, u8 phy_intf_sel) > +{ > + struct syna_dwmac *dwmac = bsp_priv; > + u32 phyif; > + > + switch (phy_intf_sel) { > + case PHY_INTF_SEL_RMII: > + phyif = CTL_PHY_INTF_RMII; > + break; > + case PHY_INTF_SEL_RGMII: > + phyif = CTL_PHY_INTF_RGMII; > + break; > + default: > + dev_err(dwmac->dev, "unsupported phy interface %s\n", > + phy_modes(phy_intf_sel)); > + return -EINVAL; > + } [Severity: Low] Does phy_modes(phy_intf_sel) log the wrong PHY interface name here? phy_intf_sel is a DWMAC PHY_INTF_SEL_* constant rather than a phy_interface_t enum value expected by phy_modes(), so an unsupported interface logs an empty or mismatched mode string (for example, PHY_INTF_SEL_SGMII logs "mii"). Since the caller stmmac_prereset_configure() already logs an error with phy_modes(interface) when set_phy_intf_sel() returns -EINVAL, this dev_err() could be dropped or passed dwmac->plat->phy_interface. -- Sashiko AI review · https://sashiko.dev/#/patchset/20261202151531.28480-1-jszhang@kernel.org?part=2 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-12-04 13:23 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-12-02 15:15 [PATCH net-next v4 0/2] net: stmmac: add SL2610 ethernet support Jisheng Zhang 2026-12-02 15:15 ` [PATCH net-next v4 1/2] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang 2026-12-03 15:37 ` sashiko-bot 2026-12-04 13:23 ` Rob Herring 2026-12-02 15:15 ` [PATCH net-next v4 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang 2026-12-03 15:37 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox