openwrt/target/linux
Michael Pratt 5d7805c78b 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>
(cherry picked from commit de5394a29d)
2022-04-19 14:48:21 +02:00
..
apm821xx apm821xx: fix crash/panic related to SATA/SSD choice 2022-03-26 21:26:07 +01:00
arc770 arc770: set device vendor and model variables 2021-05-26 23:36:40 +02:00
archs38 kernel: Add missing kernel config options 2021-09-13 18:49:15 +02:00
armvirt kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
at91 treewide: make AddDepends/usb-serial selective 2021-06-08 22:50:32 +02:00
ath25 kernel: bump 5.4 to 5.4.132 2021-07-19 22:47:17 +02:00
ath79 ath79: Move TPLink WPA8630Pv2 to ath79-tiny target 2022-04-16 14:59:34 +02:00
bcm27xx bcm27xx: add AMP2 to HifiBerry DAC+ / DAC+ Pro package 2022-04-16 14:55:27 +02:00
bcm47xx bcm47xx: make WGT634U NVRAM patch apply again 2021-03-17 23:38:46 +01:00
bcm53xx bcm53xx: sysupgrade: fix support for Luxul's legacy firmware format 2021-12-13 18:21:25 +01:00
bcm63xx kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
bcm4908 bcm4908: include U-Boot in images 2022-03-14 08:51:02 +01:00
gemini kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
generic kernel: bump 5.4 to 5.4.188 2022-04-07 20:42:34 +02:00
imx6 kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
ipq40xx kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
ipq806x ipq806x: base-files: asrock: fix bootcount include 2022-02-28 15:21:32 +01:00
kirkwood kirkwood: increase kernel partition of Linksyses 2021-09-13 15:24:35 +02:00
lantiq lantiq: flag FritzBox 7360 family buttons active-low 2022-01-15 22:49:28 +01:00
layerscape kernel: bump 5.4 to 5.4.188 2022-04-07 20:42:34 +02:00
malta target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
mediatek kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
mpc85xx mpc85xx: add missing Kconfig symbols 2021-07-13 22:19:23 +02:00
mvebu mvebu: kernel: enable CONFIG_BLK_DEV_NVME 2022-04-19 14:40:24 +02:00
mxs target: use SPDX license identifiers on scripts 2021-02-10 15:47:23 +01:00
octeon kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
octeontx kernel: bump 5.4 to 5.4.179 2022-02-12 19:41:39 +01:00
omap kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
oxnas kernel: bump 5.4 to 5.4.182 2022-03-06 20:55:26 +01:00
pistachio kernel: add pending mtd patches adding NVMEM support 2021-03-17 21:24:22 +01:00
ramips ramips: mt7620: allow both internal and external PHYs 2022-04-19 14:48:21 +02:00
realtek kernel: bump 5.4 to 5.4.163 2021-12-12 20:08:17 +01:00
rockchip rockchip: fix broken squashfs sysupgrade 2021-09-24 12:29:22 +02:00
sunxi sunxi: cortexa7: fix ethernet link detection on a20-olinuxino-lime2 2022-03-24 09:40:12 +01:00
tegra kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
uml target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
x86 x86: legacy: enable pata_sis driver 2022-03-10 23:32:59 +01:00
zynq kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
Makefile target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00