diff mbox series

[RFC,V2,5/6] net: bcmgenet: Add RGMII_RXID and RGMII_ID support

Message ID 1572702093-18261-6-git-send-email-wahrenst@gmx.net
State RFC
Delegated to: David Miller
Headers show
Series ARM: Enable GENET support for RPi 4 | expand

Commit Message

Stefan Wahren Nov. 2, 2019, 1:41 p.m. UTC
This adds the missing support for the PHY modes RGMII_RXID and
RGMII_ID. This is necessary for the Raspberry Pi 4.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

--
2.7.4

Comments

Florian Fainelli Nov. 2, 2019, 8 p.m. UTC | #1
On 11/2/2019 6:41 AM, Stefan Wahren wrote:
> This adds the missing support for the PHY modes RGMII_RXID and
> RGMII_ID. This is necessary for the Raspberry Pi 4.

Are both used? Your next patch only uses "rgmii-rxid". Can you remind me
of the GTXC and RXC skew setting the PHY you are using comes up with?
And this was tested with Broadcom PHY (drivers/net/phy/broadcom.c)
driver or with the Generic PHY driver?
Stefan Wahren Nov. 3, 2019, 9:34 a.m. UTC | #2
Am 02.11.19 um 21:00 schrieb Florian Fainelli:
>
> On 11/2/2019 6:41 AM, Stefan Wahren wrote:
>> This adds the missing support for the PHY modes RGMII_RXID and
>> RGMII_ID. This is necessary for the Raspberry Pi 4.
> Are both used?
Sorry, the wording was a little bit unlucky. Only the RGMII_RXID is used.
>  Your next patch only uses "rgmii-rxid". Can you remind me
> of the GTXC and RXC skew setting the PHY you are using comes up with?

I dumped the following register values before bcm54xx_config_clock_delay
tries to change the values:
SHDWSEL_MISC: 0x71E7
SHD_CLK_CTL: 0x0100

https://github.com/raspberrypi/linux/issues/3101#issuecomment-544266615

> And this was tested with Broadcom PHY (drivers/net/phy/broadcom.c)
> driver or with the Generic PHY driver?

After applying the series i'm getting the following output:

[    5.431262] bcmgenet fd580000.ethernet: failed to get enet clock
[    5.431271] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    5.431283] bcmgenet fd580000.ethernet: failed to get enet-wol clock
[    5.431294] bcmgenet fd580000.ethernet: failed to get enet-eee clock
[    5.880660] libphy: bcmgenet MII bus: probed
[    5.970751] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[   11.570672] bcmgenet fd580000.ethernet: configuring instance for
external RGMII (RX delay)
[   11.583231] bcmgenet fd580000.ethernet eth0: Link is Down
[   16.811045] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full
- flow control rx/tx

So i assume it's the Broadcom PHY.

Regards
Stefan
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 8f7b2c0..9091e5b 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -273,6 +273,16 @@  int bcmgenet_mii_config(struct net_device *dev, bool init)
 		phy_name = "external RGMII (TX delay)";
 		port_ctrl = PORT_MODE_EXT_GPHY;
 		break;
+
+	case PHY_INTERFACE_MODE_RGMII_RXID:
+		phy_name = "external RGMII (RX delay)";
+		port_ctrl = PORT_MODE_EXT_GPHY;
+		break;
+
+	case PHY_INTERFACE_MODE_RGMII_ID:
+		phy_name = "external RGMII (RX/TX delay)";
+		port_ctrl = PORT_MODE_EXT_GPHY;
+		break;
 	default:
 		dev_err(kdev, "unknown phy mode: %d\n", priv->phy_interface);
 		return -EINVAL;