Bug 248128

Summary: With U-Boot 2020.07 rtl8211e: ethernet-phy@1 no longer detected by kernel on rk3399
Product: Base System Reporter: Bjoern A. Zeeb <bz>
Component: armAssignee: freebsd-arm (Nobody) <freebsd-arm>
Status: New ---    
Severity: Affects Only Me CC: decke, me
Priority: --- Keywords: regression
Version: CURRENT   
Hardware: arm64   
OS: Any   

Description Bjoern A. Zeeb freebsd_committer freebsd_triage 2020-07-20 19:45:23 UTC
With the updated U-Boot 2020.07 the (same) kernel (as before) no longer detects the Realtek 8211E PHY on this RK3399.

The reason seems to be that u-boot no longer initialises the Ethernet unless there is an "ethaddr" set (which is not by the default environment).  FreeBSD then probably (I assume from looking) doesn't go through the reset logic properly and hence the PHY is not detected.  Basically we are relying on u-boot to dtrt for us and it no longer does.

An example case for the gmac (and PHY) can be seen in the rk3399-nanopi4.dtsi.


While looking I also noticed the "clkin_gmac" errors logged during a verbose boot; not sure how related that might be; didn't cross-check yet with an older u-boot.

# dmesg -a | grep -i gmac
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
Clock: clkin_gmac, parent: (NULL)(-1), freq: 9
Clock: pclk_gmac_pre_c, parent: aclk_gmac_pre(0), freq: 3000000
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
Clock: clk_rmii_src, parent: clkin_gmac(1), freq: 9
Clock: clk_gmac_c, parent: npll(2), freq: 1200000
Clock: aclk_gmac_pre_c, parent: cpll_aclk_gmac_src(0), freq: 6000000
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
clknode_link_recalc: Attempt to use unresolved linked clock: clkin_gmac
Cannot get frequency for clk: clkin_gmac, error: 9
Clock: clk_gmac, parent: clk_gmac_c(0), freq: 1200000
Clock: pclk_gmac_pre, parent: pclk_gmac_pre_c(0), freq: 3000000
Clock: aclk_gmac_pre, parent: aclk_gmac_pre_c(0), freq: 6000000
Clock: cpll_aclk_gmac_src, parent: cpll(0), freq: 24000000
Clock: gpll_aclk_gmac_src, parent: gpll(0), freq: 400000000
Clock: aclk_perf_gmac, parent: aclk_gmac_pre(0), freq: 6000000
Clock: pclk_gmac_noc, parent: pclk_gmac_pre(0), freq: 3000000
Clock: pclk_gmac, parent: pclk_gmac_pre(0), freq: 3000000
Clock: aclk_gmac_noc, parent: aclk_gmac_pre(0), freq: 6000000
Clock: aclk_gmac, parent: aclk_gmac_pre(0), freq: 6000000


In case you need anything else, please let me know and I'll try to provide info or test patches.