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