Add Zyxel P-2812HNU-Fx images
[openwrt/staging/chunkeey.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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:= \
17 http://mirror2.openwrt.org/sources \
18 ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
20 PKG_TARGETS:=bin
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
23
24 PKG_BUILD_PARALLEL:=1
25
26 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define uboot/Default
31 TITLE:=
32 SOC:=
33 DDR_SETTINGS:=
34 IMAGE:=
35 DEPS:=
36 endef
37
38 define uboot/arv4519pw_ram
39 TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
40 SOC:=danube
41 DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
42 DEPS:=@TARGET_lantiq_xway_ARV4519PW
43 endef
44
45 define uboot/arv4519pw_nor
46 TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
47 SOC:=danube
48 DEPS:=@TARGET_lantiq_xway_ARV4519PW
49 endef
50
51 define uboot/arv4519pw_brn
52 TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
53 SOC:=danube
54 DEPS:=@TARGET_lantiq_xway_ARV4519PW
55 endef
56
57 define uboot/arv7510pw_ram
58 TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
59 SOC:=danube
60 DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
61 DEPS:=@TARGET_lantiq_xway_ARV4510PW
62 endef
63
64 define uboot/arv7510pw_nor
65 TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
66 SOC:=danube
67 DEPS:=@TARGET_lantiq_xway_ARV4510PW
68 endef
69
70 define uboot/arv7510pw_brn
71 TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
72 SOC:=danube
73 DEPS:=@TARGET_lantiq_xway_ARV4510PW
74 endef
75
76 define uboot/arv7518pw_ram
77 TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
78 SOC:=danube
79 DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
80 DEPS:=@TARGET_lantiq_xway_ARV7518PW
81 endef
82
83 define uboot/arv7518pw_nor
84 TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
85 SOC:=danube
86 DEPS:=@TARGET_lantiq_xway_ARV7518PW
87 endef
88
89 define uboot/arv7518pw_brn
90 TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
91 SOC:=danube
92 DEPS:=@TARGET_lantiq_xway_ARV7518PW
93 endef
94
95 define uboot/arv752dpw_ram
96 TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
97 SOC:=danube
98 DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
99 DEPS:=@TARGET_lantiq_xway_ARV752DPW
100 endef
101
102 define uboot/arv752dpw_nor
103 TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
104 SOC:=danube
105 DEPS:=@TARGET_lantiq_xway_ARV752DPW
106 endef
107
108 define uboot/arv752dpw_brn
109 TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
110 SOC:=danube
111 DEPS:=@TARGET_lantiq_xway_ARV752DPW
112 endef
113
114 define uboot/arv752dpw22_ram
115 TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
116 SOC:=danube
117 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
118 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
119 endef
120
121 define uboot/arv752dpw22_nor
122 TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
123 SOC:=danube
124 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
125 endef
126
127 define uboot/arv752dpw22_brn
128 TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
129 SOC:=danube
130 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
131 endef
132
133 define uboot/gigasx76x_ram
134 TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
135 SOC:=danube
136 DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
137 DEPS:=@TARGET_lantiq_xway_GIGASX76X
138 endef
139
140 define uboot/gigasx76x_nor
141 TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
142 SOC:=danube
143 DEPS:=@TARGET_lantiq_xway_GIGASX76X
144 endef
145
146 define uboot/acmp252_ram
147 TITLE:=U-Boot for AudioCodes MP-252 (RAM)
148 SOC:=danube
149 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
150 DEPS:=@TARGET_lantiq_xway_ACMP252
151 endef
152
153 define uboot/acmp252_nor
154 TITLE:=U-Boot for AudioCodes MP-252 (NOR)
155 SOC:=danube
156 DEPS:=@TARGET_lantiq_xway_ACMP252
157 endef
158
159 define uboot/easy50712_ram
160 TITLE:=U-Boot for Lantiq EASY50712 (RAM)
161 SOC:=danube
162 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
163 DEPS:=@TARGET_lantiq_xway_EASY50712
164 endef
165
166 define uboot/easy50712_nor
167 TITLE:=U-Boot for Lantiq EASY50712 (NOR)
168 SOC:=danube
169 DEPS:=@TARGET_lantiq_xway_EASY50712
170 endef
171
172 define uboot/easy50712_norspl
173 TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
174 SOC:=danube
175 IMAGE:=u-boot.ltq.lzo.norspl
176 DEPS:=@TARGET_lantiq_xway_EASY50712
177 endef
178
179 define uboot/easy80920_ram
180 TITLE:=U-Boot for Lantiq EASY80920 (RAM)
181 SOC:=vr9
182 DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
183 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
184 endef
185
186 define uboot/easy80920_nor
187 TITLE:=U-Boot for Lantiq EASY80920 (NOR)
188 SOC:=vr9
189 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
190 endef
191
192 define uboot/easy80920_norspl
193 TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
194 SOC:=vr9
195 IMAGE:=u-boot.ltq.lzo.norspl
196 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
197 endef
198
199 define uboot/easy80920_sfspl
200 TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
201 SOC:=vr9
202 IMAGE:=u-boot.ltq.lzo.sfspl
203 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
204 endef
205
206 define uboot/fb3370_eva
207 TITLE:=U-Boot for AVM FRITZ3370 (EVA)
208 SOC:=vr9
209 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
210 endef
211
212 define uboot/fb3370_ram
213 TITLE:=U-Boot for AVM FRITZ3370 (RAM)
214 SOC:=vr9
215 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
216 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
217 endef
218
219 define uboot/fb3370_sfspl
220 TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
221 SOC:=vr9
222 IMAGE:=u-boot.ltq.lzo.sfspl
223 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
224 endef
225
226 define uboot/p2812hnufx_ram
227 TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
228 SOC:=vr9
229 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
230 DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
231 endef
232
233 define uboot/p2812hnufx_nandspl
234 TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
235 SOC:=vr9
236 IMAGE:=u-boot.ltq.lzo.nandspl
237 DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
238 endef
239
240
241 UBOOTS:= \
242 arv4519pw_ram arv4519pw_nor arv4519pw_brn \
243 arv7510pw_ram arv7510pw_nor arv7510pw_brn \
244 arv7518pw_ram arv7518pw_nor arv7518pw_brn \
245 arv752dpw_ram arv752dpw_nor arv752dpw_brn \
246 arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
247 gigasx76x_ram gigasx76x_nor \
248 acmp252_ram acmp252_nor \
249 easy50712_ram easy50712_nor easy50712_norspl \
250 easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
251 fb3370_eva fb3370_ram fb3370_sfspl \
252 p2812hnufx_ram p2812hnufx_nandspl
253
254 define Package/uboot/template
255 define Package/uboot-lantiq-$(1)
256 SECTION:=boot
257 CATEGORY:=Boot Loaders
258 DEPENDS:=$(3)
259 TITLE:=$(2)
260 URL:=http://www.denx.de/wiki/U-Boot
261 VARIANT:=$(1)
262 MAINTAINER:=Luka Perkov <luka@openwrt.org>
263 endef
264 endef
265
266 define BuildUBootPackage
267 $(eval $(uboot/Default))
268 $(eval $(uboot/$(1)))
269 DEPS:=$(uboot/$(1)/DEPS)
270 $(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
271 endef
272
273 define CopyVR9Firmware
274 $(CP) $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
275 $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
276 endef
277
278 define Build/Prepare
279 $(call Build/Prepare/Default)
280 mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
281 $(call CopyVR9Firmware,11g,1)
282 $(call CopyVR9Firmware,11g,2)
283 $(call CopyVR9Firmware,22f,1)
284 $(call CopyVR9Firmware,22f,2)
285 endef
286
287 define Build/Configure
288 $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
289 endef
290
291 define Build/Compile
292 $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
293 endef
294
295 define Package/uboot/install/default
296 $(CP) \
297 $(PKG_BUILD_DIR)/$(2) \
298 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
299 endef
300
301 define Package/uboot/install/uart
302 awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
303 -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
304 > $(PKG_BUILD_DIR)/ddr_settings
305 perl $(PKG_BUILD_DIR)/tools/gct.pl \
306 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
307 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
308 endef
309
310 define Package/uboot/install/template
311 define Package/uboot-lantiq-$(1)/install
312 $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
313 $(if $(DDR_SETTINGS), \
314 $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
315 )
316 endef
317 endef
318
319 $(foreach u,$(UBOOTS), \
320 $(eval $(call BuildUBootPackage,$(u))) \
321 $(eval $(call Package/uboot/install/template,$(u))) \
322 $(eval $(call BuildPackage,uboot-lantiq-$(u))) \
323 )