From nobody Fri Mar 04 10:29:31 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6660219F5335; Fri, 4 Mar 2022 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K93xl22Bsz4g4W; Fri, 4 Mar 2022 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646389771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RLv3yTYWoyZ/kPkF2idHtOZaovmrge4VVAX3KLjnDqE=; b=v9uRjOaCNQ4YHVI70oJMwJH2M1WRRtA7M1fgkM9r7R4xCFRU/bL+GgWfDq6bRtl9FfoJ5e KkFbPemnmu23kjaOZw8Ww6GPufgt/a61b/CCRtVW1B4JrEeXBKvbraAMMT/c85WtWdYlk3 iiQoFxW9Ii5BRFBy3tS3qOGLe7de+LqvuW+w0ZwfvGj7bbWtPrg0nEpo8PjD7nhA1O+hXV 20cmq0hGhFHdbXN2UmeWPRev1iGqeRwp06s7+R2olpiB5kf7rWesMIl/OBLLSFxZbh60zF MGrxTmZoskdqtZxYwaDQSMt93rxb12zfryvVZVbGkCo8xYODKlVp4Svw/PcdEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21B231F51; Fri, 4 Mar 2022 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 224ATVuo013492; Fri, 4 Mar 2022 10:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 224ATVQT013491; Fri, 4 Mar 2022 10:29:31 GMT (envelope-from git) Date: Fri, 4 Mar 2022 10:29:31 GMT Message-Id: <202203041029.224ATVQT013491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 949837074342 - stable/13 - dwc: Support phy mode MII List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 949837074342a5206a17de5debd277da1d61b1cb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646389771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RLv3yTYWoyZ/kPkF2idHtOZaovmrge4VVAX3KLjnDqE=; b=EsGUPmRVQCrvXD6QhzR8je4eV8/Vsyvy9y3bv3cuxIQUae9Kes8h77YH591tJbatgrj4TT ICWse9J5fYdT7P1Q070husTJPuxHPFDSpAHbr9EdBdQ/nFVFe5IV+AzLyoZ06n597ELdNF CpZ1PhU1wIstSKJ0qYCbQqH/w6OHl70zyptK07xXfqer3rM193MWiCpnERNftutkFR5ySK sCC6pWMqP61cJW9DvriWkercUi9XDOBiKWUh4nPVm8koXoQLWZTMS6cKJaw8soKq7I5H5z V8EPD/9CBEKAWQxyTf6IU1xPc6OnlAtR3aaCy6ar2Xp67myufdhOjRe2Cg4vmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646389771; a=rsa-sha256; cv=none; b=dWXCZdVSgA1/TKN0581ngSc24qjJnS2cjiTvZuBgS71J6ZYvXjZ+PrNjt5mFXKEHMsOG/V A4NX+0Qf2doS/PCjPqlGsgqbN8tTviYimRTb3wxtAY8pSTObZP0ZGsKEjRnjEA+1mQAL61 WBGsPSC1j/fjJVBo/ywH+w60c5lRhcTx26ODZ4p/aJAO9m4VCwXkwT+c5g21vYp5vh5pH9 E8R92VWi6o3o19ooypJFQMDrSi35X7gdqMVRUsHoMFHk0oBl7Pxg+BfPXlEqr8DWNvacjK mB07dES4SjC5bhWI/RKyTvjIOSc7b2C1XRPYHXPLQdpMQPLBK/tsJ46v6r2zlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=949837074342a5206a17de5debd277da1d61b1cb commit 949837074342a5206a17de5debd277da1d61b1cb Author: Emmanuel Vadot AuthorDate: 2022-02-22 08:58:36 +0000 Commit: Emmanuel Vadot 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 */