layerscape: add 64b/32b target for ls1043ardb device
[openwrt/openwrt.git] / package / boot / uboot-layerscape / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
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 include $(INCLUDE_DIR)/image.mk
10
11 PKG_NAME:=fsl-sdk
12 PKG_VERSION:=v2.0
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14 PKG_SOURCE_URL:= \
15 http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot
16 PKG_MD5SUM:=14f7ccc757bfa71c9b7fd68d24051231
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot_$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20 PKG_LICENSE:=GPL-2.0 GPL-2.0+
21 PKG_LICENSE_FILES:=Licenses/README
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define uboot/Default
26 TITLE:=
27 CONFIG:=
28 IMAGE:=
29 endef
30
31 define uboot/ls1043ardb
32 TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board
33 CONFIG=ls1043ardb
34 endef
35
36 UBOOTS := \
37 ls1043ardb
38
39 define Package/uboot/template
40 define Package/uboot-layerscape-64b-$(1)
41 SECTION:=boot
42 CATEGORY:=Boot Loaders
43 DEPENDS:= @TARGET_layerscape_64b
44 TITLE:=$(2)
45 URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot
46 VARIANT:=$(1)
47 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
48 endef
49 endef
50
51 define BuildUBootPackage
52 $(eval $(uboot/Default))
53 $(eval $(uboot/$(1)))
54 $(call Package/uboot/template,$(1),$(TITLE))
55 endef
56
57 ifdef BUILD_VARIANT
58 $(eval $(call uboot/$(BUILD_VARIANT)))
59 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
60 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin)
61 endif
62
63 define Build/Configure
64 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
65 $(UBOOT_CONFIG)_config
66 endef
67
68 define Build/Compile
69 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
70 CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc
71 endef
72
73 define Package/uboot/install/default
74 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin
75 endef
76
77 define Package/uboot/install/template
78 define Package/uboot-layerscape-64b-$(1)/install
79 $(call Package/uboot/install/default,$(2))
80 endef
81 endef
82
83 $(foreach u,$(UBOOTS), \
84 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
85 )
86
87 $(foreach u,$(UBOOTS), \
88 $(eval $(call BuildUBootPackage,$(u))) \
89 $(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \
90 )