openwrt/target/linux
Christian Marangi e927456ec3
qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp
Commit 947b44d ("ipq807x: fix wrong define for LAN and WAN ess mask")
started fixing wrong switch_lan_bmp that defined lan there weren't
actually present. This displayed a fragility in the malibu phy init code
in qca-ssdk.

Add patch to fix this. Also update each DTS with the new required
property if needed.

The new binding malibu_phy_start_addr is required with devices that
place the malibu first PHY referring port1 on a different PHY addres
than 0. The most common configuration is 0 but some device (for example
Qnap 301W) place the malibu PHY at an offset to address 16.

Refer to ipq8074-ess dtsi for extensive description on how to derive
this value.

Quoting the patch detailed description:

The usage of first_phy_addr is EXTREMELY FRAGILE and results
in dangerous results if the OEM (or anyone that by chance try to
implement things in a logical manner) deviates from the default values
from the "magical template".

To be in more details. With QSDK 12.4, some tweaks were done to improve
autoneg and now on every call of port status, the phydev is tried to
add. This resulted in the call and log spam of an error with ports that
are actually not present on the system with qsdk reporting phydev is
NULL. This itself is not an error and printing the error is correct.

What is actually an error from ages is setting generic bitmap reporting
presence of port that are actually not present. This is very common on
OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap
results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3
PORT4 PORT5). Reality is that many device are used as AP with one LAN
port or one WAN port. (or even exotic configuration with PORT1 not
present and PORT2 PORT3 PORT4 present (Xiaomi 3600)

With this finding one can say... ok nice, then lets update the DT and
set the correct bitmap...

Again world is a bad place and reality is that this cause wonderful
regression in some case of by extreme luck the first ever connected
port working and the rest of the switch dead.

The problem has been bisected to all the device that doesn't have the
PORT1 declared in any of the bitmap.

With this prefaction in mind, on to the REAL problem.

malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr
to the first detected PHY addr that coincidentally is always PORT1.
PORT1 addr is 0x0. The entire code in malibu_phy use this variable to
derive the phy addrs in some function.

Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only
one connected) result in first_phy_addr set to 1 or whatever phy addr is
detected first setting wrong value all over the init stage.

To fix this, introduce a new binding malibu_first_phy_addr to manually
declare the first phy that the malibu PHY driver should use and permit
to detach it from port bmp detection. The legacy detection is kept for
compatibility reason.

Fixes: #13945
Fixes: 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # Qnap 301W
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-13 14:27:16 +01:00
..
airoha kernel: bump 5.15 to 5.15.125 2023-08-09 22:06:24 +02:00
apm821xx apm821xx: WNDR4700: fix broken sysupgrade, factory images 2023-10-20 18:13:57 +02:00
archs38 treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
armsr armsr: preserve configuration during sysupgrade 2023-10-20 00:36:32 +02:00
at91 treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
ath25 kernel: bump 5.15 to 5.15.125 2023-08-09 22:06:24 +02:00
ath79 kernel: bump 5.15 to 5.15.138 2023-11-10 17:33:59 +01:00
bcm27xx kernel: bump 6.1 to 6.1.61 2023-11-03 13:02:30 +01:00
bcm47xx kernel: bump 5.15 to 5.15.133 2023-10-04 21:03:12 +02:00
bcm53xx bcm53xx: refresh kernel config for 6.1 2023-11-06 13:25:59 +01:00
bcm63xx kernel: bump 5.15 to 5.15.125 2023-08-09 22:06:24 +02:00
bcm4908 kernel: bump 5.15 to 5.15.137 2023-10-27 19:43:06 +01:00
bmips kernel: bump 6.1 to 6.1.60 2023-10-26 12:08:52 +02:00
gemini gemini: usb-fotg210: remove uneeded dependency on @USB_SUPPORT 2023-11-08 22:01:44 +01:00
generic kernel: bump 6.1 to 6.1.62 2023-11-10 17:37:12 +01:00
imx kernel: backport NVMEM patches queued for the v6.5 2023-06-16 09:45:38 +02:00
ipq40xx ipq40xx: wpj428: switch to zimage to fit kernel partition 2023-10-20 18:13:57 +02:00
ipq806x ipq806x: setup DSA port conduit in board.d 2023-11-10 12:30:34 +01:00
ixp4xx ixp4xx: Add USRobotics USR8200 support 2023-10-25 11:29:29 +02:00
kirkwood kirkwood: add support for Iomega Storcenter ix4-200d 2023-05-20 15:35:37 +02:00
lantiq kernel: bump 5.15 to 5.15.138 2023-11-10 17:33:59 +01:00
layerscape treewide: fix shell errors during dump stage 2023-11-13 14:01:25 +01:00
malta kernel: remove CRYPTO_BLAKE2S from all >=5.15 2023-07-08 16:54:01 +02:00
mediatek treewide: fix shell errors during dump stage 2023-11-13 14:01:25 +01:00
mpc85xx mpc85xx: add Enterasys WS-AP3715i reset button 2023-09-27 23:13:36 +02:00
mvebu mvebu: fix PXA I2C bus with recovery 2023-11-12 14:28:21 +01:00
mxs mxs: add testing kernel 6.1 2023-07-01 12:54:30 +02:00
octeon kernel: bump 5.15 to 5.15.125 2023-08-09 22:06:24 +02:00
octeontx kernel: bump 5.15 to 5.15.138 2023-11-10 17:33:59 +01:00
omap treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
oxnas treewide: disable CONFIG_SLUB_DEBUG in target configs 2023-11-09 21:23:01 +01:00
pistachio kernel: fix mtd/NVMEM regression affecting U-Boot env NVMEM driver 2023-10-31 17:33:28 +01:00
qoriq treewide: disable CONFIG_SLUB_DEBUG in target configs 2023-11-09 21:23:01 +01:00
qualcommax qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp 2023-11-13 14:27:16 +01:00
ramips ramips: mt7621: use lzma-loader for Sercomm NA502 2023-11-12 15:32:24 +01:00
realtek realtek: add support for TP-Link T1600G-28TS v3 2023-10-20 18:13:57 +02:00
rockchip treewide: disable CONFIG_SLUB_DEBUG in target configs 2023-11-09 21:23:01 +01:00
sifiveu treewide: disable CONFIG_SLUB_DEBUG in target configs 2023-11-09 21:23:01 +01:00
sunxi sunxi: enable cpufreq driver for H6 SoC 2023-10-28 18:31:43 +02:00
tegra treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
uml kernel: bump 6.1 to 6.1.53 2023-09-23 13:10:28 +02:00
x86 x86: add support for Mellanox Spectrum SN2000 Switches 2023-10-31 21:12:15 +01:00
zynq generic: enable CONFIG_ARM_CRYPTO for 32bit arm targets 2023-05-10 19:01:45 +02:00
Makefile build: fix issues with targets installed via feeds 2022-09-27 13:41:12 +02:00