@wei.zuo can you tell me whats different in network compared to evb? I can boot mainline (5.16-rc4) with my dts (evb with changed iodomain and switch node added),but ethernet driver reports it cannot connect to phy
Just for info: mainline uboot (2022-01-rc) with patch for fip-creation is bootable,but cannot boot kernel. Confirmed by Peter. So i use peters uboot and boot Image+dtb with extlinux.conf (currently with his initrd and reduced quartz64 defconfig)
Our chipid 0x6367 seems to be supported.
Currently i hang on getting gmac/mdio up on soc-side (with reduced phy driver) but then we can test the dsa driver. currently it’s hard to apply it because it depends on net-next with many other patches before.
If anybody can figure out,how to define the dts (linking to mdio, interface mode) we can test it.
I have added the dsa driver in 5.16-r2pro-dsa tree,and do some tests woth old r64,but it seems that mdio is not working right…i always get 0x0 as chip id and so initialization is not done
Maybe anyone has an idea whats missing/wrong? Maybe the reset is needed,but driver does not support it yet
with a reset of switch using the gpio definition from phy-driver, i get dsa-driver running partially on my r64 v0.1…switch is initialized and dsa-ports are shown in “ip a”…after changing names the seem to be functional…but i cannot get the gmac to run (no traffic), in phy-driver it uses EXTPORT0 as gmac0 (sgmii-port in r64v0.1 i have changed to rgmii/1000Mbit/s already, dsa driver only supports only rgmii). this is mapped to internal number 16, need to look how this is used and compare to dsa driver where a dts-property “realtek,ext-int” (defined as 0-2, so i used 0) is used like it seems…but i’m unsure if i need to change “reg” too
but it seems they come not together (no traffic), rx_pkt_n is zero whereas tx_pkt_n is 51 after some pings (using “lan0” port, first lan next to wan)
@wei.zuo any idea? btw. i wonder why switch driver setup 2 gmacs but wan-port seems not going over switch (is already working in my mainline linux without working switch)
Edit: problem is portmap…as wan is directly connected i dropped portmap property in dts. Now the last port (port4,not connected) get the vlan config for “wan”…now all 4 lan-ports working with full phy driver. And after changing mdio phy-id (r64 used 29,r2pro uses 0) in my reduced driver it works too
edit 2: my reduced phy driver has now a dts property to set the phy-id, works on both devices without touching driver code. got dsa driver on r64 working by using second gmac (already rgmii), maybe first gmac/switchport does not support rgmii. wait for next version and merge this then to r2pro and test there
FYI: With some minor problems (strange ip assignment, flapping unconnected interfaces) i got the dsa driver posted to mainline working on my r2pro. It will not be merged to 5.17 but maybe 5.18.
It is a very basic driver that does not support internal switching (all traffic goes to cpu), no hw offload and rgmii only.
# dmesg | grep -i 'mt753'
[ 0.000000] Linux version 5.17.0-r2pro-mt7531dsa-00166-g8e291c72610e (frank@frank-G5-U20) (aarch64-linux-gnu-gcc (Ubuntu 9.4.0-1u2
[ 1.761349] mt7530 stmmac-0:00: no interrupt support
[ 1.798268] mt7530 stmmac-0:00: configuring for fixed/rgmii link mode
[ 1.800253] mt7530 stmmac-0:00: Link is Up - 1Gbps/Full - flow control rx/tx
[ 1.840596] mt7530 stmmac-0:00 wan (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.889002] mt7530 stmmac-0:00 lan0 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.940066] mt7530 stmmac-0:00 lan1 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.991166] mt7530 stmmac-0:00 lan2 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 2.042119] mt7530 stmmac-0:00 lan3 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 2.594275] mt7530 stmmac-0:00 wan: configuring for phy/gmii link mode
[ 2.604647] mt7530 stmmac-0:00 lan0: configuring for phy/gmii link mode
[ 2.619995] mt7530 stmmac-0:00 lan1: configuring for phy/gmii link mode
[ 2.635667] mt7530 stmmac-0:00 lan2: configuring for phy/gmii link mode
[ 2.653356] mt7530 stmmac-0:00 lan3: configuring for phy/gmii link mode
[ 186.969595] mt7530 stmmac-0:00 lan1: Link is Up - 1Gbps/Full - flow control rx/tx
#
basicly linked the mt753x_phc.c into the mt7530 dsa driver. not nice, but works so far. i plugged into second lan-port (tested the others too - except wan that is not connected they are right)
but have not yet traffic working over the switch…so there is still something missing. and i guess here i need some help
Imho i miss the vlan config
@wei.zuo@sinovoip
can you tell me which port of mt7531 (p5 or p6) is connected to the gmac0 of rk3568? this is not clear to me and dsa driver seems to initialize only port 6
i do not know if port 5 is initialized…mt7530 part has note that only p6 is initialized, but p5 is changed below it…for mt7531 this part is completely missing. as the gmac only supports rgmii and switch seems to support this only on p5 (p6 sgmii only) i guess gmac0 is connected to p5…after some debug it looks like only port5 is enabled (succesfully in rgmii-mode), not port 6…based on my devicetree
I was told only mt7531 variant is sold. Here i fixed in mainline (6.0-rc1 has fixes in). There is only a speed-issue we are working on (wip patch),maybe fixed by some patches in daniels bpi-r3 staging tree (do similar as the wip for r2pro).
Realtek variant had no dsa driver,but now has. But i have not tested it after this got mainlined. Prepared a dual dts way in 5.18-main afair where you can try. Be aware of iodomains (different between these 2) if you have such variant.
Do not boot (mainline) dts for mt7531 if you really have a realtek switch!
what do you mean with ethernet-transformer? a phy? wan-port has a realtek phy and switch has a internal phy
each hardware-part needs a driver. soc needs multiple drivers (power,clock,pinctrl, perpherals like spi/i2c, …), ethernet-gmacs, the realtek-phy, the switch,…independly on how they are connected…the connection is described mostly in devicetree
there is imho no ready-to-use image as this version was not in sale…only for developers
if you really have such board you can add dts like here and use this (tree also contains the reduced rtl8367 phy driver, maybe the dsa too):
driver for rtl8367 switch is already in mainline when you use 5.19
drivers/net/dsa/realtek/rtl8365mb.c
only need to enable it, maybe compatible needs to be changed.
Okey, so they do not use it. When I checked Switch schematic with RTL8367 almost all has Coil (transformer) so, I wonder if not using is good or not. Thank’s for your answers @frank-w
Hi Frank.
I’m making a switch using RTL8367RB to be able to connect to a controller. I’ve tried once and it doesn’t work.
As I searched through the Internet, I found some schematics which are different to each other and I want to know how to connect other pins of the IC except RJ45s.
can you please guide me and give me the schematic and PCB documents which you got result? I wanna use it as a source of my PCB.
Thanks a lot.
[email protected]
You should ask @sinovoip as i am not allowed to publish shematics. I only worked on software-support. The switch chip is now supported by mainline code (tested series in upstreaming process). Maybe sinovoip allows me to share parts of shematic…
Hello,
Why on BPI-R2 Pro there is RTL8211F-CG PHY connected onto GMAC1 and acting as WAN port? Since there is also switch chip MT7615BE (2x RGMII+5PHYs) connected onto GMAC0 of RK3568 plus and only 4 PHY ports are used as LAN.
Is it possible to use just switch MT7615BE with all 5 PHYs where one will be for WAN and 4 for LAN?