Skip to content
Snippets Groups Projects
Commit c5e1b87a authored by Markus Gothe's avatar Markus Gothe :ok_hand: Committed by Andreas Gnau
Browse files

Fixup how we use the RGMII bus on panther.

The RGMII bus on the panther is special and weird.
We just need to ensure it is working.

This commit patch the code for communicating with via
RGMII with the functional one used in 5.04L02. The new
code in 5.04L02p1 will probably never work.
parent 332f6f8f
No related branches found
No related tags found
1 merge request!316Fixup how we use the RGMII bus on panther.
From b791d53f15b87d635fcce9a6359a82d577462be6 Mon Sep 17 00:00:00 2001
From: Markus Gothe <markus.gothe@genexis.eu>
Date: Tue, 30 Nov 2021 18:25:01 +0100
Subject: [PATCH] Use bus_read() for RGMII on panther
---
.../net/enet/impl7/bcmenet_ioctl_compat.c | 59 +++++++++++++++----
1 file changed, 48 insertions(+), 11 deletions(-)
diff --git a/bcm963xx/bcmdrivers/opensource/net/enet/impl7/bcmenet_ioctl_compat.c b/bcm963xx/bcmdrivers/opensource/net/enet/impl7/bcmenet_ioctl_compat.c
index 38c5db77d..20b21475a 100644
--- a/bcm963xx/bcmdrivers/opensource/net/enet/impl7/bcmenet_ioctl_compat.c
+++ b/bcm963xx/bcmdrivers/opensource/net/enet/impl7/bcmenet_ioctl_compat.c
@@ -1870,26 +1870,63 @@ cd_end:
#elif defined(CONFIG_BCM_PON)
{
uint16_t val = ethctl->val;
- phy_dev_t *phy_dev = phy_dev_get(PHY_TYPE_UNKNOWN, ethctl->phy_addr);
+ bus_drv_t *bus_drv = NULL;
- if (!phy_dev || !phy_dev->phy_drv)
+ if (ethctl->flags == ETHCTL_FLAG_ACCESS_INT_PHY)
{
- enet_err("No PHY at address %d has been found.\n", ethctl->phy_addr);
+#ifdef CONFIG_BCM96858
+ bus_drv = bus_drv_get(BUS_TYPE_6858_LPORT);
+#endif
+#ifdef CONFIG_BCM96856
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_INT);
+#endif
+#ifdef CONFIG_BCM96846
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_INT);
+#endif
+#ifdef CONFIG_BCM96878
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_INT);
+#endif
+ }
+ else if (ethctl->flags == ETHCTL_FLAG_ACCESS_EXT_PHY)
+ {
+#ifdef CONFIG_BCM96858
+ bus_drv = bus_drv_get(BUS_TYPE_6858_LPORT);
+#endif
+#ifdef CONFIG_BCM96856
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_EXT);
+#endif
+#ifdef CONFIG_BCM96846
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_EXT);
+#endif
+#ifdef CONFIG_BCM96878
+ bus_drv = bus_drv_get(BUS_TYPE_MDIO_V1_EXT);
+#endif
+ }
+
+ if (!bus_drv)
+ {
+ enet_err("cannot resolve phy bus driver for phy_addr %d, flags %d\n", ethctl->phy_addr, ethctl->flags);
return -EFAULT;
}
if (ethctl->op == ETHGETMIIREG)
- ret = ethsw_phy_exp_read(phy_dev, ethctl->phy_reg, &val);
- else
- ret = ethsw_phy_exp_write(phy_dev, ethctl->phy_reg, val);
+ {
+ if (bus_read(bus_drv, ethctl->phy_addr, ethctl->phy_reg, &val))
+ return -EFAULT;
- if (ret)
- return ret;
+ ethctl->val = val;
+ enet_dbg("get phy_id: %d; reg_num = %d; val = 0x%x \n", ethctl->phy_addr, ethctl->phy_reg, val);
- ethctl->val = val;
+ if (copy_to_user(rq->ifr_data, ethctl, sizeof(struct ethctl_data)))
+ return -EFAULT;
+ }
+ else
+ {
+ if (bus_write(bus_drv, ethctl->phy_addr, ethctl->phy_reg, ethctl->val))
+ return -EFAULT;
- if (copy_to_user(rq->ifr_data, ethctl, sizeof(struct ethctl_data)))
- return -EFAULT;
+ enet_dbg("set phy_id: %d; reg_num = %d; val = 0x%x \n", ethctl->phy_addr, ethctl->phy_reg, ethctl->val);
+ }
return 0;
}
--
2.34.0
0001-Disable-EXT1-RGMII-in-u-boot-for-panther-devices.patch
0002-Force-full-duplex-on-RGMII.patch
0003-Use-bus_read-for-RGMII-on-panther.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment