ramips: Add support for VoCore
[openwrt/staging/chunkeey.git] / target / linux / ramips / image / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define imgname
11 $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)
12 endef
13
14 define sysupname
15 $(call imgname,$(1),$(2))-sysupgrade.bin
16 endef
17
18 VMLINUX:=$(IMG_PREFIX)-vmlinux
19 UIMAGE:=$(IMG_PREFIX)-uImage
20
21 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
22 define Image/Build/Initramfs
23 $(call Image/Build/Profile/$(PROFILE),initramfs)
24 endef
25 endif
26
27 ifeq ($(CONFIG_SOC_RT288X),y)
28 define kernel_entry
29 -a 0x88000000 -e 0x88000000
30 endef
31 else
32 ifeq ($(CONFIG_SOC_MT7621),y)
33 define kernel_entry
34 -a 0x80001000 -e 0x80001000
35 endef
36 else
37 define kernel_entry
38 -a 0x80000000 -e 0x80000000
39 endef
40 endif
41 endif
42
43 define MkCombineduImage
44 $(call PatchKernelLzma,$(2),$(3))
45 if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt `expr $(4) - 64` ]; then \
46 echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \
47 else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
48 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
49 else \
50 ( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=`expr $(4) - 64` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.lzma.combined ; \
51 fi ; fi
52 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.combined,$(call sysupname,$(1),$(2)),$(6))
53 endef
54
55
56 #
57 # The real magic happens inside these templates
58 #
59
60 define MkImage
61 $(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION)))
62 -mkimage -A mips -O linux -T kernel -C $(1) $(call kernel_entry)\
63 -n "$(imagename)" \
64 -d $(2) $(3)
65 endef
66
67 define CompressLzma
68 $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2)
69 endef
70
71 define MkImageSysupgrade/squashfs
72 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
73 cat $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) > $(KDIR)/$(output_name)
74 $(call prepare_generic_squashfs,$(KDIR)/$(output_name))
75 if [ `stat -c%s "$(KDIR)/$(output_name)"` -gt $(3) ]; then \
76 echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \
77 else \
78 $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \
79 fi
80 endef
81
82 define PatchKernelLzmaDtb
83 cp $(KDIR)/vmlinux$(3) $(KDIR)/vmlinux-$(1)$(3)
84 $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts
85 $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1)$(3) $(KDIR)/$(2).dtb
86 $(call CompressLzma,$(KDIR)/vmlinux-$(1)$(3),$(KDIR)/vmlinux-$(1)$(3).bin.lzma)
87 endef
88
89 define MkImageLzmaDtb
90 $(call PatchKernelLzmaDtb,$(1),$(2),$(4))
91 $(call MkImage,lzma,$(KDIR)/vmlinux-$(1)$(4).bin.lzma,$(KDIR)/vmlinux-$(1)$(4).uImage,$(3))
92 endef
93
94 define BuildFirmware/OF
95 $(call MkImageLzmaDtb,$(2),$(3),$(5))
96 $(call MkImageSysupgrade/$(1),$(1),$(2),$(4),$(6))
97 endef
98
99 define BuildFirmware/OF/initramfs
100 $(call MkImageLzmaDtb,$(2),$(3),$(4),-initramfs)
101 $(CP) $(KDIR)/vmlinux-$(2)-initramfs.uImage $(call imgname,$(1),$(2))-uImage.bin
102 endef
103
104
105 # Build images for default ralink layout for 4MB flash
106 # kernel + roots = 0x3b0000
107 # $(1) = squashfs/initramfs
108 # $(2) = lowercase board name
109 # $(3) = dts file
110 ralink_default_fw_size_4M=3866624
111 BuildFirmware/Default4M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_4M),$(4))
112 BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
113
114 # Build images for default ralink layout for 8MB flash
115 # kernel + roots = 0x7b0000
116 # $(1) = squashfs/initramfs
117 # $(2) = lowercase board name
118 # $(3) = dts file
119 ralink_default_fw_size_8M=8060928
120 BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
121 BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
122
123 ralink_default_fw_size_16M=16121856
124 BuildFirmware/Default16M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_16M),$(4))
125 BuildFirmware/Default16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
126
127 # Build images for a custom sized flash layout
128 # $(1) = squashfs/initramfs
129 # $(2) = lowercase board name
130 # $(3) = dts file
131 # $(4) = kernel + rootfs size
132 BuildFirmware/CustomFlash/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(4),$(5),$(6))
133 BuildFirmware/CustomFlash/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
134
135 # wrappers for boards that have 4MB and 8MB versions
136 define BuildFirmware/DefaultDualSize/squashfs
137 $(call BuildFirmware/Default4M/$(1),$(1),$(2)-4M,$(3)-4M)
138 $(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M)
139 endef
140 define BuildFirmware/DefaultDualSize/initramfs
141 $(call BuildFirmware/OF/initramfs,$(1),$(2)-4M,$(3)-4M)
142 $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
143 endef
144
145 # Some boards need a special header inside the uImage to make them bootable
146 define BuildFirmware/CustomFlashFactory/squashfs
147 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4))
148 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4),$(5),$(6))
149 endef
150 BuildFirmware/CustomFlashFactory/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
151
152 # sign an image to make it work with edimax tftp recovery
153 define BuildFirmware/Edimax/squashfs
154 $(call BuildFirmware/OF,$(1),$(2),$(3),$(4))
155 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
156 mkedimaximg -i $(call sysupname,$(1),$(2)) \
157 -o $(call imgname,$(1),$(2))-factory.bin \
158 -s $(5) -m $(6) -f $(7) -S $(8); \
159 fi
160 endef
161 BuildFirmware/Edimax/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
162
163 # build Seama header images
164 define BuildFirmware/Seama/squashfs
165 $(call MkImageLzmaDtb,$(2),$(3),$(5))
166 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.bin)
167 cat $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/root.$(1) > $(KDIR)/img_$(2).$(1).tmp
168 if [ `stat -c%s "$(KDIR)/img_$(2).$(1).tmp"` -gt $$$$(($(5) - 64)) ]; then \
169 echo "Warning: $(KDIR)/img_$(2).$(1).tmp is too big" >&2; \
170 else \
171 dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=64k conv=sync; \
172 ( \
173 dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64`; \
174 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
175 ) > $(KDIR)/vmlinux-$(2).tmp; \
176 $(STAGING_DIR_HOST)/bin/seama \
177 -i $(KDIR)/vmlinux-$(2).tmp \
178 -m "dev=/dev/mtdblock/2" -m "type=firmware"; \
179 $(STAGING_DIR_HOST)/bin/seama \
180 -s $(call imgname,$(1),$(2))-factory.bin \
181 -m "signature=$(4)" \
182 -i $(KDIR)/vmlinux-$(2).tmp.seama; \
183 dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64` of=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp; \
184 $(STAGING_DIR_HOST)/bin/seama \
185 -i $(KDIR)/vmlinux-$(2)-sysupgrade.tmp \
186 -m "dev=/dev/mtdblock/2" -m "type=firmware"; \
187 ( \
188 dd if=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp.seama; \
189 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
190 ) > $(BIN_DIR)/$(output_name); \
191 fi
192 endef
193 BuildFirmware/Seama/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
194
195 # sign Buffalo images
196 define BuildFirmware/Buffalo
197 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
198 buffalo-enc -p $(3) -v 1.76 \
199 -i $(KDIR)/vmlinux-$(2).uImage \
200 -o $(KDIR)/vmlinux-$(2).uImage.enc; \
201 buffalo-enc -p $(3) -v 1.76 \
202 -i $(KDIR)/root.$(1) \
203 -o $(KDIR)/root.$(2).enc; \
204 buffalo-tag -b $(3) -p $(3) -a ram -v 1.76 -m 1.01 \
205 -l mlang8 -f 1 -r EU \
206 -i $(KDIR)/vmlinux-$(2).uImage.enc \
207 -i $(KDIR)/root.$(2).enc \
208 -o $(call imgname,$(1),$(2))-factory-EU.bin; \
209 fi
210 endef
211
212 # sign trednet / UMedia images
213 define BuildFirmware/UMedia/squashfs
214 $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
215 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
216 fix-u-media-header -T 0x46 -B $(4) \
217 -i $(call sysupname,$(1),$(2)) \
218 -o $(call imgname,$(1),$(2))-factory.bin; \
219 fi
220 endef
221 BuildFirmware/UMedia/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
222
223 # sign dap 1350 based images
224 dap1350_mtd_size=7667712
225 define BuildFirmware/dap1350/squashfs
226 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(dap1350_mtd_size))
227 -mkdapimg -s $(4) \
228 -i $(call sysupname,$(1),$(2)) \
229 -o $(call imgname,$(1),$(2))-factory.bin
230 endef
231 BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
232
233 # Sign Poray images
234 define BuildFirmware/Poray4M/squashfs
235 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
236 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
237 mkporayfw -B $(3) -F 4M \
238 -f $(call sysupname,$(1),$(2)) \
239 -o $(call imgname,$(1),$(2))-factory.bin; \
240 fi
241 endef
242 BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
243
244 define BuildFirmware/Poray8M/squashfs
245 $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
246 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
247 mkporayfw -B $(3) -F 8M \
248 -f $(call sysupname,$(1),$(2)) \
249 -o $(call imgname,$(1),$(2))-factory.bin; \
250 fi
251 endef
252 BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
253
254 define BuildFirmware/PorayDualSize/squashfs
255 $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
256 if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \
257 mkporayfw -B $(3) -F 4M \
258 -f $(call sysupname,$(1),$(2)-4M) \
259 -o $(call imgname,$(1),$(2))-4M-factory.bin; \
260 fi
261 if [ -e "$(call sysupname,$(1),$(2)-8M)" ]; then \
262 mkporayfw -B $(3) -F 8M \
263 -f $(call sysupname,$(1),$(2)-8M) \
264 -o $(call imgname,$(1),$(2))-8M-factory.bin; \
265 fi
266 endef
267 BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3))
268
269 define BuildFirmware/Gemtek/squashfs
270 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
271 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
272 mkheader_gemtek "$(call sysupname,$(1),$(2))" \
273 "$(call imgname,$(1),$(2))-factory.bin" $(2) || \
274 rm -f "$(call imgname,$(1),$(2))-factory.bin"; \
275 fi
276 endef
277 BuildFirmware/Gemtek/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
278
279 #
280 # RT288X Profiles
281 #
282
283 Image/Build/Profile/AR725W=$(call BuildFirmware/Gemtek/$(1),$(1),ar725w,AR725W)
284
285 # 0x790000
286 belkin_f5d8235v1_mtd_size=7929856
287 Image/Build/Profile/F5D8235V1=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v1,F5D8235_V1,$(belkin_f5d8235v1_mtd_size))
288
289 Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RT-N15)
290
291 Image/Build/Profile/V11STFE=$(call BuildFirmware/Default4M/$(1),$(1),v11st-fe,V11STFE)
292
293 Image/Build/Profile/WLITX4AG300N=$(call BuildFirmware/Default4M/$(1),$(1),wli-tx4-ag300n,WLI-TX4-AG300N)
294
295 ifeq ($(SUBTARGET),rt288x)
296 define Image/Build/Profile/Default
297 $(call Image/Build/Profile/AR725W,$(1))
298 $(call Image/Build/Profile/F5D8235V1,$(1))
299 $(call Image/Build/Profile/RTN15,$(1))
300 $(call Image/Build/Profile/V11STFE,$(1))
301 $(call Image/Build/Profile/WLITX4AG300N,$(1))
302 endef
303 endif
304
305
306
307 #
308 # RT305X Profiles
309 #
310
311 Image/Build/Profile/DIR610A1=$(call BuildFirmware/Seama/$(1),$(1),dir-610-a1,DIR-610-A1,wrgn59_dlob.hans_dir610,$(ralink_default_fw_size_4M))
312
313 edimax_3g6200n_mtd_size=3735552
314 Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
315
316 Image/Build/Profile/3G6200NL=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200nl,3G-6200NL,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
317
318 Image/Build/Profile/3G300M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),3g300m,3G300M,$(ralink_default_fw_size_4M),3G150M_SPI Kernel Image,factory)
319
320 Image/Build/Profile/AIR3GII=$(call BuildFirmware/Default4M/$(1),$(1),air3gii,AIR3GII)
321
322 define BuildFirmware/UIMAGE_8M
323 $(call MkCombineduImage,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M),$(7))
324 endef
325 define Image/Build/Profile/ALL02393G
326 $(call Image/Build/Template/$(image_type)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys)
327 endef
328
329 Image/Build/Profile/ALL0256N=$(call BuildFirmware/DefaultDualSize/$(1),$(1),all0256n,ALL0256N)
330
331 allnet_all5002_mtd_size=33226752
332 Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,ALL5002,$(allnet_all5002_mtd_size))
333 Image/Build/Profile/ALL5003=$(call BuildFirmware/CustomFlash/$(1),$(1),all5003,ALL5003,$(allnet_all5002_mtd_size))
334
335 argus_atp52b_mtd_size=7995392
336 Image/Build/Profile/ARGUS_ATP52B=$(call BuildFirmware/CustomFlash/$(1),$(1),argus_atp52b,ARGUS_ATP52B,$(argus_atp52b_mtd_size))
337
338 asl26555_8mb_mtd_size=7929856
339 asl26555_16mb_mtd_size=16252928
340 define BuildFirmware/ASL26555/squashfs
341 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-8M,$(3)-8M,$(asl26555_8mb_mtd_size))
342 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-16M,$(3)-16M,$(asl26555_16mb_mtd_size))
343 endef
344 define BuildFirmware/ASL26555/initramfs
345 $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
346 $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
347 endef
348 Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
349
350 Image/Build/Profile/AWM002EVB=$(call BuildFirmware/DefaultDualSize/$(1),$(1),awm002-evb,AWM002-EVB)
351 Image/Build/Profile/AWM003EVB=$(call BuildFirmware/Default8M/$(1),$(1),awm003-evb,AWM003-EVB)
352 Image/Build/Profile/AWAPN2403=$(call BuildFirmware/Default4M/$(1),$(1),awmapn2403,AWAPN2403)
353
354 Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
355
356 broadway_mtd_size=7929856
357 Image/Build/Profile/BROADWAY=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),broadway,BROADWAY,$(broadway_mtd_size),Broadway Kernel Image,factory)
358
359 Image/Build/Profile/CARAMBOLA=$(call BuildFirmware/Default8M/$(1),$(1),carambola,CARAMBOLA)
360
361 Image/Build/Profile/D105=$(call BuildFirmware/Default4M/$(1),$(1),d105,D105)
362
363 define BuildFirmware/DIR300B1/squashfs
364 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
365 -mkwrgimg -s $(4) -d /dev/mtdblock/2 \
366 -i $(call sysupname,$(1),$(2)) \
367 -o $(call imgname,$(1),$(2))-factory.bin
368 endef
369 BuildFirmware/DIR300B1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
370 Image/Build/Profile/DIR-300-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-300-b1,DIR-300-B1,wrgn23_dlwbr_dir300b)
371 Image/Build/Profile/DIR-600-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b)
372 Image/Build/Profile/DIR-600-B2=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b2,DIR-600-B2,wrgn23_dlwbr_dir600b)
373 Image/Build/Profile/DIR-615-D=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d)
374
375 Image/Build/Profile/DIR-620-A1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-a1,DIR-620-A1)
376 Image/Build/Profile/DIR-620-D1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-d1,DIR-620-D1)
377
378 define BuildFirmware/DIR615H1/squashfs
379 $(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1)
380 -mkdir615h1 -e $(call sysupname,$(1),dir-615-h1) \
381 -o $(call imgname,$(1),dir-615-h1)-factory.bin
382 endef
383 BuildFirmware/DIR615H1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1)
384 Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1))
385
386 Image/Build/Profile/DAP1350=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350,DAP-1350,RT3052-AP-DAP1350-3)
387
388 Image/Build/Profile/DAP1350WW=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350WW,DAP-1350,RT3052-AP-DAP1350WW-3)
389
390 define BuildFirmware/DCS930/squashfs
391 $(call BuildFirmware/Default4M/squashfs,squashfs,$(2),$(3))
392 dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/image.$(2).combined bs=1048512 count=1 conv=sync
393 cat $(KDIR)/root.squashfs >> $(KDIR)/image.$(2).combined
394 $(call MkImage,lzma,$(KDIR)/image.$(2).combined,$(KDIR)/image.$(2))
395 $(call prepare_generic_squashfs,$(KDIR)/image.$(2))
396 if [ `stat -c%s "$(KDIR)/image.$(2)"` -gt $(ralink_default_fw_size_4M) ]; then \
397 echo "Warning: $(KDIR)/image.$(2) is too big" >&2; \
398 else \
399 dd if=$(KDIR)/image.$(2) of=$(KDIR)/dcs.tmp bs=64K count=5 conv=sync ;\
400 cat $(KDIR)/image.$(2) >> $(KDIR)/dcs.tmp ; \
401 dd if=$(KDIR)/dcs.tmp of=$(call imgname,$(1),$(2))-factory.bin bs=4096k count=1 conv=sync ;\
402 $(STAGING_DIR_HOST)/bin/mkdcs932 $(call imgname,$(1),$(2))-factory.bin ; \
403 fi
404 endef
405 BuildFirmware/DCS930/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
406 Image/Build/Profile/DCS930=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930,DCS-930)
407
408 Image/Build/Profile/ESR-9753=$(call BuildFirmware/Default4M/$(1),$(1),esr-9753,ESR-9753)
409
410 Image/Build/Profile/HW550-3G=$(call BuildFirmware/Default8M/$(1),$(1),hw550-3g,HW550-3G)
411
412 belkin_f5d8235v2_mtd_size=7929856
413 Image/Build/Profile/F5D8235V2=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v2,F5D8235_V2,$(belkin_f5d8235v2_mtd_size))
414
415 # 0x770000
416 belkin_f7c027_mtd_size=7798784
417 Image/Build/Profile/F7C027=$(call BuildFirmware/CustomFlash/$(1),$(1),belkinf7c027,F7C027,$(belkin_f7c027_mtd_size))
418
419 Image/Build/Profile/FONERA20N=$(call BuildFirmware/Edimax/$(1),$(1),fonera20n,FONERA20N,$(ralink_default_fw_size_8M),RSDK,NL1T,0x50000,0xc0000)
420
421 Image/Build/Profile/RT-N13U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n13u,RT-N13U)
422
423 #Image/Build/Profile/HG255D=$(call BuildFirmware/Default16M/$(1),$(1),hg255d,HG255D)
424
425 Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freestation5,FREESTATION5)
426
427 Image/Build/Profile/IP2202=$(call BuildFirmware/Default8M/$(1),$(1),ip2202,IP2202)
428
429 BuildFirmware/HLKRM04/squashfs=$(call BuildFirmware/Default4M/squashfs,$(1),$(2),$(3),$(4))
430 define BuildFirmware/HLKRM04/initramfs
431 $(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
432 #mkhilinkfw -e -i$(call imgname,$(1),$(2))-uImage.bin -o $(call imgname,$(1),$(2))-factory.bin;
433 endef
434 Image/Build/Profile/HLKRM04=$(call BuildFirmware/HLKRM04/$(1),$(1),hlk-rm04,HLKRM04,HLK-RM02)
435
436 Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)
437
438 Image/Build/Profile/M4=$(call BuildFirmware/PorayDualSize/$(1),$(1),m4,M4)
439
440 Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN)
441
442 # Kernel name should be "Linux Kernel Image" to make the OpenWrt image installable from factory Web UI
443 Image/Build/Profile/MPRA1=$(call BuildFirmware/Default4M/$(1),$(1),mpr-a1,MPRA1,Linux Kernel Image)
444 Image/Build/Profile/MPRA2=$(call BuildFirmware/Default8M/$(1),$(1),mpr-a2,MPRA2,Linux Kernel Image)
445
446 Image/Build/Profile/DIR-300-B7=$(call BuildFirmware/Default4M/$(1),$(1),dir-300-b7,DIR-300-B7)
447 Image/Build/Profile/DIR-320-B1=$(call BuildFirmware/Default8M/$(1),$(1),dir-320-b1,DIR-320-B1)
448
449 Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N)
450
451 Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2,MZK-W300NH2,$(mzkw300nh2_mtd_size),CSYS,RN52,0x50000,0xc0000)
452
453 Image/Build/Profile/NCS601W=$(call BuildFirmware/Default8M/$(1),$(1),ncs601W,NCS601W)
454
455 nw718_mtd_size=3801088
456 Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw718m,NW718,$(nw718_mtd_size),ARA1B4NCRNW718;1,factory)
457
458 Image/Build/Profile/OMNI-EMB=$(call BuildFirmware/Default8M/$(1),$(1),omni-emb,OMNI-EMB)
459
460 Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W)
461
462 Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004)
463
464 Image/Build/Profile/PX4885=$(call BuildFirmware/Default4M/$(1),$(1),px4885,PX4885)
465
466 Image/Build/Profile/RTG32B1=$(call BuildFirmware/Default4M/$(1),$(1),rt-g32-b1,RT-G32-B1)
467
468 Image/Build/Profile/RTN10PLUS=$(call BuildFirmware/Default4M/$(1),$(1),rt-n10-plus,RT-N10-PLUS)
469
470 Image/Build/Profile/RUT5XX=$(call BuildFirmware/Default8M/$(1),$(1),rut5xx,RUT5XX)
471
472 Image/Build/Profile/SL-R7205=$(call BuildFirmware/Default4M/$(1),$(1),sl-r7205,SL-R7205)
473
474 Image/Build/Profile/V22RW-2X2=$(call BuildFirmware/Default4M/$(1),$(1),v22rw-2x2,V22RW-2X2)
475
476 Image/Build/Profile/VOCORE=$(call BuildFirmware/Default8M/$(1),$(1),vocore,VOCORE)
477
478 Image/Build/Profile/W150M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w150m,W150M,$(ralink_default_fw_size_4M),W150M Kernel Image,factory)
479
480 Image/Build/Profile/W306R_V20=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w306r-v20,W306R_V20,$(ralink_default_fw_size_4M),linkn Kernel Image,factory)
481
482 Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
483
484 Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
485
486 buffalo_whrg300n_mtd_size=3801088
487 define BuildFirmware/WHRG300N/squashfs
488 $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N)
489 # the following line has a bad argument 3 ... the old Makefile was already broken
490 $(call BuildFirmware/Buffalo,$(1),whr-g300n,whr-g300n)
491 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
492 ( \
493 echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \
494 dd bs=512 count=1 conv=sync; \
495 dd if=$(call sysupname,$(1),whr-g300n); \
496 ) > $(KDIR)/whr-g300n-tftp.tmp && \
497 buffalo-tftp -i $(KDIR)/whr-g300n-tftp.tmp \
498 -o $(call imgname,$(1),whr-g300n)-tftp.bin; \
499 fi
500 endef
501 BuildFirmware/WHRG300N/initramfs=$(call BuildFirmware/OF/initramfs,$(1),whr-g300n,WHR-G300N)
502 Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
503
504 Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
505
506 Image/Build/Profile/WL_330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL_330N)
507
508 Image/Build/Profile/WL_330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL_330N3G)
509
510 kernel_size_wl341v3=917504
511 rootfs_size_wl341v3=2949120
512 define BuildFirmware/WL341V3/squashfs
513 $(call BuildFirmware/Default4M/$(1),$(1),wl341v3,WL341V3)
514 # This code looks broken and really needs to be converted to C
515 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
516 ( \
517 dd if=/dev/zero bs=195936 count=1; \
518 echo "1.01"; \
519 dd if=/dev/zero bs=581 count=1; \
520 echo -n -e "\x73\x45\x72\x43\x6F\x4D\x6D\x00\x01\x00\x00\x59\x4E\x37\x95\x58\x10\x00\x20\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x03\x00\x00\x80\x00\x00\x00\x00\x03\x00\x00\x10\x12\x00\x00\x00\x10\x73\x45\x72\x43\x6F\x4D\x6D"; \
521 dd if=/dev/zero bs=65552 count=1; \
522 dd if=$(KDIR)/vmlinux-$(2).uImage bs=$(kernel_size_wl341v3) conv=sync; \
523 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
524 dd if=/dev/zero bs=`expr 4194304 - 262144 - 16 - $(kernel_size_wl341v3) - \( \( \( \`stat -c%s $(KDIR)/root.$(1)\` / 65536 \) + 1 \) \* 65536 \)` count=1; \
525 echo -n -e "\x11\x03\x80\x00\x10\x12\x90\xF7\x65\x52\x63\x4F\x6D\x4D\x00\x00"; \
526 ) > $(call imgname,$(1),$(2))-factory.bin; \
527 fi
528 endef
529 BuildFirmware/WL341V3/initramfs=$(call BuildFirmware/OF/initramfs,$(1),wl341v3,WL341V3)
530 Image/Build/Profile/WL341V3=$(call BuildFirmware/WL341V3/$(1),$(1))
531
532 Image/Build/Profile/WL-351=$(call BuildFirmware/Default4M/$(1),$(1),wl-351,WL-351)
533
534 define BuildFirmware/WNCE2001/squashfs
535 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
536 -mkdapimg -s RT3052-AP-WNCE2001-3 -r WW -v 1.0.0.99 \
537 -i $(call sysupname,$(1),$(2)) \
538 -o $(call imgname,$(1),$(2))-factory-worldwide.bin
539 -mkdapimg -s RT3052-AP-WNCE2001-3 -r NA -v 1.0.0.99 \
540 -i $(call sysupname,$(1),$(2)) \
541 -o $(call imgname,$(1),$(2))-factory-northamerica.bin
542 endef
543 BuildFirmware/WNCE2001/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
544 Image/Build/Profile/WNCE2001=$(call BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WNCE2001)
545
546 Image/Build/Profile/WR512-3GN=$(call BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
547
548 Image/Build/Profile/UR-326N4G=$(call BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
549
550 Image/Build/Profile/UR-336UN=$(call BuildFirmware/Default8M/$(1),$(1),ur-336un,UR-336UN)
551
552 Image/Build/Profile/WR6202=$(call BuildFirmware/Default8M/$(1),$(1),wr6202,WR6202)
553
554 Image/Build/Profile/X5=$(call BuildFirmware/Poray8M/$(1),$(1),x5,X5)
555
556 Image/Build/Profile/X8=$(call BuildFirmware/Poray8M/$(1),$(1),x8,X8)
557
558 Image/Build/Profile/XDXRN502J=$(call BuildFirmware/Default4M/$(1),$(1),xdxrn502j,XDXRN502J)
559
560 ifeq ($(SUBTARGET),rt305x)
561 define Image/Build/Profile/Default
562 $(call Image/Build/Profile/3G6200N,$(1))
563 $(call Image/Build/Profile/3G6200NL,$(1))
564 $(call Image/Build/Profile/3G300M,$(1))
565 $(call Image/Build/Profile/AIR3GII,$(1))
566 $(call Image/Build/Profile/ALL02393G,$(1))
567 $(call Image/Build/Profile/ALL0256N,$(1))
568 $(call Image/Build/Profile/ALL5002,$(1))
569 $(call Image/Build/Profile/ALL5003,$(1))
570 $(call Image/Build/Profile/ARGUS_ATP52B,$(1))
571 $(call Image/Build/Profile/ASL26555,$(1))
572 $(call Image/Build/Profile/AWM002EVB,$(1))
573 $(call Image/Build/Profile/AWAPN2403,$(1))
574 $(call Image/Build/Profile/BC2,$(1))
575 $(call Image/Build/Profile/BROADWAY,$(1))
576 $(call Image/Build/Profile/CARAMBOLA,$(1))
577 $(call Image/Build/Profile/D105,$(1))
578 $(call Image/Build/Profile/DIR-300-B1,$(1))
579 $(call Image/Build/Profile/DIR-600-B1,$(1))
580 $(call Image/Build/Profile/DIR-300-B7,$(1))
581 $(call Image/Build/Profile/DIR-320-B1,$(1))
582 $(call Image/Build/Profile/DIR-600-B2,$(1))
583 $(call Image/Build/Profile/DIR610A1,$(1))
584 $(call Image/Build/Profile/DIR-615-D,$(1))
585 $(call Image/Build/Profile/DIR-620-A1,$(1))
586 $(call Image/Build/Profile/DIR-620-D1,$(1))
587 $(call Image/Build/Profile/DIR615H1,$(1))
588 $(call Image/Build/Profile/DAP1350,$(1))
589 $(call Image/Build/Profile/DAP1350WW,$(1))
590 $(call Image/Build/Profile/DCS930,$(1))
591 $(call Image/Build/Profile/ESR-9753,$(1))
592 $(call Image/Build/Profile/F7C027,$(1))
593 $(call Image/Build/Profile/F5D8235V2,$(1))
594 $(call Image/Build/Profile/FONERA20N,$(1))
595 $(call Image/Build/Profile/FREESTATION5,$(1))
596 # $(call Image/Build/Profile/HG255D,$(1))
597 $(call Image/Build/Profile/HLKRM04,$(1))
598 $(call Image/Build/Profile/HW550-3G,$(1))
599 $(call Image/Build/Profile/IP2202,$(1))
600 $(call Image/Build/Profile/M3,$(1))
601 $(call Image/Build/Profile/M4,$(1))
602 $(call Image/Build/Profile/MOFI3500-3GN,$(1))
603 $(call Image/Build/Profile/MPRA2,$(1))
604 $(call Image/Build/Profile/MZKW300NH2,$(1))
605 $(call Image/Build/Profile/NBG-419N,$(1))
606 $(call Image/Build/Profile/NCS601W,$(1))
607 $(call Image/Build/Profile/NW718,$(1))
608 $(call Image/Build/Profile/OMNI-EMB,$(1))
609 $(call Image/Build/Profile/PSR-680W,$(1))
610 $(call Image/Build/Profile/PWH2004,$(1))
611 $(call Image/Build/Profile/PX4885,$(1))
612 $(call Image/Build/Profile/RTG32B1,$(1))
613 $(call Image/Build/Profile/RTN10PLUS,$(1))
614 $(call Image/Build/Profile/RT-N13U,$(1))
615 $(call Image/Build/Profile/RUT5XX,$(1))
616 $(call Image/Build/Profile/SL-R7205,$(1))
617 $(call Image/Build/Profile/UR-326N4G,$(1))
618 $(call Image/Build/Profile/V22RW-2X2,$(1))
619 $(call Image/Build/Profile/VOCORE,$(1))
620 $(call Image/Build/Profile/W150M,$(1))
621 $(call Image/Build/Profile/W306R_V20,$(1))
622 $(call Image/Build/Profile/W502U,$(1))
623 $(call Image/Build/Profile/WCR150GN,$(1))
624 $(call Image/Build/Profile/WHRG300N,$(1))
625 $(call Image/Build/Profile/WIZARD8800,$(1))
626 $(call Image/Build/Profile/WL_330N,$(1))
627 $(call Image/Build/Profile/WL_330N3G,$(1))
628 $(call Image/Build/Profile/WL341V3,$(1))
629 $(call Image/Build/Profile/WL-351,$(1))
630 $(call Image/Build/Profile/WNCE2001,$(1))
631 $(call Image/Build/Profile/WR512-3GN,$(1))
632 $(call Image/Build/Profile/WR6202,$(1))
633 $(call Image/Build/Profile/X5,$(1))
634 $(call Image/Build/Profile/X8,$(1))
635 $(call Image/Build/Profile/XDXRN502J,$(1))
636 endef
637 endif
638
639
640
641 #
642 # RT3662/RT3883 Profiles
643 #
644
645 # $(1) = squashfs/initramfs
646 # $(2) = lowercase board name
647 # $(3) = dts file
648 # $(4) = kernel size
649 # $(5) = rootfs size
650 # $(6) = signature
651 # $(7) = model
652 # $(8) = flash address
653 # $(9) = start address
654 define BuildFirmware/EdimaxCombined/squashfs
655 $(call PatchKernelLzmaDtb,$(2),$(3))
656 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).bin.uImage)
657 if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.uImage"` -gt `expr $(4) - 20` ]; then \
658 echo "Warning: $(KDIR)/vmlinux-$(2).bin.uImage is too big" >&2; \
659 exit 1; \
660 else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
661 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
662 exit 1; \
663 else \
664 ( dd if=$(KDIR)/vmlinux-$(2).bin.uImage bs=`expr $(4) - 20` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.uImage.combined ; \
665 fi ; fi
666 mkedimaximg -i "$(KDIR)/vmlinux-$(2).bin.uImage.combined" \
667 -o $(call imgname,$(1),$(2)).bin \
668 -s $(6) -m $(7) -f $(8) -S $(9)
669 endef
670
671 Image/Build/Profile/CYSWR1100=$(call BuildFirmware/Seama/$(1),$(1),cy-swr1100,CY-SWR1100,wrgnd10_samsung_ss815,$(ralink_default_fw_size_8M))
672
673 Image/Build/Profile/DIR645=$(call BuildFirmware/Seama/$(1),$(1),dir-645,DIR-645,wrgn39_dlob.hans_dir645,$(ralink_default_fw_size_8M))
674
675 omniembhpm_mtd_size=16449536
676 Image/Build/Profile/OMNIEMBHPM=$(call BuildFirmware/CustomFlash/$(1),$(1),omni-emb-hpm,OMNI-EMB-HPM,$(omniembhpm_mtd_size))
677
678 define BuildFirmware/RTN56U/squashfs
679 $(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RTN56U)
680 -mkrtn56uimg -s $(call sysupname,$(1),rt-n56u)
681 -cp $(call sysupname,$(1),rt-n56u) $(call imgname,$(1),rt-n56u)-factory.bin
682 -mkrtn56uimg -f $(call imgname,$(1),rt-n56u)-factory.bin
683 endef
684 Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RTN56U)
685
686 Image/Build/Profile/TEW691GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-691gr,TEW-691GR,0x026910)
687
688 Image/Build/Profile/TEW692GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-692gr,TEW-692GR,0x026920)
689
690 kernel_size_BR6475ND:=2097152
691 rootfs_size_BR6475ND:=5832704
692 Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-6475nd,BR-6475ND,$(kernel_size_BR6475ND),$(rootfs_size_BR6475ND),CSYS,RN54,0x70000,0x01100000)
693
694 ifeq ($(SUBTARGET),rt3883)
695 define Image/Build/Profile/Default
696 $(call Image/Build/Profile/CYSWR1100,$(1))
697 $(call Image/Build/Profile/DIR645,$(1))
698 $(call Image/Build/Profile/OMNIEMBHPM,$(1))
699 $(call Image/Build/Profile/RTN56U,$(1))
700 $(call Image/Build/Profile/BR6475ND,$(1))
701 $(call Image/Build/Profile/TEW691GR,$(1))
702 $(call Image/Build/Profile/TEW692GR,$(1))
703 endef
704 endif
705
706 #
707 # MT7620A Profiles
708 #
709
710 Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
711 Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
712 Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
713 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
714 Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp_n53,RP-N53)
715 whr_300hp2_mtd_size=7012352
716 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
717 Image/Build/Profile/WHR600D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-600d,WHR-600D,$(whr_300hp2_mtd_size))
718 whr_1166d_mtd_size=15400960
719 Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166hd_mtd_size))
720 dlink810l_mtd_size=6881280
721 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
722 na930_mtd_size=20971520
723 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
724 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
725
726 ifeq ($(SUBTARGET),mt7620a)
727 define Image/Build/Profile/Default
728 $(call Image/Build/Profile/MT7620a,$(1))
729 $(call Image/Build/Profile/MT7620a_MT7610e,$(1))
730 $(call Image/Build/Profile/MT7620a_MT7530,$(1))
731 $(call Image/Build/Profile/MT7620a_V22SG,$(1))
732 $(call Image/Build/Profile/RP-N53,$(1))
733 $(call Image/Build/Profile/DIR-810L,$(1))
734 $(call Image/Build/Profile/WHR300HP2,$(1))
735 $(call Image/Build/Profile/WHR600D,$(1))
736 $(call Image/Build/Profile/WHR1166D,$(1))
737 $(call Image/Build/Profile/MZK-750DHP,$(1))
738 $(call Image/Build/Profile/NA930,$(1))
739 endef
740 endif
741
742
743 #
744 # MT7620N Profiles
745 #
746
747 Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
748 Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR300)
749 Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
750 Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,WR8305RT)
751 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
752 Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
753
754 ifeq ($(SUBTARGET),mt7620n)
755 define Image/Build/Profile/Default
756 $(call Image/Build/Profile/MLW221,$(1))
757 $(call Image/Build/Profile/WMR300,$(1))
758 $(call Image/Build/Profile/RT-N14U,$(1))
759 $(call Image/Build/Profile/WR8305RT,$(1))
760 $(call Image/Build/Profile/WRTNODE,$(1))
761 $(call Image/Build/Profile/ZBT-WA05,$(1))
762 endef
763 endif
764
765
766 #
767 # MT7621 Profiles
768 #
769
770 Image/Build/Profile/MT7621=$(call BuildFirmware/Default4M/$(1),$(1),mt7621,MT7621)
771
772 ifeq ($(SUBTARGET),mt7621)
773 define Image/Build/Profile/Default
774 $(call Image/Build/Profile/MT7621,$(1))
775 endef
776 endif
777
778
779 #
780 # Generic Targets
781 #
782 define Image/BuildKernel
783 cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf
784 cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin
785 $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
786 $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
787 cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin
788 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
789 cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf
790 cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin
791 $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
792 $(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma)
793 cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin
794 endif
795 $(call Image/Build/Initramfs)
796 endef
797
798 define Image/Build
799 $(call Image/Build/$(1))
800 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
801 $(call Image/Build/Profile/$(PROFILE),$(1))
802 endef
803
804 $(eval $(call BuildImage))