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