uboot-kirkwood: update to 2013.10
[openwrt/openwrt.git] / package / boot / uboot-kirkwood / Makefile
1 #
2 # Copyright (C) 2010-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_PARALLEL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define uboot/Default
27 TITLE:=
28 CONFIG:=
29 IMAGE:=
30 endef
31
32 define uboot/dockstar
33 TITLE:=U-Boot for Seagate DockStar
34 endef
35
36 define uboot/dockstar_second_stage
37 TITLE:=second stage U-Boot for Seagate DockStar
38 endef
39
40 define uboot/ib62x0
41 TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
42 endef
43
44 define uboot/ib62x0_second_stage
45 TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
46 endef
47
48 define uboot/iconnect
49 TITLE:=U-Boot for Iomega iConnect Wireless
50 endef
51
52 define uboot/iconnect_second_stage
53 TITLE:=second stage U-Boot for Iomega iConnect Wireless
54 endef
55
56 define uboot/pogo_e02
57 TITLE:=U-Boot for Cloud Engines Pogoplug E02
58 endef
59
60 define uboot/sheevaplug
61 TITLE:=U-Boot for SheevaPlug
62 endef
63
64 UBOOTS:= \
65 dockstar dockstar_second_stage \
66 ib62x0 ib62x0_second_stage \
67 iconnect iconnect_second_stage \
68 pogo_e02 \
69 sheevaplug
70
71 define Package/uboot/template
72 define Package/uboot-kirkwood-$(1)
73 SECTION:=boot
74 CATEGORY:=Boot Loaders
75 DEPENDS:=@TARGET_kirkwood
76 TITLE:=$(2)
77 URL:=http://www.denx.de/wiki/U-Boot
78 VARIANT:=$(1)
79 endef
80 endef
81
82 define BuildUBootPackage
83 $(eval $(uboot/Default))
84 $(eval $(uboot/$(1)))
85 $(call Package/uboot/template,$(1),$(TITLE))
86 endef
87
88 ifdef BUILD_VARIANT
89 $(eval $(call uboot/$(BUILD_VARIANT)))
90 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
91 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
92 endif
93
94 define Build/Configure
95 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
96 $(UBOOT_CONFIG)_config
97 endef
98
99 define Build/Compile
100 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
101 u-boot.kwb \
102 CROSS_COMPILE=$(TARGET_CROSS)
103 mkimage -A $(ARCH) -O linux -T kernel -C none \
104 -a 0x600000 -e 0x600000 \
105 -n 'OpenWrt Das U-Boot uImage' \
106 -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
107 endef
108
109 define Package/uboot/install/default
110 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
111 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
112 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
113 $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
114 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
115 $(CP) $(PKG_BUILD_DIR)/u-boot.img \
116 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
117 $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
118 $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
119 $(BIN_DIR)/u-boot-kwboot/
120 endef
121
122 define Package/uboot/install/template
123 define Package/uboot-kirkwood-$(1)/install
124 $(call Package/uboot/install/default,$(2))
125 endef
126 endef
127
128 $(foreach u,$(UBOOTS), \
129 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
130 )
131
132 $(foreach u,$(UBOOTS), \
133 $(eval $(call BuildUBootPackage,$(u))) \
134 $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
135 )