About mt7620a process two rgmii ports

I have a routing board, which has 6 ports, of which 4 ports use the built-in PHY port, and the 5 and 6 ports use 2 ip1001 chips.
Now port 5 can drive and use. Port 4, however, cannot be driven and used properly.

You mean port 5 and 6.
Differ the phy addresses of port 5 and port 6 in the DTS file ?
Normally you have one MDIO for all external PHYs.

Board / device ?

foreach 0 to 5 port.
now port5 OKAY.
port 0 to 3 use buit-in ephy,OKAY.
port 5 use MDIO for ext-phy,OKAY
but port 4 alway use MDIO for ext-phy, is not.
I'm modify gsw-mt7620.c,set port 4 to rgmii, ip1001 chip is OKAY,
but ping gateway timeout. VLAN is config.
kernel msg no problerm.

board:lewifi-w1.soc is mt7620a

as I read in the source file the is some entry for port 4

of_property_read_string(np, "mediatek,port4", &port4);
if (port4 && !strcmp(port4, "ephy"))
	gsw->port4 = PORT4_EPHY;
else if (port4 && !strcmp(port4, "gmac"))
	gsw->port4 = PORT4_EXT;
	gsw->port4 = PORT4_EPHY;

mediatek,port4 = "ephy";

should used here
grep with
git grep port4 target/linux/ramips/dts/
for some sample DTS files ...

port 4 can't use mediatek,port4 = "ephy" this set.
I'm set mediatek,port4 = "gmac";
port4 mast set rgmii mode (used ip1001 chips)