diff mbox series

[V3,net-next,6/7] net: bcmgenet: Add RGMII_RXID and RGMII_ID support

Message ID 1573326009-2275-7-git-send-email-wahrenst@gmx.net (mailing list archive)
State New, archived
Headers show
Series ARM: Enable GENET support for RPi 4 | expand

Commit Message

Stefan Wahren Nov. 9, 2019, 7 p.m. UTC
This adds the missing support for the PHY modes RGMII_RXID and
RGMII_ID. Based on the used register settings in the downstream tree
the mode RGMII_RXID 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. 10, 2019, 8:32 p.m. UTC | #1
On 11/9/2019 11:00 AM, Stefan Wahren wrote:
> This adds the missing support for the PHY modes RGMII_RXID and
> RGMII_ID. Based on the used register settings in the downstream tree
> the mode RGMII_RXID is necessary for the Raspberry Pi 4.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> 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;

Technically for this one we should probably make sure that we do set
id_mode_dis in order for the MAC not to add the delay and leave the PHY
to do it though I don't have such a configuration handy to
prove/disprove that is necessary.
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;