openwrt/target/linux/bcm4908/patches-6.6/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch

47 lines
2.1 KiB
Diff
Raw Normal View History

bcm4008: prepare to work on kernel 6.6 Don't add KERNEL_TESTING_PATCHVER yet as there are some issues with it. On TP-Link Archer C2300 serial console seems to stop working after preinit: > Press the [f] key and hit [enter] to enter failsafe mode > Press the [1], [2], [3] or [4] key and hit [enter] to select the de� On Netgear R8000P XHCI causes external abort: [ 2.139586] Internal error: synchronous external abort: 0000000096000210 [#1] SMP [ 2.147212] Modules linked in: xhci_plat_hcd(+) xhci_hcd ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug(O) usbcore nls_base usb_common crc32c_generic [ 2.164774] CPU: 0 PID: 358 Comm: kmodloader Tainted: G O 6.6.22 #0 [ 2.172658] Hardware name: Netgear R8000P (DT) [ 2.177229] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 2.184395] pc : xhci_gen_setup+0x80/0x34c [xhci_hcd] [ 2.189591] lr : xhci_gen_setup+0x74/0x34c [xhci_hcd] [ 2.194788] sp : ffffffc0815d37b0 [ 2.198194] x29: ffffffc0815d37b0 x28: ffffff8002000000 x27: ffffff8001172d88 [ 2.205540] x26: ffffff8002000000 x25: 0000000000000000 x24: ffffffc078b603c0 [ 2.212888] x23: ffffffc078b2a008 x22: ffffff8001172c10 x21: ffffff8002000000 [ 2.220235] x20: ffffff8002000000 x19: ffffff8002000250 x18: 0000000000000000 [ 2.227582] x17: 626d756e20737562 x16: 2064656e67697373 x15: ffffffffffffffff [ 2.234929] x14: ffffff80019e9915 x13: ffffff80019e9913 x12: 00000000ffffffea [ 2.242276] x11: 00000000ffffefff x10: 0000000000000062 x9 : 00000000ffffffd0 [ 2.246760] bcm63138_nand ff801800.nand-controller: timeout waiting for command 0x4 [ 2.249623] x8 : 0000000000000073 x7 : ffffffc0815d37c0 x6 : 0000000000000075 [ 2.257513] bcm63138_nand ff801800.nand-controller: intfc status c00000e0 [ 2.264855] x5 : 0000000000000081 x4 : 0000000000000000 x3 : ffffff8001b61800 [ 2.279193] x2 : ffffffc080b5d000 x1 : ffffff80020003a8 x0 : ffffff8002000398 [ 2.286540] Call trace: [ 2.289048] xhci_gen_setup+0x80/0x34c [xhci_hcd] Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-03-28 11:25:54 +00:00
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Mon, 15 Feb 2021 23:59:26 +0100
Subject: [PATCH] net: dsa: bcm_sf2: enable GPHY for switch probing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GPHY needs to be enabled to succesfully probe & setup switch port
connected to it. Otherwise hardcoding PHY OUI would be required.
Before:
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch wan (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 7
After:
brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
brcm-sf2 80080000.switch wan (uninitialized): PHY [800c05c0.mdio--1:0c] driver [Generic PHY] (irq=POLL)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/dsa/bcm_sf2.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf
rev = reg_readl(priv, REG_PHY_REVISION);
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
+ bcm_sf2_gphy_enable_set(priv->dev->ds, true);
+
ret = b53_switch_register(dev);
if (ret)
goto out_mdio;
+ bcm_sf2_gphy_enable_set(priv->dev->ds, false);
+
dev_info(&pdev->dev,
"Starfighter 2 top: %x.%02x, core: %x.%02x, IRQs: %d, %d\n",
priv->hw_params.top_rev >> 8, priv->hw_params.top_rev & 0xff,