aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2023-09-13 00:57:49 +0100
committerDaniel Golle <daniel@makrotopia.org>2023-09-21 10:15:08 +0100
commitce7209bd21661e3daa4a7f2f58dafdff990da19f (patch)
tree87a84b1818fd8817269acfb301ec30e2c77dbbf2 /target/linux/mediatek/image
parent8428bed15d9b5a71a634c7f5639de31a09795bec (diff)
downloadupstream-ce7209bd21661e3daa4a7f2f58dafdff990da19f.tar.gz
upstream-ce7209bd21661e3daa4a7f2f58dafdff990da19f.tar.bz2
upstream-ce7209bd21661e3daa4a7f2f58dafdff990da19f.zip
mediatek: add build for MT7981 RFB
Add build for the MTK3943 reference board for MT7981B+MT7976C. **Hardware specification:** - SoC: MediaTek MT7981B 2x A53 - Flash: various options - RAM: 256MB DDR3 - Ethernet: 4 x 10/100/1000 Mbps via MT7531AE switch EITHER 1 x 10/100/1000 Mbps built-in PHY OR 1 x 10/100/1000/2500 Mbps MaxLinear GPY211C - Switch: MediaTek MT7531AE - WiFi: MediaTek MT7976C - Button: RST, WPS **Flash instructions for SPIM-NAND:** - write *mt7981-rfb-spim-nand-preloader.bin to 'BL2' partition - write *mt7981-rfb-spim-nand-bl31-uboot.fip to 'FIP' partition - erase 'ubi' partition - reset board - create ubootenv and ubootenv2 UBI volumes in U-Boot - edit environment and set bootcmd, e.g. setenv bootconf 'config-1#mt7981-rfb-spim-nand#mt7981-rfb-mxl-2p5g-phy-eth1' setenv bootcmd 'ubi read $loadaddr fit; bootm $loadaddr#$bootconf' - load initramfs image via TFTP: setenv serverip 192.168.1.254 setenv ipaddr 192.168.1.1 setenv bootfile openwrt-mediatek-filogic-mediatek_mt7981-rfb-initramfs.itb saveenv ; saveenv tftpboot bootm $loadaddr#$bootconf - Now use sysupgrade to write OpenWrt firmware to flash. SNFI-NAND, SPIM-NOR and eMMC all work very similar, a bootable SD card image is also being generated. However, as the board I've been provided only comes with SPIM-NAND all other boot media are untested. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/image')
-rw-r--r--target/linux/mediatek/image/filogic.mk55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 571815249ff..48f5946e4b2 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -282,6 +282,61 @@ define Device/netgear_wax220
endef
TARGET_DEVICES += netgear_wax220
+define Device/mediatek_mt7981-rfb
+ DEVICE_VENDOR := MediaTek
+ DEVICE_MODEL := MT7981 rfb
+ DEVICE_DTS := mt7981-rfb
+ DEVICE_DTS_OVERLAY:= \
+ mt7981-rfb-spim-nand \
+ mt7981-rfb-mxl-2p5g-phy-eth1 \
+ mt7981-rfb-mxl-2p5g-phy-swp5
+ DEVICE_DTS_DIR := $(DTS_DIR)/
+ DEVICE_DTC_FLAGS := --pad 4096
+ DEVICE_DTS_LOADADDR := 0x43f00000
+ DEVICE_PACKAGES := kmod-mt7981-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs mt7981-wo-firmware
+ KERNEL_LOADADDR := 0x44000000
+ KERNEL := kernel-bin | gzip
+ KERNEL_INITRAMFS := kernel-bin | lzma | \
+ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+ KERNEL_INITRAMFS_SUFFIX := .itb
+ KERNEL_IN_UBI := 1
+ UBOOTENV_IN_UBI := 1
+ IMAGES := sysupgrade.itb
+ IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
+ IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
+ ARTIFACTS := \
+ emmc-preloader.bin emmc-bl31-uboot.fip \
+ nor-preloader.bin nor-bl31-uboot.fip \
+ sdcard.img.gz \
+ snfi-nand-preloader.bin snfi-nand-bl31-uboot.fip \
+ spim-nand-preloader.bin spim-nand-bl31-uboot.fip
+ ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr3
+ ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc
+ ARTIFACT/nor-preloader.bin := mt7981-bl2 nor-ddr3
+ ARTIFACT/nor-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc
+ ARTIFACT/snfi-nand-preloader.bin := mt7981-bl2 snand-ddr3
+ ARTIFACT/snfi-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-snfi
+ ARTIFACT/spim-nand-preloader.bin := mt7981-bl2 spim-nand-ddr3
+ ARTIFACT/spim-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-spim-nand
+ ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
+ pad-to 17k | mt7981-bl2 sdmmc-ddr3 |\
+ pad-to 6656k | mt7981-bl31-uboot rfb-sd |\
+ $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
+ pad-to 12M | append-image-stage initramfs.itb | check-size 44m |\
+ ) \
+ pad-to 44M | mt7981-bl2 spim-nand-ddr3 |\
+ pad-to 45M | mt7981-bl31-uboot rfb-spim-nand |\
+ pad-to 49M | mt7981-bl2 nor-ddr3 |\
+ pad-to 50M | mt7981-bl31-uboot rfb-nor |\
+ pad-to 51M | mt7981-bl2 snand-ddr3 |\
+ pad-to 53M | mt7981-bl31-uboot rfb-snfi |\
+ $(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
+ pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
+ ) \
+ gzip
+endef
+TARGET_DEVICES += mediatek_mt7981-rfb
+
define Device/mediatek_mt7986a-rfb-nand
DEVICE_VENDOR := MediaTek
DEVICE_MODEL := MT7986 rfba AP (NAND)