aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-07-13 04:30:32 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-08-30 13:36:28 +0100
commita96382c1bb204698cd43e82193877c10e4b63027 (patch)
tree8731bd46ed0128f54440ba5d30ce79b6de54322b /target/linux/mediatek/image
parent38f7e932a5bbbf0f6dbc64ac05aa59e27c7ceec6 (diff)
downloadupstream-a96382c1bb204698cd43e82193877c10e4b63027.tar.gz
upstream-a96382c1bb204698cd43e82193877c10e4b63027.tar.bz2
upstream-a96382c1bb204698cd43e82193877c10e4b63027.zip
mediatek: add support for Bananapi BPi-R3
The Bananapi BPi-R3 is a development router board built around the MediaTek Filogic 830 (MT7986A) SoC. The board can boot either from microSD, SPI-NAND, SPI-NOR or eMMC. Only either SPI-NAND or SPI-NOR can be used at the same time, also only either microSD or eMMC can be used. The various storage options can be selected using small SMD switches on the board. Specs: * MediaTek MT7986A (Filogic 830) 4x ARM Cortex A53 * 4T4R 2.4G 802.11bgnax (MT7975N) * 4T4R 5G 802.11anac/ax (MT7975P) * 2 GB DDR4 RAM * 8 GB eMMC * 128 MB SPI-NAND flash * 32 MB SPI-NOR flash * on-board MT7531 GbE switch * 2x SFP+ (1 GbE / 2.5 GbE) * 5x GbE network port * miniPCIe slot (only USB 2.0 connected) * uSIM slot (connected to miniPCIe interface) * M.2 KEY-E PCIe interface (PCIe x2) * microSD card interface * 26 PIN GPIO Hardware details: https://wiki.banana-pi.org/Banana_Pi_BPI-R3 Working: * all 4 boot methods incl. installation via U-Boot, sysupgrade, ... * copper LAN and WAN ports * SFP1 (connected to gmac1, eth1 in Linux) * WiFi * LEDs * Buttons * PSTORE/ramoops based dual-boot Not Working (missing driver features): * SFP2 (connected to MT7531 switch) Untested: * M.2/NGFF slot (PCIe x2) * mPCIe slot (USB 2.0 + SIM) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/image')
-rw-r--r--target/linux/mediatek/image/filogic.mk71
1 files changed, 71 insertions, 0 deletions
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index dfa7f092cf..dfc71bbb14 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -8,6 +8,77 @@ define Image/Prepare
echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
endef
+define Build/bl2
+ cat $(STAGING_DIR_IMAGE)/mt7986-$1-bl2.img >> $@
+endef
+
+define Build/bl31-uboot
+ cat $(STAGING_DIR_IMAGE)/mt7986_$1-u-boot.fip >> $@
+endef
+
+define Build/mt7986-gpt
+ cp $@ $@.tmp 2>/dev/null || true
+ ptgen -g -o $@.tmp -a 1 -l 1024 \
+ $(if $(findstring sdmmc,$1), \
+ -H \
+ -t 0x83 -N bl2 -r -p 4079k@17k \
+ ) \
+ -t 0x83 -N ubootenv -r -p 512k@4M \
+ -t 0x83 -N factory -r -p 2M@4608k \
+ -t 0xef -N fip -r -p 4M@6656k \
+ -N recovery -r -p 32M@12M \
+ $(if $(findstring sdmmc,$1), \
+ -N install -r -p 20M@44M \
+ -t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@64M \
+ ) \
+ $(if $(findstring emmc,$1), \
+ -t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@64M \
+ )
+ cat $@.tmp >> $@
+ rm $@.tmp
+endef
+
+define Device/bananapi_bpi-r3
+ DEVICE_VENDOR := Bananapi
+ DEVICE_MODEL := BPi-R3
+ DEVICE_DTS := mt7986a-bananapi-bpi-r3
+ DEVICE_DTS_CONFIG := config-mt7986a-bananapi-bpi-r3
+ DEVICE_DTS_OVERLAY:= mt7986a-bananapi-bpi-r3-nor mt7986a-bananapi-bpi-r3-emmc-nor mt7986a-bananapi-bpi-r3-emmc-snand mt7986a-bananapi-bpi-r3-snand
+ DEVICE_DTS_DIR := ../dts
+ DEVICE_PACKAGES := kmod-btmtkuart kmod-usb3 kmod-i2c-gpio kmod-sfp e2fsprogs f2fsck mkf2fs
+ IMAGES := sysupgrade.itb
+ KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+ ARTIFACTS := \
+ emmc-preloader.bin emmc-bl31-uboot.fip \
+ nor-preloader.bin nor-bl31-uboot.fip \
+ sdcard.img.gz \
+ snand-preloader.bin snand-bl31-uboot.fip
+ ARTIFACT/emmc-preloader.bin := bl2 emmc-ddr4
+ ARTIFACT/emmc-bl31-uboot.fip := bl31-uboot bananapi_bpi-r3-emmc
+ ARTIFACT/nor-preloader.bin := bl2 nor-ddr4
+ ARTIFACT/nor-bl31-uboot.fip := bl31-uboot bananapi_bpi-r3-nor
+ ARTIFACT/snand-preloader.bin := bl2 spim-nand-ddr4
+ ARTIFACT/snand-bl31-uboot.fip := bl31-uboot bananapi_bpi-r3-snand
+ ARTIFACT/sdcard.img.gz := mt7986-gpt sdmmc |\
+ pad-to 17k | bl2 sdmmc-ddr4 |\
+ pad-to 6656k | bl31-uboot bananapi_bpi-r3-sdmmc |\
+ pad-to 12M | append-image-stage initramfs-recovery.itb |\
+ pad-to 44M | bl2 spim-nand-ddr4 |\
+ pad-to 45M | bl31-uboot bananapi_bpi-r3-snand |\
+ pad-to 49M | bl2 nor-ddr4 |\
+ pad-to 50M | bl31-uboot bananapi_bpi-r3-nor |\
+ pad-to 51M | bl2 emmc-ddr4 |\
+ pad-to 52M | bl31-uboot bananapi_bpi-r3-emmc |\
+ pad-to 56M | mt7986-gpt emmc |\
+ pad-to 64M | append-image squashfs-sysupgrade.itb | gzip
+ 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-static-with-rootfs | pad-rootfs | append-metadata
+ DTC_FLAGS += -@ --space 32768
+endef
+TARGET_DEVICES += bananapi_bpi-r3
+
define Device/mediatek_mt7986a-rfb
DEVICE_VENDOR := MediaTek
DEVICE_MODEL := MTK7986 rfba AP