This is my last config:
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "dlink,dap-1620-a1", "ralink,mt7620a-soc";
model = "D-Link DAP-1620 A1";
aliases {
led-boot = &led_power;
led-failsafe = &led_status;
led-running = &led_power;
led-upgrade = &led_status;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 0>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 2 0>;
linux,code = <KEY_WPS_BUTTON>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "dap-1620-a1:green:power";
gpios = <&gpio2 0 1>;
};
lan {
label = "dap-1620:green:lan";
gpios = <&gpio0 12 1>;
};
led_status: status {
label = "dap-1620-a1:red:status";
gpios = <&gpio0 13 1>;
};
wlan2g {
label = "dap-1620-a1:green:wlan2g";
gpios = <&gpio0 8 1>;
linux,default-trigger = "phy1radio";
};
wlan5g {
label = "dap-1620-a1:green:wlan5g";
gpios = <&gpio0 11 1>;
linux,default-trigger = "phy0radio";
};
wps {
label = "dap-1620-a1:red:wps";
gpios = <&gpio0 9 1>;
};
};
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "nvram";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0x7b0000>;
compatible = "denx,uimage";
};
};
};
};
&state_default {
default {
groups = "ephy", "uartf", "spi refclk", "wled";
function = "gpio";
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address-increment = <(2)>;
led {
led-sources = <2>;
led-active-low;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf", "nd_sd", "rgmii2";
ralink,function = "gpio";
};
};
};
ðernet {
status = "okay";
mtd-mac-address = <&factory 0x4>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
mediatek,portmap = "l";
mediatek,mdio-mode = <1>;
port@5 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
status = "disabled";
reg = <0>;
phy-mode = "rgmii";
};
phy1: ethernet-phy@1 {
status = "disabled";
reg = <1>;
phy-mode = "rgmii";
};
phy2: ethernet-phy@2 {
status = "disabled";
reg = <2>;
phy-mode = "rgmii";
};
phy3: ethernet-phy@3 {
status = "disabled";
reg = <3>;
phy-mode = "rgmii";
};
phy4: ethernet-phy@4 {
status = "disabled";
reg = <4>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port5 = "gmac";
};
&wmac {
status = "okay";
ralink,mtd-eeprom = <&factory 0x0>;
ralink,5ghz = <0>;
mtd-mac-address-increment = <1>;
};
ethernet still not working this is output:
[ 1.605796] libphy: Fixed MDIO Bus: probed
[ 1.623485] gsw: setting port4 to ephy mode
[ 1.632303] libphy: mdio: probed
[ 1.638832] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[ 1.652046] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[ 1.664587] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
Do you know phy address of RTL8211E? Is it visible at mdio bus (/sys/slass/bus/mdio_bus if I'm not mistaken)? RTL8211E phy address may conflict with internal switch phys (addresses 0-4).
And port 5 statistics swconfig dev mt7620 port 5 show may be helpful.
this shows on boot so I think it's port 5.
Port 5 is MAC layer. Ports 0-4 are connected to internal fast ethernet phy (100Mbps max).
But port 5 is connected to external gigabit ethernet phy RTL8211E. To correctly configure RTL8211E must be connected to mdio bus and have unique address. If internal phy is not disabled this address must be in 5-7 range. Specs says that RTL8211E phy address may be configured in 0-7 range by pullup/pulldown PHY_AD0, PHY_AD1. PHY_AD2 (pins 34,35,13 for RTL8211E). If address is known (e.g 7) than add to dts-file:
phy7: ethernet-phy@7 {
reg = <7>;
phy-mode = "rgmii";
};
In this case RTL8211E must be visible at mdio bus and can be configured by realtek phy driver.
root@OpenWrt:/sys/devices/platform/10100000.ethernet/net/eth0# swconfig dev mt76
20 port 5 show
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:down
Interesting :
root@OpenWrt:/sys/devices/platform/10100000.ethernet/net/eth0# swconfig dev mt76
20 port 6 show
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
But when I add address 6 I get
[ 1.569898] gsw: setting port4 to ephy mode
[ 1.578711] libphy: mdio: probed
[ 1.585275] mdio_bus mdio-bus: MDIO device at address 6 is missing.
[ 1.597979] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[ 1.610505] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0 100000, irq 5
I think port 6 is CPU so swconfig doesn't give any usefull info...and /sys/slass/bus/mdio_bus has multiple folders don't knoe exactly the structure.
Why? Try 7
And show bootlog and output of commands:
ifconfig -a
swconfig dev mt7620 show
Simply find devices sudir and phy_id file (RTL8211E phy_id is 0x001cc915).
[ 1.623065] gsw: setting port4 to ephy mode
[ 1.631878] libphy: mdio: probed
[ 1.638448] mdio_bus mdio-bus: MDIO device at address 7 is missing.
[ 1.651147] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[ 1.663679] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
ifconfig -a
root@OpenWrt:/# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
inet6 addr: fe80::20c:43ff:fe76:2058/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:896 (896.0 B)
Interrupt:5
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:128 errors:0 dropped:0 overruns:0 frame:0
TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8704 (8.5 KiB) TX bytes:8704 (8.5 KiB)
wlan0 Link encap:Ethernet HWaddr 24:42:6F:B7:CD:08
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan1 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
swconfig dev mt7620 show
root@OpenWrt:/# swconfig dev mt7620 show
Global attributes:
enable_vlan: 1
mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0
mirror_monitor_port: 0
arl_table: address resolution table
Port 6: MAC 00:0c:43:76:20:58
Port 0:
mib: Port 0 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:0 link:down
Port 1:
mib: Port 1 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:1 link:down
Port 2:
mib: Port 2 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:2 link:down
Port 3:
mib: Port 3 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:3 link:down
Port 4:
mib: Port 4 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:4 link:down
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:down
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 8
RxBOC : 0
RxGOC : 928
RxEPC1 : 0
RxEPC2 : 8
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
Port 7:
mib: Port 7 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:7 link:down
root@OpenWrt:/#
root@OpenWrt:/sys# ls
block class devices fs module
bus dev firmware kernel
root@OpenWrt:/sys# cd class
root@OpenWrt:/sys/class# ls
bdi gpio mdio_bus mtd phy tty
block ieee80211 mem net ppp watchdog
firmware leds misc pci_bus spi_master
root@OpenWrt:/sys/class# cd mdio_bus/
root@OpenWrt:/sys/class/mdio_bus# ls
fixed-0 mdio-bus
root@OpenWrt:/sys/class/mdio_bus# cd mdio-bus/
root@OpenWrt:/sys/devices/platform/10100000.ethernet/mdio_bus/mdio-bus# ls
device of_node subsystem uevent
root@OpenWrt:/sys/devices/platform/10100000.ethernet/mdio_bus/mdio-bus# cd devic
e
root@OpenWrt:/sys/devices/platform/10100000.ethernet# ls
driver mdio_bus net subsystem
driver_override modalias of_node uevent
root@OpenWrt:/sys/devices/platform/10100000.ethernet# find /sys -name phy_id
root@OpenWrt:/sys/devices/platform/10100000.ethernet#
With this config :
ðernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins >;
mtd-mac-address = <&factory 0x4>;
ralink,port-map = "wllll";
mediatek,mdio-mode = <1>;
port@4 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port4 = "gmac";
};
I have:
root@OpenWrt:/sys/firmware/devicetree/base/ethernet@10100000/mdio-bus# ip link s
et eth0 up
[ 188.819665] mtk_soc_eth 10100000.ethernet eth0: port 4 link up (1000Mbps/Full duplex)
[ 188.835952] 8021q: adding VLAN 0 to HW filter on device eth0
[ 188.847558] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
root@OpenWrt:/sys/firmware/devicetree/base/ethernet@10100000/mdio-bus# swconfig
dev mt7620 show
Global attributes:
enable_vlan: 1
mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0
mirror_monitor_port: 0
arl_table: address resolution table
Port 0:
mib: Port 0 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:0 link:down
Port 1:
mib: Port 1 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:1 link:down
Port 2:
mib: Port 2 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:2 link:down
Port 3:
mib: Port 3 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:3 link:down
Port 4:
mib: Port 4 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:4 link:up speed:1000baseT full-duplex
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:down
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 7
RxBOC : 0
RxGOC : 854
RxEPC1 : 0
RxEPC2 : 7
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
Port 7:
mib: Port 7 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:7 link:down
root@OpenWrt:/sys/firmware/devicetree/base/ethernet@10100000/mdio-bus#
But link still doesn't go up. I think best thing would be to find uout from u-boot but don't know how...
I think you don't need force link to 1Gbit. And switch config is incorrect. Vlan is enabled by default
But there is no vlan created. Disable vlan or create vlan1 with untagged ports 5 6
So try this variant:
port@5 {
status = "okay";
phy-mode = "rgmii";
phy-handle = <&phy0>;
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
};
};
And configure switch with commands:
swconfig dev mt7620 set reset 1
swconfig dev mt7620 set enable_vlan 1
swconfig dev mt7620 vlan 1 set ports '5 6'
swconfig dev mt7620 set apply 1
Or totally disable vlan:
swconfig dev mt7620 set reset 1
swconfig dev mt7620 set enable_vlan 0
swconfig dev mt7620 set apply 1
with config you purpose I have:
[ 1.622333] gsw: setting port4 to ephy mode
[ 1.631149] libphy: mdio: probed
[ 1.638760] mtk_soc_eth 10100000.ethernet: connected port 5 to PHY at mdio-bus:00 [uid=03a2940d, driver=Generic PHY]
[ 1.660018] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[ 1.672567] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[ 1.689611] rt2880_wdt 10000120.watchdog: Initialized
checged config to :
ðernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins >;
mtd-mac-address = <&factory 0x4>;
ralink,port-map = "wllll";
mediatek,mdio-mode = <1>;
port@5 {
status = "okay";
phy-mode = "rgmii";
phy-handle = <&phy1>;
};
mdio-bus {
status = "okay";
phy1: ethernet-phy@1 {
reg = <1>;
phy-mode = "rgmii";
};
};
};
&gsw {
mediatek,port5 = "gmac";
};
Same result , alwais showes ethernet cable not connected.
Output of
ifconfig -a
swconfig dev mt7620 show
?
root@OpenWrt:/# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:5
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:96 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6528 (6.3 KiB) TX bytes:6528 (6.3 KiB)
root@OpenWrt:/#
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 7
RxBOC : 0
RxGOC : 854
RxEPC1 : 0
RxEPC2 : 7
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:up speed:1000baseT full-duplex
Output of
ifconfig -a
swconfig dev mt7620 show
?
root@OpenWrt:/# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:5
lo Link encap:Local Loopback
LOOPBACK MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr B4:25:BB:7B:65:8D
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan1 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@OpenWrt:/# swconfig dev mt7620 show
Global attributes:
enable_vlan: 1
mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0
mirror_monitor_port: 0
arl_table: address resolution table
Port 0:
mib: Port 0 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:0 link:down
Port 1:
mib: Port 1 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:1 link:down
Port 2:
mib: Port 2 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:2 link:down
Port 3:
mib: Port 3 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:3 link:down
Port 4:
mib: Port 4 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:4 link:down
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:down
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
Port 7:
mib: Port 7 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:7 link:down
root@OpenWrt:/# swconfig dev mt7620 set reset 1
root@OpenWrt:/# swconfig dev mt7620 set reset 1
root@OpenWrt:/# swconfig dev mt7620 set apply 1
root@OpenWrt:/# swconfig dev mt7620 show
Global attributes:
enable_vlan: 1
mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0
mirror_monitor_port: 0
arl_table: address resolution table
Port 0:
mib: Port 0 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:0 link:down
Port 1:
mib: Port 1 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:1 link:down
Port 2:
mib: Port 2 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:2 link:down
Port 3:
mib: Port 3 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:3 link:down
Port 4:
mib: Port 4 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:4 link:down
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:down
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
Port 7:
mib: Port 7 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:7 link:down
root@OpenWrt:/#
I see two different logs. In 1st:
and in 2nd:
Can you reproduce 1st case and show logs again?
BTW something wrong in this commands:
I suggest to disable vlan or to define vlan 1 ports. You simple reset switch.
To simplify discussion let's see schema:
mt7620 switch
+------------+
eth0 <==> |P6 |
| |
|P5 <==========> phy??(0-7)RTL8211E
| +--------^
| | |
|P4 <==> phy4|
| | |
|P3 <==> phy3|
| | |
|P2 <==> phy2|
| | |
|P1 <==> phy1|
| | |
|P0 <==> phy0|
+------------+
^
|
mdio bus <----------+
where
<====> - network dataflow
<---> - mdio phy managment dataflow
In case of correct config any sent packet through eth0 (ifconfig eth0 TX packets statistics) must increase received packets of P6 (Rx* statistics for port 6)
and increase transmitted packets of P5 (Tx* statistics for port 5).
And vice versus: eth0 recieved packets increase Tx* of P6 and Rx* of P5 statistics.
As you see in 1st log P5 link is up and Rx* statistics shows received network data. But no recieved packets in eth0 statistics and you don't show P6 statistics.
123serge123:
P5 link is up
it was when I put : mediatek,fixed-link = <1000 1 1 1>;
But I never received link connected on PC side always Network Cable Unpluged.
Only in one case I have that uninitialized connection on PC with OpenWRT booted when I don't initialize ethernet at all and it stays connected from u-boot initialisation.
The main question was:
Can you reproduce 1st case and show logs again?
This is when I set :
mediatek,fixed-link = <1000 1 1 1>;
root@OpenWrt:/# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:5
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:156 errors:0 dropped:0 overruns:0 frame:0
TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10608 (10.3 KiB) TX bytes:10608 (10.3 KiB)
wlan0 Link encap:Ethernet HWaddr 44:E6:35:AE:A6:55
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan1 Link encap:Ethernet HWaddr 00:0C:43:76:20:58
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@OpenWrt:/# swconfig dev mt7620 show
Global attributes:
enable_vlan: 1
mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 3
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0
mirror_monitor_port: 0
arl_table: address resolution table
Port 0:
mib: Port 0 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:0 link:down
Port 1:
mib: Port 1 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:1 link:down
Port 2:
mib: Port 2 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:2 link:down
Port 3:
mib: Port 3 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:3 link:down
Port 4:
mib: Port 4 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:4 link:down
Port 5:
mib: Port 5 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:5 link:up speed:1000baseT full-duplex
Port 6:
mib: Port 6 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
Port 7:
mib: Port 7 MIB counters
TxGPC : 0
TxBOC : 0
TxGOC : 0
TxEPC : 0
RxGPC : 0
RxBOC : 0
RxGOC : 0
RxEPC1 : 0
RxEPC2 : 0
enable_mirror_rx: 0
enable_mirror_tx: 0
pvid: 0
link: port:7 link:down
root@OpenWrt:/#
But as I told I never got any traffic on the interface also switch port doesn't even lingt up like cable not pluged.