uboot-lantiq: add packages for AudioCodes MP-252
[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_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 include $(INCLUDE_DIR)/package.mk
25
26 define uboot/Default
27   TITLE:=
28   SOC:=
29   DDR_SETTINGS:=
30   IMAGE:=
31 endef
32
33 define uboot/arv4519pw_ram
34   TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
35   SOC:=danube
36   DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
37 endef
38
39 define uboot/arv4519pw_nor
40   TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
41   SOC:=danube
42 endef
43
44 define uboot/arv4519pw_brn
45   TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
46   SOC:=danube
47 endef
48
49 define uboot/arv7510pw_ram
50   TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
51   SOC:=danube
52   DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
53 endef
54
55 define uboot/arv7510pw_nor
56   TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
57   SOC:=danube
58 endef
59
60 define uboot/arv7510pw_brn
61   TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
62   SOC:=danube
63 endef
64
65 define uboot/arv7518pw_ram
66   TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
67   SOC:=danube
68   DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
69 endef
70
71 define uboot/arv7518pw_nor
72   TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
73   SOC:=danube
74 endef
75
76 define uboot/arv7518pw_brn
77   TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
78   SOC:=danube
79 endef
80
81 define uboot/arv752dpw_ram
82   TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
83   SOC:=danube
84   DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
85 endef
86
87 define uboot/arv752dpw_nor
88   TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
89   SOC:=danube
90 endef
91
92 define uboot/arv752dpw_brn
93   TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
94   SOC:=danube
95 endef
96
97 define uboot/arv752dpw22_ram
98   TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
99   SOC:=danube
100   DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
101 endef
102
103 define uboot/arv752dpw22_nor
104   TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
105   SOC:=danube
106 endef
107
108 define uboot/arv752dpw22_brn
109   TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
110   SOC:=danube
111 endef
112
113 define uboot/gigasx76x_ram
114   TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
115   SOC:=danube
116   DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
117 endef
118
119 define uboot/gigasx76x_nor
120   TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
121   SOC:=danube
122 endef
123
124 define uboot/acmp252_ram
125   TITLE:=U-Boot for AudioCodes MP-252 (RAM)
126   SOC:=danube
127   DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
128 endef
129
130 define uboot/acmp252_nor
131   TITLE:=U-Boot for AudioCodes MP-252 (NOR)
132   SOC:=danube
133 endef
134
135 define uboot/easy50712_ram
136   TITLE:=U-Boot for Lantiq EASY50712 (RAM)
137   SOC:=danube
138   DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
139 endef
140
141 define uboot/easy50712_nor
142   TITLE:=U-Boot for Lantiq EASY50712 (NOR)
143   SOC:=danube
144 endef
145
146 define uboot/easy50712_norspl
147   TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
148   SOC:=danube
149   IMAGE:=u-boot.ltq.lzo.norspl
150 endef
151
152 define uboot/easy80920_ram
153   TITLE:=U-Boot for Lantiq EASY80920 (RAM)
154   SOC:=vr9
155   DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
156 endef
157
158 define uboot/easy80920_nor
159   TITLE:=U-Boot for Lantiq EASY80920 (NOR)
160   SOC:=vr9
161 endef
162
163 define uboot/easy80920_norspl
164   TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
165   SOC:=vr9
166   IMAGE:=u-boot.ltq.lzo.norspl
167 endef
168
169 define uboot/easy80920_sfspl
170   TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
171   SOC:=vr9
172   IMAGE:=u-boot.ltq.lzo.sfspl
173 endef
174
175
176 UBOOTS:= \
177         arv4519pw_ram arv4519pw_nor arv4519pw_brn \
178         arv7510pw_ram arv7510pw_nor arv7510pw_brn \
179         arv7518pw_ram arv7518pw_nor arv7518pw_brn \
180         arv752dpw_ram arv752dpw_nor arv752dpw_brn \
181         arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
182         gigasx76x_ram gigasx76x_nor \
183         acmp252_ram acmp252_nor \
184         easy50712_ram easy50712_nor easy50712_norspl \
185         easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl
186
187 define Package/uboot/template
188 define Package/uboot-lantiq-$(1)
189   SECTION:=boot
190   CATEGORY:=Boot Loaders
191   DEPENDS:=@TARGET_lantiq_xway
192   TITLE:=$(2)
193   URL:=http://www.denx.de/wiki/U-Boot
194   VARIANT:=$(1)
195   MAINTAINER:=Luka Perkov <luka@openwrt.org>
196 endef
197 endef
198
199 define BuildUBootPackage
200         $(eval $(uboot/Default))
201         $(eval $(uboot/$(1)))
202         $(call Package/uboot/template,$(1),$(TITLE))
203 endef
204
205 define Build/Configure
206         $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
207 endef
208
209 define Build/Compile
210         $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
211 endef
212
213 define Package/uboot/install/default
214         $(CP) \
215                 $(PKG_BUILD_DIR)/$(2) \
216                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
217 endef
218
219 define Package/uboot/install/uart
220         awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
221                 -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
222                 > $(PKG_BUILD_DIR)/ddr_settings
223         perl $(PKG_BUILD_DIR)/tools/gct.pl \
224                 $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
225                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
226  endef
227
228 define Package/uboot/install/template
229 define Package/uboot-lantiq-$(1)/install
230         $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
231         $(if $(DDR_SETTINGS), \
232                 $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
233         )
234 endef
235 endef
236
237 $(foreach u,$(UBOOTS), \
238         $(eval $(call BuildUBootPackage,$(u))) \
239         $(eval $(call Package/uboot/install/template,$(u))) \
240         $(eval $(call BuildPackage,uboot-lantiq-$(u))) \
241 )