5493737d3fe3a264d6e857c1e7127b674b56f80e
[openwrt/openwrt.git] / package / boot / uboot-lantiq / Makefile
1 #
2 # Copyright (C) 2012-2013 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 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=u-boot
11 PKG_VERSION:=2013.10
12 PKG_RELEASE:=1
13
14 PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55
15
16 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
17
18 include $(INCLUDE_DIR)/u-boot.mk
19 include $(INCLUDE_DIR)/package.mk
20
21 define U-Boot/Default
22 BUILD_TARGET:=lantiq
23 DDR_SETTINGS:=
24 endef
25
26 define U-Boot/arv4519pw_ram
27 NAME:=Arcadyan arv4519pw (RAM)
28 BUILD_SUBTARGET:=xway
29 BUILD_DEVICES:=arcadyan_arv4519pw
30 DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
31 endef
32
33 define U-Boot/arv4519pw_nor
34 NAME:=Arcadyan arv4519pw (NOR)
35 BUILD_SUBTARGET:=xway
36 BUILD_DEVICES:=arcadyan_arv4519pw
37 endef
38
39 define U-Boot/arv4519pw_brn
40 NAME:=Arcadyan arv4519pw (BRN)
41 BUILD_SUBTARGET:=xway
42 BUILD_DEVICES:=arcadyan_arv4519pw
43 endef
44
45 define U-Boot/arv7506pw11_ram
46 NAME:=Arcadyan ARV7506PW11 (RAM)
47 BUILD_SUBTARGET:=xway
48 BUILD_DEVICES:=arcadyan_arv7506pw11
49 DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h
50 endef
51
52 define U-Boot/arv7506pw11_nor
53 NAME:=Arcadyan ARV7506PW11 (NOR)
54 BUILD_SUBTARGET:=xway
55 BUILD_DEVICES:=arcadyan_arv7506pw11
56 endef
57
58 define U-Boot/arv7506pw11_brn
59 NAME:=Arcadyan ARV7506PW11 (BRN)
60 BUILD_SUBTARGET:=xway
61 BUILD_DEVICES:=arcadyan_arv7506pw11
62 endef
63
64 define U-Boot/arv7510pw_ram
65 NAME:=Arcadyan arv7510pw (RAM)
66 BUILD_SUBTARGET:=xway
67 BUILD_DEVICES:=arcadyan_arv4510pw
68 DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
69 endef
70
71 define U-Boot/arv7510pw_nor
72 NAME:=Arcadyan arv7510pw (NOR)
73 BUILD_SUBTARGET:=xway
74 BUILD_DEVICES:=arcadyan_arv4510pw
75 endef
76
77 define U-Boot/arv7510pw_brn
78 NAME:=Arcadyan arv7510pw (BRN)
79 BUILD_SUBTARGET:=xway
80 BUILD_DEVICES:=arcadyan_arv4510pw
81 endef
82
83 define U-Boot/arv7510pw22_ram
84 NAME:=Arcadyan arv7510pw22 (RAM)
85 BUILD_SUBTARGET:=xway
86 BUILD_DEVICES:=arcadyan_arv7510pw22
87 DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
88 endef
89
90 define U-Boot/arv7510pw22_nor
91 NAME:=Arcadyan arv7510pw22 (NOR)
92 BUILD_SUBTARGET:=xway
93 BUILD_DEVICES:=arcadyan_arv7510pw22
94 endef
95
96 define U-Boot/arv7510pw22_brn
97 NAME:=Arcadyan arv7510pw22 (BRN)
98 BUILD_SUBTARGET:=xway
99 BUILD_DEVICES:=arcadyan_arv7510pw22
100 endef
101
102 define U-Boot/arv7518pw_ram
103 NAME:=Arcadyan arv7518pw (RAM)
104 BUILD_SUBTARGET:=xway
105 BUILD_DEVICES:=arcadyan_arv7518pw
106 DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
107 endef
108
109 define U-Boot/arv7518pw_nor
110 NAME:=Arcadyan arv7518pw (NOR)
111 BUILD_SUBTARGET:=xway
112 BUILD_DEVICES:=arcadyan_arv7518pw
113 endef
114
115 define U-Boot/arv7518pw_brn
116 NAME:=Arcadyan arv7518pw (BRN)
117 BUILD_SUBTARGET:=xway
118 BUILD_DEVICES:=arcadyan_arv7518pw
119 endef
120
121 define U-Boot/arv752dpw_ram
122 NAME:=Arcadyan arv752dpw (RAM)
123 BUILD_SUBTARGET:=xway
124 DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
125 BUILD_DEVICES:=arcadyan_arv752dpw
126 endef
127
128 define U-Boot/arv752dpw_nor
129 NAME:=Arcadyan arv752dpw (NOR)
130 BUILD_SUBTARGET:=xway
131 BUILD_DEVICES:=arcadyan_arv752dpw
132 endef
133
134 define U-Boot/arv752dpw_brn
135 NAME:=Arcadyan arv752dpw (BRN)
136 BUILD_SUBTARGET:=xway
137 BUILD_DEVICES:=arcadyan_arv752dpw
138 endef
139
140 define U-Boot/arv752dpw22_ram
141 NAME:=Arcadyan arv752dpw22 (RAM)
142 BUILD_SUBTARGET:=xway
143 BUILD_DEVICES:=arcadyan_arv752dpw22
144 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
145 endef
146
147 define U-Boot/arv752dpw22_nor
148 NAME:=Arcadyan arv752dpw22 (NOR)
149 BUILD_SUBTARGET:=xway
150 BUILD_DEVICES:=arcadyan_arv752dpw22
151 endef
152
153 define U-Boot/arv752dpw22_brn
154 NAME:=Arcadyan arv752dpw22 (BRN)
155 BUILD_SUBTARGET:=xway
156 BUILD_DEVICES:=arcadyan_arv752dpw22
157 endef
158
159 define U-Boot/arv8539pw22_ram
160 NAME:=Speedport W 504V Typ A (RAM)
161 BUILD_SUBTARGET:=xway
162 BUILD_DEVICES:=arcadyan_arv8539pw22
163 DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
164 endef
165
166 define U-Boot/arv8539pw22_nor
167 NAME:=Speedport W 504V Typ A (NOR)
168 BUILD_SUBTARGET:=xway
169 BUILD_DEVICES:=arcadyan_arv8539pw22
170 endef
171
172 define U-Boot/arv8539pw22_brn
173 NAME:=Speedport W 504V Typ A (BRN)
174 BUILD_SUBTARGET:=xway
175 BUILD_DEVICES:=arcadyan_arv8539pw22
176 endef
177
178 define U-Boot/gigasx76x_ram
179 NAME:=Siemens Gigaset sx76x (RAM)
180 BUILD_SUBTARGET:=xway
181 BUILD_DEVICES:=siemens_gigaset-sx76x
182 DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
183 endef
184
185 define U-Boot/gigasx76x_nor
186 NAME:=Siemens Gigaset sx76x (NOR)
187 BUILD_SUBTARGET:=xway
188 BUILD_DEVICES:=siemens_gigaset-sx76x
189 endef
190
191 define U-Boot/acmp252_ram
192 NAME:=AudioCodes MP-252 (RAM)
193 BUILD_SUBTARGET:=xway
194 BUILD_DEVICES:=audiocodes_mp-252
195 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
196 endef
197
198 define U-Boot/acmp252_nor
199 NAME:=AudioCodes MP-252 (NOR)
200 BUILD_SUBTARGET:=xway
201 BUILD_DEVICES:=audiocodes_mp-252
202 endef
203
204 define U-Boot/bthomehubv5a_ram
205 NAME:=BT Home Hub 5A (RAM)
206 BUILD_SUBTARGET:=xrx200
207 BUILD_DEVICES:=bt_homehub-v5a
208 DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h
209 endef
210
211 define U-Boot/easy50712_ram
212 NAME:=Lantiq EASY50712 (RAM)
213 BUILD_SUBTARGET:=xway
214 BUILD_DEVICES:=lantiq_easy50712
215 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
216 endef
217
218 define U-Boot/easy50712_nor
219 NAME:=Lantiq EASY50712 (NOR)
220 BUILD_SUBTARGET:=xway
221 BUILD_DEVICES:=lantiq_easy50712
222 endef
223
224 define U-Boot/easy50712_norspl
225 NAME:=Lantiq EASY50712 (NOR SPL)
226 BUILD_SUBTARGET:=xway
227 BUILD_DEVICES:=lantiq_easy50712
228 UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
229 DEPENDS+=@BROKEN
230 endef
231
232 define U-Boot/easy80920_ram
233 NAME:=Lantiq EASY80920 (RAM)
234 BUILD_SUBTARGET:=xrx200
235 BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
236 DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
237 endef
238
239 define U-Boot/easy80920_nor
240 NAME:=Lantiq EASY80920 (NOR)
241 BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
242 BUILD_SUBTARGET:=xrx200
243 endef
244
245 define U-Boot/easy80920_norspl
246 NAME:=Lantiq EASY80920 (NOR SPL)
247 BUILD_SUBTARGET:=xrx200
248 BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
249 UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
250 DEPENDS+=@BROKEN
251 endef
252
253 define U-Boot/easy80920_sfspl
254 NAME:=Lantiq EASY80920 (SPI SPL)
255 BUILD_SUBTARGET:=xrx200
256 BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
257 UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
258 DEPENDS+=@BROKEN
259 endef
260
261 define U-Boot/fb3370_eva
262 NAME:=AVM FRITZ3370 (EVA)
263 BUILD_SUBTARGET:=xrx200
264 BUILD_DEVICES:=avm_fritz3370
265 endef
266
267 define U-Boot/fb3370_ram
268 NAME:=AVM FRITZ3370 (RAM)
269 BUILD_SUBTARGET:=xrx200
270 BUILD_DEVICES:=avm_fritz3370
271 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
272 endef
273
274 define U-Boot/fb3370_sfspl
275 NAME:=AVM FRITZ3370 (SPI SPL)
276 BUILD_SUBTARGET:=xrx200
277 BUILD_DEVICES:=avm_fritz3370
278 UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
279 DEPENDS+=@BROKEN
280 endef
281
282 define U-Boot/p2812hnufx_ram
283 NAME:=ZyXEL P-2812HNU-Fx (RAM)
284 BUILD_SUBTARGET:=xrx200
285 BUILD_DEVICES:=zyxel_p-2812hnu-f1
286 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
287 endef
288
289 define U-Boot/p2812hnufx_nandspl
290 NAME:=ZyXEL P-2812HNU-Fx (NAND SPL)
291 BUILD_SUBTARGET:=xrx200
292 BUILD_DEVICES:=zyxel_p-2812hnu-f1
293 UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl
294 DEPENDS+=@BROKEN
295 endef
296
297 define U-Boot/vgv7510kw22_brn
298 NAME:=Arcadyan VGV7510KW22 (BRN)
299 BUILD_SUBTARGET:=xrx200
300 BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
301 endef
302
303 define U-Boot/vgv7510kw22_nor
304 NAME:=Arcadyan VGV7510KW22 (NOR)
305 BUILD_SUBTARGET:=xrx200
306 BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
307 endef
308
309 define U-Boot/vgv7510kw22_ram
310 NAME:=Arcadyan VGV7510KW22 (RAM)
311 BUILD_SUBTARGET:=xrx200
312 BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
313 DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
314 endef
315
316 define U-Boot/vgv7519_brn
317 NAME:=Arcadyan VGV7519 (BRN)
318 BUILD_SUBTARGET:=xrx200
319 BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
320 endef
321
322 define U-Boot/vgv7519_nor
323 NAME:=Arcadyan VGV7519 (NOR)
324 BUILD_SUBTARGET:=xrx200
325 BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
326 endef
327
328 define U-Boot/vgv7519_ram
329 NAME:=Arcadyan VGV7519 (RAM)
330 BUILD_SUBTARGET:=xrx200
331 BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
332 DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
333 endef
334
335 UBOOT_TARGETS:= \
336 arv4519pw_ram arv4519pw_nor arv4519pw_brn \
337 arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \
338 arv7510pw_ram arv7510pw_nor arv7510pw_brn \
339 arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
340 arv7518pw_ram arv7518pw_nor arv7518pw_brn \
341 arv752dpw_ram arv752dpw_nor arv752dpw_brn \
342 arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
343 arv8539pw22_brn arv8539pw22_nor arv8539pw22_ram \
344 bthomehubv5a_ram \
345 gigasx76x_ram gigasx76x_nor \
346 acmp252_ram acmp252_nor \
347 easy50712_ram easy50712_nor easy50712_norspl \
348 easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
349 fb3370_eva fb3370_ram fb3370_sfspl \
350 p2812hnufx_ram p2812hnufx_nandspl \
351 vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
352 vgv7519_brn vgv7519_nor vgv7519_ram
353
354 define CompressVR9Firmware
355 $(STAGING_DIR_HOST)/bin/lzma e \
356 $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
357 $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
358 endef
359
360 define Build/Prepare
361 $(call Build/Prepare/Default)
362 mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
363 $(call CompressVR9Firmware,11g,1)
364 $(call CompressVR9Firmware,11g,2)
365 $(call CompressVR9Firmware,22f,1)
366 $(call CompressVR9Firmware,22f,2)
367 endef
368
369 UBOOT_MAKE_FLAGS :=
370
371 ifeq ($(SUBTARGET),xway)
372 SOC:=danube
373 else
374 SOC:=vr9
375 endif
376
377 define Package/u-boot/install/uart
378 awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
379 -v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \
380 > $(PKG_BUILD_DIR)/ddr_settings
381 perl $(PKG_BUILD_DIR)/tools/gct.pl \
382 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
383 $(1)/u-boot.asc
384 endef
385
386 define Package/u-boot/install
387 $(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default))
388 endef
389
390 $(eval $(call BuildPackage/U-Boot))