[adm5120] reduce wasted flash space by ~56K on Edimax devices, thanks to Bernhard...
[15.05/openwrt.git] / target / linux / adm5120 / image / router_le.mk
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define Image/Build/Compex
9         $(call Image/Build/Loader,$(2),gz,0x80500000,0,y,$(2))
10         $(call Image/Build/TRX,$(call imgname,$(1),$(2)).trx,$(1),$(KDIR)/loader-$(2).gz)
11 endef
12
13 define Image/Build/Edimax
14         $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
15         $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
16         $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d -w \
17                 -r $(KDIR)/loader-$(2).gz::8192 \
18                 -x $(call imgname,$(1),$(2)).trx \
19                 $(call imgname,$(1),$(2))-webui.bin
20         $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
21                 -r $(KDIR)/loader-$(2).gz::8192 \
22                 -x $(call imgname,$(1),$(2)).trx \
23                 $(call imgname,$(1),$(2))-xmodem.bin
24         rm -f $(call imgname,$(1),$(2)).trx
25 endef
26
27 define Image/Build/Infineon
28         $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
29         $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
30         dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).img bs=64k conv=sync
31         cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).img
32 endef
33
34 define Image/Build/MyLoader
35         $(call Image/Build/Loader,$(2),gz,0x80500000,0)
36         $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
37         $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) \
38                 -p0x20000:0x10000:ahp:0x80001000 \
39                 -p0x30000:0 \
40                 -b0x20000:0x10000:h:$(KDIR)/loader-$(2).gz \
41                 -b0x30000:0::$(call imgname,$(1),$(2)).trx \
42                 $(call imgname,$(1),$(2)).bin
43 endef
44
45 #
46 # Cellvision CAS-771
47 #
48 define Image/Build/Board/CAS771/Initramfs
49         $(call Image/Build/LZMAKernel/Admboot,cas-771,gz)
50 endef
51
52 #
53 # Cellvision CAS-771W
54 #
55 define Image/Build/Board/CAS771W/Initramfs
56         $(call Image/Build/LZMAKernel/Admboot,cas-771w,gz)
57 endef
58
59 #
60 # Compex NP27G
61 #
62 define Image/Build/Board/NP27G
63         $(call Image/Build/MyLoader,$(1),np27g)
64 endef
65
66 define Image/Build/Board/NP27G/squashfs
67         $(call Image/Build/Board/NP27G,squashfs)
68 endef
69
70 define Image/Build/Board/NP27G/jffs2-64k
71         $(call Image/Build/Board/NP27G,jffs2-64k)
72 endef
73
74 define Image/Build/Board/NP27G/Initramfs
75         $(call Image/Build/LZMAKernel/Generic,np27g,bin)
76 endef
77
78 #
79 # Compex NP28G
80 #
81 define Image/Build/Board/NP28G
82         $(call Image/Build/MyLoader,$(1),np28g)
83 endef
84
85 define Image/Build/Board/NP28G/squashfs
86         $(call Image/Build/Board/NP28G,squashfs)
87 endef
88
89 define Image/Build/Board/NP28G/jffs2-64k
90         $(call Image/Build/Board/NP28G,jffs2-64k)
91 endef
92
93 define Image/Build/Board/NP28G/Initramfs
94         $(call Image/Build/LZMAKernel/Generic,np28g,bin)
95 endef
96
97 #
98 # Compex WP54G
99 #
100 define Image/Build/Board/WP54G
101         $(call Image/Build/MyLoader,$(1),wp54g)
102 endef
103
104 define Image/Build/Board/WP54G/squashfs
105         $(call Image/Build/Board/WP54G,squashfs)
106 endef
107
108 define Image/Build/Board/WP54G/jffs2-64k
109         $(call Image/Build/Board/WP54G,jffs2-64k)
110 endef
111
112 define Image/Build/Board/WP54G/Initramfs
113         $(call Image/Build/LZMAKernel/Generic,wp54g,bin)
114 endef
115
116 #
117 # Compex WP54AG
118 #
119 define Image/Build/Board/WP54AG
120         $(call Image/Build/MyLoader,$(1),wp54ag)
121 endef
122
123 define Image/Build/Board/WP54AG/squashfs
124         $(call Image/Build/Board/WP54AG,squashfs)
125 endef
126
127 define Image/Build/Board/WP54AG/jffs2-64k
128         $(call Image/Build/Board/WP54AG,jffs2-64k)
129 endef
130
131 define Image/Build/Board/WP54AG/Initramfs
132         $(call Image/Build/LZMAKernel/Generic,wp54ag,bin)
133 endef
134
135 #
136 # Compex WPP54G
137 #
138 define Image/Build/Board/WPP54G
139         $(call Image/Build/MyLoader,$(1),wpp54g)
140 endef
141
142 define Image/Build/Board/WPP54G/squashfs
143         $(call Image/Build/Board/WPP54G,squashfs)
144 endef
145
146 define Image/Build/Board/WPP54G/jffs2-64k
147         $(call Image/Build/Board/WPP54G,jffs2-64k)
148 endef
149
150 define Image/Build/Board/WPP54G/Initramfs
151         $(call Image/Build/LZMAKernel/Generic,wpp54g,bin)
152 endef
153
154 #
155 # Compex WPP54AG
156 #
157 define Image/Build/Board/WPP54AG
158         $(call Image/Build/MyLoader,$(1),wpp54ag)
159 endef
160
161 define Image/Build/Board/WPP54AG/squashfs
162         $(call Image/Build/Board/WPP54AG,squashfs)
163 endef
164
165 define Image/Build/Board/WPP54AG/jffs2-64k
166         $(call Image/Build/Board/WPP54AG,jffs2-64k)
167 endef
168
169 define Image/Build/Board/WPP54AG/Initramfs
170         $(call Image/Build/LZMAKernel/Generic,wpp54ag,bin)
171 endef
172
173 #
174 # Compex WP54G-WRT
175 #
176 define Image/Build/Board/WP54GWRT
177         $(call Image/Build/Compex,$(1),wp54g-wrt)
178 endef
179
180 define Image/Build/Board/WP54GWRT/squashfs
181         $(call Image/Build/Board/WP54GWRT,squashfs)
182 endef
183
184 define Image/Build/Board/WP54GWRT/jffs2-64k
185         $(call Image/Build/Board/WP54GWRT,jffs2-64k)
186 endef
187
188 define Image/Build/Board/WP54GWRT/Initramfs
189         $(call Image/Build/LZMAKernel/KArgs,wp54g-wrt,bin)
190 endef
191
192 #
193 # Edimax BR-6104K/KP
194 #
195 define Image/Build/Board/BR6104K
196         $(call Image/Build/Edimax,$(1),br-6104k)
197 endef
198
199 define Image/Build/Board/BR6104K/squashfs
200         $(call Image/Build/Board/BR6104K,squashfs)
201 endef
202
203 define Image/Build/Board/BR6104K/Initramfs
204         $(call Image/Build/LZMAKernel/Admboot,br-6104k,gz)
205 endef
206
207 #
208 # Edimax BR-6104WG
209 #
210 define Image/Build/Board/BR6104WG
211         $(call Image/Build/Edimax,$(1),br-6104wg)
212 endef
213
214 define Image/Build/Board/BR6104WG/squashfs
215         $(call Image/Build/Board/BR6104WG,squashfs)
216 endef
217
218 define Image/Build/Board/BR6104WG/Initramfs
219         $(call Image/Build/LZMAKernel/Admboot,br-6104wg,gz)
220 endef
221
222 #
223 # Infineon EASY 83000
224 #
225 define Image/Build/Board/EASY83000
226         $(call Image/Build/Infineon,$(1),easy-83000)
227 endef
228
229 define Image/Build/Board/EASY83000/squashfs
230         $(call Image/Build/Board/EASY83000,squashfs)
231 endef
232
233 define Image/Build/Board/EASY83000/jffs2-64k
234         $(call Image/Build/Board/EASY83000,jffs2-64k)
235 endef
236
237 define Image/Build/Board/EASY83000/Initramfs
238         $(call Image/Build/LZMAKernel/Admboot,easy-83000,gz)
239 endef
240
241 #
242 # Mikrotik RB-1xx
243 #
244 define Image/Build/Board/RB1xx/Initramfs
245         $(CP) $(KDIR)/vmlinux.elf $(call imgname,netboot,rb1xx)
246 endef
247
248 #
249 # Groups
250 #
251 define Image/Build/Group/Cellvision
252         $(call Image/Build/Board/CAS771/$(1))
253         $(call Image/Build/Board/CAS771W/$(1))
254 endef
255
256 define Image/Build/Group/WP54G
257         $(call Image/Build/Board/WP54G/$(1))
258         $(call Image/Build/Board/WP54AG/$(1))
259         $(call Image/Build/Board/WPP54G/$(1))
260         $(call Image/Build/Board/WPP54AG/$(1))
261         $(call Image/Build/Board/WP54GWRT/$(1))
262 endef
263
264 define Image/Build/Group/Compex
265         $(call Image/Build/Board/NP27G/$(1))
266         $(call Image/Build/Board/NP28G/$(1))
267
268         $(call Image/Build/Group/WP54G,$(1))
269 endef
270
271 define Image/Build/Group/Edimax
272         $(call Image/Build/Board/BR6104K/$(1))
273         $(call Image/Build/Board/BR6104WG/$(1))
274 endef
275
276 define Image/Build/Group/Infineon
277         $(call Image/Build/Board/EASY83000/$(1))
278 endef
279
280 define Image/Build/Group/All
281         $(call Image/Build/Group/Cellvision,$(1))
282         $(call Image/Build/Group/Compex,$(1))
283         $(call Image/Build/Group/Edimax,$(1))
284         $(call Image/Build/Group/Cellvision,$(1))
285         $(call Image/Build/Group/Infineon,$(1))
286         $(call Image/Build/Board/RB1xx/$(1))
287 endef
288
289 #
290 # Profiles
291 #
292 define Image/Build/Profile/Generic
293         $(call Image/Build/Group/All,$(1))
294 endef
295
296 define Image/Build/Profile/Atheros
297         $(call Image/Build/AllBoards,$(1))
298 endef
299
300 define Image/Build/Profile/Texas
301         $(call Image/Build/AllBoards,$(1))
302 endef
303
304 define Image/Build/Profile/Ralink
305         $(call Image/Build/AllBoards,$(1))
306 endef
307
308 define Image/Build/Profile/WP54G
309         $(call Image/Build/Group/WP54G,$(1))
310 endef
311
312 define Image/Build/Profile/NP27G
313         $(call Image/Build/Board/NP27G/$(1))
314 endef
315
316 define Image/Build/Profile/NP28G
317         $(call Image/Build/Board/NP28G/$(1))
318 endef
319
320 define Image/Build/Profile/CAS771
321         $(call Image/Build/Board/CAS771/$(1))
322 endef
323
324 define Image/Build/Profile/CAS771W
325         $(call Image/Build/Board/CAS771W/$(1))
326 endef
327
328 define Image/Build/Profile/BR6104KP
329         $(call Image/Build/Board/BR6104K/$(1))
330 endef
331
332 define Image/Build/Profile/RouterBoard
333         $(call Image/Build/Board/RB1xx/$(1))
334 endef
335
336 ifeq ($(PROFILE),RouterBoard)
337   define Image/cmdline/yaffs2
338         root=/dev/mtdblock3 rootfstype=yaffs2 init=/etc/preinit
339   endef
340
341   define Image/BuildKernel/RouterBoard
342         $(CP) $(KDIR)/vmlinux.elf $(call imgname,kernel,rb1xx)
343         $(STAGING_DIR_HOST)/bin/patch-cmdline $(call imgname,kernel,rb1xx) \
344                 '$(strip $(call Image/cmdline/yaffs2))'
345   endef
346
347   ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
348     define Image/BuildKernel
349         $(call Image/BuildKernel/RouterBoard)
350     endef
351   endif
352
353 endif
354