From: Stefan Wahren Date: Mon, 23 Dec 2019 19:42:53 +0100 Subject: [PATCH 1/3] net: Add support for Broadcom GENETv5 Ethernet controller In-Reply-To: <2142da8a-fd2f-8c58-4a67-1ff06f1a57cd@i2se.com> References: <20191218115918.6366-1-andre.przywara@arm.com> <20191218115918.6366-2-andre.przywara@arm.com> <2142da8a-fd2f-8c58-4a67-1ff06f1a57cd@i2se.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Am 20.12.19 um 20:29 schrieb Stefan Wahren: > 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 Except of this, i noticed another issue with current u-boot. It complains about misaligned access: U-Boot 2020.01-rc5-00007-g5111518-dirty (Dec 23 2019 - 19:25:49 +0100)   DRAM:  948 MiB RPI 4 Model B (0xc03112) MMC:   sdhci at 7e300000: 0, emmc2 at 7e340000: 1 Loading Environment from FAT... Card did not respond to voltage select! In:    serial Out:   serial Err:   serial Net:   eth0: ethernet at 7d580000 Hit any key to stop autoboot:  0 Card did not respond to voltage select! switch to partitions #0, OK mmc1 is current device Scanning mmc 1:1... Found U-Boot script /boot.scr 213 bytes read in 73 ms (2 KiB/s) ## Executing script at 02400000 Card did not respond to voltage select! Wrong Image Format for bootm command ERROR: can't get kernel image! SCRIPT FAILED: continuing... 30395 bytes read in 53 ms (559.6 KiB/s) ethernet at 7d580000 Waiting for PHY auto negotiation to complete.. done BOOTP broadcast 1 CACHE: Misaligned operation at range [3b3ed1c0, 3b3ed316] CACHE: Misaligned operation at range [3b3ed1c0, 3b3ed316] DHCP client bound to address 192.168.1.171 (15 ms) *** Warning: no boot file name; using 'C0A801AB.img' Using ethernet at 7d580000 device TFTP from server 192.168.1.1; our IP address is 192.168.1.171 Filename 'C0A801AB.img'. Load address: 0x200000 Loading: CACHE: Misaligned operation at range [3b3ec640, 3b3ec66a]