openwrt/target/linux/mediatek/image/filogic.mk
Roland Reinl 6e51ff88b0 filogic: Add support for D-Link AQUILA PRO AI M30
Specification:
 - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
 - MT7531 switch
 - 512MB RAM
 - 128MB NAND flash with two UBI partitions with identical size
 - 1 multi color LED (red, green, blue, white) connected via GCA230718
 - 3 buttons (WPS, reset, LED on/off)
 - 1 1Gbit WAN port
 - 4 1Gbit LAN ports

Disassembly:
 - There are four screws at the bottom: 2 under the rubber feets, 2 under the label.
 - After removing the screws, the white plastic part can be shifted out of the blue part.
 - Be careful because the antennas are mounted on the side and the top of the white part.

Serial Interface
 - The serial interface can be connected to the 4 pin holes on the side of the board.
 - Pins (from front to rear):
   - 3.3V
   - RX
   - TX
   - GND
 - Settings: 115200, 8N1

MAC addresses:
 - WAN MAC is stored in partition "Odm" at offset 0x81
 - LAN (as printed on the device) is WAN MAC + 1
 - WLAN MAC (2.4 GHz) is WAN MAC + 2
 - WLAN MAC (5GHz) is WAN MAC + 3

Flashing via Recovery Web Interface:
 - The recovery web interface always flashes to the currently active partition.
 - If OpenWrt is flahsed to the second partition, it will not boot.
 - Ensure that you have an OEM image available (encrypted and decrypted version). Decryption is described in the end.
 - Set your IP address to 192.168.200.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-recovery.bin
 - The recovery web interface always reports successful flashing, even if it fails
 - After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored)
 - If OpenWrt was flashed to the first partition, OpenWrt will boot (The status LED will start blinking white and stay white in the end). In this case you're done and can use OpenWrt.
 - If OpenWrt was flashed to the second partition, OpenWrt won't boot (The status LED will stay red forever). In this case, the following steps are reuqired:
   - Start the web recovery interface again and flash the **decrypted OEM image**. This will be flashed to the second partition as well. The OEM firmware web interface is afterwards accessible via http://192.168.200.1.
   - Now flash the **encrypted OEM image** via OEM firmware web interface. In this case, the new firmware is flashed to the first partition. After flashing and the following reboot, the OEM firmware web interface should still be accessible via http://192.168.200.1.
   - Start the web recovery interface again and flash the OpenWrt recovery image. Now it will be flashed to the first partition, OpenWrt will boot correctly afterwards and is accessible via 192.168.1.1.

Flashing via U-Boot:
 - Open the case, connect to the UART console
 - Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-initramfs-kernel.bin.
 - Power on the device and select "7. Load image" in the U-Boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
 - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
 - Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-sysupgrade.bin
 - Reboot the device. OpenWrt should start from flash now

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.200.2, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
 - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
 - Run ./m32-firmware-util M30 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
 - Example for firmware M30A1_FW101B05: ./m32-firmware-util M30 --DecryptFactoryImage M30A1_FW101B05\(0725091522\).bin M30A1_FW101B05\(0725091522\)_decrypted.bin

Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition.

Controlling the LEDs:
 - The LEDs are controlled by a chip called "GCA230718" which is connected to the main CPU via I2C (address 0x40)
 - I didn't find any documentation or driver for it, so the information below is purely based on my investigations
 - If there is already I driver for it, please tell me. Maybe I didn't search enough
 - I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
 - The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
 - The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
 - Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
 - Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
   - A reset command (0x81 0xE4) written to register 0x00
   - A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
 - The reset command is always the same
 - In the control command
   - byte 0 is always the same
   - byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
   - byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
   - byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
   - byte 7 defines the toggling frequency (if toggling enabled)
   - byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
   - byte 12 is constant 0x87

Comparison to M32/R32:
 - The algorithms for decrypting the OEM firmware are the same for M30/M32/R32, only the keys differ
 - The keys are available in the GPL sources for the M32
 - The M32/R32 contained raw data in the firmware images (kernel, rootfs), the R30 uses a sysupgrade tar instead
 - Creation of the recovery image is quite similar, only the header start string changes. So mostly takeover from M32/R32 for that.
 - Turned out that the bytes at offset 0x0E and 0x0F in the recovery image header are the checksum over the data area
 - This checksum was not checked in the recovery web interface of M32/R32 devices, but is now active in R30
 - I adapted the recovery image creation to also calculate the checksum over the data area
 - The recovery image header for M30 contains addresses which don't match the memory layout in the DTS. The same addresses are also present in the OEM images
 - The recovery web interface either calculates the correct addresses from it or has it's own logic to determine where which information must be written

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 29cca6cfee)
2024-07-08 23:06:38 +02:00

1134 lines
41 KiB
Makefile

DTS_DIR := $(DTS_DIR)/mediatek
define Image/Prepare
# For UBI we want only one extra block
rm -f $(KDIR)/ubi_mark
echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
endef
define Build/mt7981-bl2
cat $(STAGING_DIR_IMAGE)/mt7981-$1-bl2.img >> $@
endef
define Build/mt7981-bl31-uboot
cat $(STAGING_DIR_IMAGE)/mt7981_$1-u-boot.fip >> $@
endef
define Build/mt7986-bl2
cat $(STAGING_DIR_IMAGE)/mt7986-$1-bl2.img >> $@
endef
define Build/mt7986-bl31-uboot
cat $(STAGING_DIR_IMAGE)/mt7986_$1-u-boot.fip >> $@
endef
define Build/mt7988-bl2
cat $(STAGING_DIR_IMAGE)/mt7988-$1-bl2.img >> $@
endef
define Build/mt7988-bl31-uboot
cat $(STAGING_DIR_IMAGE)/mt7988_$1-u-boot.fip >> $@
endef
define Build/mt798x-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
metadata_gl_json = \
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
"metadata_version": "1.1", \
"compat_version": "$(call json_quote,$(compat_version))", \
$(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \
$(if $(filter-out 1.0,$(compat_version)),"new_supported_devices": \
[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma) \
"supported_devices": ["$(call json_quote,$(legacy_supported_message))"]$(comma)) \
$(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \
"version": { \
"release": "$(call json_quote,$(VERSION_NUMBER))", \
"date": "$(shell TZ='Asia/Chongqing' date '+%Y%m%d%H%M%S')", \
"dist": "$(call json_quote,$(VERSION_DIST))", \
"version": "$(call json_quote,$(VERSION_NUMBER))", \
"revision": "$(call json_quote,$(REVISION))", \
"target": "$(call json_quote,$(TARGETID))", \
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
} \
}'
define Build/append-gl-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
sha256sum "$@" | cut -d" " -f1 > "$@.sha256sum"
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
ucert -A -c "$@.ucert" -x "$@.sig" ;\
fwtool -S "$@.ucert" "$@" ;\
}
endef
define Build/zyxel-nwa-fit-filogic
$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
$@.its $@ "80 e1 ff ff ff ff ff ff ff ff"
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
define Build/cetron-header
$(eval magic=$(word 1,$(1)))
$(eval model=$(word 2,$(1)))
( \
dd if=/dev/zero bs=856 count=1 2>/dev/null; \
printf "$(model)," | dd bs=128 count=1 conv=sync 2>/dev/null; \
md5sum $@ | cut -f1 -d" " | dd bs=32 count=1 2>/dev/null; \
printf "$(magic)" | dd bs=4 count=1 conv=sync 2>/dev/null; \
cat $@; \
) > $@.tmp
fw_crc=$$(gzip -c $@.tmp | tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n'); \
printf "$$(echo $$fw_crc | sed 's/../\\x&/g')" | cat - $@.tmp > $@
rm $@.tmp
endef
define Device/acelink_ew-7886cax
DEVICE_VENDOR := Acelink
DEVICE_MODEL := EW-7886CAX
DEVICE_DTS := mt7986a-acelink-ew-7886cax
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += acelink_ew-7886cax
define Device/acer_predator-w6
DEVICE_VENDOR := Acer
DEVICE_MODEL := Predator W6
DEVICE_DTS := mt7986a-acer-predator-w6
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
IMAGES := sysupgrade.bin
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += acer_predator-w6
define Device/adtran_smartrg
DEVICE_VENDOR := Adtran
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-hwmon-pwmfan \
kmod-mt7986-firmware mt7986-wo-firmware
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/smartrg_sdg-8612
$(call Device/adtran_smartrg)
DEVICE_MODEL := SDG-8612
DEVICE_DTS := mt7986a-smartrg-SDG-8612
endef
TARGET_DEVICES += smartrg_sdg-8612
define Device/smartrg_sdg-8614
$(call Device/adtran_smartrg)
DEVICE_MODEL := SDG-8614
DEVICE_DTS := mt7986a-smartrg-SDG-8614
endef
TARGET_DEVICES += smartrg_sdg-8614
define Device/smartrg_sdg-8622
$(call Device/adtran_smartrg)
DEVICE_MODEL := SDG-8622
DEVICE_DTS := mt7986a-smartrg-SDG-8622
DEVICE_PACKAGES += kmod-mt7915-firmware
endef
TARGET_DEVICES += smartrg_sdg-8622
define Device/smartrg_sdg-8632
$(call Device/adtran_smartrg)
DEVICE_MODEL := SDG-8632
DEVICE_DTS := mt7986a-smartrg-SDG-8632
DEVICE_PACKAGES += kmod-mt7915-firmware
endef
TARGET_DEVICES += smartrg_sdg-8632
define Device/asus_rt-ax59u
DEVICE_VENDOR := ASUS
DEVICE_MODEL := RT-AX59U
DEVICE_DTS := mt7986a-asus-rt-ax59u
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += asus_rt-ax59u
define Device/asus_tuf-ax4200
DEVICE_VENDOR := ASUS
DEVICE_MODEL := TUF-AX4200
DEVICE_DTS := mt7986a-asus-tuf-ax4200
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
IMAGES := sysupgrade.bin
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += asus_tuf-ax4200
define Device/asus_tuf-ax6000
DEVICE_VENDOR := ASUS
DEVICE_MODEL := TUF-AX6000
DEVICE_DTS := mt7986a-asus-tuf-ax6000
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
IMAGES := sysupgrade.bin
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += asus_tuf-ax6000
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-emmc mt7986a-bananapi-bpi-r3-nand mt7986a-bananapi-bpi-r3-nor mt7986a-bananapi-bpi-r3-sd
DEVICE_DTS_DIR := $(DTS_DIR)/
DEVICE_DTS_LOADADDR := 0x43f00000
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-gpio kmod-mt7986-firmware kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7986-wo-firmware
IMAGES := sysupgrade.itb
KERNEL_LOADADDR := 0x44000000
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 := mt7986-bl2 emmc-ddr4
ARTIFACT/emmc-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-emmc
ARTIFACT/nor-preloader.bin := mt7986-bl2 nor-ddr4
ARTIFACT/nor-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-nor
ARTIFACT/snand-preloader.bin := mt7986-bl2 spim-nand-ddr4
ARTIFACT/snand-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-snand
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
pad-to 17k | mt7986-bl2 sdmmc-ddr4 |\
pad-to 6656k | mt7986-bl31-uboot bananapi_bpi-r3-sdmmc |\
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\
) \
pad-to 44M | mt7986-bl2 spim-nand-ddr4 |\
pad-to 45M | mt7986-bl31-uboot bananapi_bpi-r3-snand |\
pad-to 49M | mt7986-bl2 nor-ddr4 |\
pad-to 50M | mt7986-bl31-uboot bananapi_bpi-r3-nor |\
pad-to 51M | mt7986-bl2 emmc-ddr4 |\
pad-to 52M | mt7986-bl31-uboot bananapi_bpi-r3-emmc |\
pad-to 56M | mt798x-gpt emmc |\
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
) \
gzip
ifeq ($(DUMP),)
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
endif
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
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_COMPAT_VERSION := 1.1
DEVICE_COMPAT_MESSAGE := Device tree overlay mechanism needs bootloader update
endef
TARGET_DEVICES += bananapi_bpi-r3
define Device/cetron_ct3003
DEVICE_VENDOR := Cetron
DEVICE_MODEL := CT3003
DEVICE_DTS := mt7981b-cetron-ct3003
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGES += factory.bin
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | cetron-header rd30 CT3003
endef
TARGET_DEVICES += cetron_ct3003
define Device/cmcc_rax3000m
DEVICE_VENDOR := CMCC
DEVICE_MODEL := RAX3000M
DEVICE_DTS := mt7981b-cmcc-rax3000m
DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand
DEVICE_DTS_DIR := ../dts
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_DTS_LOADADDR := 0x43f00000
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
e2fsprogs f2fsck mkf2fs
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 := -recovery.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-static-with-rootfs | \
pad-rootfs | append-metadata
ARTIFACTS := \
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
nand-preloader.bin nand-bl31-uboot.fip
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr4
ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc
ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4
ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand
endef
TARGET_DEVICES += cmcc_rax3000m
define Device/comfast_cf-e393ax
DEVICE_VENDOR := Comfast
DEVICE_MODEL := CF-E393AX
DEVICE_DTS := mt7981a-comfast-cf-e393ax
DEVICE_DTS_DIR := ../dts
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_DTS_LOADADDR := 0x43f00000
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
KERNEL_LOADADDR := 0x44000000
KERNEL = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGES := sysupgrade.bin factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += comfast_cf-e393ax
define Device/confiabits_mt7981
DEVICE_VENDOR := Confiabits
DEVICE_MODEL := MT7981
DEVICE_DTS := mt7981b-confiabits-mt7981
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-2500wan-gmac2-rfb
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += confiabits_mt7981
define Device/cudy_re3000-v1
DEVICE_VENDOR := Cudy
DEVICE_MODEL := RE3000
DEVICE_VARIANT := v1
DEVICE_DTS := mt7981b-cudy-re3000-v1
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
IMAGES := sysupgrade.bin
IMAGE_SIZE := 15424k
SUPPORTED_DEVICES += R36
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += cudy_re3000-v1
define Device/cudy_tr3000-v1
DEVICE_VENDOR := Cudy
DEVICE_MODEL := TR3000
DEVICE_VARIANT := v1
DEVICE_DTS := mt7981b-cudy-tr3000-v1
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES += R47
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += cudy_tr3000-v1
define Device/cudy_wr3000-v1
DEVICE_VENDOR := Cudy
DEVICE_MODEL := WR3000
DEVICE_VARIANT := v1
DEVICE_DTS := mt7981b-cudy-wr3000-v1
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
IMAGES := sysupgrade.bin
IMAGE_SIZE := 15424k
SUPPORTED_DEVICES += R31
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += cudy_wr3000-v1
define Device/dlink_aquila-pro-ai-m30-a1
DEVICE_VENDOR := D-Link
DEVICE_MODEL := AQUILA PRO AI M30
DEVICE_VARIANT := A1
DEVICE_DTS := mt7981b-dlink-aquila-pro-ai-m30-a1
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-leds-gca230718 kmod-mt7981-firmware mt7981-wo-firmware
KERNEL_IN_UBI := 1
IMAGES += recovery.bin
IMAGE_SIZE := 51200k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/recovery.bin := sysupgrade-tar | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6110001 \x6A\x28\xEE\x0B \x00\x00\x2C\x00 \x00\x00\x20\x03 \x61\x6E
endef
TARGET_DEVICES += dlink_aquila-pro-ai-m30-a1
define Device/glinet_gl-mt3000
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MT3000
DEVICE_DTS := mt7981b-glinet-gl-mt3000
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES += glinet,mt3000-snand
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 246272k
KERNEL_IN_UBI := 1
IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
endef
TARGET_DEVICES += glinet_gl-mt3000
define Device/glinet_gl-mt6000
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MT6000
DEVICE_DTS := mt7986a-glinet-gl-mt6000
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs
IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot glinet_gl-mt6000
endef
TARGET_DEVICES += glinet_gl-mt6000
define Device/h3c_magic-nx30-pro
DEVICE_VENDOR := H3C
DEVICE_MODEL := Magic NX30 Pro
DEVICE_DTS := mt7981b-h3c-magic-nx30-pro
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGE_SIZE := 65536k
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot h3c_magic-nx30-pro
endef
TARGET_DEVICES += h3c_magic-nx30-pro
define Device/jcg_q30-pro
DEVICE_VENDOR := JCG
DEVICE_MODEL := Q30 PRO
DEVICE_DTS := mt7981b-jcg-q30-pro
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro
endef
TARGET_DEVICES += jcg_q30-pro
define Device/jdcloud_re-cp-03
DEVICE_VENDOR := JDCloud
DEVICE_MODEL := RE-CP-03
DEVICE_DTS := mt7986a-jdcloud-re-cp-03
DEVICE_DTS_DIR := ../dts
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_DTS_LOADADDR := 0x43f00000
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware \
e2fsprogs f2fsck mkf2fs
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 := -recovery.itb
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-static-with-rootfs | \
pad-rootfs | append-metadata
ARTIFACTS :=gpt.bin preloader.bin bl31-uboot.fip
ARTIFACT/gpt.bin := mt798x-gpt emmc
ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot jdcloud_re-cp-03
endef
TARGET_DEVICES += jdcloud_re-cp-03
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)
DEVICE_DTS := mt7986a-rfb-spim-nand
DEVICE_DTS_DIR := $(DTS_DIR)/
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
KERNEL = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
endef
TARGET_DEVICES += mediatek_mt7986a-rfb-nand
define Device/mediatek_mt7986b-rfb
DEVICE_VENDOR := MediaTek
DEVICE_MODEL := MTK7986 rfbb AP
DEVICE_DTS := mt7986b-rfb
DEVICE_DTS_DIR := $(DTS_DIR)/
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
SUPPORTED_DEVICES := mediatek,mt7986b-rfb
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += mediatek_mt7986b-rfb
define Device/mediatek_mt7988a-rfb
DEVICE_VENDOR := MediaTek
DEVICE_MODEL := MT7988A rfb
DEVICE_DTS := mt7988a-rfb
DEVICE_DTS_OVERLAY:= \
mt7988a-rfb-emmc \
mt7988a-rfb-sd \
mt7988a-rfb-snfi-nand \
mt7988a-rfb-spim-nand \
mt7988a-rfb-spim-nor \
mt7988a-rfb-eth1-aqr \
mt7988a-rfb-eth1-i2p5g-phy \
mt7988a-rfb-eth1-mxl \
mt7988a-rfb-eth1-sfp \
mt7988a-rfb-eth2-aqr \
mt7988a-rfb-eth2-mxl \
mt7988a-rfb-eth2-sfp
DEVICE_DTS_DIR := $(DTS_DIR)/
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_DTS_LOADADDR := 0x45f00000
DEVICE_PACKAGES := kmod-sfp
KERNEL_LOADADDR := 0x46000000
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
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
IMAGES := sysupgrade.itb
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
ARTIFACTS := \
emmc-gpt.bin 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-gpt.bin := mt798x-gpt emmc
ARTIFACT/emmc-preloader.bin := mt7988-bl2 emmc-comb
ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot rfb-emmc
ARTIFACT/nor-preloader.bin := mt7988-bl2 nor-comb
ARTIFACT/nor-bl31-uboot.fip := mt7988-bl31-uboot rfb-nor
ARTIFACT/snand-preloader.bin := mt7988-bl2 spim-nand-comb
ARTIFACT/snand-bl31-uboot.fip := mt7988-bl31-uboot rfb-snand
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
pad-to 17k | mt7988-bl2 sdmmc-comb |\
pad-to 6656k | mt7988-bl31-uboot rfb-sd |\
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
pad-to 12M | append-image-stage initramfs.itb | check-size 44m |\
) \
pad-to 44M | mt7988-bl2 spim-nand-comb |\
pad-to 45M | mt7988-bl31-uboot rfb-snand |\
pad-to 51M | mt7988-bl2 nor-comb |\
pad-to 51M | mt7988-bl31-uboot rfb-nor |\
pad-to 55M | mt7988-bl2 emmc-comb |\
pad-to 56M | mt7988-bl31-uboot rfb-emmc |\
pad-to 62M | mt798x-gpt emmc |\
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
) \
gzip
endef
TARGET_DEVICES += mediatek_mt7988a-rfb
define Device/mercusys_mr90x-v1
DEVICE_VENDOR := MERCUSYS
DEVICE_MODEL := MR90X v1
DEVICE_DTS := mt7986b-mercusys-mr90x-v1
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 51200k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += mercusys_mr90x-v1
define Device/netcore_n60
DEVICE_VENDOR := Netcore
DEVICE_MODEL := N60
DEVICE_DTS := mt7986a-netcore-n60
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot netcore_n60
endef
TARGET_DEVICES += netcore_n60
define Device/netgear_wax220
DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := WAX220
DEVICE_DTS := mt7986b-netgear-wax220
DEVICE_DTS_DIR := ../dts
NETGEAR_ENC_MODEL := WAX220
NETGEAR_ENC_REGION := US
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
IMAGE_SIZE := 32768k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGES += factory.img
# Padding to 10M seems to be required by OEM web interface
IMAGE/factory.img := sysupgrade-tar | \
pad-to 10M | check-size | netgear-encrypted-factory
endef
TARGET_DEVICES += netgear_wax220
define Device/qihoo_360t7
DEVICE_VENDOR := Qihoo
DEVICE_MODEL := 360T7
DEVICE_DTS := mt7981b-qihoo-360t7
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot qihoo_360t7
endef
TARGET_DEVICES += qihoo_360t7
define Device/routerich_ax3000
DEVICE_VENDOR := Routerich
DEVICE_MODEL := AX3000
DEVICE_DTS := mt7981b-routerich-ax3000
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
endef
TARGET_DEVICES += routerich_ax3000
define Device/tplink_tl-xdr-common
DEVICE_VENDOR := TP-Link
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
endef
define Device/tplink_tl-xdr4288
DEVICE_MODEL := TL-XDR4288
DEVICE_DTS := mt7986a-tplink-tl-xdr4288
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr4288
$(call Device/tplink_tl-xdr-common)
endef
TARGET_DEVICES += tplink_tl-xdr4288
define Device/tplink_tl-xdr6086
DEVICE_MODEL := TL-XDR6086
DEVICE_DTS := mt7986a-tplink-tl-xdr6086
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr6086
$(call Device/tplink_tl-xdr-common)
endef
TARGET_DEVICES += tplink_tl-xdr6086
define Device/tplink_tl-xdr6088
DEVICE_MODEL := TL-XDR6088
DEVICE_DTS := mt7986a-tplink-tl-xdr6088
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr6088
$(call Device/tplink_tl-xdr-common)
endef
TARGET_DEVICES += tplink_tl-xdr6088
define Device/ubnt_unifi-6-plus
DEVICE_VENDOR := Ubiquiti
DEVICE_MODEL := UniFi 6 Plus
DEVICE_DTS := mt7981a-ubnt-unifi-6-plus
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware e2fsprogs f2fsck mkf2fs fdisk partx-utils
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += ubnt_unifi-6-plus
define Device/unielec_u7981-01
DEVICE_VENDOR := Unielec
DEVICE_MODEL := U7981-01
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs fdisk partx-utils
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/unielec_u7981-01-emmc
DEVICE_DTS := mt7981b-unielec-u7981-01-emmc
DEVICE_VARIANT := (EMMC)
$(call Device/unielec_u7981-01)
endef
TARGET_DEVICES += unielec_u7981-01-emmc
define Device/unielec_u7981-01-nand
DEVICE_DTS := mt7981b-unielec-u7981-01-nand
DEVICE_VARIANT := (NAND)
$(call Device/unielec_u7981-01)
endef
TARGET_DEVICES += unielec_u7981-01-nand
define Device/xiaomi_mi-router-ax3000t
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router AX3000T
DEVICE_DTS := mt7981b-xiaomi-mi-router-ax3000t
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS := initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
endif
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += xiaomi_mi-router-ax3000t
define Device/xiaomi_mi-router-ax3000t-ubootmod
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router AX3000T (OpenWrt U-Boot layout)
DEVICE_DTS := mt7981b-xiaomi-mi-router-ax3000t-ubootmod
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-ax3000t
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS += initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
endif
endef
TARGET_DEVICES += xiaomi_mi-router-ax3000t-ubootmod
define Device/xiaomi_mi-router-wr30u-stock
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router WR30U (stock layout)
DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-stock
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS := initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
endif
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += xiaomi_mi-router-wr30u-stock
define Device/xiaomi_mi-router-wr30u-ubootmod
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router WR30U (OpenWrt U-Boot layout)
DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-ubootmod
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
IMAGES := sysupgrade.itb
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
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 | append-metadata
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-wr30u
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS += initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
endif
endef
TARGET_DEVICES += xiaomi_mi-router-wr30u-ubootmod
define Device/xiaomi_redmi-router-ax6000-stock
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Redmi Router AX6000 (stock layout)
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS := initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
endif
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock
define Device/xiaomi_redmi-router-ax6000-ubootmod
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout)
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
IMAGES := sysupgrade.itb
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
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 | append-metadata
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS += initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
endif
endef
TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod
define Device/yuncore_ax835
DEVICE_VENDOR := YunCore
DEVICE_MODEL := AX835
DEVICE_DTS := mt7981b-yuncore-ax835
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
IMAGES := sysupgrade.bin
IMAGE_SIZE := 14336k
SUPPORTED_DEVICES += mediatek,mt7981-spim-nor-rfb
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += yuncore_ax835
define Device/zbtlink_zbt-z8102ax
DEVICE_VENDOR := Zbtlink
DEVICE_MODEL := ZBT-Z8102AX
DEVICE_DTS := mt7981b-zbtlink-zbt-z8102ax
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option
KERNEL_IN_UBI := 1
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += zbtlink_zbt-z8102ax
define Device/zbtlink_zbt-z8103ax
DEVICE_VENDOR := Zbtlink
DEVICE_MODEL := ZBT-Z8103AX
DEVICE_DTS := mt7981b-zbtlink-zbt-z8103ax
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
KERNEL_IN_UBI := 1
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += zbtlink_zbt-z8103ax
define Device/zyxel_ex5601-t0-stock
DEVICE_VENDOR := Zyxel
DEVICE_MODEL := EX5601-T0
DEVICE_VARIANT := (stock layout)
DEVICE_DTS := mt7986a-zyxel-ex5601-t0-stock
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3
SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand
UBINIZE_OPTS := -E 5
BLOCKSIZE := 256k
PAGESIZE := 4096
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
KERNEL = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
endef
TARGET_DEVICES += zyxel_ex5601-t0-stock
define Device/zyxel_ex5601-t0-ubootmod
DEVICE_VENDOR := Zyxel
DEVICE_MODEL := EX5601-T0
DEVICE_VARIANT := (OpenWrt U-Boot layout)
DEVICE_DTS := mt7986a-zyxel-ex5601-t0-ubootmod
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
IMAGES := sysupgrade.itb
UBINIZE_OPTS := -E 5
BLOCKSIZE := 256k
PAGESIZE := 4096
KERNEL_IN_UBI := 1
UBOOTENV_IN_UBI := 1
KERNEL := kernel-bin | lzma
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
IMAGE/sysupgrade.itb := append-kernel | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS += initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
endif
endef
TARGET_DEVICES += zyxel_ex5601-t0-ubootmod
define Device/zyxel_ex5700-telenor
DEVICE_VENDOR := ZyXEL
DEVICE_MODEL := EX5700 (Telenor)
DEVICE_DTS := mt7986a-zyxel-ex5700-telenor
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7916-firmware kmod-ubootenv-nvram kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 65536k
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += zyxel_ex5700-telenor
define Device/zyxel_nwa50ax-pro
DEVICE_VENDOR := ZyXEL
DEVICE_MODEL := NWA50AX Pro
DEVICE_DTS := mt7981b-zyxel-nwa50ax-pro
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware zyxel-bootconfig
DEVICE_DTS_LOADADDR := 0x44000000
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 51200k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) | zyxel-nwa-fit-filogic
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += zyxel_nwa50ax-pro