100 Commits
Author SHA1 Message Date
Izabela Bakollari cad78d0040 new configs in net drivers
Upstream status: RHEL only

JIRA: https://issues.redhat.com/browse/RHEL-100501

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-05-05 16:32:51 +02:00
Izabela Bakollari ce0dee8e15 dt-bindings: net: nxp,s32-dwmac: Use the GPR syscon
JIRA: https://issues.redhat.com/browse/RHEL-100501

commit 0d958803954339acbde220865c6c4241d2abf406
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Fri Jan 30 16:19:47 2026 +0300

    dt-bindings: net: nxp,s32-dwmac: Use the GPR syscon

    The S32 chipsets have a GPR region which has a miscellaneous registers
    including the GMAC_0_CTRL_STS register.  Originally, this code accessed
    that register in a sort of ad-hoc way, but it's cleaner to use a
    syscon interface to access these registers.

    We still need to maintain the old method of accessing the GMAC register
    but using a syscon will let us access other registers more cleanly.

    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
    Link: https://patch.msgid.link/3b75e950b2f8faecd1a9fa757e7eb7b42ace838f.1769764941.git.dan.carpenter@linaro.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-05-05 16:32:36 +02:00
Izabela Bakollari ed0d5110e0 net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII
JIRA: https://issues.redhat.com/browse/RHEL-100501

commit b0eeeb1b70c0b2e1118fec7c28ffb0e21fe98688
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Fri Jan 30 16:19:41 2026 +0300

    net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII

    On the s32 chipsets the GMAC_0_CTRL_STS register is in GPR region.
    Originally, accessing this register was done in a sort of ad-hoc way,
    but we want to use the syscon interface to do it.

    This is a little bit ugly because we have to maintain backwards
    compatibility to the old device trees so we have to support both ways
    to access this register.

    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reviewed-by: Jan Petrous (OSS) <jan.petrous@oss.nxp.com>
    Link: https://patch.msgid.link/b6b60d03344d070b2b4db7f0f00527f166e594e0.1769764941.git.dan.carpenter@linaro.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-05-05 16:32:17 +02:00
Izabela Bakollari 2f75103a48 net: stmmac: Fix PTP ref clock for Tegra234
JIRA: https://issues.redhat.com/browse/RHEL-100501

commit 1345e9f4e3f3bc7d8a0a2138ae29e205a857a555
Author: Jon Hunter <jonathanh@nvidia.com>
Date:   Wed Apr 1 11:29:39 2026 +0100

    net: stmmac: Fix PTP ref clock for Tegra234

    Since commit 030ce919e114 ("net: stmmac: make sure that ptp_rate is not
    0 before configuring timestamping") was added the following error is
    observed on Tegra234:

     ERR KERN tegra-mgbe 6800000.ethernet eth0: Invalid PTP clock rate
     WARNING KERN tegra-mgbe 6800000.ethernet eth0: PTP init failed

    It turns out that the Tegra234 device-tree binding defines the PTP ref
    clock name as 'ptp-ref' and not 'ptp_ref' and the above commit now
    exposes this and that the PTP clock is not configured correctly.

    In order to update device-tree to use the correct 'ptp_ref' name, update
    the Tegra MGBE driver to use 'ptp_ref' by default and fallback to using
    'ptp-ref' if this clock name is present.

    Fixes: d8ca113724 ("net: stmmac: tegra: Add MGBE support")
    Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260401102941.17466-2-jonathanh@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-05-05 16:31:24 +02:00
Izabela Bakollari 076d35770b dt-bindings: net: pcs: renesas,rzn1-miic: Add RZ/T2H and RZ/N2H support
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 8c01cc2382bc351672c8eb946c16f567cfffef60
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Date:   Wed Sep 10 21:41:22 2025 +0100

    dt-bindings: net: pcs: renesas,rzn1-miic: Add RZ/T2H and RZ/N2H support

    Add device tree binding support for RZ/T2H and RZ/N2H SoCs to the
    existing RZ/N1 MIIC converter binding. These SoCs share similar MIIC
    functionality but have architectural differences that require schema
    updates.

    Add new compatible strings "renesas,r9a09g077-miic" for RZ/T2H and
    "renesas,r9a09g087-miic" for RZ/N2H, with the latter falling back to
    the RZ/T2H variant. The new SoCs require reset support with two reset
    lines for converter register reset and converter reset, which are not
    present on RZ/N1.

    Update port configurations to accommodate the different architectures.
    RZ/N1 supports 5 ports numbered 1-5 with complex input mappings
    covering indices 0-13, while RZ/T2H and RZ/N2H support 4 ports
    numbered 0-3 with simplified input mappings covering indices 0-8.
    Extend the switch port configuration property to support value 0 for
    the new SoCs.

    Add a new dt-bindings header file with media interface connection
    matrix constants that map GMAC, ESC, and ETHSW ports to numeric
    identifiers for use with RZ/T2H and RZ/N2H device trees.

    Update DT schema validation to ensure proper port numbering and input
    mappings per SoC variant.

    Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
    Link: https://patch.msgid.link/20250910204132.319975-2-prabhakar.mahadev-lad.rj@bp.renesas.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:48 +02:00
Izabela Bakollari 7b78495eeb net: stmmac: add stmmac_mac_irq_modify()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 442a8c68f083f267c0f52526f1cd16988837ec0f
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 23 10:46:20 2025 +0100

    net: stmmac: add stmmac_mac_irq_modify()

    Add a function to allow interrupts to be enabled and disabled in a
    core independent manner.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vBrtk-0000000BMYm-3CV5@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:47 +02:00
Izabela Bakollari cc0a28aa55 net: ethtool: mm: extract stmmac verification logic into common library
Conflicts: Only the stmmac driver changes were applies, as the rest of
the patch is aalready present in RHEl

JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 9ff2aa4206eff40a202e425f232036bc84ad4c0e
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Mon Mar 17 23:07:30 2025 -0400

    net: ethtool: mm: extract stmmac verification logic into common library

    It appears that stmmac is not the only hardware which requires a
    software-driven verification state machine for the MAC Merge layer.

    While on the one hand it's good to encourage hardware implementations,
    on the other hand it's quite difficult to tolerate multiple drivers
    implementing independently fairly non-trivial logic.

    Extract the hardware-independent logic from stmmac into library code and
    put it in ethtool. Name the state structure "mmsv" for MAC Merge
    Software Verification. Let this expose an operations structure for
    executing the hardware stuff: sync hardware with the tx_active boolean
    (result of verification process), enable/disable the pMAC, send mPackets,
    notify library of external events (reception of mPackets), as well as
    link state changes.

    Note that it is assumed that the external events are received in hardirq
    context. If they are not, it is probably a good idea to disable hardirqs
    when calling ethtool_mmsv_event_handle(), because the library does not
    do so.

    Also, the MM software verification process has no business with the
    tx_min_frag_size, that is all the driver's to handle.

    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Co-developed-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
    Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
    Tested-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
    Tested-by: Furong Xu <0x1207@gmail.com>
    Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:47 +02:00
Izabela Bakollari 2a6c3bc279 net: stmmac: Fix VLAN 0 deletion in vlan_del_hw_rx_fltr()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d9db25723677c3741a0cf3643f7f7429fc983921
Author: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Date:   Thu Nov 13 11:27:20 2025 +0000

    net: stmmac: Fix VLAN 0 deletion in vlan_del_hw_rx_fltr()

    When the "rx-vlan-filter" feature is enabled on a network device, the 8021q
    module automatically adds a VLAN 0 hardware filter when the device is
    brought administratively up.

    For stmmac, this causes vlan_add_hw_rx_fltr() to create a new entry for
    VID 0 in the mac_device_info->vlan_filter array, in the following format:

        VLAN_TAG_DATA_ETV | VLAN_TAG_DATA_VEN | vid

    Here, VLAN_TAG_DATA_VEN indicates that the hardware filter is enabled for
    that VID.

    However, on the delete path, vlan_del_hw_rx_fltr() searches the vlan_filter
    array by VID only, without verifying whether a VLAN entry is enabled. As a
    result, when the 8021q module attempts to remove VLAN 0, the function may
    mistakenly match a zero-initialized slot rather than the actual VLAN 0
    entry, causing incorrect deletions and leaving stale entries in the
    hardware table.

    Fix this by verifying that the VLAN entry's enable bit (VLAN_TAG_DATA_VEN)
    is set before matching and deleting by VID. This ensures only active VLAN
    entries are removed and avoids leaving stale entries in the VLAN filter
    table, particularly for VLAN ID 0.

    Fixes: ed64639bc1 ("net: stmmac: Add support for VLAN Rx filtering")
    Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/20251113112721.70500-2-ovidiu.panait.rb@renesas.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:47 +02:00
Izabela Bakollari 327094819f net: stmmac: qcom-ethqos: remove mac_base
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d414ed34a8616bf4c1bcbec9bf67aff88a3b0c86
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Jan 28 10:52:29 2026 +0000

    net: stmmac: qcom-ethqos: remove mac_base

    In commit 9b443e58a896 ("net: stmmac: qcom-ethqos: remove MAC_CTRL_REG
    modification"), ethqos->mac_base is only written, never read. Let's
    remove it.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vl39x-00000006uvc-0A3S@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:47 +02:00
Izabela Bakollari 5524621fb0 net: stmmac: fix stm32 (and potentially others) resume regression
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit dbbec8c5a79f4c7aa8d07da8c0b5a34d76c50699
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Jan 30 20:04:57 2026 +0000

    net: stmmac: fix stm32 (and potentially others) resume regression

    Marek reported that suspending stm32 causes the following errors when
    the interface is administratively down:

            $ echo devices > /sys/power/pm_test
            $ echo mem > /sys/power/state
            ...
            ck_ker_eth2stp already disabled
            ...
            ck_ker_eth2stp already unprepared
            ...

    On suspend, stm32 starts the eth2stp clock in its suspend method, and
    stops it in the resume method. This is because the blamed commit omits
    the call to the platform glue ->suspend() method, but does make the
    call to the platform glue ->resume() method.

    This problem affects all other converted drivers as well - e.g. looking
    at the PCIe drivers, pci_save_state() will not be called, but
    pci_restore_state() will be. Similar issues affect all other drivers.

    Fix this by always calling the ->suspend() method, even when the network
    interface is down. This fixes all the conversions to the platform glue
    ->suspend() and ->resume() methods.

    Link: https://lore.kernel.org/r/20260114081809.12758-1-marex@nabladev.com
    Fixes: 07bbbfe7addf ("net: stmmac: add suspend()/resume() platform ops")
    Reported-by: Marek Vasut <marex@nabladev.com>
    Tested-by: Marek Vasut <marex@nabladev.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vlujh-00000007Hkw-2p6r@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:47 +02:00
Izabela Bakollari d3a9d0c428 net: stmmac: dwmac-sophgo: Add phy interface filter
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit db37c6e510deabc9b0ee27c08f1c5aaa19f2e8ef
Author: Inochi Amaoto <inochiama@gmail.com>
Date:   Fri Nov 14 08:38:05 2025 +0800

    net: stmmac: dwmac-sophgo: Add phy interface filter

    As the SG2042 has an internal rx delay, the delay should be removed
    when initializing the mac, otherwise the phy will be misconfigurated.

    Fixes: 543009e2d4cd ("net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC")
    Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
    Tested-by: Han Gao <rabenda.cn@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20251114003805.494387-4-inochiama@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:46 +02:00
Izabela Bakollari b324e3dd4a net: pcs: pcs-mtk-lynxi: report in-band capability for 2500Base-X
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit e8ca461f7d19464b47c64fe4cf2f83162421bcc0
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Wed Jan 21 02:23:17 2026 +0000

    net: pcs: pcs-mtk-lynxi: report in-band capability for 2500Base-X

    It turns out that 2500Base-X actually works fine with in-band status on
    MediaTek's LynxI PCS -- I wrongly concluded it didn't because it is
    broken in all the copper SFP modules and GPON sticks I used for testing.

    Hence report LINK_INBAND_ENABLE also for 2500Base-X mode.

    This reverts most of commit a003c38d9bbb ("net: pcs: pcs-mtk-lynxi:
    correctly report in-band status capabilities").

    The removal of the QSGMII interface mode was correct and is left
    untouched.

    Link: https://github.com/openwrt/openwrt/issues/21436
    Fixes: a003c38d9bbb ("net: pcs: pcs-mtk-lynxi: correctly report in-band status capabilities")
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>
    Link: https://patch.msgid.link/b1cf26157b63fee838be09ae810497fb22fd8104.1768961746.git.daniel@makrotopia.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:46 +02:00
Izabela Bakollari 8ada866cf4 net: stmmac: Disable EEE RX clock stop when VLAN is enabled
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c171e679ee66d7c0e2b58db9531af96797a76bca
Author: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Date:   Thu Nov 13 11:27:21 2025 +0000

    net: stmmac: Disable EEE RX clock stop when VLAN is enabled

    On the Renesas RZ/V2H EVK platform, where the stmmac MAC is connected to a
    Microchip KSZ9131RNXI PHY, creating or deleting VLAN interfaces may fail
    with timeouts:

        # ip link add link end1 name end1.5 type vlan id 5
        15c40000.ethernet end1: Timeout accessing MAC_VLAN_Tag_Filter
        RTNETLINK answers: Device or resource busy

    Disabling EEE at runtime avoids the problem:

        # ethtool --set-eee end1 eee off
        # ip link add link end1 name end1.5 type vlan id 5
        # ip link del end1.5

    The stmmac hardware requires the receive clock to be running when writing
    certain registers, such as those used for MAC address configuration or
    VLAN filtering. However, by default the driver enables Energy Efficient
    Ethernet (EEE) and allows the PHY to stop the receive clock when the link
    is idle. As a result, the RX clock might be stopped when attempting to
    access these registers, leading to timeouts and other issues.

    Commit dd557266cf5fb ("net: stmmac: block PHY RXC clock-stop")
    addressed this issue for most register accesses by wrapping them in
    phylink_rx_clk_stop_block()/phylink_rx_clk_stop_unblock() calls.
    However, VLAN add/delete operations may be invoked with bottom halves
    disabled, where sleeping is not allowed, so using these helpers is not
    possible.

    Therefore, to fix this, disable the RX clock stop feature in the phylink
    configuration if VLAN features are set. This ensures the RX clock remains
    active and register accesses succeed during VLAN operations.

    Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/20251113112721.70500-3-ovidiu.panait.rb@renesas.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:46 +02:00
Izabela Bakollari 15869ac2ac net: stmmac: rk: use PHY_INTF_SEL_x in functions
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 1188741cb5a29187a93ee908274f7034e81486f6
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 13 17:46:50 2025 +0000

    net: stmmac: rk: use PHY_INTF_SEL_x in functions

    Rather than defining one xxx_GMAC_PHY_INTF_SEL_xxx() for each mode,
    define xxx_GMAC_PHY_INTF_SEL() which takes the phy_intf_sel value.
    Pass the appropriate value into these new macros in the set_to_xxx()
    methods.

    No change to produced code on aarch64.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vJbPG-0000000EBqb-2cF2@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:46 +02:00
Izabela Bakollari 5b3d8085fc net: stmmac: rk: use PHY_INTF_SEL_x constants
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 5e37047f745b1a705ba7a1b580b5e5fe2bfd5993
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 13 17:46:45 2025 +0000

    net: stmmac: rk: use PHY_INTF_SEL_x constants

    The values used in the xxx_GMAC_PHY_INTF_SEL_xxx() macros are the
    phy_intf_sel values used for the dwmac core. Use these to define these
    constants.

    No change to produced code on aarch64.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vJbPB-0000000EBqV-27GS@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:45 +02:00
Izabela Bakollari 59559009f9 net: stmmac: rk: convert all bitfields to GRF_FIELD*()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 764ebe423ef946daaa63336b14dc71a942507982
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 13 17:46:40 2025 +0000

    net: stmmac: rk: convert all bitfields to GRF_FIELD*()

    Convert all bitfields to GRF_FIELD() or GRF_FIELD_CONST(), which makes
    the bitfield values more readable, and also allows the aarch64 compiler
    to produce better code.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vJbP6-0000000EBqP-1cmm@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:45 +02:00
Izabela Bakollari 2401d82028 net: stmmac: rk: replace HIWORD_UPDATE() with GRF_FIELD()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit ebb07edf97383e6821e7263d17cf6b591603c47b
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 13 17:46:35 2025 +0000

    net: stmmac: rk: replace HIWORD_UPDATE() with GRF_FIELD()

    Provide GRF_FIELD() which takes the high/low bit numbers of the field
    and field value, generates the mask and passes it to FIELD_PREP_WM16.
    Replace all HIWORD_UPDATE() instances with this.

    No change to produced code on aarch64.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vJbP1-0000000EBqJ-1AjR@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:45 +02:00
Izabela Bakollari 8489510e7e net: pcs: xpcs-plat: fix MODULE_AUTHOR
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 55f943c6af6d12a1b44978f7e87c90f9a9c05806
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Wed Nov 12 23:11:18 2025 +0200

    net: pcs: xpcs-plat: fix MODULE_AUTHOR

    This field needs to hold just Serge's name.

    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Link: https://patch.msgid.link/20251112211118.700875-1-vladimir.oltean@nxp.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:45 +02:00
Izabela Bakollari 8691a52650 net: stmmac: clean up stmmac_reset()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d0af55df5a786cb8f11ca1923cd7dc8b2af01309
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 11:26:39 2025 +0000

    net: stmmac: clean up stmmac_reset()

    stmmac_reset() takes the stmmac_priv and an ioaddr. It has one call
    site, which passes the priv pointer, and dereferences priv for the
    ioaddr.

    stmmac_reset() then checks whether priv is NULL. If it was, the caller
    would have oopsed. Remove the checks for NULL, and move the dereference
    for ioaddr into stmmac_reset().

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vImWF-0000000DrIr-1fmn@rmk-PC.armlinux.org.uk
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:44 +02:00
Izabela Bakollari 19356d52f1 net: stmmac: visconti: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit ccb4ff9f24e23f3599dd13e124f0c7cd29380df3
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:48 2025 +0000

    net: stmmac: visconti: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result and use that to set the
    control register to select the operating mode for the DWMAC core.

    Note that this will allow GMII as well as MII as the phy_intf_sel
    value is the same for both.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIjUe-0000000DquB-3JDY@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:44 +02:00
Izabela Bakollari e2b6a8e1d9 net: stmmac: visconti: use PHY_INTF_SEL_x to select PHY interface
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit bb68e0183e0452d0a1f3af747ec33976a9335ee5
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:43 2025 +0000

    net: stmmac: visconti: use PHY_INTF_SEL_x to select PHY interface

    Convert dwmac-visconti to use the PHY_INTF_SEL_x definitions. The
    original definitions used constant 0, BIT(0) (==1) and BIT(2) (==4)
    to define these, but the values of the bits corresponds with the
    PHY_INTF_SEL_x values, so it is highly likely that these are not
    individual bits, but the PHY_INTF_SEL_x bitfield.

    This removes this incorrect use of BIT().

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIjUZ-0000000Dqu5-2sDI@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:44 +02:00
Izabela Bakollari 33dd8b6136 net: stmmac: stm32: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 45c5e24a53f10cabb4a311c915680624b832cc2b
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:38 2025 +0000

    net: stmmac: stm32: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value. As both configure functions would end up with the
    same code, call this from stm32mp1_set_mode(), validate the result and
    pass the resulting value into the stm32 configure function. Use this
    value to set the operating mode for the DWMAC core.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIjUU-0000000Dqtz-2PwT@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:44 +02:00
Izabela Bakollari eeab2247e8 net: stmmac: stm32: use PHY_INTF_SEL_x directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 07669cf12ea8c7e4cb2e5f34bb8351bf65917be2
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:33 2025 +0000

    net: stmmac: stm32: use PHY_INTF_SEL_x directly

    Rather than defining separate constants for each, use the
    PHY_INTF_SEL_x definitions in the switch()es configuring the
    control register, and use one FIELD_PREP() to convert phy_intf_sel
    to the register value.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIjUP-0000000Dqtt-1bYn@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:43 +02:00
Izabela Bakollari 2b9554c01f net: stmmac: stm32: use PHY_INTF_SEL_x to select PHY interface
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 73130c298fa0d30f5ead5d9aeb7edc813651a8b3
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:28 2025 +0000

    net: stmmac: stm32: use PHY_INTF_SEL_x to select PHY interface

    Convert dwmac-stm32 to use the PHY_INTF_SEL_x definitions.

    For stm32mp1, the original definitions used constant 0 (GMII, 0 << 21),
    BIT(21) (RGMII, 1 << 21) and BIT(23) (RMII, 4 << 21) to define these,
    but from the values it can be clearly seen that these are the
    PHY_INTF_SEL_x inputs to the dwmac.

    For stm32mp2, the original definitions cover a bitfield 6:4 in the
    SYSCFG Ethernet1 control register (according to documentation) and use
    the PHY_INTF_SEL_x values.

    Use the common dwmac definitions for the PHY interface selection field
    by adding the bitfield mask, and using FIELD_PREP() for the bitfield
    values.

    This removes this incorrect use of BIT().

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIjUK-0000000Dqtn-1AyK@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:43 +02:00
Izabela Bakollari f288091666 net: stmmac: starfive: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d22045997b538aaf801b849dfa6369d76f0152c0
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:23 2025 +0000

    net: stmmac: starfive: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result and use that to set the
    control register to select the operating mode for the DWMAC core.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
    Link: https://patch.msgid.link/E1vIjUF-0000000Dqth-0gwD@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:43 +02:00
Izabela Bakollari f69471f3ee net: stmmac: starfive: use PHY_INTF_SEL_x to select PHY interface
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit f0917b475378055c1de6c9a911da579be8726a54
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:18 2025 +0000

    net: stmmac: starfive: use PHY_INTF_SEL_x to select PHY interface

    Use the common dwmac definitions for the PHY interface selection field.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
    Link: https://patch.msgid.link/E1vIjUA-0000000Dqtb-0AfP@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:42 +02:00
Izabela Bakollari d70ad7008d net: stmmac: mediatek: simplify set_interface() methods
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit f06620091fe75015d5e97f4a0da4f5b124ca6455
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:12 2025 +0000

    net: stmmac: mediatek: simplify set_interface() methods

    Use the phy_intf_sel field value when deciding what other options to
    apply for the configuration register.

    Note that this will allow GMII as well as MII as the phy_intf_sel
    value is the same for both.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vIjU4-0000000DqtV-3qsX@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:42 +02:00
Izabela Bakollari f7e8cbd96b net: stmmac: mediatek: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d9c7964fd93490b31a09fe08034033cb2aa747f5
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:07 2025 +0000

    net: stmmac: mediatek: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result, and pass that into the
    implementation specific ->dwmac_set_phy_interface() method. Use this
    to configure the PHY interface selection field.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vIjTz-0000000DqtP-3N9v@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:42 +02:00
Izabela Bakollari d0118e9a0a net: stmmac: mediatek: use PHY_INTF_SEL_x
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c3308d380e2c69c5dcb85784b750c4f83a965ef4
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:12:02 2025 +0000

    net: stmmac: mediatek: use PHY_INTF_SEL_x

    Use PHY_INTF_SEL_x definitions for the fields that correspond to the
    phy_intf_sel inputs to the dwmac core.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vIjTu-0000000DqtI-2sUB@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:42 +02:00
Izabela Bakollari a2f2f3bac3 net: stmmac: loongson1: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 83eb6c7e18641f328aed5da2e9bbf63e83806ca4
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:11:57 2025 +0000

    net: stmmac: loongson1: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result and use that to set the
    control register to select the operating mode for the DWMAC core.

    Note that this will allow GMII as well as MII as the phy_intf_sel
    value is the same for both.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vIjTp-0000000DqtC-2DmI@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:41 +02:00
Izabela Bakollari 3fe38fae52 net: stmmac: loongson1: use PHY_INTF_SEL_x directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 031f7a05d4b3ad4414e646414e16dfd4ab388772
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:11:52 2025 +0000

    net: stmmac: loongson1: use PHY_INTF_SEL_x directly

    Use the PHY_INTF_SEL_xx values directly in ls1c_dwmac_syscon_init(),
    converting them to the PHY_INTF_SELI bitfield when calling
    regmap_update_bits().

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vIjTk-0000000Dqt6-1gN9@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:41 +02:00
Izabela Bakollari c496bc4ee9 net: stmmac: loongson1: use PHY_INTF_SEL_x
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 5d88b24c1de80037af8f46db478639679668ece5
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 08:11:47 2025 +0000

    net: stmmac: loongson1: use PHY_INTF_SEL_x

    Use PHY_INTF_SEL_x definitions for phy_intf_sel bitfield.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:41 +02:00
Izabela Bakollari c253847110 net: stmmac: improve ndev->max_mtu setup readability
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 7e975caa0f7bf2f83a5e18b4ae69c3d7fff4eafa
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Nov 11 11:26:34 2025 +0000

    net: stmmac: improve ndev->max_mtu setup readability

    Improve the readibility of the code setting ndev->max_mtu. This depends
    on the hardware specific maximum defined by the MAC core, and also a
    platform provided maximum.

    The code was originally checking that the platform specific maximum was
    between ndev->min_mtu..MAC core maximum before reducing ndev->max_mtu,
    otherwise if the platform specific maximum was less than ndev->min_mtu,
    issuing a warning.

    Re-order the code to handle the case where the platform specific max is
    below ndev->min_mtu, which then means that the subsequent test is
    simply reducing ndev->max_mtu.

    Update the comment, and add a few blank lines to separate the blocks of
    code.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vImWA-0000000DrIl-1HZY@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:40 +02:00
Izabela Bakollari b63199e3a6 net: stmmac: meson8b: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit da3d1501235df39d9f2db092ac8592eb6f7c52b1
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 10 14:42:53 2025 +0000

    net: stmmac: meson8b: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result and use that to set the
    control register to select the operating mode for the DWMAC core.

    Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIT6b-0000000DpPX-1LQ0@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:40 +02:00
Izabela Bakollari 9a5c27fcdb net: stmmac: meson8b: use phy_intf_sel directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 52d639da6feea3c8787a60b1efb534bd48ea053d
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 10 14:42:48 2025 +0000

    net: stmmac: meson8b: use phy_intf_sel directly

    Rearrange meson_axg_set_phy_mode() to use phy_intf_sel directly,
    converting it to the register field for meson8b_dwmac_mask_bits().

    Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIT6W-0000000DpPR-0tby@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:40 +02:00
Izabela Bakollari daaced3ec5 net: stmmac: meson8b: use PHY_INTF_SEL_x
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 12f42597ab148753959bc466c0c66abcf10e4267
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 10 14:42:43 2025 +0000

    net: stmmac: meson8b: use PHY_INTF_SEL_x

    Use PHY_INTF_SEL_x definitions for phy_intf_sel bitfield.

    Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vIT6R-0000000DpPL-0Nli@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:40 +02:00
Izabela Bakollari fb7e7b62ba net: stmmac: ingenic: use ->set_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 34bf68a691227faac490a313b7925ed10cf8de15
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:26 2025 +0000

    net: stmmac: ingenic: use ->set_phy_intf_sel()

    Rather than placing the phy_intf_sel() setup in the ->init() method,
    move it to the new ->set_phy_intf_sel() method.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHqY-0000000Djrn-1D6H@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:39 +02:00
Izabela Bakollari 070f0ec7fe net: stmmac: ingenic: pass ingenic_mac struct rather than plat_dat
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 9352f74fd13de34468be95291bdb0782aac8ca3d
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:21 2025 +0000

    net: stmmac: ingenic: pass ingenic_mac struct rather than plat_dat

    It no longer makes sense to pass a pointer to struct
    plat_stmmacenet_data when calling the set_mode() methods to only use it
    to get a pointer to the ingenic_mac structure that we already had in
    the caller. Simplify this by passing the struct ingenic_mac pointer.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHqT-0000000Djrh-0ka3@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:39 +02:00
Izabela Bakollari 400b23f6f2 net: stmmac: ingenic: simplify x2000 mac_set_mode()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 2284cca0bced3cd8c1cb643d1ae6923a75e47265
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:16 2025 +0000

    net: stmmac: ingenic: simplify x2000 mac_set_mode()

    As per the previous commit, we have validated that the phy_intf_sel
    value is one that is permissible for this SoC, so there is no need to
    handle invalid PHY interface modes. We can also apply the other
    configuration based upon the phy_intf_sel value rather than the
    PHY interface mode.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHqO-0000000Djrb-0DPN@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:39 +02:00
Izabela Bakollari 6b6955a252 net: stmmac: ingenic: simplify mac_set_mode() methods
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 608975d4d791644d15b286b2b7bfcd25359c979f
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:10 2025 +0000

    net: stmmac: ingenic: simplify mac_set_mode() methods

    x1000, x1600 and x1830 only accept RMII mode. PHY_INTF_SEL_RMII is only
    selected with PHY_INTERFACE_MODE_RMII, and PHY_INTF_SEL_RMII has been
    validated by the SoC's .valid_phy_intf_sel bitmask. Thus, checking the
    interface mode in these functions becomes unnecessary. Remove these.

    jz4775 is similar, except for a greater set of PHY_INTF_SEL_x valies.
    Also remove the switch statement here.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHqI-0000000DjrV-3ygL@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:39 +02:00
Izabela Bakollari 49836477a7 net: stmmac: ingenic: move "MAC PHY control register" debug
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 35147b5c9e414c1ced1903c0447609643d03e2f3
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:05 2025 +0000

    net: stmmac: ingenic: move "MAC PHY control register" debug

    Move the printing of the MAC PHY control register interface mode
    setting into ingenic_set_phy_intf_sel(), and use phy_modes() to
    print the string rather than using the enum name.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHqD-0000000DjrP-3aaU@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:38 +02:00
Izabela Bakollari 891ea7cb91 net: stmmac: ingenic: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 0e2fa91c55c05f441417489957a1f909ff6c9aa1
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:29:00 2025 +0000

    net: stmmac: ingenic: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result against the SoC specific
    supported phy_intf_sel values, and pass into the SoC specific
    set_mode() methods, replacing the local phy_intf_sel variable. This
    provides the value for the MACPHYC_PHY_INFT_MASK field.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHq8-0000000DjrJ-2NRK@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:38 +02:00
Izabela Bakollari b9e415f4fa net: stmmac: ingenic: prep PHY_INTF_SEL_x field after switch()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 14497aaa5eb63f7d77cf72c281afe330baea970b
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:28:55 2025 +0000

    net: stmmac: ingenic: prep PHY_INTF_SEL_x field after switch()

    Move the preparation of the PHY_INTF_SEL_x bitfield out of the switch()
    statement such that it only appears once.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHq3-0000000DjrD-1u8O@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:38 +02:00
Izabela Bakollari fc61051643 net: stmmac: ingenic: use PHY_INTF_SEL_x directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit dbf99dc7d166944df4af1f52351a355512e1c573
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:28:50 2025 +0000

    net: stmmac: ingenic: use PHY_INTF_SEL_x directly

    Use the PHY_INTF_SEL_x values directly in each of the mac_set_mode
    methods rather than the driver private MACPHYC_PHY_INFT_x definitions.
    Remove the MACPHYC_PHY_INFT_x definitions.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHpy-0000000Djr7-1R1m@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:38 +02:00
Izabela Bakollari 2cc841b1d8 net: stmmac: ingenic: use PHY_INTF_SEL_x to select PHY interface
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit da6e9fd1046f1b936d8dd1db738ffb06f21851c0
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:28:45 2025 +0000

    net: stmmac: ingenic: use PHY_INTF_SEL_x to select PHY interface

    Use the common dwmac definitions for the PHY interface selection field.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHpt-0000000Djr1-0wwr@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:38 +02:00
Izabela Bakollari db6dbed1f6 net: stmmac: ingenic: simplify jz4775 mac_set_mode()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 307a575775fd06b1a63ec017a63a82485bedf62f
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:28:40 2025 +0000

    net: stmmac: ingenic: simplify jz4775 mac_set_mode()

    All paths configure the transmit clock as an input. Move this out of
    the switch() statement to simplify the code.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHpo-0000000Djqv-0RD4@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:37 +02:00
Izabela Bakollari 32fd50cf98 net: stmmac: ingenic: move ingenic_mac_init()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 2dd63c36453408583c2c37a742705a0232612c57
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Fri Nov 7 08:28:34 2025 +0000

    net: stmmac: ingenic: move ingenic_mac_init()

    Move ingenic_mac_init() to between variant specific set_mode()
    implementations and ingenic_mac_probe(). No code changes.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vHHpi-0000000Djqp-4910@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:37 +02:00
Izabela Bakollari 05f9769e17 net: stmmac: sti: use ->set_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit e3c8f25cf2aa3f2547da26e7a46424c016550d31
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:52 2025 +0000

    net: stmmac: sti: use ->set_phy_intf_sel()

    Rather than placing the phy_intf_sel() setup in the ->init() method,
    move it to the new ->set_phy_intf_sel() method.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5o-0000000DhQn-34JE@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:37 +02:00
Izabela Bakollari 2da38653da net: stmmac: sti: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit ef5e870be90ffc390ae9afc0b50d411d3538126c
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:47 2025 +0000

    net: stmmac: sti: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, validate the result and use that to set the
    control register to select the operating mode for the DWMAC core.

    Note that when an unsupported interface mode is used, the array would
    decode this to PHY_INTF_SEL_GMII_MII, so preserve this behaviour.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5j-0000000DhQh-2e0x@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:36 +02:00
Izabela Bakollari 38060e13f9 net: stmmac: sti: use PHY_INTF_SEL_x directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit bd5a68159259efc910a5b199b3cd1a27d47205fb
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:42 2025 +0000

    net: stmmac: sti: use PHY_INTF_SEL_x directly

    Use the PHY_INTF_SEL_x values directly rather than the driver private
    ETH_PHY_SEL_x values. Move the FIELD_PREP() into sti_dwmac_set_mode().
    Use dwmac->interface directly.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5e-0000000DhQb-2B7I@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:36 +02:00
Izabela Bakollari 6a5c9b3357 net: stmmac: sti: use PHY_INTF_SEL_x to select PHY interface
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 9cd23c02ac57a4727095e1d1d62974e0bea445fb
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:37 2025 +0000

    net: stmmac: sti: use PHY_INTF_SEL_x to select PHY interface

    Use the common dwmac definitions for the PHY interface selection field,
    adding MII_PHY_SEL_VAL() temporarily to avoid line wrapping.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5Z-0000000DhQV-1e2l@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:36 +02:00
Izabela Bakollari ea47a2824e net: stmmac: lpc18xx: use ->set_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 7fe0e06a7364ff7ffb3b44fe1c9340824b45c1a8
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:32 2025 +0000

    net: stmmac: lpc18xx: use ->set_phy_intf_sel()

    Move the configuration of the dwmac PHY interface selection to the new
    ->set_phy_intf_sel() method.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5U-0000000DhQP-19Hd@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:36 +02:00
Izabela Bakollari b4b8f5c54d net: stmmac: lpc18xx: validate phy_intf_sel
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 4bad4219249f12dabb5c246f5cf9378f3693e226
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:27 2025 +0000

    net: stmmac: lpc18xx: validate phy_intf_sel

    Validate the phy_intf_sel value rather than the PHY interface mode.
    This will allow us to transition to the ->set_phy_intf_sel() method.
    Note that this will allow GMII as well as MII as the phy_intf_sel
    value is the same for both.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5P-0000000DhQJ-0Oi3@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:35 +02:00
Izabela Bakollari 5e5c20d537 net: stmmac: lpc18xx: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 9882f12194082a0178a025946911e677cfdcd8d8
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:21 2025 +0000

    net: stmmac: lpc18xx: use stmmac_get_phy_intf_sel()

    Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
    phy_intf_sel value, and use the result to program the ethernet mode.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5J-0000000DhQD-46Ob@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:35 +02:00
Izabela Bakollari deba030dd9 net: stmmac: lpc18xx: use PHY_INTF_SEL_x directly
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit eb0533c7e63be03c1220f24bd00aeb2a4f0e3f78
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:16 2025 +0000

    net: stmmac: lpc18xx: use PHY_INTF_SEL_x directly

    Use the PHY_INTF_SEL_x values directly rather than the driver private
    LPC18XX_CREG_CREG6_ETHMODE_x definitions, and convert
    LPC18XX_CREG_CREG6_ETHMODE_MASK to use GENMASK().

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy5E-0000000DhQ7-3cuy@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:35 +02:00
Izabela Bakollari f24f39052c net: stmmac: lpc18xx: convert to PHY_INTF_SEL_x
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 5636fcdb02114f492dd922cef67d1b1b5f09893b
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Nov 6 11:23:11 2025 +0000

    net: stmmac: lpc18xx: convert to PHY_INTF_SEL_x

    Use the common dwmac definitions for the PHY interface selection field.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vGy59-0000000DhQ1-393H@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:35 +02:00
Izabela Bakollari 4d5bb9bdf0 net: stmmac: socfpga: Add hardware supported cross-timestamp
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit fd8c4f6454963aa7ea895657472aa57f33779d57
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Sat Nov 1 01:27:10 2025 +0800

    net: stmmac: socfpga: Add hardware supported cross-timestamp

    Cross timestamping is supported on Agilex5 platform with Synchronized
    Multidrop Timestamp Gathering(SMTG) IP. The hardware cross-timestamp
    result is made available the applications through the ioctl call
    PTP_SYS_OFFSET_PRECISE, which inturn calls stmmac_getcrosststamp().

    Device time is stored in the MAC Auxiliary register. The 64-bit System
    time (ARM_ARCH_COUNTER) is stored in SMTG IP. SMTG IP is an MDIO device
    with 0xC - 0xF MDIO register space holds 64-bit system time.

    This commit is similar to following commit for Intel platforms:
    Commit 341f67e424 ("net: stmmac: Add hardware supported cross-timestamp")

    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Link: https://patch.msgid.link/20251101-agilex5_ext-v2-4-a6b51b4dca4d@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:34 +02:00
Izabela Bakollari 57e33de6d9 net: stmmac: socfpga: Enable TSO for Agilex5 platform
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit e28988aef70f8f993d93a62161a202e930cfce55
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Sat Nov 1 01:27:09 2025 +0800

    net: stmmac: socfpga: Enable TSO for Agilex5 platform

    Agilex5 supports TCP Segmentation Offload(TSO). This commit enables
    TSO for Agilex5 socfpga platforms.

    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Link: https://patch.msgid.link/20251101-agilex5_ext-v2-3-a6b51b4dca4d@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:34 +02:00
Izabela Bakollari eaca01891a net: stmmac: socfpga: Enable TBS support for Agilex5
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 4c00476d44804db3c16838299b87a11741cd0dbd
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Sat Nov 1 01:27:08 2025 +0800

    net: stmmac: socfpga: Enable TBS support for Agilex5

    Agilex5 supports Time-Based Scheduling(TBS) for Tx queue 6 and Tx
    queue 7. This commit enables TBS support for these queues.

    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Link: https://patch.msgid.link/20251101-agilex5_ext-v2-2-a6b51b4dca4d@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:34 +02:00
Izabela Bakollari caa8747564 net: stmmac: socfpga: Agilex5 EMAC platform configuration
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 93d46ea3e984323fae0e5d2919cf5817e1297d41
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Sat Nov 1 01:27:07 2025 +0800

    net: stmmac: socfpga: Agilex5 EMAC platform configuration

    Agilex5 HPS EMAC uses the dwxgmac-3.10a IP, unlike previous socfpga
    platforms which use dwmac1000 IP. Due to differences in platform
    configuration, Agilex5 requires a distinct setup.

    Introduce a setup_plat_dat() callback in socfpga_dwmac_ops to handle
    platform-specific setup. This callback is invoked before
    stmmac_dvr_probe() to ensure the platform data is correctly
    configured. Also, implemented separate setup_plat_dat() callback for
    current socfpga platforms and Agilex5.

    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/20251101-agilex5_ext-v2-1-a6b51b4dca4d@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:33 +02:00
Izabela Bakollari 4ef83ed47f net: stmmac: imx: use ->set_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit eaca1a4dc51e5e4979e45a4ad72a1c2a88a80a72
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:46 2025 +0000

    net: stmmac: imx: use ->set_phy_intf_sel()

    Rather than placing the phy_intf_sel() setup in the ->init() method,
    move it to the new ->set_phy_intf_sel() method.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt5C-0000000ChpR-2kAB@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:33 +02:00
Izabela Bakollari 65011e8b2a net: stmmac: imx: cleanup arguments for set_intf_mode() method
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 38cd4e84b369c11680966fdea129e11dbb28a6ec
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:41 2025 +0000

    net: stmmac: imx: cleanup arguments for set_intf_mode() method

    Pass the imx_priv_data instead of the plat_stmmacenet_data into the
    set_intf_mode() SoC specific methods.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt57-0000000ChpL-25kS@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:33 +02:00
Izabela Bakollari b6b2594771 net: stmmac: imx: simplify set_intf_mode() implementations
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 35103babce3036058cd9ed8674c98e9ab397d715
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:36 2025 +0000

    net: stmmac: imx: simplify set_intf_mode() implementations

    Simplify the set_intf_mode() implementations, testing the phy_intf_sel
    value rather than the PHY interface mode.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt52-0000000ChpG-1bsd@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:33 +02:00
Izabela Bakollari 625faa4651 net: stmmac: imx: use stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c012710c14a70dfa21691e2542d18dd4b621c518
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:31 2025 +0000

    net: stmmac: imx: use stmmac_get_phy_intf_sel()

    i.MX implementations other than IMX8DXL involve setting the dwmac core
    phy_intf_sel input. Use stmmac_get_phy_intf_sel() to decode the PHY
    interface mode to the phy_intf_sel value, validating the result, and
    passing it into the implementation specific .set_intf_mode() method
    rather than each .set_intf_mode() method doing this.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4x-0000000ChpA-1Edr@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:32 +02:00
Izabela Bakollari 853fa02d1c net: stmmac: imx: use FIELD_PREP()/FIELD_GET() for PHY_INTF_SEL_x
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d73c1dccfb9909f0e2d517af887fe414ab421cea
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:26 2025 +0000

    net: stmmac: imx: use FIELD_PREP()/FIELD_GET() for PHY_INTF_SEL_x

    Use FIELD_PREP()/FIELD_GET() in the functions to construct the PHY
    interface selection bitfield or to extract its value.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4s-0000000Chp4-0kwf@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:32 +02:00
Izabela Bakollari a4eac6f070 net: stmmac: imx: convert to PHY_INTF_SEL_xxx
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 8233cc439779eac1d2682d334c1aa6bb6d95120c
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:21 2025 +0000

    net: stmmac: imx: convert to PHY_INTF_SEL_xxx

    Convert dwmac-imx to use the PHY_INTF_SEL_xxx definitions rather than
    constants via:
    - ensuring that the prefix for the MASK and value definitions is the
      same.
    - using FIELD_PREP() to shift the PHY_INTF_SEL_xxx definition to the
      appropriate bitfield.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4n-0000000Choy-0IeG@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:32 +02:00
Izabela Bakollari d273980c11 net: stmmac: add support for configuring the phy_intf_sel inputs
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 1b6aa81c85621d6b55099906585ff09a477203b8
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:15 2025 +0000

    net: stmmac: add support for configuring the phy_intf_sel inputs

    When dwmac is synthesised with support for multiple PHY interfaces, the
    core provides phy_intf_sel inputs, sampled on reset, to configure the
    PHY facing interface. Use stmmac_get_phy_intf_sel() in core code to
    determine the dwmac phy_intf_sel input value, and provide a new
    platform method called with this value just before we issue a soft
    reset to the dwmac core.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4h-0000000Chos-3wxX@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:32 +02:00
Izabela Bakollari 26dcf90850 net: stmmac: add stmmac_get_phy_intf_sel()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit b459790d3fd6d7ead31182ae0cd8632fe79deed6
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:10 2025 +0000

    net: stmmac: add stmmac_get_phy_intf_sel()

    Provide a function to translate the PHY interface mode to the
    phy_intf_sel pin configuration for dwmac1000 and dwmac4 cores that
    support multiple interfaces. We currently handle MII, GMII, RGMII,
    SGMII, RMII and REVMII, but not TBI, RTBI nor SMII as drivers do not
    appear to use these three and the driver doesn't currently support
    these.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4c-0000000Choe-3SII@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:31 +02:00
Izabela Bakollari ad596ae47a net: stmmac: add phy_intf_sel and ACTPHYIF definitions
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 4a4692e9091867dd413764c7d81f09e8109a233a
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:05 2025 +0000

    net: stmmac: add phy_intf_sel and ACTPHYIF definitions

    Add definitions for the active PHY interface found in DMA hardware
    feature register 0, and also used to configure the core in multi-
    interface designs via phy_intf_sel.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/E1vFt4X-0000000ChoY-30p9@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:31 +02:00
Izabela Bakollari f533e4fa46 net: stmmac: s32: move PHY_INTF_SEL_x definitions out of the way
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 553f23d1953527eb277efa902cd498131b2527e1
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:50:00 2025 +0000

    net: stmmac: s32: move PHY_INTF_SEL_x definitions out of the way

    S32's PHY_INTF_SEL_x definitions conflict with those for the dwmac
    cores as they use a different bitmapping. Add a S32 prefix so that
    they are unique.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Reviewed-by: Jan Petrous (OSS) <jan.petrous@oss.nxp.com>
    Link: https://patch.msgid.link/E1vFt4S-0000000ChoS-2Ahi@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:31 +02:00
Izabela Bakollari 3ad8d0f1f3 net: stmmac: imx: use phylink's interface mode for set_clk_tx_rate()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit dec568a36f9b16f0334aed8e95ec4225606830cc
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Mon Nov 3 11:49:55 2025 +0000

    net: stmmac: imx: use phylink's interface mode for set_clk_tx_rate()

    imx_dwmac_set_clk_tx_rate() is passed the interface mode from phylink
    which will be the same as plat_dat->phy_interface. Use the passed-in
    interface mode rather than plat_dat->phy_interface.

    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vFt4N-0000000ChoM-1llp@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:30 +02:00
Izabela Bakollari 1b3c18794b net: stmmac: qcom-ethqos: remove MAC_CTRL_REG modification
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 9b443e58a896fce4d377d83da8dfd083664d8739
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 30 10:20:32 2025 +0000

    net: stmmac: qcom-ethqos: remove MAC_CTRL_REG modification

    When operating in "SGMII" mode (Cisco SGMII or 2500BASE-X), qcom-ethqos
    modifies the MAC control register in its ethqos_configure_sgmii()
    function, which is only called from one path:

    stmmac_mac_link_up()
    +- reads MAC_CTRL_REG
    +- masks out priv->hw->link.speed_mask
    +- sets bits according to speed (2500, 1000, 100, 10) from priv->hw.link.speed*
    +- ethqos_fix_mac_speed()
    |  +- qcom_ethqos_set_sgmii_loopback(false)
    |  +- ethqos_update_link_clk(speed)
    |  `- ethqos_configure(speed)
    |     `- ethqos_configure_sgmii(speed)
    |        +- reads MAC_CTRL_REG,
    |        +- configures PS/FES bits according to speed
    |        `- writes MAC_CTRL_REG as the last operation
    +- sets duplex bit(s)
    +- stmmac_mac_flow_ctrl()
    +- writes MAC_CTRL_REG if changed from original read
    ...

    As can be seen, the modification of the control register that
    stmmac_mac_link_up() overwrites the changes that ethqos_fix_mac_speed()
    does to the register. This makes ethqos_configure_sgmii()'s
    modification questionable at best.

    Analysing the values written, GMAC4 sets the speed bits as:
    speed_mask = GMAC_CONFIG_FES | GMAC_CONFIG_PS
    speed2500 = GMAC_CONFIG_FES                     B14=1 B15=0
    speed1000 = 0                                   B14=0 B15=0
    speed100 = GMAC_CONFIG_FES | GMAC_CONFIG_PS     B14=1 B15=1
    speed10 = GMAC_CONFIG_PS                        B14=0 B15=1

    Whereas ethqos_configure_sgmii():
    2500: clears ETHQOS_MAC_CTRL_PORT_SEL           B14=X B15=0
    1000: clears ETHQOS_MAC_CTRL_PORT_SEL           B14=X B15=0
    100: sets ETHQOS_MAC_CTRL_PORT_SEL |            B14=1 B15=1
              ETHQOS_MAC_CTRL_SPEED_MODE
    10: sets ETHQOS_MAC_CTRL_PORT_SEL               B14=0 B15=1
        clears ETHQOS_MAC_CTRL_SPEED_MODE

    Thus, they appear to be doing very similar, with the exception of the
    FES bit (bit 14) for 1G and 2.5G speeds.

    Given that stmmac_mac_link_up() will write the MAC_CTRL_REG after
    ethqos_configure_sgmii(), remove the unnecessary update in the
    glue driver's ethqos_configure_sgmii() method, simplifying the code.

    Konrad states:

    Without any additional knowledge, the register description says:

    2500: B14=1 B15=0
    1000: B14=0 B15=0
     100: B14=1 B15=1
      10: B14=0 B15=1

    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vEPlg-0000000CFHY-282A@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:30 +02:00
Izabela Bakollari 82061b46c2 net: stmmac: mdio: fix incorrect phy address check
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit cf35f4347ddd42ceca156e57a87ec489788f1bd7
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date:   Sat Oct 25 20:35:47 2025 +0200

    net: stmmac: mdio: fix incorrect phy address check

    max_addr is the max number of addresses, not the highest possible address,
    therefore check phydev->mdio.addr > max_addr isn't correct.
    To fix this change the semantics of max_addr, so that it represents
    the highest possible address. IMO this is also a little bit more intuitive
    wrt name max_addr.

    Fixes: 4a107a0e8361 ("net: stmmac: mdio: use phy_find_first to simplify stmmac_mdio_register")
    Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reported-by: Simon Horman <horms@kernel.org>
    Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/e869999b-2d4b-4dc1-9890-c2d3d1e8d0f8@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:30 +02:00
Izabela Bakollari 42a41f526d net: stmmac: est: Fix GCL bounds checks
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 48b2e323c018c4c908ae5acabff326647bab5240
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Tue Oct 28 11:18:45 2025 +0800

    net: stmmac: est: Fix GCL bounds checks

    Fix the bounds checks for the hw supported maximum GCL entry
    count and gate interval time.

    Fixes: b60189e039 ("net: stmmac: Integrate EST with TAPRIO scheduler API")
    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
    Link: https://patch.msgid.link/20251028-qbv-fixes-v4-3-26481c7634e3@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:29 +02:00
Izabela Bakollari f9f00d3ee3 net: stmmac: Consider Tx VLAN offload tag length for maxSDU
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit ded9813d17d3dd50a08e7a2ca1495769ef9c6673
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Tue Oct 28 11:18:44 2025 +0800

    net: stmmac: Consider Tx VLAN offload tag length for maxSDU

    Queue maxSDU requirement of 802.1 Qbv standard requires mac to drop
    packets that exceeds maxSDU length and maxSDU doesn't include
    preamble, destination and source address, or FCS but includes
    ethernet type and VLAN header.

    On hardware with Tx VLAN offload enabled, VLAN header length is not
    included in the skb->len, when Tx VLAN offload is requested. This
    leads to incorrect length checks and allows transmission of
    oversized packets. Add the VLAN_HLEN to the skb->len before checking
    the Qbv maxSDU if Tx VLAN offload is requested for the packet.

    Fixes: c5c3e1bfc9 ("net: stmmac: Offload queueMaxSDU from tc-taprio")
    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
    Link: https://patch.msgid.link/20251028-qbv-fixes-v4-2-26481c7634e3@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:29 +02:00
Izabela Bakollari f5814c066c net: stmmac: vlan: Disable 802.1AD tag insertion offload
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c657f86106c8729240e1f50a62c6606b578ecf20
Author: Rohan G Thomas <rohan.g.thomas@altera.com>
Date:   Tue Oct 28 11:18:43 2025 +0800

    net: stmmac: vlan: Disable 802.1AD tag insertion offload

    The DWMAC IP's VLAN tag insertion offload does not support inserting
    STAG (802.1AD) and CTAG (802.1Q) types in bytes 13 and 14 using the
    same MAC_VLAN_Incl and MAC_VLAN_Inner_Incl register configurations.

    Currently, MAC_VLAN_Incl is configured to offload only STAG type
    insertion. However, the DWMAC IP inserts a CTAG type when the inner
    VLAN ID field of the descriptor is not configured, and a STAG type
    when it is configured. This behavior is not documented and leads to
    inconsistent double VLAN tagging.

    Additionally, an unexpected CTAG with VLAN ID 0 is inserted, resulting
    in frames like:

    Frame 1: 110 bytes on wire (880 bits), 110 bytes captured (880 bits)
    Ethernet II, Src: <src> (<src>), Dst: <dst> (<dst>)
    IEEE 802.1ad, ID: 100
    802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 0 (unexpected)
    802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 200
    Internet Protocol Version 4, Src: 192.168.4.10, Dst: 192.168.4.11
    Internet Control Message Protocol

    To avoid this undocumented and incorrect behavior, disable 802.1AD tag
    insertion offload. Also, don't set CSVL bit. As per the data book,
    when this bit is set, S-VLAN type (0x88A8) is inserted in the 13th and
    14th bytes of transmitted packets and when this bit is reset, C-VLAN
    type (0x8100) is inserted in the 13th and 14th bytes of transmitted
    packets.

    Fixes: 30d932279d ("net: stmmac: Add support for VLAN Insertion Offload")
    Fixes: e94e3f3b51 ("net: stmmac: Add support for VLAN Insertion Offload in GMAC4+")
    Fixes: 1d2c7a5fee31 ("net: stmmac: Refactor VLAN implementation")
    Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
    Reviewed-by: Boon Khai Ng <boon.khai.ng@altera.com>
    Link: https://patch.msgid.link/20251028-qbv-fixes-v4-1-26481c7634e3@altera.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:29 +02:00
Izabela Bakollari bf4a1c99d9 net: stmmac: reorganise stmmac_hwif_init()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 6436f408eb214bce9c5c308d51372a1611940dff
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:46 2025 +0000

    net: stmmac: reorganise stmmac_hwif_init()

    Reorganise stmmac_hwif_init() to handle the error case of
    stmmac_hwif_find() in the indented block, which follows normal
    programming pattern.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtfG-0000000CCCX-2YwQ@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:29 +02:00
Izabela Bakollari fa7cee0e76 net: stmmac: use != rather than ^ for comparing dev_id
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit f9326b139b4c77128564574ea2d7b83c8a758114
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:41 2025 +0000

    net: stmmac: use != rather than ^ for comparing dev_id

    Use the more usual not-equals rather than exclusive-or operator when
    comparing the dev_id in stmmac_hwif_find().

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtfB-0000000CCCR-25rr@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:29 +02:00
Izabela Bakollari 1c61bd5b35 net: stmmac: provide function to lookup hwif
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 7b510ea8e58eb0ead6bc41fd0f15ec064312dcbf
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:36 2025 +0000

    net: stmmac: provide function to lookup hwif

    Provide a function to lookup the hwif entry given the core type,
    Synopsys version, and device ID (used for XGMAC cores).

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtf6-0000000CCCL-1cQA@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:28 +02:00
Izabela Bakollari 199d9e1060 net: stmmac: use FIELD_GET() for version register
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit b2fe9e29b5f65aa5ad87e859966871061eb37303
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:31 2025 +0000

    net: stmmac: use FIELD_GET() for version register

    Provide field definitions in common.h, and use these with FIELD_GET()
    to extract the fields from the version register.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtf1-0000000CCCF-0uUV@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:28 +02:00
Izabela Bakollari 012d8b00c4 net: stmmac: move stmmac_get_*id() into stmmac_get_version()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 7b2e41fff76f53b53e7e00222674e3d87cbd4a67
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:26 2025 +0000

    net: stmmac: move stmmac_get_*id() into stmmac_get_version()

    Move the contents of both stmmac_get_id() and stmmac_get_dev_id() into
    stmmac_get_version() as it no longer makes sense for these to be
    separate functions.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtew-0000000CCC9-0KeM@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:28 +02:00
Izabela Bakollari ecd0e91c10 net: stmmac: consolidate version reading and validation
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c36b97e4ca773f20ff20db34ed97e35cc36ad97c
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:20 2025 +0000

    net: stmmac: consolidate version reading and validation

    There is no need to read the version register twice, once in
    stmmac_get_id() and then again in stmmac_get_dev_id(). Consolidate
    this into stmmac_get_version() and pass each of these this value.

    As both functions unnecessarily issue the same warning for a zero
    register value, also move this into stmmac_get_version().

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDteq-0000000CCC3-3zbJ@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:28 +02:00
Izabela Bakollari 6ffa56d440 net: stmmac: simplify stmmac_get_version()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit f49838f77cf6c50961afa33a5bc1ea95e061d7f0
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:15 2025 +0000

    net: stmmac: simplify stmmac_get_version()

    We can simplify stmmac_get_version() by pre-initialising the version
    members to zero, detecting the MAC100 core and returning, otherwise
    determining the version register offset separately from calling
    stmmac_get_id() and stmmac_get_dev_id(). Do this.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDtel-0000000CCBx-3Lpf@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:27 +02:00
Izabela Bakollari b621be98ba net: stmmac: move version handling into own function
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit fc18b6e98cce2380e8f31b0e5089b11ceecb541d
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Wed Oct 29 00:03:10 2025 +0000

    net: stmmac: move version handling into own function

    Move the version handling out of stmmac_hwif_init() and into its own
    function, returning the version information through a structure.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vDteg-0000000CCBr-2m7q@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:27 +02:00
Izabela Bakollari 476a79b47e net: stmmac: Move subsecond increment configuration in dedicated helper
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 792000fbcd0ca32f358c4e14eaa40a73690be24c
Author: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date:   Fri Oct 24 09:07:17 2025 +0200

    net: stmmac: Move subsecond increment configuration in dedicated helper

    In preparation for fine/coarse support, let's move the subsecond increment
    and addend configuration in a dedicated helper.

    Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/20251024070720.71174-2-maxime.chevallier@bootlin.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:27 +02:00
Izabela Bakollari c636c03802 ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 2010163a8ea4a19308ec6cf259fe68f014553efb
Author: David Wu <david.wu@rock-chips.com>
Date:   Thu Oct 23 13:12:11 2025 +0200

    ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support

    Add the needed glue blocks for the RK3506-specific setup.

    The RK3506 dwmac only supports up to 100MBit with a RMII PHY,
    but no RGMII.

    Signed-off-by: David Wu <david.wu@rock-chips.com>
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Link: https://patch.msgid.link/20251023111213.298860-5-heiko@sntech.de
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:27 +02:00
Izabela Bakollari 130fc3bbaa net: stmmac: add support for controlling PCS interrupts
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit eed68edac508fed36e3726f5b0b828a83efab7f8
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 23 10:46:25 2025 +0100

    net: stmmac: add support for controlling PCS interrupts

    Add support to the PCS instance for controlling the PCS interrupts
    depending on whether the PCS is used.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vBrtp-0000000BMYs-3bhI@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:26 +02:00
Izabela Bakollari 0bb6ad14d2 net: stmmac: convert to phylink managed WoL PHY speed
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit d65cb2e27e6e18d036276905c1aa11828aac5b6a
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 23 10:16:55 2025 +0100

    net: stmmac: convert to phylink managed WoL PHY speed

    Convert stmmac to use phylink's management of the PHY speed when
    Wake-on-Lan is enabled.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vBrRH-0000000BLzm-3JjF@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:26 +02:00
Izabela Bakollari 24f4c65866 net: stmmac: convert to phylink-managed Wake-on-Lan
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 6911308d7d111a9c367293b52f2dc265819f2b60
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 23 10:16:50 2025 +0100

    net: stmmac: convert to phylink-managed Wake-on-Lan

    Convert stmmac to use phylink-managed Wake-on-Lan support. To achieve
    this, we implement the .mac_wol_set() method, which simply configures
    the driver model's struct device wakeup for stmmac, and sets the
    priv->wolopts appropriately.

    When STMMAC_FLAG_USE_PHY_WOL is set, in the stmmac world this means to
    only use the PHY's WoL support and ignore the MAC's WoL capabilities.
    To preserve this behaviour, we enable phylink's legacy mode, and avoid
    telling phylink that the MAC has any WoL support. This achieves the
    same functionality for this case.

    When STMMAC_FLAG_USE_PHY_WOL is not set, we provide the MAC's WoL
    capabilities to phylink, which then allows phylink to choose between
    the PHY and MAC for WoL depending on their individual capabilities
    as described in the phylink commit. This only augments the WoL
    functionality with PHYs that declare to the driver model that they are
    wake-up capable. Currently, very few PHY drivers support this.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/E1vBrRC-0000000BLzg-2tA4@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:26 +02:00
Izabela Bakollari 31be7bafb0 net: stmmac: replace has_xxxx with core_type
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 26ab9830beabda863766be4a79dc590c7645f4d9
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Tue Oct 21 08:26:49 2025 +0100

    net: stmmac: replace has_xxxx with core_type

    Replace the has_gmac, has_gmac4 and has_xgmac ints, of which only one
    can be set when matching a core to its driver backend, with an
    enumerated type carrying the DWMAC core type.

    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Acked-by: Chen-Yu Tsai <wens@kernel.org>
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
    Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    Link: https://patch.msgid.link/E1vB6ld-0000000BIPy-2Qi4@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:25 +02:00
Izabela Bakollari e5b15238d3 net: stmmac: mdio: use phy_find_first to simplify stmmac_mdio_register
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 4a107a0e836177359b861e9849a2a24ad35e9919
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date:   Sat Oct 18 20:48:07 2025 +0200

    net: stmmac: mdio: use phy_find_first to simplify stmmac_mdio_register

    Simplify the code by using phy_find_first().

    Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://patch.msgid.link/20ca4962-9588-40b8-b021-fb349a92e9e5@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:25 +02:00
Izabela Bakollari ac1fc52ab2 net: stmmac: convert to phylink PCS support
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 2c81f3357136a0ece9b36be991c78a384399eaac
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:52 2025 +0100

    net: stmmac: convert to phylink PCS support

    Now that stmmac's PCS support is much more simple - just a matter of
    configuring the control register - the basic conversion to phylink PCS
    support becomes straight forward.

    Create the infrastructure to setup a phylink_pcs instance for the
    integrated PCS:
    - add a struct stmmac_pcs to encapsulate the phylink_pcs structure,
      pointer to stmmac_priv, and the core-specific base address of the PCS
      registers.
    - modify stmmac_priv and stmmac_mac_select_pcs() to return the embedded
      phylink_pcs structure when setup and STMMAC_PCS_SGMII is in use, and
      move the comment from stmmac_hw_setup() to here.
    - create stmmac_pcs.c, which contains the phylink_pcs_ops structure, a
      dummy .pcs_get_state() method which always reports link-down, and
      .pcs_config() method, moving the call to stmmac_pcs_ctrl_ane() here,
      but without indirecting through the dwmac specific core code. The
      link-down behaviour mentioned above maintains the current behaviour
      when phylink is used with inband but without a PCS.

    This will ensure that the PCS control register is configured to the
    same settings as before, but will now happen when the netdev is opened
    or reusmed rather than only during probe time. However, this will be
    before the .fix_mac_speed() method is called, which is critical for the
    behaviour in dwmac-qcom-ethqos's ethqos_configure_sgmii() function to
    be maintained.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P72-0000000AomR-3ro4@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:25 +02:00
Izabela Bakollari 2d0255aea0 net: stmmac: provide PCS initialisation hook
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 237e54caeaeff5693c1fc2c04737ee5fe77a8bcd
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:47 2025 +0100

    net: stmmac: provide PCS initialisation hook

    dwmac cores provide a feature bit to indicate when the PCS block is
    present, but features are only read after the core's setup() function
    has been called, meaning we can't decide whether to initialise the
    integrated PCS in the setup function. Provide a new MAC core hook
    for PCS initialisation, which will be called after the feature
    registers have been read.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6x-0000000AomL-3OKd@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:25 +02:00
Izabela Bakollari 88f5ed56d2 net: stmmac: only call stmmac_pcs_ctrl_ane() for integrated SGMII PCS
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 045d7e5727c451f310f0de72ec1452274167431f
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:42 2025 +0100

    net: stmmac: only call stmmac_pcs_ctrl_ane() for integrated SGMII PCS

    The internal PCS registers only exist if the core is synthesized with
    SGMII, TBI or RTBI support. They have no relevance for RGMII.

    However, priv->hw->pcs contains a STMMAC_PCS_RGMII flag, which is set
    if a PCS has been synthesized but we are operating in RGMII mode. As
    the register has no effect for RGMII, there is no point calling
    stmmac_pcs_ctrl_ane() in this case. Add a comment describing this
    and make it conditional on STMMAC_PCS_SGMII.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6s-0000000AomE-2pAa@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:24 +02:00
Izabela Bakollari edfa4658ae net: stmmac: do not require snps,ps-speed for SGMII
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 5c61db08d9aeb960691fae16cfdb23df1355987e
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:37 2025 +0100

    net: stmmac: do not require snps,ps-speed for SGMII

    SGMII mode does not require port-speed to be specified; this only
    switches SGMII to use the MAC configuration register speed settings
    and the actual value is irrelevant when the link comes up.

    As it seems the intention was to support "reverse SGMII" with this
    setting, but the code didn't actually configure that due to a typo,
    the warning and bad DT binding documentation has led people to
    specify snps,ps-speed in their DT files inappropriately.

    If mac_port_sel_speed is zero, then don't complain that the speed
    is invalid, as this means we're using "normal" SGMII.

    This does _not_ obsolete snps,ps-speed, nor does it change the
    behaviour of that property, with the exception of not making people
    mistakenly believe that they need to specify this option to use
    normal SGMII. There is no need to modify the binding.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6n-0000000Aom9-2LuZ@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:24 +02:00
Izabela Bakollari 45e698360b net: stmmac: hw->ps becomes hw->reverse_sgmii_enable
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 5d1e7621f869a4d9d1da1652eb2e944784d868d8
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:32 2025 +0100

    net: stmmac: hw->ps becomes hw->reverse_sgmii_enable

    After a lot of digging, it seems that the oddly named hw->ps member
    is all about setting the core into reverse SGMII speed. When set to
    a non-zero value, it:

    1. Configures the MAC at initialisation time to operate at a specific
       speed.
    2. It _incorrectly_ enables the transmitter (GMAC_CONFIG_TE) which
       makes no sense, rather than enabling the "transmit configuration"
       bit (GMAC_CONFIG_TC).
    3. It configures the SGMII rate adapter layer to retrieve its speed
       setting from the MAC configuration register rather than the PHY.

    In the previous commit, we removed (1) and (2) as phylink overwrites
    the configuration set at that step.

    Thus, the only functional aspect is (3), which is a boolean operation.
    This means there is no need to store the actual speed, and just have a
    boolean flag.

    Convert the priv->ps member to a boolean, and rename it to
    priv->reverse_sgmii_enable to make it more understandable.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6i-0000000Aom3-1y2y@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:24 +02:00
Izabela Bakollari 805e31f0ea net: stmmac: simplify stmmac_check_pcs_mode()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 412d5f32cb36110475d1c77e291b73e97f2f000a
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:27 2025 +0100

    net: stmmac: simplify stmmac_check_pcs_mode()

    Now that we only support one mode, simplify stmmac_check_pcs_mode().

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6d-0000000Aolw-1T7d@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:24 +02:00
Izabela Bakollari eb99e8c352 net: stmmac: move reverse-"pcs" mode setup to stmmac_check_pcs_mode()
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit c7b0d7874de0db6ce24bae3530ee91309aa2ff4e
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:22 2025 +0100

    net: stmmac: move reverse-"pcs" mode setup to stmmac_check_pcs_mode()

    The broken reverse-mode, selected by snps,ps-speed, is configured when
    the platform provides a valid port speed and a PCS is being used.

    Both these remain constant after the driver has probed, so the software
    state doesn't need to be re-initialised each time stmmac_hw_setup() is
    called (which is called at open and resume time.)

    Move the software setup of reverse-mode to stmmac_check_pcs_mode()
    which is called from the driver probe function.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6Y-0000000Aolr-0vLH@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:23 +02:00
Izabela Bakollari fc8f210121 net: stmmac: remove RGMII "pcs" mode
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit 70589b05a03e853367c6f887191a7527bcf08163
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:17 2025 +0100

    net: stmmac: remove RGMII "pcs" mode

    Remove the RGMII "pcs" code in stmmac_check_pcs_mode() due to:

    1) This should never have been conditional on a PCS being present, as
       when a core is synthesised using only RGMII, the PCS won't be present
       and priv->dma_cap.pcs will be false. Only multi-interface cores which
       have a PCS present would have detected RGMII.

    2) STMMAC_PCS_RGMII has no effect since the broken netif_carrier and
       ethtool code was removed.

    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6T-0000000Aoll-0Ify@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:23 +02:00
Izabela Bakollari 3b05d0322e net: stmmac: remove hw->ps xxx_core_init() hardware setup
JIRA: https://issues.redhat.com/browse/RHEL-128151

commit aa1b6775aef74b2177aa72f912564cd064a83b70
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Thu Oct 16 15:37:11 2025 +0100

    net: stmmac: remove hw->ps xxx_core_init() hardware setup

    After a lot of digging, it seems that the oddly named hw->ps member is
    all about configuring the core for reverse SGMII. This member is set to
    one of 0, SPEED_10, SPEED_100 or SPEED_1000 depending on
    priv->plat->mac_port_sel_speed. On DT systems, this comes from the
    "snps,ps-speed" DT property.

    When set to a non-zero value, it:

    1. Configures the MAC at initialisation time to operate at a specific
       speed. However, this will be overwritten by mac_link_up() when the
       link comes up (e.g. with the fixed-link parameters.)

       Note that dwxgmac2 wants to also support SPEED_2500 and SPEED_10000,
       but both these values are impossible.

    2. It _incorrectly_ enables the transmitter (GMAC_CONFIG_TE) which
       makes no sense, rather than enabling the "transmit configuration"
       bit (GMAC_CONFIG_TC). Likely a typo.

    3. It configures the SGMII rate adapter layer to retrieve its speed
       setting from the MAC configuration register rather than the PHY.

    There are two ways forward here:

    a) fixing (2) so that we set GMAC_CONFIG_TC. However, we have platform
       that set the "snps,ps-speed" property and that work today. Fixing
       this will cause the RGMII, SGMII or SMII inband configuration to be
       transmitted, which will be a functional change which could cause a
       regression.

    b) ripping out (1) and (2) as they are ineffective. This also has the
       possibility of regressions, but the patch author believes this risk
       is much lower than (a).

    Therefore, this commit takes the approach in (b).

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://patch.msgid.link/E1v9P6N-0000000Aolg-3y0a@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
2026-04-29 09:46:23 +02:00