From f781582828475f23abc478a07422db94f1bcda16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 13 Jul 2019 13:33:44 +0200 Subject: [PATCH] brcm2708: Add Raspberry Pi 4 support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Support added to bcm2709 subtarget (32 bit). - 64 bit kernel still requires many hacks on RPi 4B. Signed-off-by: Álvaro Fernández Rojas --- .../base-files/etc/board.d/02_network | 3 +- .../lib/preinit/05_set_preinit_iface_brcm2708 | 1 + target/linux/brcm2708/bcm2709/config-4.19 | 11 +++++- target/linux/brcm2708/bcm2709/target.mk | 4 +- target/linux/brcm2708/image/Makefile | 38 +++++++++++++------ 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network b/target/linux/brcm2708/base-files/etc/board.d/02_network index c8449bb78f..33aa15d85e 100755 --- a/target/linux/brcm2708/base-files/etc/board.d/02_network +++ b/target/linux/brcm2708/base-files/etc/board.d/02_network @@ -16,7 +16,8 @@ raspberrypi,model-b-plus |\ raspberrypi,model-b-rev2 |\ raspberrypi,2-model-b |\ raspberrypi,3-model-b |\ -raspberrypi,3-model-b-plus) +raspberrypi,3-model-b-plus |\ +raspberrypi,4-model-b) ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 index 3a5c198fc6..bbb95149c2 100644 --- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 +++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 @@ -9,6 +9,7 @@ set_preinit_iface() { raspberrypi,2-model-b |\ raspberrypi,3-model-b |\ raspberrypi,3-model-b-plus |\ + raspberrypi,4-model-b |\ raspberrypi,model-b |\ raspberrypi,model-b-plus |\ raspberrypi,model-b-rev2) diff --git a/target/linux/brcm2708/bcm2709/config-4.19 b/target/linux/brcm2708/bcm2709/config-4.19 index 4836540377..e7a14a59b0 100644 --- a/target/linux/brcm2708/bcm2709/config-4.19 +++ b/target/linux/brcm2708/bcm2709/config-4.19 @@ -223,6 +223,8 @@ CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_PHY=y CONFIG_GENERIC_PINCONF=y @@ -388,9 +390,11 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_PCI=y -# CONFIG_PCIE_BRCMSTB is not set +CONFIG_PCIE_BRCMSTB=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y # CONFIG_PCI_V3_SEMI is not set CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=3 @@ -478,10 +482,15 @@ CONFIG_USB_DWCOTG=y CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y +CONFIG_USB_PCI=y CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y CONFIG_USB_UAS=y +# CONFIG_USB_UHCI_HCD is not set CONFIG_USB_USBNET=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y +CONFIG_USB_XHCI_PLATFORM=y CONFIG_USE_OF=y CONFIG_VFP=y CONFIG_VFPv3=y diff --git a/target/linux/brcm2708/bcm2709/target.mk b/target/linux/brcm2708/bcm2709/target.mk index 2675494b36..c253ffd3df 100644 --- a/target/linux/brcm2708/bcm2709/target.mk +++ b/target/linux/brcm2708/bcm2709/target.mk @@ -4,11 +4,11 @@ # SUBTARGET:=bcm2709 -BOARDNAME:=BCM2709/BCM2710 boards (32 bit) +BOARDNAME:=BCM2709/BCM2710/BCM2711 boards (32 bit) CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 define Target/Description - Build firmware image for BCM2709/BCM2710 devices. + Build firmware image for BCM2709/BCM2710/BCM2711 devices. This firmware features a 32 bit kernel. endef diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile index c3e7cbac48..c850acdc25 100644 --- a/target/linux/brcm2708/image/Makefile +++ b/target/linux/brcm2708/image/Makefile @@ -21,18 +21,12 @@ define Build/kernel-img mv $@.tmp $@ endef -define Build/boot-img +define Build/boot-common rm -f $@.boot mkfs.fat -C $@.boot $(FAT32_BLOCKS) mcopy -i $@.boot $(KDIR)/COPYING.linux :: mcopy -i $@.boot $(KDIR)/bootcode.bin :: mcopy -i $@.boot $(KDIR)/LICENCE.broadcom :: - mcopy -i $@.boot $(KDIR)/start.elf :: - mcopy -i $@.boot $(KDIR)/start_cd.elf :: - mcopy -i $@.boot $(KDIR)/start_x.elf :: - mcopy -i $@.boot $(KDIR)/fixup.dat :: - mcopy -i $@.boot $(KDIR)/fixup_cd.dat :: - mcopy -i $@.boot $(KDIR)/fixup_x.dat :: mcopy -i $@.boot cmdline.txt :: mcopy -i $@.boot config.txt :: mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_IMG) @@ -42,6 +36,24 @@ define Build/boot-img mcopy -i $@.boot $(DTS_DIR)/overlays/README ::/overlays/ endef +define Build/boot-2708 + mcopy -i $@.boot $(KDIR)/start.elf :: + mcopy -i $@.boot $(KDIR)/start_cd.elf :: + mcopy -i $@.boot $(KDIR)/start_x.elf :: + mcopy -i $@.boot $(KDIR)/fixup.dat :: + mcopy -i $@.boot $(KDIR)/fixup_cd.dat :: + mcopy -i $@.boot $(KDIR)/fixup_x.dat :: +endef + + define Build/boot-2711 + mcopy -i $@.boot $(KDIR)/start4.elf :: + mcopy -i $@.boot $(KDIR)/start4cd.elf :: + mcopy -i $@.boot $(KDIR)/start4x.elf :: + mcopy -i $@.boot $(KDIR)/fixup4.dat :: + mcopy -i $@.boot $(KDIR)/fixup4cd.dat :: + mcopy -i $@.boot $(KDIR)/fixup4x.dat :: +endef + define Build/sdcard-img ./gen_rpi_sdcard_img.sh $@ $@.boot $(IMAGE_ROOTFS) \ $(CONFIG_TARGET_KERNEL_PARTSIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE) @@ -52,8 +64,8 @@ define Device/Default KERNEL := kernel-bin | kernel-img KERNEL_IMG := kernel.img IMAGES := factory.img.gz sysupgrade.img.gz - IMAGE/sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata - IMAGE/factory.img.gz := boot-img | sdcard-img | gzip + IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | sdcard-img | gzip | append-metadata + IMAGE/factory.img.gz := boot-common | boot-2708 | sdcard-img | gzip endef define Device/rpi @@ -74,8 +86,8 @@ ifeq ($(SUBTARGET),bcm2708) endif define Device/rpi-2 - DEVICE_TITLE := Raspberry Pi 2B/3B/3B+/3CM - DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3 + DEVICE_TITLE := Raspberry Pi 2B/3B/3B+/3CM/4B + DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2711-rpi-4-b bcm2710-rpi-cm3 SUPPORTED_DEVICES := \ rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm \ raspberrypi,2-model-b \ @@ -85,8 +97,10 @@ define Device/rpi-2 brcmfmac-firmware-43430-sdio \ brcmfmac-firmware-43430-sdio-rpi-3b \ brcmfmac-firmware-43455-sdio brcmfmac-firmware-43455-clm_blob \ - brcmfmac-firmware-43455-sdio-rpi-3b-plus \ + brcmfmac-firmware-43455-sdio-rpi-3b-plus brcmfmac-firmware-43455-sdio-rpi-4b \ kmod-brcmfmac wpad-basic + IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata + IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip endef ifeq ($(SUBTARGET),bcm2709) TARGET_DEVICES += rpi-2 -- 2.25.1