diff options
author | Michael Pratt <mcpratt@pm.me> | 2021-04-20 18:45:15 -0400 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2022-04-19 14:48:21 +0200 |
commit | 5d7805c78b7d8e9f02e53fdb2237971fa3353296 (patch) | |
tree | 2cd2d90c4036c0bf49994b93aba652c2d68c7f46 /target/linux/ramips/mt7620 | |
parent | 01bbed74445f82a0da8c414b132762fe2aed1344 (diff) | |
download | upstream-5d7805c78b7d8e9f02e53fdb2237971fa3353296.tar.gz upstream-5d7805c78b7d8e9f02e53fdb2237971fa3353296.tar.bz2 upstream-5d7805c78b7d8e9f02e53fdb2237971fa3353296.zip |
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: 391df3782914 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit de5394a29dae9356a830d043e76591698411e97a)
Diffstat (limited to 'target/linux/ramips/mt7620')
0 files changed, 0 insertions, 0 deletions