191d108771eaa25b9ae7b09809d4e3d3c6c72cd8
[openwrt/openwrt.git] / package / boot / uboot-tegra / Makefile
1 #
2 # Copyright (C) 2017-2019 Tomasz Maciej Nowak <tomek_n@o2.pl>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_VERSION := 2019.01
10 PKG_RELEASE := 1
11
12 PKG_HASH := 50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22
13
14 PKG_MAINTAINER := Tomasz Maciej Nowak <tomek_n@o2.pl>
15
16 include $(INCLUDE_DIR)/u-boot.mk
17 include $(INCLUDE_DIR)/package.mk
18
19 define U-Boot/Default
20 BUILD_TARGET := tegra
21 HIDDEN := y
22 endef
23
24 define U-Boot/trimslice
25 NAME := CompuLab TrimSlice
26 BUILD_DEVICES := trimslice
27 UBOOT_IMAGE := trimslice-mmc.img trimslice-spi.img
28 SOC := tegra20
29 VENDOR := compulab
30 endef
31
32 UBOOT_TARGETS := trimslice
33
34 define Build/bct-image
35 $(CP) $(PKG_BUILD_DIR)/u-boot-dtb-tegra.bin $(PKG_BUILD_DIR)/u-boot.bin
36 $(foreach bct,$(basename $(UBOOT_IMAGE)), \
37 cd $(PKG_BUILD_DIR); \
38 cbootimage -s $(SOC) -gbct \
39 $(STAGING_DIR_HOST)/share/cbootimage-configs/$(SOC)/$(VENDOR)/$(VARIANT)/$(bct).bct.cfg \
40 $(bct).bct; \
41 cbootimage -s $(SOC) \
42 $(STAGING_DIR_HOST)/share/cbootimage-configs/$(SOC)/$(VENDOR)/$(VARIANT)/$(bct).img.cfg \
43 $(PKG_BUILD_DIR)/$(bct).img; \
44 rm -f $(bct).bct; \
45 )
46 endef
47
48 define Build/Configure
49 sed '/select BINMAN/d' -i $(PKG_BUILD_DIR)/arch/arm/mach-tegra/Kconfig
50 $(call Build/Configure/U-Boot)
51 endef
52
53 define Build/Compile
54 $(call Build/Compile/U-Boot)
55 $(call Build/bct-image)
56 endef
57
58 define Build/InstallDev
59 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
60 $(foreach img,$(UBOOT_IMAGE), \
61 $(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/;)
62 endef
63
64 $(eval $(call BuildPackage/U-Boot))