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