Thank you, I definitely put it in the wrong place.you need disable-wp under the sdhci node
root@Radax-E25:/ # dmesg | grep mmc
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xfe2b0000-0xfe2b3fff irq 33 on ofwbus0
rockchip_dwmmc0: Hardware version ID is 270a
mmc0: <MMC/SD bus> on rockchip_dwmmc0
mmc1: <MMC/SD bus> on sdhci_fdt0
mmcsd0: 31GB <SDHC SD16G 2.0 SN 00000D2B MFG 10/2022 by 254 42> at mmc0 50.0MHz/4bit/1016-block
mmcsd1: 16GB <MMCHC D9D16G 8.7 SN B1166BA0 MFG 02/2021 by 136 0x0003> at mmc1 200.0MHz/8bit/8192-block
mmcsd1boot0: 4MB partition 1 at mmcsd1
mmcsd1boot1: 4MB partition 2 at mmcsd1
mmcsd1rpmb: 4MB partition 3 at mmcsd1
--- /home/titus/builds/freebsd-src/sys/dev/eqos/if_eqos_var.h 2023-10-19 14:25:53.844535000 +0300
+++ /sys/dev/eqos/if_eqos_var.h 2023-10-18 08:47:19.235640000 +0300
@@ -76,8 +76,14 @@
struct resource *res[EQOS_RES_COUNT];
void *irq_handle;
#ifdef FDT
- struct syscon *grf;
+ struct syscon *grf, *php_grf;
int grf_offset;
+ int phy_mode;
+ struct eqos_ops *ops;
+ clk_t *clks;
+ clk_t clk_stmmaceth;
+ bool clock_in;
+ uint8_t idx;
#endif
uint32_t csr_clock;
uint32_t csr_clock_range;
root@NanoPi-R5S:~ # grep Unres dmesg-r5s.txt
Unresolved linked clock found: clk_32k_pvtm
Unresolved linked clock found: usb480m_phy
Unresolved linked clock found: mpll
Unresolved linked clock found: i2s0_mclkin
Unresolved linked clock found: i2s1_mclkin
Unresolved linked clock found: i2s2_mclkin
Unresolved linked clock found: i2s3_mclkin
Unresolved linked clock found: gpu_pvtpll_out
Unresolved linked clock found: npu_pvtpll_out
Unresolved linked clock found: gmac0_clkin
Unresolved linked clock found: gmac1_clkin
Unresolved linked clock found: clk_gmac0_xpcs_mii
Unresolved linked clock found: clk_gmac1_xpcs_mii
Unresolved linked clock found: dummy
root@NanoPi-R5S:~ #
clocks = <0x20 0x186 0x20 0x189 0x20 0x189 0x20 0xc7 0x20 0xc3 0x20 0xc4 0x20 0x189 0x20 0xc8 0x20 0xac 0x20 0xab>;
clock-names = "stmmaceth", "mac_clk_rx", "mac_clk_tx", "clk_mac_refout", "aclk_mac", "pclk_mac", "clk_mac_speed", "ptp_ref", "pclk_xpcs", "clk_xpcs_eee";
external-gmac1-clock {
compatible = "fixed-clock";
clock-frequency = <0x7735940>;
clock-output-names = "gmac1_clkin";
#clock-cells = <0x0>;
phandle = <0x13e>;
};
xpcs-gmac1-clock {
compatible = "fixed-clock";
clock-frequency = <0x7735940>;
clock-output-names = "clk_gmac1_xpcs_mii";
#clock-cells = <0x0>;
phandle = <0x13f>;
};
I need time to carefully check my DTS.i also have thisCode:clocks = <0x20 0x186 0x20 0x189 0x20 0x189 0x20 0xc7 0x20 0xc3 0x20 0xc4 0x20 0x189 0x20 0xc8 0x20 0xac 0x20 0xab>; clock-names = "stmmaceth", "mac_clk_rx", "mac_clk_tx", "clk_mac_refout", "aclk_mac", "pclk_mac", "clk_mac_speed", "ptp_ref", "pclk_xpcs", "clk_xpcs_eee";
Code:external-gmac1-clock { compatible = "fixed-clock"; clock-frequency = <0x7735940>; clock-output-names = "gmac1_clkin"; #clock-cells = <0x0>; phandle = <0x13e>; }; xpcs-gmac1-clock { compatible = "fixed-clock"; clock-frequency = <0x7735940>; clock-output-names = "clk_gmac1_xpcs_mii"; #clock-cells = <0x0>; phandle = <0x13f>; };
ethernet@fe2a0000 {
compatible = "rockchip,rk3568-gmac", "snps,dwmac-4.20a";
reg = <0x0 0xfe2a0000 0x0 0x10000>;
interrupts = <0x0 0x1b 0x4 0x0 0x18 0x4>;
interrupt-names = "macirq", "eth_wake_irq";
clocks = <0x21 0x182 0x21 0x185 0x21 0x185 0x21 0xb8 0x21 0xb4 0x21 0xb5 0x21 0x185 0x21 0xb9>;
clock-names = "stmmaceth", "mac_clk_rx", "mac_clk_tx", "clk_mac_refout", "aclk_mac", "pclk_mac", "clk_mac_speed", "ptp_ref";
resets = <0x21 0xd7>;
reset-names = "stmmaceth";
rockchip,grf = <0x1b>;
snps,axi-config = <0x22c>;
snps,mixed-burst;
snps,mtl-rx-config = <0x22d>;
snps,mtl-tx-config = <0x22e>;
snps,tso;
status = "okay";
assigned-clocks = <0x21 0x185 0x21 0x182>;
assigned-clock-parents = <0x21 0x183 0x21 0xb6>;
assigned-clock-rates = <0x0 0x7735940>;
clock_in_out = "output";
pinctrl-0 = <0xef 0xf3 0xf2 0xf4 0xf5 0xf0>;
pinctrl-names = "default";
phy-mode = "rgmii";
phy-handle = <0x22b>;
phy-supply = <0x34>;
snps,reset-gpio = <0xb9 0x15 0x1>;
snps,reset-active-low;
snps,reset-delays-us = <0x0 0x3a98 0xc350>;
tx_delay = <0x3c>;
rx_delay = <0x2f>;
phandle = <0x229>;
&gmac0 {
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
phy-handle = <&rgmii_phy0>;
phy-mode = "rgmii";
pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus>;
snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
/* Reset time is 15ms, 50ms for rtl8211f */
snps,reset-delays-us = <0 15000 50000>;
tx_delay = <0x3c>;
rx_delay = <0x2f>;
status = "okay";
};
gmac0_clkin: external-gmac0-clock {
compatible = "fixed-clock";
clock-frequency = <125000000>;
clock-output-names = "gmac0_clkin";
#clock-cells = <0>;
};
&gmac0 {
phy-mode = "rgmii";
phy-handle = <&rgmii_phy0>;
clock_in_out = "input";
snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
snps,reset-delays-us = <0 15000 50000>;
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&gmac0_clkin>;
pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus
&gmac0_clkinout>;
tx_delay = <0x3c>;
rx_delay = <0x2f>;
status = "okay";
eq0: <DesignWare EQOS Gigabit ethernet> mem 0xfe2a0000-0xfe2affff irq 87,88 on ofwbus0
eq0: Clock input from the PHY
eq0: no phy-supply property
eq0: DesignWare EQOS ver 0x51 (0x30)
eq0: hw features 160171e7 010c01c8 10000000 00000000
eq0: Ethernet address f2:00:91:0b:20:61
eq0: TX ring @ 0xb1a000, RX ring @ 0x2adb000
miibus0: <MII bus> on eq0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 0 on miibus0
rgephy0: OUI 0x00e04c, model 0x0011, rev. 6
rgephy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
rgephy1: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy1: OUI 0x00e04c, model 0x0011, rev. 6
rgephy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
eq0: bpf attached
eq0: Ethernet address: f2:00:91:0b:20:61
TX
==============
gic0,s32: eqos0 24308 22846
gic0,s32: eqos0 15840 15086
gic0,s32: eqos0 21298 21234
gic0,s32: eqos0 6607 6210
gic0,s32: eqos0 13457 13027
gic0,s32: eqos0 13922 13072
gic0,s32: eqos0 20601 19490
gic0,s32: eqos0 15779 14914
gic0,s32: eqos0 14499 13614
gic0,s32: eqos0 12951 12912
gic0,s32: eqos0 14373 14330
=======================
RX
gic0,s32: eqos0 729 726
gic0,s32: eqos0 733 731
gic0,s32: eqos0 756 736
gic0,s32: eqos0 760 757
gic0,s32: eqos0 736 734
gic0,s32: eqos0 779 731
gic0,s32: eqos0 755 753
gic0,s32: eqos0 739 738
gic0,s32: eqos0 733 731
gic0,s32: eqos0 766 720
gic0,s32: eqos0 743 741
root@NanoPi-R5S:~ # ifconfig
re0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
ether 58:9c:fc:10:24:6e
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
re1: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
ether 58:9c:fc:10:e7:10
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
eq0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=80008<VLAN_MTU,LINKSTATE>
ether 22:30:f4:8e:eb:d2
inet 192.168.1.208 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (100baseTX <half-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@NanoPi-R5S:~ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=107 time=51.961 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=107 time=51.899 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=107 time=51.783 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 3 packets received, 25.0% packet loss
round-trip min/avg/max/stddev = 51.783/51.881/51.961/0.074 ms
root@NanoPi-R5S:~ #
Tell me how to do this, we need corrections in the driver source code, or corrections in DTS?fixed a (self induced) bug in sdhci_fdt.c (patch is on reviews.freebsd.org)
fiddled with eqos and broke something in the phy (hardware) and now it works full gigabit
also added tx and rx hw checksums
seems like somehow the external gmac clock which passes thru the phy caused problems