]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: MII-Lite PHY interface mode
authorKamil Horák - 2N <kamilh@axis.com>
Tue, 8 Jul 2025 09:01:37 +0000 (11:01 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Jul 2025 02:32:30 +0000 (19:32 -0700)
Some Broadcom PHYs are capable to operate in simplified MII mode,
without TXER, RXER, CRS and COL signals as defined for the MII.
The MII-Lite mode can be used on most Ethernet controllers with full
MII interface by just leaving the input signals (RXER, CRS, COL)
inactive. The absence of COL signal makes half-duplex link modes
impossible but does not interfere with BroadR-Reach link modes on
Broadcom PHYs, because they are all full-duplex only.

Add MII-Lite interface mode, especially for Broadcom two-wire PHYs.

Signed-off-by: Kamil Horák - 2N <kamilh@axis.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20250708090140.61355-2-kamilh@axis.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/phy.rst
drivers/net/phy/phy-core.c
drivers/net/phy/phy_caps.c
drivers/net/phy/phylink.c
include/linux/phy.h

index f64641417c541f746115cad2128b770126397999..7f159043ad5a96920593d08511362d3b8b8f3dee 100644 (file)
@@ -333,6 +333,13 @@ Some of the interface modes are described below:
     SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved
     through symbol replication. The PCS expects the standard USXGMII code word.
 
+``PHY_INTERFACE_MODE_MIILITE``
+    Non-standard, simplified MII mode, without TXER, RXER, CRS and COL signals
+    as defined for the MII. The absence of COL signal makes half-duplex link
+    modes impossible but does not interfere with BroadR-Reach link modes on
+    Broadcom (and other two-wire Ethernet) PHYs, because they are full-duplex
+    only.
+
 Pause frames / flow control
 ===========================
 
index c480bb40fa7346024e5b0642f6909c0f545d39cc..605ca20ae192d737f75c031495402ac4527c545f 100644 (file)
@@ -115,6 +115,7 @@ int phy_interface_num_ports(phy_interface_t interface)
                return 0;
        case PHY_INTERFACE_MODE_INTERNAL:
        case PHY_INTERFACE_MODE_MII:
+       case PHY_INTERFACE_MODE_MIILITE:
        case PHY_INTERFACE_MODE_GMII:
        case PHY_INTERFACE_MODE_TBI:
        case PHY_INTERFACE_MODE_REVMII:
index d11ce1c7e712c5d48564b2dc3a8b4fd1483ecda0..2cc9ee97e867da8a1b98784f5d7434a9b65a1783 100644 (file)
@@ -316,6 +316,10 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
                link_caps |= BIT(LINK_CAPA_100HD) | BIT(LINK_CAPA_100FD);
                break;
 
+       case PHY_INTERFACE_MODE_MIILITE:
+               link_caps |= BIT(LINK_CAPA_10FD) | BIT(LINK_CAPA_100FD);
+               break;
+
        case PHY_INTERFACE_MODE_TBI:
        case PHY_INTERFACE_MODE_MOCA:
        case PHY_INTERFACE_MODE_RTBI:
index f5473510b762c15d7851b8f1bce3f49eec55dc4e..c7f867b361dda8f5feaa9609ed86275daa78495b 100644 (file)
@@ -237,6 +237,7 @@ static int phylink_interface_max_speed(phy_interface_t interface)
        case PHY_INTERFACE_MODE_SMII:
        case PHY_INTERFACE_MODE_REVMII:
        case PHY_INTERFACE_MODE_MII:
+       case PHY_INTERFACE_MODE_MIILITE:
                return SPEED_100;
 
        case PHY_INTERFACE_MODE_TBI:
index 543a94751a6badb0a89fc8a88fbb12fc81efefa5..4c2b8b6e7187923d6e32bf522be6f1645b375613 100644 (file)
@@ -106,6 +106,7 @@ extern const int phy_basic_ports_array[3];
  * @PHY_INTERFACE_MODE_50GBASER: 50GBase-R - with Clause 134 FEC
  * @PHY_INTERFACE_MODE_LAUI: 50 Gigabit Attachment Unit Interface
  * @PHY_INTERFACE_MODE_100GBASEP: 100GBase-P - with Clause 134 FEC
+ * @PHY_INTERFACE_MODE_MIILITE: MII-Lite - MII without RXER TXER CRS COL
  * @PHY_INTERFACE_MODE_MAX: Book keeping
  *
  * Describes the interface between the MAC and PHY.
@@ -150,6 +151,7 @@ typedef enum {
        PHY_INTERFACE_MODE_50GBASER,
        PHY_INTERFACE_MODE_LAUI,
        PHY_INTERFACE_MODE_100GBASEP,
+       PHY_INTERFACE_MODE_MIILITE,
        PHY_INTERFACE_MODE_MAX,
 } phy_interface_t;
 
@@ -272,6 +274,8 @@ static inline const char *phy_modes(phy_interface_t interface)
                return "laui";
        case PHY_INTERFACE_MODE_100GBASEP:
                return "100gbase-p";
+       case PHY_INTERFACE_MODE_MIILITE:
+               return "mii-lite";
        default:
                return "unknown";
        }