[PATCH net v6 0/4] net: phy: bcm54811: Fix the PHY initialization

Kamil Horák - 2N posted 4 patches 3 months ago
.../bindings/net/ethernet-controller.yaml     |  1 +
Documentation/networking/phy.rst              |  7 ++++
drivers/net/phy/broadcom.c                    | 39 ++++++++++++++++---
drivers/net/phy/phy-core.c                    |  1 +
drivers/net/phy/phy_caps.c                    |  4 ++
drivers/net/phy/phylink.c                     |  1 +
include/linux/brcmphy.h                       |  6 +++
include/linux/phy.h                           |  4 ++
8 files changed, 58 insertions(+), 5 deletions(-)
[PATCH net v6 0/4] net: phy: bcm54811: Fix the PHY initialization
Posted by Kamil Horák - 2N 3 months ago
Fix the bcm54811 PHY driver initialization for MII-Lite.

The bcm54811 PHY in MLP package must be setup for MII-Lite interface
mode by software. Normally, the PHY to MAC interface is selected in
hardware by setting the bootstrap pins of the PHY. However, MII and
MII-Lite share the same hardware setup and must be distinguished by
software, setting appropriate bit in a configuration register.
The MII-Lite interface mode is non-standard one, defined by Broadcom
for some of their PHYs. The MII-Lite lightness consist in omitting
RXER, TXER, CRS and COL signals of the standard MII interface.
Absence of COL them makes half-duplex links modes impossible but
does not interfere with Broadcom's BroadR-Reach link modes, because
they are full-duplex only.
To do it in a clean way, MII-Lite must be introduced first, including
its limitation to link modes (no half-duplex), because it is a
prerequisite for the patch #3 of this series. The patch #4 does not
depend on MII-Lite directly but both #3 and #4 are necessary for 
bcm54811 to work properly without additional configuration steps to be
done - for example in the bootloader, before the kernel starts.


PATCH 1 - Add MII-Lite PHY interface mode as defined by Broadcom for
   their two-wire PHYs. It can be used with most Ethernet controllers
   under certain limitations (no half-duplex link modes etc.).

PATCH 2 - Add MII-Lite PHY interface type

PATCH 3 - Activation of MII-Lite interface mode on Broadcom bcm5481x
   PHYs

PATCH 4 - Fix the BCM54811 PHY initialization so that it conforms
   to the datasheet regarding a reserved bit in the LRE Control
   register, which must be written to zero after every device reset.
   Also fix the LRE Status register reading, there is another bit to
   be ignored on bcm54811.

Changes in v2:
  - Applied reviewers' comments
  - Divided into more patches (separated common and Broadcom
   PHY specific code)

Changes in v3:
  - Added MII-Lite documentation

Changes in v4:
  - Added missing Fixes headers

Changes in v5:
  - Removed unused PHY register bits definition

Changes in v6:
  - Reworded the cover letter to explain why this series should be applied
   at once and routed through "net", not "net-next".

  Kamil Horák - 2N (4):
  net: phy: MII-Lite PHY interface mode
  dt-bindings: ethernet-phy: add MII-Lite phy interface type
  net: phy: bcm5481x: MII-Lite activation
  net: phy: bcm54811: Fix the PHY initialization

 .../bindings/net/ethernet-controller.yaml     |  1 +
 Documentation/networking/phy.rst              |  7 ++++
 drivers/net/phy/broadcom.c                    | 39 ++++++++++++++++---
 drivers/net/phy/phy-core.c                    |  1 +
 drivers/net/phy/phy_caps.c                    |  4 ++
 drivers/net/phy/phylink.c                     |  1 +
 include/linux/brcmphy.h                       |  6 +++
 include/linux/phy.h                           |  4 ++
 8 files changed, 58 insertions(+), 5 deletions(-)

-- 
2.39.5

Re: [PATCH net v6 0/4] net: phy: bcm54811: Fix the PHY initialization
Posted by Jakub Kicinski 3 months ago
On Fri, 4 Jul 2025 10:35:08 +0200 Kamil Horák - 2N wrote:
> Fix the bcm54811 PHY driver initialization for MII-Lite.

Sorry for the delay, I went AFK for the long weekend shortly after
responding to v5. IIUC bcm54811 basically never worked, so I think
net-next is appropriate for the whole series. Please rebase and strip
the Fixes tags.
-- 
pw-bot: cr
Re: [PATCH net v6 0/4] net: phy: bcm54811: Fix the PHY initialization
Posted by Kamil Horák (2N) 3 months ago

On 7/7/25 21:53, Jakub Kicinski wrote:
> On Fri, 4 Jul 2025 10:35:08 +0200 Kamil Horák - 2N wrote:
>> Fix the bcm54811 PHY driver initialization for MII-Lite.
> 
> Sorry for the delay, I went AFK for the long weekend shortly after
> responding to v5. IIUC bcm54811 basically never worked, so I think
> net-next is appropriate for the whole series. Please rebase and strip
> the Fixes tags.
OK tried to do so as best as possible. Keeping the Reviewed tags, hope 
it is correct even when we switched to net-next.
The PHY still initializes and runs correctly in the kernel built from 
net-next.

Kamil