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
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
24 include $(INCLUDE_DIR)/package.mk
33 define uboot/arv4519pw_ram
34 TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
36 DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
39 define uboot/arv4519pw_nor
40 TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
44 define uboot/arv7518pw_ram
45 TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
47 DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
50 define uboot/arv7518pw_nor
51 TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
55 define uboot/gigasx76x_ram
56 TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
58 DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
61 define uboot/gigasx76x_nor
62 TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
66 define uboot/easy50712_ram
67 TITLE:=U-Boot for Lantiq EASY50712 (RAM)
69 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
72 define uboot/easy50712_nor
73 TITLE:=U-Boot for Lantiq EASY50712 (NOR)
77 define uboot/easy50712_norspl
78 TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
80 IMAGE:=u-boot.ltq.lzo.norspl
83 define uboot/easy80920_ram
84 TITLE:=U-Boot for Lantiq EASY80920 (RAM)
86 DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
89 define uboot/easy80920_nor
90 TITLE:=U-Boot for Lantiq EASY80920 (NOR)
94 define uboot/easy80920_norspl
95 TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
97 IMAGE:=u-boot.ltq.lzo.norspl
100 define uboot/easy80920_sfspl
101 TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
103 IMAGE:=u-boot.ltq.lzo.sfspl
108 arv4519pw_ram arv4519pw_nor \
109 arv7518pw_ram arv7518pw_nor \
110 gigasx76x_ram gigasx76x_nor \
111 easy50712_ram easy50712_nor easy50712_norspl \
112 easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl
114 define Package/uboot/template
115 define Package/uboot-lantiq-$(1)
117 CATEGORY:=Boot Loaders
118 DEPENDS:=@TARGET_lantiq_xway
120 URL:=http://www.denx.de/wiki/U-Boot
122 MAINTAINER:=Luka Perkov <luka@openwrt.org>
126 define BuildUBootPackage
127 $(eval $(uboot/Default))
128 $(eval $(uboot/$(1)))
129 $(call Package/uboot/template,$(1),$(TITLE))
132 define Build/Configure
133 $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
137 $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
140 define Package/uboot/install/default
142 $(PKG_BUILD_DIR)/$(2) \
143 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
146 define Package/uboot/install/uart
147 awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
148 -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
149 > $(PKG_BUILD_DIR)/ddr_settings
150 perl $(PKG_BUILD_DIR)/tools/gct.pl \
151 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
152 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
155 define Package/uboot/install/template
156 define Package/uboot-lantiq-$(1)/install
157 $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
158 $(if $(DDR_SETTINGS), \
159 $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
164 $(foreach u,$(UBOOTS), \
165 $(eval $(call BuildUBootPackage,$(u))) \
166 $(eval $(call Package/uboot/install/template,$(u))) \
167 $(eval $(call BuildPackage,uboot-lantiq-$(u))) \