Add support for Conceptronic C54BSR4
[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 trxedimax/jffs2-128k
9 -a 0x20000 -f $(KDIR)/root.jffs2-128k
10 endef
11
12 define trxedimax/jffs2-64k
13 -a 0x10000 -f $(KDIR)/root.jffs2-64k
14 endef
15
16 define trxedimax/squashfs
17 -a 1024 -f $(KDIR)/root.squashfs
18 endef
19
20 define Image/Build/TRXEdimax
21         $(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
22                 $(call trxedimax/$(2))
23 endef
24
25 define Image/Build/Compex
26         $(call Image/Build/Loader,$(2),gz,0x80500000,0,y,$(2))
27         $(call Image/Build/TRX,$(call imgname,$(1),$(2)).trx,$(1),$(KDIR)/loader-$(2).gz)
28 endef
29
30 define Image/Build/Edimax
31         $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
32         $(call Image/Build/TRXEdimax,$(call imgname,$(1),$(2)).trx,$(1))
33         $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d -w \
34                 -r $(KDIR)/loader-$(2).gz::0x1000 \
35                 -x $(call imgname,$(1),$(2)).trx:0x10000 \
36                 -x $(JFFS2MARK):0x10000 \
37                 $(call imgname,$(1),$(2))-webui.bin
38         $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
39                 -r $(KDIR)/loader-$(2).gz::0x1000 \
40                 -x $(call imgname,$(1),$(2)).trx:0x10000 \
41                 -x $(JFFS2MARK):0x10000 \
42                 $(call imgname,$(1),$(2))-xmodem.bin
43         rm -f $(call imgname,$(1),$(2)).trx
44 endef
45
46 define Image/Build/Infineon
47         $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
48         $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
49         dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).img bs=64k conv=sync
50         cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).img
51 endef
52
53 define Image/Build/MyLoader
54         $(call Image/Build/Loader,$(2),gz,0x80500000,0)
55         $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
56         $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) \
57                 -p0x20000:0x10000:ahp:0x80001000 \
58                 -p0x30000:0 \
59                 -b0x20000:0x10000:h:$(KDIR)/loader-$(2).gz \
60                 -b0x30000:0::$(call imgname,$(1),$(2)).trx \
61                 $(call imgname,$(1),$(2)).bin
62 endef
63
64 #
65 # Cellvision CAS-771
66 #
67 define Image/Build/Board/CAS771/Initramfs
68         $(call Image/Build/LZMAKernel/Admboot,cas-771,gz)
69 endef
70
71 #
72 # Cellvision CAS-771W
73 #
74 define Image/Build/Board/CAS771W/Initramfs
75         $(call Image/Build/LZMAKernel/Admboot,cas-771w,gz)
76 endef
77
78 #
79 # Compex NP27G
80 #
81 define Image/Build/Board/NP27G
82         $(call Image/Build/MyLoader,$(1),np27g)
83 endef
84
85 define Image/Build/Board/NP27G/squashfs
86         $(call Image/Build/Board/NP27G,squashfs)
87 endef
88
89 define Image/Build/Board/NP27G/jffs2-64k
90         $(call Image/Build/Board/NP27G,jffs2-64k)
91 endef
92
93 define Image/Build/Board/NP27G/Initramfs
94         $(call Image/Build/LZMAKernel/Generic,np27g,bin)
95 endef
96
97 #
98 # Compex NP28G
99 #
100 define Image/Build/Board/NP28G
101         $(call Image/Build/MyLoader,$(1),np28g)
102 endef
103
104 define Image/Build/Board/NP28G/squashfs
105         $(call Image/Build/Board/NP28G,squashfs)
106 endef
107
108 define Image/Build/Board/NP28G/jffs2-64k
109         $(call Image/Build/Board/NP28G,jffs2-64k)
110 endef
111
112 define Image/Build/Board/NP28G/Initramfs
113         $(call Image/Build/LZMAKernel/Generic,np28g,bin)
114 endef
115
116 #
117 # Compex WP54G
118 #
119 define Image/Build/Board/WP54G
120         $(call Image/Build/MyLoader,$(1),wp54g)
121 endef
122
123 define Image/Build/Board/WP54G/squashfs
124         $(call Image/Build/Board/WP54G,squashfs)
125 endef
126
127 define Image/Build/Board/WP54G/jffs2-64k
128         $(call Image/Build/Board/WP54G,jffs2-64k)
129 endef
130
131 define Image/Build/Board/WP54G/Initramfs
132         $(call Image/Build/LZMAKernel/Generic,wp54g,bin)
133 endef
134
135 #
136 # Compex WP54AG
137 #
138 define Image/Build/Board/WP54AG
139         $(call Image/Build/MyLoader,$(1),wp54ag)
140 endef
141
142 define Image/Build/Board/WP54AG/squashfs
143         $(call Image/Build/Board/WP54AG,squashfs)
144 endef
145
146 define Image/Build/Board/WP54AG/jffs2-64k
147         $(call Image/Build/Board/WP54AG,jffs2-64k)
148 endef
149
150 define Image/Build/Board/WP54AG/Initramfs
151         $(call Image/Build/LZMAKernel/Generic,wp54ag,bin)
152 endef
153
154 #
155 # Compex WPP54G
156 #
157 define Image/Build/Board/WPP54G
158         $(call Image/Build/MyLoader,$(1),wpp54g)
159 endef
160
161 define Image/Build/Board/WPP54G/squashfs
162         $(call Image/Build/Board/WPP54G,squashfs)
163 endef
164
165 define Image/Build/Board/WPP54G/jffs2-64k
166         $(call Image/Build/Board/WPP54G,jffs2-64k)
167 endef
168
169 define Image/Build/Board/WPP54G/Initramfs
170         $(call Image/Build/LZMAKernel/Generic,wpp54g,bin)
171 endef
172
173 #
174 # Compex WPP54AG
175 #
176 define Image/Build/Board/WPP54AG
177         $(call Image/Build/MyLoader,$(1),wpp54ag)
178 endef
179
180 define Image/Build/Board/WPP54AG/squashfs
181         $(call Image/Build/Board/WPP54AG,squashfs)
182 endef
183
184 define Image/Build/Board/WPP54AG/jffs2-64k
185         $(call Image/Build/Board/WPP54AG,jffs2-64k)
186 endef
187
188 define Image/Build/Board/WPP54AG/Initramfs
189         $(call Image/Build/LZMAKernel/Generic,wpp54ag,bin)
190 endef
191
192 #
193 # Compex WP54G-WRT
194 #
195 define Image/Build/Board/WP54GWRT
196         $(call Image/Build/Compex,$(1),wp54g-wrt)
197 endef
198
199 define Image/Build/Board/WP54GWRT/squashfs
200         $(call Image/Build/Board/WP54GWRT,squashfs)
201 endef
202
203 define Image/Build/Board/WP54GWRT/jffs2-64k
204         $(call Image/Build/Board/WP54GWRT,jffs2-64k)
205 endef
206
207 define Image/Build/Board/WP54GWRT/Initramfs
208         $(call Image/Build/LZMAKernel/KArgs,wp54g-wrt,bin)
209 endef
210
211 #
212 # Edimax BR-6104K
213 #
214 define Image/Build/Board/BR6104K
215         $(call Image/Build/Edimax,$(1),br-6104k)
216 endef
217
218 define Image/Build/Board/BR6104K/squashfs
219         $(call Image/Build/Board/BR6104K,squashfs)
220 endef
221
222 define Image/Build/Board/BR6104K/Initramfs
223         $(call Image/Build/LZMAKernel/Admboot,br-6104k,gz)
224 endef
225
226 #
227 # Edimax BR-6104KP
228 #
229 define Image/Build/Board/BR6104KP
230         $(call Image/Build/Edimax,$(1),br-6104kp)
231 endef
232
233 define Image/Build/Board/BR6104KP/squashfs
234         $(call Image/Build/Board/BR6104KP,squashfs)
235 endef
236
237 define Image/Build/Board/BR6104KP/Initramfs
238         $(call Image/Build/LZMAKernel/Admboot,br-6104kp,gz)
239 endef
240
241 #
242 # Edimax BR-6104WG
243 #
244 define Image/Build/Board/BR6104WG
245         $(call Image/Build/Edimax,$(1),br-6104wg)
246 endef
247
248 define Image/Build/Board/BR6104WG/squashfs
249         $(call Image/Build/Board/BR6104WG,squashfs)
250 endef
251
252 define Image/Build/Board/BR6104WG/Initramfs
253         $(call Image/Build/LZMAKernel/Admboot,br-6104wg,gz)
254 endef
255
256 #
257 # Conceptronic C54BSR4
258 #
259 define Image/Build/Board/C54BSR4
260         $(call Image/Build/Edimax,$(1),c54bsr4)
261 endef
262
263 define Image/Build/Board/C54BSR4/squashfs
264         $(call Image/Build/Board/C54BSR4,squashfs)
265 endef
266
267 define Image/Build/Board/C54BSR4/Initramfs
268         $(call Image/Build/LZMAKernel/Admboot,c54bsr4,gz)
269 endef
270
271 #
272 # Infineon EASY 83000
273 #
274 define Image/Build/Board/EASY83000
275         $(call Image/Build/Infineon,$(1),easy-83000)
276 endef
277
278 define Image/Build/Board/EASY83000/squashfs
279         $(call Image/Build/Board/EASY83000,squashfs)
280 endef
281
282 define Image/Build/Board/EASY83000/jffs2-64k
283         $(call Image/Build/Board/EASY83000,jffs2-64k)
284 endef
285
286 define Image/Build/Board/EASY83000/Initramfs
287         $(call Image/Build/LZMAKernel/Admboot,easy-83000,gz)
288 endef
289
290 #
291 # Mikrotik RB-1xx
292 #
293 define Image/Build/Board/RB1xx/Initramfs
294         $(CP) $(KDIR)/vmlinux.elf $(call imgname,netboot,rb1xx)
295 endef
296
297 #
298 # Groups
299 #
300 define Image/Build/Group/Cellvision
301         $(call Image/Build/Board/CAS771/$(1))
302         $(call Image/Build/Board/CAS771W/$(1))
303 endef
304
305 define Image/Build/Group/WP54G
306         $(call Image/Build/Board/WP54G/$(1))
307         $(call Image/Build/Board/WP54AG/$(1))
308         $(call Image/Build/Board/WPP54G/$(1))
309         $(call Image/Build/Board/WPP54AG/$(1))
310         $(call Image/Build/Board/WP54GWRT/$(1))
311 endef
312
313 define Image/Build/Group/Compex
314         $(call Image/Build/Board/NP27G/$(1))
315         $(call Image/Build/Board/NP28G/$(1))
316         $(call Image/Build/Group/WP54G,$(1))
317 endef
318
319 define Image/Build/Group/Conceptronic
320         $(call Image/Build/Board/C54BSR4/$(1))
321 endef
322
323 define Image/Build/Group/Edimax
324         $(call Image/Build/Board/BR6104K/$(1))
325         $(call Image/Build/Board/BR6104KP/$(1))
326         $(call Image/Build/Board/BR6104WG/$(1))
327 endef
328
329 define Image/Build/Group/Infineon
330         $(call Image/Build/Board/EASY83000/$(1))
331 endef
332
333 define Image/Build/Group/All
334         $(call Image/Build/Group/Cellvision,$(1))
335         $(call Image/Build/Group/Compex,$(1))
336         $(call Image/Build/Group/Conceptronic,$(1))
337         $(call Image/Build/Group/Edimax,$(1))
338         $(call Image/Build/Group/Cellvision,$(1))
339         $(call Image/Build/Group/Infineon,$(1))
340         $(call Image/Build/Board/RB1xx/$(1))
341 endef
342
343 #
344 # Profiles
345 #
346 define Image/Build/Profile/Generic
347         $(call Image/Build/Group/All,$(1))
348 endef
349
350 define Image/Build/Profile/Atheros
351         $(call Image/Build/AllBoards,$(1))
352 endef
353
354 define Image/Build/Profile/Texas
355         $(call Image/Build/AllBoards,$(1))
356 endef
357
358 define Image/Build/Profile/Ralink
359         $(call Image/Build/AllBoards,$(1))
360 endef
361
362 define Image/Build/Profile/WP54G
363         $(call Image/Build/Group/WP54G,$(1))
364 endef
365
366 define Image/Build/Profile/NP27G
367         $(call Image/Build/Board/NP27G/$(1))
368 endef
369
370 define Image/Build/Profile/NP28G
371         $(call Image/Build/Board/NP28G/$(1))
372 endef
373
374 define Image/Build/Profile/CAS771
375         $(call Image/Build/Board/CAS771/$(1))
376 endef
377
378 define Image/Build/Profile/CAS771W
379         $(call Image/Build/Board/CAS771W/$(1))
380 endef
381
382 define Image/Build/Profile/BR6104K
383         $(call Image/Build/Board/BR6104K/$(1))
384 endef
385
386 define Image/Build/Profile/BR6104KP
387         $(call Image/Build/Board/BR6104KP/$(1))
388 endef
389
390 define Image/Build/Profile/C54BSR4
391         $(call Image/Build/Board/C54BSR4/$(1))
392 endef
393
394 define Image/Build/Profile/RouterBoard
395         $(call Image/Build/Board/RB1xx/$(1))
396 endef
397
398 ifeq ($(PROFILE),RouterBoard)
399   define Image/cmdline/yaffs2
400         root=/dev/mtdblock3 rootfstype=yaffs2 init=/etc/preinit
401   endef
402
403   define Image/BuildKernel/RouterBoard
404         $(CP) $(KDIR)/vmlinux.elf $(call imgname,kernel,rb1xx)
405         $(STAGING_DIR_HOST)/bin/patch-cmdline $(call imgname,kernel,rb1xx) \
406                 '$(strip $(call Image/cmdline/yaffs2))'
407   endef
408
409   ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
410     define Image/BuildKernel
411         $(call Image/BuildKernel/RouterBoard)
412     endef
413   endif
414
415 endif
416