mediatek: move mt7623 support into a 32bit subtarget
[openwrt/openwrt.git] / target / linux / mediatek / image / 32.mk
1 define Image/BuilduImage
2 $(CP) $(KDIR)/zImage$(2) $(KDIR)/zImage-$(1)$(2)
3 cat $(LINUX_DIR)/arch/arm/boot/dts/mt7623-$1.dtb >> $(KDIR)/zImage-$(1)$(2)
4 mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' -d $(KDIR)/zImage-$(1)$(2) $(KDIR)/uImage-$(1)$(2)
5 endef
6
7 define Image/Build/SysupgradeCombined
8 $(call Image/BuilduImage,$1)
9 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
10 $(call Image/BuilduImage,$1,-initramfs)
11 $(CP) $(KDIR)/uImage-$(1)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-$(1)-initramfs
12 endif
13 mkdir -p "$(KDIR_TMP)/sysupgrade-$(3)/"
14 echo "BOARD=$(3)" > "$(KDIR_TMP)/sysupgrade-$(3)/CONTROL"
15 $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(3)/root"
16 $(CP) "$(KDIR)/uImage-$(1)" "$(KDIR_TMP)/sysupgrade-$(3)/kernel"
17 (cd "$(KDIR_TMP)"; $(TAR) cvf \
18 "$(BIN_DIR)/$(IMG_PREFIX)-$(3)-sysupgrade.tar" sysupgrade-$(3) \
19 $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
20 )
21 endef
22
23 COMPAT_EMMC:=mediatek,mt7623-rfb-emmc
24 COMPAT_NAND:=mediatek,mt7623-rfb-nand
25 COMPAT_NAND_EPHY:=mediatek,mt7623-rfb-nand-ephy
26
27 define Image/Build/squashfs
28 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
29 $(CP) $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs
30
31 $(call Image/Build/SysupgradeCombined,eMMC,squashfs,$$(COMPAT_EMMC))
32
33 $(call Image/BuilduImage,NAND)
34 $(call Image/BuilduImage,NAND-ePHY)
35 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
36 $(call Image/BuilduImage,NAND,-initramfs)
37 $(call Image/BuilduImage,NAND-ePHY,-initramfs)
38 $(CP) $(KDIR)/uImage-NAND-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-NAND-initramfs
39 $(CP) $(KDIR)/uImage-NAND-ePHY-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-NAND-ePHY-initramfs
40 endif
41 $(call Image/Build/SysupgradeNAND,NAND,$(1),$(KDIR)/uImage-NAND,$$(COMPAT_NAND))
42 $(call Image/Build/SysupgradeNAND,NAND-ePHY,$(1),$(KDIR)/uImage-NAND-ePHY,$$(COMPAT_NAND_EPHY))
43 endef