From patchwork Fri Jan 17 01:20:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 239687 List-Id: U-Boot discussion From: andre.przywara at arm.com (Andre Przywara) Date: Fri, 17 Jan 2020 01:20:44 +0000 Subject: [PATCH v2 0/3] Ethernet support for Raspberry Pi 4 Message-ID: <20200117012047.31096-1-andre.przywara@arm.com> This series adds Ethernet support for the Raspberry Pi 4. The SoC includes a "Broadcom Genet v5 MAC" IP, connected as a proper platform device (no USB anymore!). Patch 1 provides a driver for that. There does not seem to be publicly available documentation, so this is based on the Linux driver, but stripped down to just provide what U-Boot needs. Patch 2 fixes up the RPi4 memory map to accommodate the MMIO area the MAC lives in, while patch 3 enables it in the respective defconfigs. This version addresses the comments by the diligent reviewers and testers, for a changelog see below. To see the individual changes as patches, refer to [1]. Please have a look and test it, I hope this helps to simplify development, as you spare the SD card and its slot from heavy swapping. I dropped the Tested-by's, as there were changes in the code. Happy to reapply them when people confirm that it still works for them. Cheers, Andre. [1] https://github.com/apritzel/u-boot/commits/rpi4-eth-v2 Changelog v1 ... v2: - use native endianess functions when accessing MMIO registers - use dev_* DM wrappers for accessing devicetree data - round base and length for flush_dcache_range, plus a comment - check and round length for invalidate_cache_range - support RGMII_RXID PHY mode, to support mainline .dtb Amit Singh Tomar (3): net: Add support for Broadcom GENETv5 Ethernet controller rpi4: Update memory map to accommodate scb devices rpi4: Enable GENET Ethernet controller arch/arm/mach-bcm283x/init.c | 6 +- configs/rpi_4_32b_defconfig | 2 + configs/rpi_4_defconfig | 2 + configs/rpi_arm64_defconfig | 1 + drivers/net/Kconfig | 7 + drivers/net/Makefile | 1 + drivers/net/bcmgenet.c | 722 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 738 insertions(+), 3 deletions(-) create mode 100644 drivers/net/bcmgenet.c Tested-by: Corentin Labbe