From f16dc4b42fb265affb2298e815a7ce0a13d60da6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 23 Jul 2023 12:38:15 +0100 Subject: mediatek: add support for BananaPi BPI-R4 board Hardware -------- SOC: MediaTek MT7988A (4x Cortex-A73) RAM: 4 GiB DDR4 Flash: 128 MiB Winbond SPI-NAND MMC: 8 GiB eMMC *or* microSD (cannot be used both) ETH: 4x 1GE (1x WAN, 3x LAN) 2x SFP+ (10G, 5G, 2.5G, 1G) USB: on-board USB 3.2 4-port hub 1x USB 3.2 port (type A connector) 1x M.2 for 4G/5G modem 2x mPCIe for additional modems WiFi: optional MediaTek MT7996 Wi-Fi 7 module (using 2x PCIe gen3 x2 on the mPCIe slots and 12V power) Installation ------------ 1. Decompress and write the sdcard image to a micro SD card and use that to boot the R4 (both dip switches in upper position). 2. Use the bootloader menu accessible via the serial console to install to SPI-NAND. 3. Switch to boot from SPI-NAND and install to eMMC. Known issues ------------ - The RST button is hard-wired to the SoC reset and can't be read from software. This can be changed by modifying the board (ie. moving a 0-ohm resistor). However, in order to maintain compatibility with the board as it comes from factory the button isn't used by OpenWrt and the WPS button is used as factory/reset button instead. - various small things still need to be fixed in DT Signed-off-by: Daniel Golle --- target/linux/mediatek/image/filogic.mk | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'target/linux/mediatek/image/filogic.mk') diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 90a0e91f02..0d36199f0d 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -272,6 +272,51 @@ endif endef TARGET_DEVICES += bananapi_bpi-r3 +define Device/bananapi_bpi-r4 + DEVICE_VENDOR := Bananapi + DEVICE_MODEL := BPi-R4 + DEVICE_DTS := mt7988a-bananapi-bpi-r4 + DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4 + DEVICE_DTS_DIR := $(DTS_DIR)/ + DEVICE_DTS_LOADADDR := 0x45f00000 + DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a + DEVICE_DTC_FLAGS := --pad 4096 + DEVICE_PACKAGES := fitblk kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware \ + kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs + IMAGES := sysupgrade.itb + KERNEL_LOADADDR := 0x46000000 + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + ARTIFACTS := \ + emmc-preloader.bin emmc-bl31-uboot.fip \ + sdcard.img.gz \ + snand-preloader.bin snand-bl31-uboot.fip + ARTIFACT/emmc-preloader.bin := mt7988-bl2 emmc-comb + ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot bananapi_bpi-r4-emmc + ARTIFACT/snand-preloader.bin := mt7988-bl2 spim-nand-ubi-comb + ARTIFACT/snand-bl31-uboot.fip := mt7988-bl31-uboot bananapi_bpi-r4-snand + ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\ + pad-to 17k | mt7988-bl2 sdmmc-comb |\ + pad-to 6656k | mt7988-bl31-uboot bananapi_bpi-r4-sdmmc |\ + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\ + pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\ + ) \ + pad-to 44M | mt7988-bl2 spim-nand-ubi-comb |\ + pad-to 45M | mt7988-bl31-uboot bananapi_bpi-r4-snand |\ + pad-to 51M | mt7988-bl2 emmc-comb |\ + pad-to 52M | mt7988-bl31-uboot bananapi_bpi-r4-emmc |\ + pad-to 56M | mt798x-gpt emmc |\ + $(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\ + pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\ + ) \ + gzip + IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += bananapi_bpi-r4 + define Device/cetron_ct3003 DEVICE_VENDOR := Cetron DEVICE_MODEL := CT3003 -- cgit v1.2.3