git: 949837074342 - stable/13 - dwc: Support phy mode MII
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 04 Mar 2022 10:29:31 UTC
The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=949837074342a5206a17de5debd277da1d61b1cb commit 949837074342a5206a17de5debd277da1d61b1cb Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2022-02-22 08:58:36 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2022-03-04 10:29:13 +0000 dwc: Support phy mode MII Some board use dwc phy in MII mode, so do not fail to attach if this is the case. Only rockchip code uses the phy mode to program some custom syscon register. PR: 260848 MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit da6252a6a099e6253207b69960e6762ce3cca0f8) --- sys/dev/dwc/if_dwc.c | 11 +++++++---- sys/dev/dwc/if_dwc.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 0704912b48ad..d2e21d22a776 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -1579,11 +1579,14 @@ dwc_attach(device_t dev) case MII_CONTYPE_RGMII_ID: case MII_CONTYPE_RGMII_RXID: case MII_CONTYPE_RGMII_TXID: - sc->phy_mode = PHY_MODE_RGMII; - break; + sc->phy_mode = PHY_MODE_RGMII; + break; case MII_CONTYPE_RMII: - sc->phy_mode = PHY_MODE_RMII; - break; + sc->phy_mode = PHY_MODE_RMII; + break; + case MII_CONTYPE_MII: + sc->phy_mode = PHY_MODE_MII; + break; default: device_printf(dev, "Unsupported MII type\n"); return (ENXIO); diff --git a/sys/dev/dwc/if_dwc.h b/sys/dev/dwc/if_dwc.h index d475974fcff9..d8c10258388a 100644 --- a/sys/dev/dwc/if_dwc.h +++ b/sys/dev/dwc/if_dwc.h @@ -40,6 +40,7 @@ #define PHY_MODE_UNKNOWN 0x0 #define PHY_MODE_RMII 0x1 #define PHY_MODE_RGMII 0x2 +#define PHY_MODE_MII 0x3 #define MAC_CONFIGURATION 0x0 #define CONF_JD (1 << 22) /* jabber timer disable */