[PATCH net-next v2 2/3] net: macb: add support for reporting SGMII inband link status
From: Charles Perry
Date: Tue Feb 24 2026 - 15:30:22 EST
This makes it possible to use in-band autonegotiation with
SGMII.
If using a device tree, this can be done by adding the managed =
"in-band-status" property to the gem node.
Signed-off-by: Charles Perry <charles.perry@xxxxxxxxxxxxx>
---
Notes:
Changes in v2:
* Move my notes to the cover letter
drivers/net/ethernet/cadence/macb_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index f4250e76cef0..f6efc1bb88b6 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -560,7 +560,12 @@ static int macb_usx_pcs_config(struct phylink_pcs *pcs,
static void macb_pcs_get_state(struct phylink_pcs *pcs, unsigned int neg_mode,
struct phylink_link_state *state)
{
- state->link = 0;
+ struct macb *bp = container_of(pcs, struct macb, phylink_sgmii_pcs);
+ u16 bmsr, lpa;
+
+ bmsr = gem_readl(bp, PCSSTS);
+ lpa = gem_readl(bp, PCSANLPBASE);
+ phylink_mii_c22_pcs_decode_state(state, neg_mode, bmsr, lpa);
}
static void macb_pcs_an_restart(struct phylink_pcs *pcs)
--
2.47.3