From: Stefan Wahren Date: Fri, 20 Dec 2019 20:29:22 +0100 Subject: [PATCH 1/3] net: Add support for Broadcom GENETv5 Ethernet controller In-Reply-To: <20191218115918.6366-2-andre.przywara@arm.com> References: <20191218115918.6366-1-andre.przywara@arm.com> <20191218115918.6366-2-andre.przywara@arm.com> Message-ID: <2142da8a-fd2f-8c58-4a67-1ff06f1a57cd@i2se.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andre, Am 18.12.19 um 12:59 schrieb Andre Przywara: > From: Amit Singh Tomar > > The Broadcom GENET Ethernet MACs are used in several MIPS based SoCs > and in the Broadcom 2711/2838 SoC used on the Raspberry Pi 4. > There is no publicly available documentation, so this driver is based > on the Linux driver. Compared to that the queue management is > drastically simplified, also we only support version 5 of the IP and > RGMII connections between MAC and PHY, as used on the RPi4. > > Signed-off-by: Amit Singh Tomar > Reviewed-by: Andre Przywara > [Andre: heavy cleanup and a few fixes] > Signed-off-by: Andre Przywara > --- > drivers/net/Kconfig | 7 + > drivers/net/Makefile | 1 + > drivers/net/bcmgenet.c | 702 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 710 insertions(+) > create mode 100644 drivers/net/bcmgenet.c > ... > + > +/* We only support RGMII (as used on the RPi4). */ > +static int bcmgenet_interface_set(struct bcmgenet_eth_priv *priv) > +{ > + phy_interface_t phy_mode = priv->interface; > + > + switch (phy_mode) { > + case PHY_INTERFACE_MODE_RGMII: > + writel(PORT_MODE_EXT_GPHY, priv->mac_reg + SYS_PORT_CTRL); > + break; This doesn't match the current Linux upstream kernel / DTS. We consider the PHY mode in the downstream DTS as wrong. It should be PHY_INTERFACE_MODE_RGMII_RXID. So please add this to keep compatibility to the upstream devicetree. Please following this series [1] for more information. Thank you a lot for this work Stefan [1] - https://marc.info/?l=linux-netdev&m=157350191805462&w=2 > + default: > + printf("unknown phy mode: %d\n", priv->interface); > + return -EINVAL; > + } > + > + return 0; > +} > +