2 # Copyright (C) 2012-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 http://mirror2.openwrt.org/sources \
18 ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
24 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
26 include $(INCLUDE_DIR)/package.mk
36 define uboot/arv4519pw_ram
37 TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
39 DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
40 DEPS:=@TARGET_lantiq_xway_ARV4519PW
43 define uboot/arv4519pw_nor
44 TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
46 DEPS:=@TARGET_lantiq_xway_ARV4519PW
49 define uboot/arv4519pw_brn
50 TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
52 DEPS:=@TARGET_lantiq_xway_ARV4519PW
55 define uboot/arv7510pw_ram
56 TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
58 DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
59 DEPS:=@TARGET_lantiq_xway_ARV4510PW
62 define uboot/arv7510pw_nor
63 TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
65 DEPS:=@TARGET_lantiq_xway_ARV4510PW
68 define uboot/arv7510pw_brn
69 TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
71 DEPS:=@TARGET_lantiq_xway_ARV4510PW
74 define uboot/arv7518pw_ram
75 TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
77 DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
78 DEPS:=@TARGET_lantiq_xway_ARV7518PW
81 define uboot/arv7518pw_nor
82 TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
84 DEPS:=@TARGET_lantiq_xway_ARV7518PW
87 define uboot/arv7518pw_brn
88 TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
90 DEPS:=@TARGET_lantiq_xway_ARV7518PW
93 define uboot/arv752dpw_ram
94 TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
96 DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
97 DEPS:=@TARGET_lantiq_xway_ARV752DPW
100 define uboot/arv752dpw_nor
101 TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
103 DEPS:=@TARGET_lantiq_xway_ARV752DPW
106 define uboot/arv752dpw_brn
107 TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
109 DEPS:=@TARGET_lantiq_xway_ARV752DPW
112 define uboot/arv752dpw22_ram
113 TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
115 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
116 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
119 define uboot/arv752dpw22_nor
120 TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
122 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
125 define uboot/arv752dpw22_brn
126 TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
128 DEPS:=@TARGET_lantiq_xway_ARV752DPW22
131 define uboot/gigasx76x_ram
132 TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
134 DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
135 DEPS:=@TARGET_lantiq_xway_GIGASX76X
138 define uboot/gigasx76x_nor
139 TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
141 DEPS:=@TARGET_lantiq_xway_GIGASX76X
144 define uboot/acmp252_ram
145 TITLE:=U-Boot for AudioCodes MP-252 (RAM)
147 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
148 DEPS:=@TARGET_lantiq_xway_ACMP252
151 define uboot/acmp252_nor
152 TITLE:=U-Boot for AudioCodes MP-252 (NOR)
154 DEPS:=@TARGET_lantiq_xway_ACMP252
157 define uboot/easy50712_ram
158 TITLE:=U-Boot for Lantiq EASY50712 (RAM)
160 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
161 DEPS:=@TARGET_lantiq_xway_EASY50712
164 define uboot/easy50712_nor
165 TITLE:=U-Boot for Lantiq EASY50712 (NOR)
167 DEPS:=@TARGET_lantiq_xway_EASY50712
170 define uboot/easy50712_norspl
171 TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
173 IMAGE:=u-boot.ltq.lzo.norspl
174 DEPS:=@TARGET_lantiq_xway_EASY50712
177 define uboot/easy80920_ram
178 TITLE:=U-Boot for Lantiq EASY80920 (RAM)
180 DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
181 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
184 define uboot/easy80920_nor
185 TITLE:=U-Boot for Lantiq EASY80920 (NOR)
187 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
190 define uboot/easy80920_norspl
191 TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
193 IMAGE:=u-boot.ltq.lzo.norspl
194 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
197 define uboot/easy80920_sfspl
198 TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
200 IMAGE:=u-boot.ltq.lzo.sfspl
201 DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
204 define uboot/fb3370_eva
205 TITLE:=U-Boot for AVM FRITZ3370 (EVA)
207 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
210 define uboot/fb3370_ram
211 TITLE:=U-Boot for AVM FRITZ3370 (RAM)
213 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
214 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
217 define uboot/fb3370_sfspl
218 TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
220 IMAGE:=u-boot.ltq.lzo.sfspl
221 DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
224 define uboot/p2812hnufx_ram
225 TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
227 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
228 DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
231 define uboot/p2812hnufx_nandspl
232 TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
234 IMAGE:=u-boot.ltq.lzo.nandspl
235 DEPS:=@TARGET_lantiq_xrx200_P2812HNUFX
240 arv4519pw_ram arv4519pw_nor arv4519pw_brn \
241 arv7510pw_ram arv7510pw_nor arv7510pw_brn \
242 arv7518pw_ram arv7518pw_nor arv7518pw_brn \
243 arv752dpw_ram arv752dpw_nor arv752dpw_brn \
244 arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
245 gigasx76x_ram gigasx76x_nor \
246 acmp252_ram acmp252_nor \
247 easy50712_ram easy50712_nor easy50712_norspl \
248 easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
249 fb3370_eva fb3370_ram fb3370_sfspl \
250 p2812hnufx_ram p2812hnufx_nandspl
252 define Package/uboot/template
253 define Package/uboot-lantiq-$(1)
255 CATEGORY:=Boot Loaders
258 URL:=http://www.denx.de/wiki/U-Boot
260 MAINTAINER:=Luka Perkov <luka@openwrt.org>
264 define BuildUBootPackage
265 $(eval $(uboot/Default))
266 $(eval $(uboot/$(1)))
267 DEPS:=$(uboot/$(1)/DEPS)
268 $(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
271 define CopyVR9Firmware
272 $(CP) $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
273 $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
277 $(call Build/Prepare/Default)
278 mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
279 $(call CopyVR9Firmware,11g,1)
280 $(call CopyVR9Firmware,11g,2)
281 $(call CopyVR9Firmware,22f,1)
282 $(call CopyVR9Firmware,22f,2)
285 define Build/Configure
286 $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
290 $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
293 define Package/uboot/install/default
295 $(PKG_BUILD_DIR)/$(2) \
296 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
299 define Package/uboot/install/uart
300 awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
301 -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
302 > $(PKG_BUILD_DIR)/ddr_settings
303 perl $(PKG_BUILD_DIR)/tools/gct.pl \
304 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
305 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
308 define Package/uboot/install/template
309 define Package/uboot-lantiq-$(1)/install
310 $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
311 $(if $(DDR_SETTINGS), \
312 $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
317 $(foreach u,$(UBOOTS), \
318 $(eval $(call BuildUBootPackage,$(u))) \
319 $(eval $(call Package/uboot/install/template,$(u))) \
320 $(eval $(call BuildPackage,uboot-lantiq-$(u))) \