ramips: add subtarget for mt7688
[openwrt/staging/chunkeey.git] / target / linux / ramips / image / Makefile
index 6e6b10b..409ff26 100644 (file)
@@ -35,7 +35,7 @@ define Device/Default
   KERNEL := $(KERNEL_DTB) | uImage lzma
   IMAGES := sysupgrade.bin
   IMAGE_SIZE := $(ralink_default_fw_size_8M)
-  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | check-size $$$$(IMAGE_SIZE) | pad-rootfs
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Build/patch-dtb
@@ -62,7 +62,7 @@ endef
 
 define Build/relocate-kernel
        ( \
-               dd if=$(KDIR)/relocate/loader.bin bs=32 conv=sync && \
+               dd if=$(KDIR)/loader.bin bs=32 conv=sync && \
                perl -e '@s = stat("$@"); print pack("V", @s[7])' && \
                cat $@ \
        ) > $@.new
@@ -514,6 +514,7 @@ define BuildFirmware/DCS930/squashfs
 endef
 BuildFirmware/DCS930/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
 Image/Build/Profile/DCS930=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930,DCS-930)
+Image/Build/Profile/DCS930LB1=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930l-b1,DCS-930L-B1)
 
 Image/Build/Profile/ESR-9753=$(call BuildFirmware/Default4M/$(1),$(1),esr-9753,ESR-9753)
 
@@ -554,6 +555,8 @@ Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi35
 # Kernel name should be "Linux Kernel Image" to make the OpenWrt image installable from factory Web UI
 Image/Build/Profile/3G150B=$(call BuildFirmware/Default4M/$(1),$(1),3g150b,3G150B,Linux Kernel Image)
 
+Image/Build/Profile/MR102N=$(call BuildFirmware/Default8M/$(1),$(1),mr-102n,MR-102N)
+
 Image/Build/Profile/MPRA1=$(call BuildFirmware/Default4M/$(1),$(1),mpr-a1,MPRA1,Linux Kernel Image)
 Image/Build/Profile/MPRA2=$(call BuildFirmware/Default8M/$(1),$(1),mpr-a2,MPRA2,Linux Kernel Image)
 
@@ -575,6 +578,10 @@ Image/Build/Profile/OMNI-EMB=$(call BuildFirmware/Default8M/$(1),$(1),omni-emb,O
 
 Image/Build/Profile/OMNI-PLUG=$(call BuildFirmware/Default8M/$(1),$(1),omni-plug,OMNI-PLUG)
 
+Image/Build/Profile/OLINUXINO-RT5350F=$(call BuildFirmware/Default8M/$(1),$(1),olinuxino-rt5350f,OLINUXINO-RT5350F)
+
+Image/Build/Profile/OLINUXINO-RT5350F-EVB=$(call BuildFirmware/Default8M/$(1),$(1),olinuxino-rt5350f-evb,OLINUXINO-RT5350F-EVB)
+
 Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W)
 
 Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004)
@@ -601,6 +608,9 @@ Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
 
 Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
 
+
+Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
+
 buffalo_whrg300n_mtd_size=3801088
 define BuildFirmware/WHRG300N/squashfs
        $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N)
@@ -710,6 +720,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/DAP1350,$(1))
        $(call Image/Build/Profile/DAP1350WW,$(1))
        $(call Image/Build/Profile/DCS930,$(1))
+       $(call Image/Build/Profile/DCS930LB1,$(1))
        $(call Image/Build/Profile/ESR-9753,$(1))
        $(call Image/Build/Profile/F7C027,$(1))
        $(call Image/Build/Profile/F5D8235V2,$(1))
@@ -724,6 +735,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/M3,$(1))
        $(call Image/Build/Profile/M4,$(1))
        $(call Image/Build/Profile/MOFI3500-3GN,$(1))
+       $(call Image/Build/Profile/MR102N,$(1))
        $(call Image/Build/Profile/MPRA1,$(1))
        $(call Image/Build/Profile/MPRA2,$(1))
        $(call Image/Build/Profile/MZKW300NH2,$(1))
@@ -732,6 +744,8 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/NW718,$(1))
        $(call Image/Build/Profile/OMNI-EMB,$(1))
        $(call Image/Build/Profile/OMNI-PLUG,$(1))
+       $(call Image/Build/Profile/OLINUXINO-RT5350F,$(1))
+       $(call Image/Build/Profile/OLINUXINO-RT5350F-EVB,$(1))
        $(call Image/Build/Profile/PSR-680W,$(1))
        $(call Image/Build/Profile/PWH2004,$(1))
        $(call Image/Build/Profile/PX4885,$(1))
@@ -760,6 +774,8 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/X5,$(1))
        $(call Image/Build/Profile/X8,$(1))
        $(call Image/Build/Profile/XDXRN502J,$(1))
+       $(call Image/Build/Profile/MZK-DP150N,$(1))
+
 endef
 endif
 
@@ -846,12 +862,14 @@ whr_300hp2_mtd_size=7012352
 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
 Image/Build/Profile/WHR600D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-600d,WHR-600D,$(whr_300hp2_mtd_size))
 whr_1166d_mtd_size=15400960
-Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166hd_mtd_size))
+Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166d_mtd_size))
 dlink810l_mtd_size=6881280
+Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n,CF-WR800N)
 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
 na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
+Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
 Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1,Y1)
 Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1s,Y1S)
 Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
@@ -862,8 +880,11 @@ Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,W
 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
 Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
 Image/Build/Profile/XIAOMI-MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),xiaomi-miwifi-mini,XIAOMI-MIWIFI-MINI)
+Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
 Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
 Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i)
+microwrt_mtd_size=16515072
+Image/Build/Profile/MicroWRT=$(call BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
 
 
 ifeq ($(SUBTARGET),mt7620)
@@ -874,6 +895,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/MT7620a_MT7530,$(1))
        $(call Image/Build/Profile/MT7620a_V22SG,$(1))
        $(call Image/Build/Profile/AIBR100,$(1))
+       $(call Image/Build/Profile/CF-WR800N,$(1))
        $(call Image/Build/Profile/RP-N53,$(1))
        $(call Image/Build/Profile/DIR-810L,$(1))
        $(call Image/Build/Profile/WHR300HP2,$(1))
@@ -881,6 +903,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/WHR1166D,$(1))
        $(call Image/Build/Profile/MZK-750DHP,$(1))
        $(call Image/Build/Profile/NA930,$(1))
+       $(call Image/Build/Profile/OY-0001,$(1))
        $(call Image/Build/Profile/Y1,$(1))
        $(call Image/Build/Profile/Y1S,$(1))
        $(call Image/Build/Profile/MLW221,$(1))
@@ -891,8 +914,10 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/WRTNODE,$(1))
        $(call Image/Build/Profile/WT3020,$(1))
        $(call Image/Build/Profile/XIAOMI-MIWIFI-MINI,$(1))
+       $(call Image/Build/Profile/ZTE-Q7,$(1))
        $(call Image/Build/Profile/ZBT-WA05,$(1))
        $(call Image/Build/Profile/ArcherC20i,$(1))
+       $(call Image/Build/Profile/MicroWRT,$(1))
 endef
 endif
 
@@ -901,7 +926,7 @@ endif
 #
 
 ifeq ($(SUBTARGET),mt7621)
-  TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt
+  TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt pbr-m1 re6500 sap-g3200u3
 endif
 
 define Device/mt7621
@@ -913,6 +938,10 @@ define Device/wsr-600
   DTS := WSR-600
 endef
 
+define Device/re6500
+  DTS := RE6500
+endef
+
 define Device/wsr-1166
   DTS := WSR-1166
   IMAGE/sysupgrade.bin := trx | pad-rootfs
@@ -935,7 +964,16 @@ endef
 
 define Device/firewrt
   DTS := FIREWRT
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+endef
+
+define Device/pbr-m1
+  DTS := PBR-M1
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+endef
+
+define Device/sap-g3200u3
+  DTS := SAP-G3200U3
 endef
 
 #
@@ -950,6 +988,20 @@ define Image/Build/Profile/Default
 endef
 endif
 
+
+#
+# MT7688 Profiles
+#
+
+Image/Build/Profile/mt7688=$(call BuildFirmware/Default16M/$(1),$(1),mt7688,MT7688)
+
+ifeq ($(SUBTARGET),mt7688)
+define Image/Build/Profile/Default
+       $(call Image/Build/Profile/mt7688,$(1))
+endef
+endif
+
+
 ifndef TARGET_DEVICES
 #
 # Generic Targets - only needed for legacy image building code
@@ -979,10 +1031,12 @@ endef
 endif
 
 ifeq ($(SUBTARGET),mt7621)
-define Build/Compile
+define Image/Prepare
+#define Build/Compile
        rm -rf $(KDIR)/relocate
-       $(CP) ./relocate $(KDIR)
+       $(CP) ../../generic/image/relocate $(KDIR)
        $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
+       $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
 endef
 endif