940. radon's second Ethernet port: the driver brings up ethernet@16040000 as well
(Number, title and slug provisional.)
calef asked for this on 2026-10-20 (UTC), at the bench: "Lets create a milestones to get jack #1
also working." A writing-only lane wrote it the same day and built nothing.
Why
radon, a VisionFive 2 v1.3B, has two RJ45 jacks. Each is a Synopsys DesignWare Ethernet QoS
controller behind its own Motorcomm YT8531: gmac0 at 0x1603_0000 and gmac1 at
0x1604_0000. Milestone 53 (the board's own peripherals: network and storage on real silicon)
drives only the first. Its first bench runs, on 2026-10-20 (UTC), on branch
milestone/53-radon-first-runs (bench/radon-2026-10-20/network-bench-{1,2,3}.log):
- U-Boot 2021.10 links on either jack.
- With the cable in
gmac0's jack,network_benchreached a 1000 Mbit/s link, a DHCP lease andcoherence : Coherent. The PHY readid 0x4f51e91b, 1800 mV I/O, settings fromFallback. - With the cable in
gmac1's jack, nife printedlink : NONE after 5003 ms. That is expected and not a fault: nothing in the tree touches0x1604_0000.
So a person who plugs radon in by the jack nearest to hand has a one-in-two chance of no network, and nothing on the console says to try the other one. The firmware has no such limit.
What the tree has
Everything port-specific is written for gmac0, and the shape of a second port is already in the
sources this tree read.
- The port.
machine_discovery::jh7110::designware_ethernet::discoverreturns the first node matching either compatible, which isgmac0in both trees.GMAC1_REGISTERS_PHYSICAL_ADDRESSexists incrates/machine_discovery/src/jh7110/designware_ethernet.rsand nothing reads it.DeviceTreeBlob's lookups answer the first match; the node name,ethernet@16040000, is the same in both trees, sonode_register_regionsandnode_propby name reach the second. - The clocks and resets.
crates/jh7110_clock_and_resethasGMAC0_SYSTEM_BRING_UPandGMAC0_ALWAYS_ON_BRING_UP, split across two domains.gmac1lives wholly in SYS. Mainline'sjh7110.dtsi(torvalds/linuxf47d223627f8, read 2026-10-20) names its clocksGMAC1_AXI(98),GMAC1_AHB(97),GMAC1_PTP(102),GMAC1_TX_INV(106) andGMAC1_GTXC(107), and its resetsSYSRST_GMAC1_AXI(66) andSYSRST_GMAC1_AHB(67). The v1.3B board file setsGMAC1_TX(105)'s parent toGMAC1_RMII_RTX(101) besidestarfive,tx-use-rgmii-clk, the same arrangementgmac0has in AON. TheSYSdomain's arithmetic already covers reset 66 and clock 107. - The interface select.
GMAC0_SYSCON_OFFSETandselect_rgmiiwrite bits 18 to 20 of the AON syscon's word0xc.gmac1's is in the other syscon: mainline'sstarfive,syscon = <&sys_syscon 0x90 0x2>, bits 2 to 4 of word0x90at0x1303_0000. That window isSYS_SYSCON_BASEin the clock crate, mapped by step 6c-prime ofkernel/src/arch/riscv64/mmu.rsonly when the PMIC plan exists. The vendor U-Boot's board code forgmac1's select was not read. - The PHY settings.
vendor_phylooks up the tree's firstethernet-phy@0, and the fallback isSettings::FALLBACK_GMAC0.gmac1's values differ, and both trees agree on them (crates/designware_ethernet/tests/fixtures/jh7110-gmac-{vendor,mainline}.dts): receive delay0x2(300 ps), transmit delay 0, transmit clock not inverted at 1000 Mbit/s.gmac0's are0xa,0xaand inverted. On silicongmac0readFallback, so radon's own tree did not yield the vendor spelling; agmac1brought up the same way today would getgmac0's delays. The two trees also disagree on inverting at 10 Mbit/s, for both ports. - The PHY address. Mainline's
phy1isethernet-phy@1withreg = <0>, ongmac1's own MDIO bus. The vendor node has noreg, andvendor_phyreads a missingregas 0, which agrees.Discovered::phy_address's doc comment says a unit address is the second choice; the code does not do that, and forgmac1it would be wrong. - One port, one process.
kernel/src/designware_ethernet.rskeeps oneREGIONand oneLAST_REPORT.crates/designware_ethernet/src/process.rsputs the DMA region at the address virtio ande1000euse, because "anet_stackdrives one NIC, never two". The progenitor holds one kernel-builtStackin slots 29 and 30 (grant_kernel_network_stackinkernel/src/user/progenitor_boot.rs), filled by the first ofe1000eand this driver. - The bench.
kernel/src/network_bench.rsprints one port's account and saysgmac0 interfacein its syscon line.
Which port the boot uses: the first to lease
Ruled by calef on 2026-10-20 (UTC), on #2470: "Lets do a and create a milestones for b." The boot
hands net_stack the port that gets a DHCP lease first, and gmac0 when both would. A lease, not
a link: a jack cabled to a switch with no DHCP server behind it links and must not win.
- Ports are tried in order,
gmac0thengmac1, skipping one with no link after the existing 5 s. Onenet_stackand one DMA region serve at a time, so trying in order is what keeps this inside one data plane, and it givesgmac0the tie. - A port that links and gets no lease within a bound is given up: its
net_stackis ended, its controller stopped, and the next port is tried. No such bound exists today.net_stackretries DISCOVER for ever and the kernel blocks on its report (kernel/src/network_bench.rs's BUGS), anddesignware_ethernet_servicerefuses a second wiring while the first server lives. Both change here. The bound's value is the lane's to choose and to state. - The cost is boot time when
gmac0links to a network with no DHCP server: one bound's worth. The console names the port chosen and why each other port lost (no link, or no lease).
Both ports at once, each its own Stack, is the milestone #2471 adds (a machine on two networks
at once). It waits on a socket-contract decision and builds on this block's per-port table. A port
named by configuration was refused: a person would have to know which jack the cable is in, which
is the failure on 2026-10-20.
Reuse: OpenBSD's if_dwqe_fdt.c (dwqe_setup_jh7110), already adapted for gmac0, picks the
port by the controller's address, so its gmac1 path is the one to adapt (its handling of the
second port's syscon is to be read, not assumed). Linux's dwmac-starfive.c and mainline's device tree (GPL) are
read for facts only, as milestone 53 does. No existing code in this tree chooses between two NICs;
the policy is a loop over the ports in order.
Exit criteria
crates/designware_ethernetdescribes each port as data: its base, its clock and reset plans, its syscon window, offset and shift, and its PHY fallback.gmac0's entry is today's constants.gmac1's cites mainline atf47d223627f8and the fixtures above. No function in the crate namesgmac0in its body.- Host tests run against the existing vendor and mainline fixtures. Discovery finds both ports in
each tree.
gmac1's PHY settings read receive0x2, transmit 0 and no inversion at 1000 Mbit/s from either spelling, and the vendor lookup reads the port's own child node.gmac1's interface select changes bits 2 to 4 of its word and nothing else. crates/jh7110_clock_and_resetcarriesgmac1's plan, and a host test shows its reset steps land on reset numbers 66 and 67 of the SYS domain and its parent select on clock 105.- The kernel maps and brings up both ports' control planes when the tree names both, with a report per port. The SYS syscon window is mapped whenever a JH7110 Ethernet port is described, not only when the PMIC plan exists.
- The boot tries the ports in order and keeps the first to lease, under a stated bound on the DHCP
wait. A port that links without leasing has its
net_stackended and its controller stopped before the next is tried. The console names the port chosen and, for each other port, whether it had no link or no lease. network_benchprints one block of lines per port (nic,syscon,phy,link), the syscon line naming the port it read, and runs the coherence probe on the port it hands out.- On radon, with a person moving the cable. With the cable in
gmac1's jack, the bench prints alinkline and adhcp : leasedline for0x16040000.verdict LEASED-AND-MEASUREDwaits on 53's receive stall. With the cable ingmac0's jack, the run matches 53's. Withgmac0cabled to a switch that serves no DHCP andgmac1to the local area network, the boot givesgmac0up after the bound and leases ongmac1. Both logs are committed underbench/radon-<date>/, each recording its port's PHY id, I/O voltage and settings source. notes/designware-ethernet.mdsays the cable may go in either jack, its runbook covers both, and its BUGS loses "gmac0only".
BUGS
- The TCP transfer stall on radon's receive side is milestone 53's, seen on
gmac0. This milestone does not fix it, and criterion 7 accepts a lease without a measured transfer for that reason. - A cable moved after boot is not followed. The port is chosen once. Re-choosing on link loss needs the interrupt-driven link state that 53's polled driver does not have.
gmac1's interface select in the vendor U-Boot is unread. The offset and shift come from mainline alone; the bench's syscon line before and after is the check.- Why
gmac0readFallbackon silicon is unexplained. It matters more here, since a wrong fallback forgmac1is a link that resolves and frames that do not move. Criterion 7 records the source per port. Finding why radon's tree lacks the vendor properties is 53's.
Index row
radon has two Ethernet jacks and nife drives only gmac0's, so a cable in the other one, gmac1
at 0x1604_0000, gets no network although the firmware links on it. Describe each port as data,
give gmac1 its SYS-domain clocks, SYS-syscon interface select and its own PHY delays, and have
the boot hand net_stack the first port to get a DHCP lease, gmac0 first.