Skip to content

Commit 67c0170

Browse files
Kamil Horák - 2Nkuba-moo
authored andcommitted
net: phy: MII-Lite PHY interface mode
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>
1 parent 6dfcbd7 commit 67c0170

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

Documentation/networking/phy.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ Some of the interface modes are described below:
333333
SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved
334334
through symbol replication. The PCS expects the standard USXGMII code word.
335335

336+
``PHY_INTERFACE_MODE_MIILITE``
337+
Non-standard, simplified MII mode, without TXER, RXER, CRS and COL signals
338+
as defined for the MII. The absence of COL signal makes half-duplex link
339+
modes impossible but does not interfere with BroadR-Reach link modes on
340+
Broadcom (and other two-wire Ethernet) PHYs, because they are full-duplex
341+
only.
342+
336343
Pause frames / flow control
337344
===========================
338345

drivers/net/phy/phy-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ int phy_interface_num_ports(phy_interface_t interface)
115115
return 0;
116116
case PHY_INTERFACE_MODE_INTERNAL:
117117
case PHY_INTERFACE_MODE_MII:
118+
case PHY_INTERFACE_MODE_MIILITE:
118119
case PHY_INTERFACE_MODE_GMII:
119120
case PHY_INTERFACE_MODE_TBI:
120121
case PHY_INTERFACE_MODE_REVMII:

drivers/net/phy/phy_caps.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
316316
link_caps |= BIT(LINK_CAPA_100HD) | BIT(LINK_CAPA_100FD);
317317
break;
318318

319+
case PHY_INTERFACE_MODE_MIILITE:
320+
link_caps |= BIT(LINK_CAPA_10FD) | BIT(LINK_CAPA_100FD);
321+
break;
322+
319323
case PHY_INTERFACE_MODE_TBI:
320324
case PHY_INTERFACE_MODE_MOCA:
321325
case PHY_INTERFACE_MODE_RTBI:

drivers/net/phy/phylink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ static int phylink_interface_max_speed(phy_interface_t interface)
237237
case PHY_INTERFACE_MODE_SMII:
238238
case PHY_INTERFACE_MODE_REVMII:
239239
case PHY_INTERFACE_MODE_MII:
240+
case PHY_INTERFACE_MODE_MIILITE:
240241
return SPEED_100;
241242

242243
case PHY_INTERFACE_MODE_TBI:

include/linux/phy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ extern const int phy_basic_ports_array[3];
106106
* @PHY_INTERFACE_MODE_50GBASER: 50GBase-R - with Clause 134 FEC
107107
* @PHY_INTERFACE_MODE_LAUI: 50 Gigabit Attachment Unit Interface
108108
* @PHY_INTERFACE_MODE_100GBASEP: 100GBase-P - with Clause 134 FEC
109+
* @PHY_INTERFACE_MODE_MIILITE: MII-Lite - MII without RXER TXER CRS COL
109110
* @PHY_INTERFACE_MODE_MAX: Book keeping
110111
*
111112
* Describes the interface between the MAC and PHY.
@@ -150,6 +151,7 @@ typedef enum {
150151
PHY_INTERFACE_MODE_50GBASER,
151152
PHY_INTERFACE_MODE_LAUI,
152153
PHY_INTERFACE_MODE_100GBASEP,
154+
PHY_INTERFACE_MODE_MIILITE,
153155
PHY_INTERFACE_MODE_MAX,
154156
} phy_interface_t;
155157

@@ -272,6 +274,8 @@ static inline const char *phy_modes(phy_interface_t interface)
272274
return "laui";
273275
case PHY_INTERFACE_MODE_100GBASEP:
274276
return "100gbase-p";
277+
case PHY_INTERFACE_MODE_MIILITE:
278+
return "mii-lite";
275279
default:
276280
return "unknown";
277281
}

0 commit comments

Comments
 (0)