From owner-freebsd-hackers@freebsd.org Sat Aug 1 09:33:21 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E8D7375273 for ; Sat, 1 Aug 2020 09:33:21 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4BJf8d1T9kz46wc for ; Sat, 1 Aug 2020 09:33:21 +0000 (UTC) (envelope-from se@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3283D37512A; Sat, 1 Aug 2020 09:33:21 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 324AE375315 for ; Sat, 1 Aug 2020 09:33:21 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJf8d0L61z477l; Sat, 1 Aug 2020 09:33:21 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f277400050cd3adce410cd2.dip0.t-ipconnect.de [IPv6:2003:cd:5f27:7400:50c:d3ad:ce41:cd2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 6B1DB128BD; Sat, 1 Aug 2020 09:33:20 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: Support for RealTek RTL8125B chipset? To: Stephen Hocking References: Cc: hackers@freebsd.org From: Stefan Esser Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: <83f06794-1945-649a-6997-dc2959cb0d82@freebsd.org> Date: Sat, 1 Aug 2020 11:33:17 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 09:33:21 -0000 Am 01.08.20 um 05:05 schrieb Stephen Hocking: > Just scored one of those spiffy Odroid H2+ boxes with 2 ethernet > ports, only to be disappointed that FreeBSD 12.1 doesn't seem to > support the ethernet chipset. Does anyone have any plans to add this > in the foreseeable future? Short answer: try the port version (net/realtek_re_kmod). I'm using it on my AMD B550 mainboard with on-board RTL8125, currently. It is known to work on amd64, but I have not seen any success reports for another architecture, yet. Since that port is based on the FreeBSD driver available from the RealTek web-site, which still has ifdefs for FreeBSD 4 and earlier, but lacks a number of features added to our version in recent years, I have started to merge the code required to support the RTL8125 to our driver, a few weeks ago. (There is no publicly available data sheet or other information for the RTL8125 and its PHY, AFAIK.) I have merged most of the header bits (defines for new registers and new bits in existing registers) to sys/dev/rl/if_rlreg.h and have added some of the new functionality to sys/dev/re/if_re.c, but a lot is missing and a lot can still be improved. And then there is the MII PHY code that is embedded in the RealTek driver and split of into the miibus framework in FreeBSD. The code that operates on the PHY has therefore to be separated out from the RealTek driver and integrated into our mii/rgephy.c ... The Realtek driver contains more than 10 embedded firmware blobs for different RealTek chips supported by the driver (supposedly to work around a number of chip bugs or deficiencies of the firmware burnt into those chips) and I have found that there are about the same number of specific firmware files for the Linux RealTek driver, too (but not 1:1 matching the one in the RealTek driver, looking at the names of those firmware files). The driver distributed by RealTek (and used for the kmod port) has a list of some 60 chip revisions and special cases in nearly every function to support them (there are 4 procedures to reset the chip, for example). I have converted quite some code from the RealTek driver to fit in with our driver version and the merged driver should contain all the features of our current re driver and missing in the RealTek version (e.g. NETMAP support) but also include support for the RTL8125 and I plan to integrate the firmware loading (but that could lead to slightly different behavior of the RTL chips and thus to regressions since our driver code assumes the behavior of the chip with its burnt in firmware ...) My version still works with e.g. the RTL8111 I bought to have another chip of this series in my development system to be able to test for regressions. But it does not fully initialize the RTL8125, yet, and work will progress as spare time permits. TL:DR The port version seems to work well enough to get the RTL8125 working without a number of features our if_re.c grew over time. It will also work with other RTL chips and might even give better results for them, since it includes revision specific firmware blobs. I hope to get a working RTL8125 driver that does include all features of our current if_re.c within a few weeks. But this is a spare-time project and progress will depend on the amount of available time ... Regards, STefan