From nobody Wed May 08 09:05:00 2024 X-Original-To: dev-commits-src-all@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 4VZ8Nr6MKbz5KgN6; Wed, 08 May 2024 09:05:00 +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 4VZ8Nr4NgGz3wx5; Wed, 8 May 2024 09:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715159100; 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=yHbTQGgUrMOFubNdr5zU2+tAnuRDk+aCjauSYJcxhbw=; b=wGow9mTkuJoc1O1VbEzm1TOMg/Dwg6/iWxN4DfmpPBiz0E/u2zlDSMUw0/c6aQTPuFiL5I HaqjH2N3/EZgnff22lHQNbG9WoggjOFxeKZ8OT3Yn3dKJ07vyX8Bnwb7PVxqZu5W7VuT7q WwvvrEm12KEWND43tA7uhND2WdqOnnidRQchEvmfNva0vzAl4/57hOYqNn4d3zz4SwUUXT QKEiOCp5kI61YasJtnS3hJGIwR053uYMKAraodeE+Qcgf1AH5/hGP4vaKzCgFAHYAaC8R+ OrtosohhBWJc0irBtqh/eKzdI60AcMuFu3sfRX442vMhUnRMzHhsVdg8Oba4WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715159100; a=rsa-sha256; cv=none; b=T5WCT/C6ZQt3qQeK7S21ABnxO9J+w7HQwk1PmiHyVRCq58pw7j2q118qaMJ+cps9CumnmB J9pmfZ2S5/agEhJmLXgteUsG9bh6RlLHZ5nt1ukd/CME716uy44HMgFEP1/Uj8zmQjzZZ1 Zmt077TFds0FLi8CL+5Td8Xz+TrzKd4nBEQDS7QAP7WNR7A1VynWnkw6L9Re0lhpBaNqVI hkG2DegjDl0sv+vW9xdYv66nzRpe1qUJONrZU2MugCZvBT9eMv6ac6t2CrgCODTen1EITM 75g2GBHw4IBvxzetrjzcDvbCxgaXSvPEtsQALsHqgNrB1kdPxJWOkaRwa6UAvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715159100; 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=yHbTQGgUrMOFubNdr5zU2+tAnuRDk+aCjauSYJcxhbw=; b=TlqodAo7AB64Uxs1K4Zojce4TdJaNhuLs7NgT0fgwYlqnhDbZhRr3Ut3u0Prtz9MEv31cd coE7HRyQr14+1DFNB1nSt2XwyUCxxjgcauTq1i7yJa94id68QqCgXVDydatlqSkqXA/K+D 8eRtkJttGdXcrmpA9i3298Q+cx39MK9rPAybx0Zbkx4TqJMbpJPhA4NbViQF3Lxjacpoud AJfB0/nOlGeQqUioQwWuQiylH1uD3oSovW0NfA5bTWtvz+wMbY2gBTyq2WOaN70tb1JfKo MFDWo9331YIW7h2o5B+5BpsSo5J42xPWBpR+sI11sYGR93qta2bK8t3B+JuebA== 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 4VZ8Nr40dzzJgp; Wed, 8 May 2024 09:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448950Lc074044; Wed, 8 May 2024 09:05:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448950p6074041; Wed, 8 May 2024 09:05:00 GMT (envelope-from git) Date: Wed, 8 May 2024 09:05:00 GMT Message-Id: <202405080905.448950p6074041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Jeremy Subject: git: 3fe25a9bfcd9 - main - mii: Add support for Realtek RTL8211F-VD PHY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: peterj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fe25a9bfcd9c8afeb096828567353a84be37423 Auto-Submitted: auto-generated The branch main has been updated by peterj: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe25a9bfcd9c8afeb096828567353a84be37423 commit 3fe25a9bfcd9c8afeb096828567353a84be37423 Author: Peter Jeremy AuthorDate: 2024-05-08 08:17:00 +0000 Commit: Peter Jeremy CommitDate: 2024-05-08 08:17:00 +0000 mii: Add support for Realtek RTL8211F-VD PHY The RTL8211F-VD is a replacement/upgrade for the RTL8211F. Based on https://github.com/torvalds/linux/commit/bb726b753f75a4eeda291438f89dfd9b94783569, the only difference is the lack of the PCR2 register, which FreeBSD doesn't use. This fixes autonegotiation problems using the RTL8211F with ukphy(4). Reviewed by: manu, bz MFC after: 1 month Differential Revision: mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= RGEPHY_8211B) { - if (sc->mii_mpd_rev == RGEPHY_8211F) { + if (sc->mii_mpd_rev >= RGEPHY_8211F) { reg = PHY_READ(sc, RGEPHY_F_MII_SSR); if (reg & RGEPHY_F_SSR_LINK) linkup++; @@ -338,7 +339,7 @@ rgephy_status(struct mii_softc *sc) if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= RGEPHY_8211B) { - if (sc->mii_mpd_rev == RGEPHY_8211F) { + if (sc->mii_mpd_rev >= RGEPHY_8211F) { ssr = PHY_READ(sc, RGEPHY_F_MII_SSR); switch (ssr & RGEPHY_F_SSR_SPD_MASK) { case RGEPHY_F_SSR_S1000: @@ -523,6 +524,7 @@ rgephy_reset(struct mii_softc *sc) switch (sc->mii_mpd_rev) { case RGEPHY_8211F: + case RGEPHY_8211FVD: pcr = PHY_READ(sc, RGEPHY_F_MII_PCR1); pcr &= ~(RGEPHY_F_PCR1_MDI_MM | RGEPHY_F_PCR1_ALDPS_EN); PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr); diff --git a/sys/dev/mii/rgephyreg.h b/sys/dev/mii/rgephyreg.h index 205f1a836020..fef985ebe30e 100644 --- a/sys/dev/mii/rgephyreg.h +++ b/sys/dev/mii/rgephyreg.h @@ -38,6 +38,7 @@ #define RGEPHY_8211B 2 #define RGEPHY_8211C 3 #define RGEPHY_8211F 6 +#define RGEPHY_8211FVD 8 /* * RealTek 8169S/8110S gigE PHY registers