[][openwrt-24][common][bsp][Add initial filogic target for unified autobuild]
[Description]
Add initial filogic target for unified autobuild
[Release-log]
N/A
Change-Id: I257aa0f0eed9ab64991b3820e75ebb526e6830bf
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9541685
diff --git a/autobuild/unified/filogic/.gitignore b/autobuild/unified/filogic/.gitignore
new file mode 100644
index 0000000..6d73d54
--- /dev/null
+++ b/autobuild/unified/filogic/.gitignore
@@ -0,0 +1,6 @@
+/*
+!master/
+
+!rules
+!mac80211
+!.gitignore
diff --git a/autobuild/unified/filogic/master/defconfig b/autobuild/unified/filogic/master/defconfig
new file mode 100644
index 0000000..57aff41
--- /dev/null
+++ b/autobuild/unified/filogic/master/defconfig
@@ -0,0 +1,58 @@
+CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
+CONFIG_BUSYBOX_CONFIG_LSPCI=y
+CONFIG_BUSYBOX_CONFIG_LSUSB=y
+CONFIG_BUSYBOX_CONFIG_MPSTAT=y
+CONFIG_BUSYBOX_CONFIG_TFTP=y
+CONFIG_BUSYBOX_CONFIG_VCONFIG=y
+CONFIG_BUSYBOX_CUSTOM=y
+# CONFIG_DROPBEAR_ED25519 is not set
+# CONFIG_KERNEL_BLK_DEV_THROTTLING is not set
+# CONFIG_KERNEL_CFS_BANDWIDTH is not set
+CONFIG_KERNEL_CGROUP_DEVICE=y
+CONFIG_KERNEL_CGROUP_FREEZER=y
+# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set
+# CONFIG_KERNEL_KEYS is not set
+# CONFIG_KERNEL_MEMCG_SWAP is not set
+CONFIG_KERNEL_NET_CLS_CGROUP=y
+CONFIG_PACKAGE_blockd=y
+CONFIG_PACKAGE_ethtool=y
+CONFIG_PACKAGE_ip-bridge=y
+CONFIG_PACKAGE_ip-full=y
+CONFIG_PACKAGE_kmod-ata-core=y
+CONFIG_PACKAGE_kmod-eeprom-at24=y
+CONFIG_PACKAGE_kmod-fs-exfat=y
+CONFIG_PACKAGE_kmod-fs-ext4=y
+CONFIG_PACKAGE_kmod-fs-msdos=y
+CONFIG_PACKAGE_kmod-fs-ntfs3=y
+CONFIG_PACKAGE_kmod-hwmon-pwmfan=y
+CONFIG_PACKAGE_kmod-i2c-gpio=y
+CONFIG_PACKAGE_kmod-i2c-mux-pca954x=y
+CONFIG_PACKAGE_kmod-mt7996-firmware=y
+CONFIG_PACKAGE_kmod-phy-airoha-en8811h=y
+CONFIG_PACKAGE_kmod-rtc-pcf8563=y
+CONFIG_PACKAGE_kmod-scsi-generic=y
+CONFIG_PACKAGE_kmod-usb-storage-extras=y
+CONFIG_PACKAGE_kmod-usb-storage-uas=y
+CONFIG_PACKAGE_lftp=y
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-app-ksmbd=y
+CONFIG_PACKAGE_luci-compat=y
+CONFIG_PACKAGE_mii_mgr=y
+CONFIG_PACKAGE_mtk_factory_rw=y
+CONFIG_PACKAGE_regs=y
+# CONFIG_PACKAGE_trusted-firmware-a-mt7981-ram-ddr3 is not set
+# CONFIG_PACKAGE_trusted-firmware-a-mt7981-ram-ddr4 is not set
+# CONFIG_PACKAGE_trusted-firmware-a-mt7986-ram-ddr3 is not set
+# CONFIG_PACKAGE_trusted-firmware-a-mt7986-ram-ddr4 is not set
+# CONFIG_PACKAGE_trusted-firmware-a-mt7988-ram-comb is not set
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7981-rfb=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7986a-rfb-nand=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7986b-rfb=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7988a-rfb=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_mediatek=y
+CONFIG_TARGET_mediatek_filogic=y
+CONFIG_USE_GC_SECTIONS=y
+CONFIG_USE_LTO=y
+CONFIG_USE_MOLD=y
diff --git a/autobuild/unified/filogic/master/patches-base/0001-mediatek-filogic-prevent-unused-artifact-files-from-.patch b/autobuild/unified/filogic/master/patches-base/0001-mediatek-filogic-prevent-unused-artifact-files-from-.patch
new file mode 100644
index 0000000..a9b47c3
--- /dev/null
+++ b/autobuild/unified/filogic/master/patches-base/0001-mediatek-filogic-prevent-unused-artifact-files-from-.patch
@@ -0,0 +1,83 @@
+From: Weijie Gao <weijie.gao@mediatek.com>
+Subject: [PATCH] mediatek/filogic: prevent unused artifact files from
+ building
+
+Artifact files (bl2/bl31/sd image) are useless in internal use.
+
+Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -760,36 +760,6 @@ define Device/mediatek_mt7981-rfb
+ 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
+
+@@ -865,35 +835,6 @@ define Device/mediatek_mt7988a-rfb
+ 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-ubi-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
+
diff --git a/autobuild/unified/filogic/master/patches-base/0002-mediatek-filogic-add-extra-image-definitions.patch b/autobuild/unified/filogic/master/patches-base/0002-mediatek-filogic-add-extra-image-definitions.patch
new file mode 100644
index 0000000..614a6a7
--- /dev/null
+++ b/autobuild/unified/filogic/master/patches-base/0002-mediatek-filogic-add-extra-image-definitions.patch
@@ -0,0 +1,10 @@
+--- a/target/linux/mediatek/image/Makefile
++++ b/target/linux/mediatek/image/Makefile
+@@ -34,6 +34,7 @@ define Device/Default
+ endef
+
+ include $(SUBTARGET).mk
++-include $(SUBTARGET)-extra.mk
+
+ define Image/Build
+ $(call Image/Build/$(1),$(1))
diff --git a/autobuild/unified/filogic/rules b/autobuild/unified/filogic/rules
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/autobuild/unified/filogic/rules