From nobody Thu Aug 11 18:23:22 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 4M3Ztf3FnBz4ZNBs; Thu, 11 Aug 2022 18:23:22 +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 4M3Ztf2SgDz4GTC; Thu, 11 Aug 2022 18:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660242202; 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=CzxhyY+RxSTDdTmUxhEEUHmbWcNa+NOnOmoEz9YDExs=; b=Ha3PJoPFXi4xUC0GqPfHMcsryz2B+CSp1hzYyo8XXKAUeuOeywJ2UqSNlZ/U60jOoe6Xlh VKY6yWpfPyNS0w0JQAZHw7BzC8OHt0gIbY3BxhmNlIwPrdtb0ypB2t5bpIswrkcuRn7XW8 DWhH2TVPqA7bHAxmMLLwuOvn3USmEKtJ/wdpDsSdE3dpvuk/H6/THwOcKwldX7EVfA6NTN o/XW2eYyJEMIBal6T7HAT+cM3mcHjteILUGw/08jebts62bWfztgb454AFvEq+oJsAg8u8 NyEvpjuoHEv7xg81F4VF2wxu9qwQsMNJMVObBcNKvfByr7hZv7lzZQXI2YhQ/Q== 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 4M3Ztf1XjJz11j7; Thu, 11 Aug 2022 18:23:22 +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 27BINMTm018090; Thu, 11 Aug 2022 18:23:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BINM8q018089; Thu, 11 Aug 2022 18:23:22 GMT (envelope-from git) Date: Thu, 11 Aug 2022 18:23:22 GMT Message-Id: <202208111823.27BINM8q018089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9c6bcc94c875 - stable/12 - 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9c6bcc94c875d10e3cd30b24d4854c62d4bc6ab9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660242202; 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=CzxhyY+RxSTDdTmUxhEEUHmbWcNa+NOnOmoEz9YDExs=; b=CBdsY1EquhmAzNsYgbzzzQWWFXxqUsbndPfNuFd83ZcvDB80s5DMVSf9X/XkGnfHNJ+bS6 RMyGf3enQ00UfhbGh0M9421E2h+GSqdziQRWoY4q8y3NI9efqzdGW2n0JvtGIp6+0K8VDb DLxDFTlmpycvq+JVEBivUuyb0fBtUrqySpqNU6JgapBpLjTNQSoZw8DPCfWTY8J8vDSb/U NcLsc2xRpkw8jRh8fCuLM7IBHhBM+EZtmSkzx0ar4XruysVwXzsnRB6UE3hVKX9L7SGxW7 C1+KbaBTjRk8IfT2ilDDuICZsjpCWDUVa1HAEckvdFWD8ftbMzzhGpu413UNzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660242202; a=rsa-sha256; cv=none; b=DtRAnkNLigwnTgFdBQhkV7k9pPCriS5swmDD7qRirVpFrV1VQUyriQ1X0BNdVla034HkpW vJ7yQlFPnxmV9KyBtl2THrOH+37LIMrH2DVRBRbDSBOtAEAb2IO6LVYZfisKf+gbo7vpzR mjrpoXohvtomdoTTZWzyex1lDKIWuHrDKtTp2ZzzJe17X2R8ne+IBRkICGnMqvEpodWUfc vEFQwVBpQWr+9HW3lDGr3HOqE77wTmehtSISDTWFaxuB+slMUZtyHcZs+Y5OvLm271oOYp tS0JAnyY8YnW/dY9kJmzubH8JitZlTnfeGcYoUhY97YdimFfZGFuWvMNWe0TXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9c6bcc94c875d10e3cd30b24d4854c62d4bc6ab9 commit 9c6bcc94c875d10e3cd30b24d4854c62d4bc6ab9 Author: Emmanuel Vadot AuthorDate: 2022-02-22 08:58:36 +0000 Commit: Mitchell Horne CommitDate: 2022-08-11 17:55:09 +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 1b0d5e97417f..06eb6bb47649 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -1450,11 +1450,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 045072abe611..005a6f1ad684 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 */