c2b6e75b0e2ba2af4e5a13a3fc1282fdff19e182
[openwrt/openwrt.git] / package / boot / uboot-layerscape-armv8_32b / 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
10 PKG_NAME:=uboot-layerscape-armv8_32b
11 PKG_VERSION:=lsdk-1806
12 PKG_RELEASE:=1
13
14 # Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit
15 # kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets,
16 # 64-bit u-boot images git tree is provided here whose source code actually is
17 # uboot-layerscape's source code.
18 PKG_SOURCE_PROTO:=git
19 PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git
20 PKG_SOURCE_VERSION:=a2a01facee0918bf724b4f0aec6746e2f1271519
21 PKG_MIRROR_HASH:=5fcb58c14cdc934793ff315e178ad1d9d2ff55fcaac394b48ec116d1b11ca324
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/uboot-layerscape-armv8_32b/Config
26 define Package/u-boot-$(1)-image
27 SECTION:=boot
28 CATEGORY:=Boot Loaders
29 TITLE:=$(2)
30 DEPENDS:=@TARGET_layerscape_armv8_32b
31 CONFIG:=$(3)
32 ENV_SIZE:=$(4)
33 endef
34 endef
35
36 define Package/uboot-layerscape-armv8_32b/ls1012ardb
37 TITLE:=U-Boot image for NXP LS1012ARDB
38 CONFIG:=ls1012ardb-uboot.bin
39 ENV_SIZE:=0x40000
40 endef
41
42 define Package/uboot-layerscape-armv8_32b/ls1012afrwy
43 TITLE:=U-Boot image for NXP LS1012FRWY
44 CONFIG:=ls1012afrwy-uboot.bin
45 ENV_SIZE:=0x10000
46 endef
47
48 define Package/uboot-layerscape-armv8_32b/ls1043ardb
49 TITLE:=U-Boot image for NXP LS1043ARDB
50 CONFIG:=ls1043ardb-uboot.bin
51 ENV_SIZE:=0x20000
52 endef
53
54 define Package/uboot-layerscape-armv8_32b/ls1046ardb
55 TITLE:=U-Boot image for NXP LS1046ARDB
56 CONFIG:=ls1046ardb-uboot.bin
57 ENV_SIZE:=0x2000
58 endef
59
60 define Build/Compile
61 endef
62
63 define Package/uboot-layerscape-armv8_32b/Install
64 define Package/u-boot-$(1)-image/install
65 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
66 $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/
67 $(PKG_BUILD_DIR)/tools/mkenvimage -s $(ENV_SIZE) \
68 -o $(STAGING_DIR_IMAGE)/$(1)-uboot-env.bin \
69 ../uboot-layerscape/files/$(1)-uEnv.txt
70 endef
71 endef
72
73 UBOOTS := \
74 ls1012ardb \
75 ls1012afrwy \
76 ls1043ardb \
77 ls1046ardb
78
79 $(foreach u,$(UBOOTS), \
80 $(eval $(Package/uboot-layerscape-armv8_32b/$(u))) \
81 $(eval $(call Package/uboot-layerscape-armv8_32b/Config,$(u),$(TITLE),$(CONFIG),$(ENV_SIZE))) \
82 $(eval $(call Package/uboot-layerscape-armv8_32b/Install,$(u))) \
83 $(eval $(call BuildPackage,u-boot-$(u)-image)) \
84 )