kirkwood: use the generic board detect
[openwrt/staging/chunkeey.git] / package / boot / uboot-kirkwood / Makefile
1 #
2 # Copyright (C) 2010-2014 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_VERSION:=2017.09
11 PKG_RELEASE:=1
12
13 PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744
14
15 include $(INCLUDE_DIR)/u-boot.mk
16 include $(INCLUDE_DIR)/package.mk
17
18 define U-Boot/Default
19 BUILD_TARGET:=kirkwood
20 BUILD_DEVICES:=$(patsubst %_second_stage,%,$(1))
21 endef
22
23 define U-Boot/dockstar
24 NAME:=Seagate DockStar
25 endef
26
27 define U-Boot/dockstar_second_stage
28 NAME:=Seagate DockStar (second stage)
29 endef
30
31 define U-Boot/goflexhome
32 NAME:=the Seagate GoFlexHome/GoFlexNet
33 BUILD_DEVICES+=goflexnet
34 endef
35
36 define U-Boot/ib62x0
37 NAME:=RaidSonic ICY BOX NAS6210 and NAS6220
38 endef
39
40 define U-Boot/ib62x0_second_stage
41 NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage)
42 endef
43
44 define U-Boot/iconnect
45 NAME:=Iomega iConnect Wireless
46 endef
47
48 define U-Boot/iconnect_second_stage
49 NAME:=Iomega iConnect Wireless (second stage)
50 endef
51
52 define U-Boot/nsa310
53 NAME:=Zyxel NSA310
54 BUILD_DEVICES:=nsa310b
55 endef
56
57 define U-Boot/nsa325
58 NAME:=Zyxel NSA325v1 and v2
59 endef
60
61 define U-Boot/pogo_e02
62 NAME:=Cloud Engines Pogoplug E02
63 endef
64
65 define U-Boot/pogo_e02_second_stage
66 NAME:=Cloud Engines Pogoplug E02 (second stage)
67 endef
68
69 UBOOT_TARGETS := \
70 dockstar dockstar_second_stage \
71 goflexhome \
72 ib62x0 ib62x0_second_stage \
73 iconnect iconnect_second_stage \
74 nsa310 \
75 nsa325 \
76 pogo_e02 pogo_e02_second_stage
77
78 define Build/Configure
79 $(if $(findstring _second_stage,$(BUILD_VARIANT)),
80 $(CP) \
81 $(PKG_BUILD_DIR)/configs/$(subst _second_stage,,$(BUILD_VARIANT))_defconfig \
82 $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
83 echo CONFIG_SECOND_STAGE=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
84 )
85 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
86 $(BUILD_VARIANT)_config V=1
87 endef
88
89 define Build/Compile
90 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
91 u-boot.kwb \
92 CROSS_COMPILE=$(TARGET_CROSS)
93 mkimage -A $(ARCH) -O linux -T kernel -C none \
94 -a 0x600000 -e 0x600000 \
95 -n 'U-Boot uImage' \
96 -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
97 endef
98
99 define Package/u-boot/install
100 $(CP) \
101 $(PKG_BUILD_DIR)/u-boot.bin \
102 $(PKG_BUILD_DIR)/u-boot.kwb \
103 $(PKG_BUILD_DIR)/u-boot.img \
104 $(1)/
105 endef
106
107 define Build/InstallDev
108 $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
109 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/
110 endef
111
112 $(eval $(call BuildPackage/U-Boot))