Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2024 19:11:14 +0000
From:      John F Carr <jfc@mit.edu>
To:        JMT Sihvola <jsihv@gmx.com>
Cc:        "freebsd-riscv@freebsd.org" <freebsd-riscv@freebsd.org>
Subject:   Re: JH7110 dwc MAC support
Message-ID:  <AA50117A-8C29-4FD2-BCFD-FBC87ECC57CC@mit.edu>
In-Reply-To: <trinity-e7a78d45-28c3-4905-9504-37475fb12770-1718379639909@3c-app-mailcom-bs01>
References:  <7E28ED97-DD4B-40AA-91FB-DB3982042265@mit.edu> <trinity-e7a78d45-28c3-4905-9504-37475fb12770-1718379639909@3c-app-mailcom-bs01>

next in thread | previous in thread | raw e-mail | index | archive | help


> On Jun 14, 2024, at 11:40, JMT Sihvola <jsihv@gmx.com> wrote:
>=20
>=20
>=20
>> Sent: Friday, June 14, 2024 at 6:06 PM
>> From: "John F Carr" <jfc@mit.edu>
>> To: "freebsd-riscv@freebsd.org" <freebsd-riscv@FreeBSD.org>
>> Subject: JH7110 dwc MAC support
>>=20
>> Has anybody gotten the ethernet driver working on this chip?
>> It's a DesignWare MAC according to the device tree so if_dwc.c
>> should be the starting point.  The driver does not work
>> simply by changing the "compatible" string.  It can't find
>> the PHY because all the register reads come back 0.  The
>> only documentation I can find is the Linux driver source code.
>> I can try updating register offsets and command bit patterns
>> to match what the Linux driver does with "snps,dwmac-5.20".
>=20
> JH7110 uses dwmac version 5.2. FreeBSD has codes for 4.x (which is
> almost similar) in sys/dev/eqos. JH7110 also uses Motorcomm's
> Ethernet-phy version 8531 which currently isn't supported.
>=20
> I have updated those codes to get network working on JH7110 but
> I have not yet submitted them because there is a problem which prevents
> changing the Ethernet port on fly. It's possible that this problem is cau=
sed
> by a bug outside of these drivers. It has been difficult to track it down
> but I keep working on with the issue.
>=20
> I have those updated driver codes in my personal github:
> https://github.com/jsihvola/freebsd-src/
> See the last commit (otherwise this repository is not up-to-date).
>=20
> So if you can live with the port switching issue, those codes
> should make it possible to get JH7110 online. Also, eqos driver
> has some shortcomings, making network speed slower than what it could be.
>=20
> JH7110 clocks required by Ethernet are available in FreeBSD repository.
> GPIO & MMC have been submitted. USB & pinctrl are being worked on.
>=20
> -jari sihvola
>=20
>=20

Thanks.  I tried putting your driver on the main (15-CURRENT) branch.
It attaches but does not seem to put anything on the wire.
I will try building your 14-based branch next.

Is it correct to see a total of four PHYs in the dmesg output below?

eqos0: <DesignWare EQOS Gigabit Ethernet for JH7110> mem 0x16030000-0x1603f=
fff irq 62,63,64 on simplebus0
eqos0: DesignWare EQOS ver 0x52 (0x41)
eqos0: hw features 1a2173f7 09845904 01000000 00000000
eqos0: Ethernet address f2:00:25:43:09:d6
eqos0: TX ring @ 0x41ede000, RX ring @ 0x42fdf000
miibus0: <MII bus> on eqos0
mcommphy0: <Motorcomm YT8531 10/100/1000 PHY> PHY 0 on miibus0
mcommphy0: OUI 0xc82b5e, model 0x0011, rev. 11
mcommphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT=
-FDX, 1000baseT-FDX-master, auto
mcommphy1: <Motorcomm YT8531 10/100/1000 PHY> PHY 1 on miibus0
mcommphy1: OUI 0xc82b5e, model 0x0011, rev. 11
mcommphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT=
-FDX, 1000baseT-FDX-master, auto
eqos0: bpf attached
eqos0: Ethernet address: f2:00:25:43:09:d6
eqos1: <DesignWare EQOS Gigabit Ethernet for JH7110> mem 0x16040000-0x1604f=
fff irq 65,66,67 on simplebus0
eqos1: DesignWare EQOS ver 0x52 (0x41)
eqos1: hw features 1a2173f7 09845904 01000000 00000000
eqos1: Ethernet address f2:00:6a:9e:95:8b
eqos1: TX ring @ 0x42fe5000, RX ring @ 0x439e7000
miibus1: <MII bus> on eqos1
mcommphy2: <Motorcomm YT8531 10/100/1000 PHY> PHY 0 on miibus1
mcommphy2: OUI 0xc82b5e, model 0x0011, rev. 11
mcommphy2:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT=
-FDX, 1000baseT-FDX-master, auto
mcommphy3: <Motorcomm YT8531 10/100/1000 PHY> PHY 1 on miibus1
mcommphy3: OUI 0xc82b5e, model 0x0011, rev. 11
mcommphy3:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT=
-FDX, 1000baseT-FDX-master, auto
eqos1: bpf attached
eqos1: Ethernet address: f2:00:6a:9e:95:8b




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AA50117A-8C29-4FD2-BCFD-FBC87ECC57CC>