uboot-lantiq: switch to using u-boot.mk
[oweals/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:=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:=ARV4519PW
37 endef
38
39 define U-Boot/arv4519pw_brn
40   NAME:=Arcadyan arv4519pw (BRN)
41   BUILD_SUBTARGET:=xway
42   BUILD_DEVICES:=ARV4519PW
43 endef
44
45 define U-Boot/arv7506pw11_ram
46   NAME:=Arcadyan ARV7506PW11 (RAM)
47   BUILD_SUBTARGET:=xway
48   BUILD_DEVICES:=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:=ARV7506PW11
56 endef
57
58 define U-Boot/arv7506pw11_brn
59   NAME:=Arcadyan ARV7506PW11 (BRN)
60   BUILD_SUBTARGET:=xway
61   BUILD_DEVICES:=ARV7506PW11
62 endef
63
64 define U-Boot/arv7510pw_ram
65   NAME:=Arcadyan arv7510pw (RAM)
66   BUILD_SUBTARGET:=xway
67   BUILD_DEVICES:=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:=ARV4510PW
75 endef
76
77 define U-Boot/arv7510pw_brn
78   NAME:=Arcadyan arv7510pw (BRN)
79   BUILD_SUBTARGET:=xway
80   BUILD_DEVICES:=ARV4510PW
81 endef
82
83 define U-Boot/arv7510pw22_ram
84   NAME:=Arcadyan arv7510pw22 (RAM)
85   BUILD_SUBTARGET:=xway
86   BUILD_DEVICES:=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:=ARV7510PW22
94 endef
95
96 define U-Boot/arv7510pw22_brn
97   NAME:=Arcadyan arv7510pw22 (BRN)
98   BUILD_SUBTARGET:=xway
99   BUILD_DEVICES:=ARV7510PW22
100 endef
101
102 define U-Boot/arv7518pw_ram
103   NAME:=Arcadyan arv7518pw (RAM)
104   BUILD_SUBTARGET:=xway
105   BUILD_DEVICES:=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:=ARV7518PW
113 endef
114
115 define U-Boot/arv7518pw_brn
116   NAME:=Arcadyan arv7518pw (BRN)
117   BUILD_SUBTARGET:=xway
118   BUILD_DEVICES:=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:=ARV752DPW
126 endef
127
128 define U-Boot/arv752dpw_nor
129   NAME:=Arcadyan arv752dpw (NOR)
130   BUILD_SUBTARGET:=xway
131   BUILD_DEVICES:=ARV752DPW
132 endef
133
134 define U-Boot/arv752dpw_brn
135   NAME:=Arcadyan arv752dpw (BRN)
136   BUILD_SUBTARGET:=xway
137   BUILD_DEVICES:=ARV752DPW
138 endef
139
140 define U-Boot/arv752dpw22_ram
141   NAME:=Arcadyan arv752dpw22 (RAM)
142   BUILD_SUBTARGET:=xway
143   BUILD_DEVICES:=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:=ARV752DPW22
151 endef
152
153 define U-Boot/arv752dpw22_brn
154   NAME:=Arcadyan arv752dpw22 (BRN)
155   BUILD_SUBTARGET:=xway
156   BUILD_DEVICES:=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:=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:=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:=ARV8539PW22
176 endef
177
178 define U-Boot/gigasx76x_ram
179   NAME:=Siemens Gigaset sx76x (RAM)
180   BUILD_SUBTARGET:=xway
181   BUILD_DEVICES:=GIGASX76X
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:=GIGASX76X
189 endef
190
191 define U-Boot/acmp252_ram
192   NAME:=AudioCodes MP-252 (RAM)
193   BUILD_SUBTARGET:=xway
194   BUILD_DEVICES:=ACMP252
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:=ACMP252
202 endef
203
204 define U-Boot/bthomehubv5a_ram
205   NAME:=BT Home Hub 5A (RAM)
206   BUILD_SUBTARGET:=xrx200
207   BUILD_DEVICES:=BTHOMEHUBV5A
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:=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:=EASY50712
222 endef
223
224 define U-Boot/easy50712_norspl
225   NAME:=Lantiq EASY50712 (NOR SPL)
226   BUILD_SUBTARGET:=xway
227   BUILD_DEVICES:=EASY50712
228   UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
229 endef
230
231 define U-Boot/easy80920_ram
232   NAME:=Lantiq EASY80920 (RAM)
233   BUILD_SUBTARGET:=xrx200
234   BUILD_DEVICES:=EASY80920NOR EASY80920NAND
235   DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
236 endef
237
238 define U-Boot/easy80920_nor
239   NAME:=Lantiq EASY80920 (NOR)
240   BUILD_DEVICES:=EASY80920NOR EASY80920NAND
241   BUILD_SUBTARGET:=xrx200
242 endef
243
244 define U-Boot/easy80920_norspl
245   NAME:=Lantiq EASY80920 (NOR SPL)
246   BUILD_SUBTARGET:=xrx200
247   BUILD_DEVICES:=EASY80920NOR EASY80920NAND
248   UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
249 endef
250
251 define U-Boot/easy80920_sfspl
252   NAME:=Lantiq EASY80920 (SPI SPL)
253   BUILD_SUBTARGET:=xrx200
254   BUILD_DEVICES:=EASY80920NOR EASY80920NAND
255   UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
256 endef
257
258 define U-Boot/fb3370_eva
259   NAME:=AVM FRITZ3370 (EVA)
260   BUILD_SUBTARGET:=xrx200
261   BUILD_DEVICES:=FRITZ3370
262 endef
263
264 define U-Boot/fb3370_ram
265   NAME:=AVM FRITZ3370 (RAM)
266   BUILD_SUBTARGET:=xrx200
267   BUILD_DEVICES:=FRITZ3370
268   DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
269 endef
270
271 define U-Boot/fb3370_sfspl
272   NAME:=AVM FRITZ3370 (SPI SPL)
273   BUILD_SUBTARGET:=xrx200
274   BUILD_DEVICES:=FRITZ3370
275   UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
276 endef
277
278 define U-Boot/p2812hnufx_ram
279   NAME:=ZyXEL P-2812HNU-Fx (RAM)
280   BUILD_SUBTARGET:=xrx200
281   BUILD_DEVICES:=P2812HNUF1
282   DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
283 endef
284
285 define U-Boot/p2812hnufx_nandspl
286   NAME:=ZyXEL P-2812HNU-Fx (NAND SPL)
287   BUILD_SUBTARGET:=xrx200
288   BUILD_DEVICES:=P2812HNUF1
289   UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl
290 endef
291
292 define U-Boot/vgv7510kw22_brn
293   NAME:=Arcadyan VGV7510KW22 (BRN)
294   BUILD_SUBTARGET:=xrx200
295   BUILD_DEVICES:=VGV7510KW22NOR
296 endef
297
298 define U-Boot/vgv7510kw22_nor
299   NAME:=Arcadyan VGV7510KW22 (NOR)
300   BUILD_SUBTARGET:=xrx200
301   BUILD_DEVICES:=VGV7510KW22NOR
302 endef
303
304 define U-Boot/vgv7510kw22_ram
305   NAME:=Arcadyan VGV7510KW22 (RAM)
306   BUILD_SUBTARGET:=xrx200
307   BUILD_DEVICES:=VGV7510KW22NOR
308   DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
309 endef
310
311 define U-Boot/vgv7519_brn
312   NAME:=Arcadyan VGV7519 (BRN)
313   BUILD_SUBTARGET:=xrx200
314   BUILD_DEVICES:=VGV7519NOR VGV7519BRN
315 endef
316
317 define U-Boot/vgv7519_nor
318   NAME:=Arcadyan VGV7519 (NOR)
319   BUILD_SUBTARGET:=xrx200
320   BUILD_DEVICES:=VGV7519NOR VGV7519BRN
321 endef
322
323 define U-Boot/vgv7519_ram
324   NAME:=Arcadyan VGV7519 (RAM)
325   BUILD_SUBTARGET:=xrx200
326   BUILD_DEVICES:=VGV7519NOR VGV7519BRN
327   DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
328 endef
329
330 UBOOT_TARGETS:= \
331         arv4519pw_ram arv4519pw_nor arv4519pw_brn \
332         arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \
333         arv7510pw_ram arv7510pw_nor arv7510pw_brn \
334         arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
335         arv7518pw_ram arv7518pw_nor arv7518pw_brn \
336         arv752dpw_ram arv752dpw_nor arv752dpw_brn \
337         arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
338         arv8539pw22_brn arv8539pw22_nor arv8539pw22_ram \
339         bthomehubv5a_ram \
340         gigasx76x_ram gigasx76x_nor \
341         acmp252_ram acmp252_nor \
342         easy50712_ram easy50712_nor easy50712_norspl \
343         easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
344         fb3370_eva fb3370_ram fb3370_sfspl \
345         p2812hnufx_ram p2812hnufx_nandspl \
346         vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
347         vgv7519_brn vgv7519_nor vgv7519_ram
348
349 define CompressVR9Firmware
350         $(STAGING_DIR_HOST)/bin/lzma e \
351                 $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
352                 $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
353 endef
354
355 define Build/Prepare
356         $(call Build/Prepare/Default)
357         mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
358         $(call CompressVR9Firmware,11g,1)
359         $(call CompressVR9Firmware,11g,2)
360         $(call CompressVR9Firmware,22f,1)
361         $(call CompressVR9Firmware,22f,2)
362 endef
363
364 ifeq ($(SUBTARGET),xway)
365   SOC:=danube
366 else
367   SOC:=vr9
368 endif
369
370 define Package/u-boot/install/uart
371         awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
372                 -v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \
373                 > $(PKG_BUILD_DIR)/ddr_settings
374         perl $(PKG_BUILD_DIR)/tools/gct.pl \
375                 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
376                 $(1)/u-boot.asc
377 endef
378
379 define Package/u-boot/install
380         $(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default))
381 endef
382
383 $(eval $(call BuildPackage/U-Boot))