openwrt/target/linux
Michael Pratt 39ee7fa356 ramips: mt7620: allow both internal and external PHYs
When the new variable ephy_base was introduced,
it was not applied to the if block for mdio_mode.

The first line in the mdio_mode if block
sets the EPHY base address to 12 in the SOC by writing a register,
but the corresponding variable in the driver
was still set to the default of 0.

This causes subsequent lines that write registers with the function
_mt7620_mii_write
to write to PHY addresses 0 through 4
while internal PHYs have been moved to addresses 12 through 16.

All of these lines are intended only for PHYs on the SOC internal switch,
however, they are being written to external ethernet switches
if they exist at those PHY addresses 0 through 4.
This causes some ethernet ports to be broken on boards with AR8327 or QCA8337 switch.

Other suggested fixes move those lines to the else block of mdio_mode,
but removing the else block completely also fixes it.

Therefore, move the lines to the mt7620_hw_init function main block,
and have only one instance of the function mtk_switch_w32
for writing the register with the EPHY base address.

In theory, this also allows for boards that have both external switches
and internal PHYs that lead to ethernet ports to be supported.

Fixes: 391df37829 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: maurerr <mariusd84@gmail.com>
2021-09-01 08:08:15 +00:00
..
apm821xx apm821xx: move CONFIG_REGULATOR to target config 2021-09-01 08:08:12 +00:00
arc770 treewide: do not quote compatible in shell scripts 2021-09-01 08:08:11 +00:00
archs38 treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
armvirt treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
at91 kernel: move some drm symbols to generic config 2021-09-01 08:08:12 +00:00
ath25 kernel: Activate FORTIFY_SOURCE for MIPS kernel 5.4 2021-09-01 08:08:02 +00:00
ath79 kernel: Backport patch to automatically bring up DSA master when opening user port 2021-09-01 08:08:14 +00:00
bcm27xx kernel: bump 5.4 to 5.4.121 2021-09-01 08:08:07 +00:00
bcm47xx bcm47xx: make WGT634U NVRAM patch apply again 2021-09-01 08:07:47 +00:00
bcm53xx kernel: bump 5.4 to 5.4.118 2021-09-01 08:08:07 +00:00
bcm63xx bcm63xx: drop USB LEDs for Technicolor TG582N / ADB P.DG A4001N 2021-09-01 08:08:10 +00:00
bcm4908 bcm4908: fix Ethernet broken state after interface restart 2021-09-01 08:08:14 +00:00
bmips bmips: remove duplicated brcmnand patch 2021-09-01 08:08:06 +00:00
gemini base-files: generate network config with "device" options 2021-09-01 08:08:09 +00:00
generic kernel: Backport patch to automatically bring up DSA master when opening user port 2021-09-01 08:08:14 +00:00
imx6 imx6: image: drop BOOT_SCRIPT and fix DEVICE_NAME 2021-09-01 08:08:09 +00:00
ipq40xx ipq40xx: add uboot-envtools to default packages 2021-09-01 08:08:10 +00:00
ipq806x ipq806x: fix LAN and WAN port assignments on TP-Link AD7200 2021-09-01 08:08:10 +00:00
ipq807x treewide: remove redundant ubifs kconfig symbols 2021-09-01 08:08:01 +00:00
kirkwood treewide: do not quote compatible in shell scripts 2021-09-01 08:08:11 +00:00
lantiq treewide: remove "+" sign for increment with macaddr_add 2021-09-01 08:08:10 +00:00
layerscape generic: backport at803x fixes 2021-09-01 08:08:11 +00:00
malta treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
mediatek kernel: bump 5.4 to 5.4.124 2021-09-01 08:08:10 +00:00
mpc85xx treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
mvebu mvebu: armada-37xx: remove ethernet alias patch 2021-09-01 08:08:10 +00:00
mxs treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
octeon octeon: use shared function for platform_copy_config() 2021-09-01 08:08:06 +00:00
octeontx treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
omap kernel: move some drm symbols to generic config 2021-09-01 08:08:12 +00:00
oxnas treewide: remove redundant ubifs kconfig symbols 2021-09-01 08:08:01 +00:00
pistachio treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
ramips ramips: mt7620: allow both internal and external PHYs 2021-09-01 08:08:15 +00:00
realtek realtek: Fix failsafe mode 2021-09-01 08:08:15 +00:00
rockchip kernel: bump 5.10 to 5.10.43 2021-09-01 08:08:13 +00:00
sunxi linux-firmware: update to version 20210315 and trim down broadcom FW 2021-09-01 08:08:11 +00:00
tegra kernel: move some drm symbols to generic config 2021-09-01 08:08:12 +00:00
uml treewide: switch the timer frequency to 100 Hz 2021-09-01 08:08:01 +00:00
x86 x86: add upgrade support to diag.sh 2021-09-01 08:08:12 +00:00
zynq kernel: move some drm symbols to generic config 2021-09-01 08:08:12 +00:00
Makefile target: use SPDX license identifiers on Makefiles 2021-09-01 08:07:34 +00:00