imgtec-ci20: genimage config/ u-boot env
[openadk.git] / package / u-boot / Makefile
blobba64d735602d02e0f0e6ae92d94ae3573fea7564
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
6 PKG_NAME:= u-boot
7 PKG_VERSION:= 2024.07
8 PKG_RELEASE:= 1
9 PKG_HASH:= f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f
10 PKG_DESCR:= portable bootloader
11 PKG_SECTION:= base/boot
12 HOST_BUILDDEP:= openssl-host dtc-host swig-host python3-host python-setuptools-host
13 PKG_BUILDDEP:= python3-host python-setuptools-host swig-host u-boot-host
14 PKG_URL:= http://www.denx.de/wiki/U-Boot
15 PKG_SITES:= ftp://ftp.denx.de/pub/u-boot/
17 DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_SYSTEM_DEPENDS:= banana-p2-zero beaglebone-black orange-pi0 raspberry-pi raspberry-pi2 raspberry-pi3 banana-pro solidrun-imx6 solidrun-clearfog raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64 rockpi4-plus phytec-imx6 pcduino-3b imgtec-ci20 st-stm32f746g starfive-visionfive2
21 include $(ADK_TOPDIR)/mk/host.mk
22 include $(ADK_TOPDIR)/mk/package.mk
24 $(eval $(call HOST_template,U_BOOT,u-boot,$(PKG_VERSION)-$(PKG_RELEASE)))
25 $(eval $(call PKG_template,U_BOOT,u-boot,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
27 UBOOT:= u-boot.bin
28 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG),y)
29 CONFIG:= clearfog_defconfig
30 UBOOT:= u-boot-with-spl.kwb
31 endif
32 ifeq ($(ADK_TARGET_SYSTEM_PHYTEC_IMX6),y)
33 CONFIG:= pcm058_defconfig
34 UBOOT:= u-boot.img
35 endif
36 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
37 CONFIG:= mx6cuboxi_defconfig
38 UBOOT:= u-boot.img
39 endif
40 ifeq ($(ADK_TARGET_SYSTEM_PCDUINO_3B),y)
41 CONFIG:= Linksprite_pcDuino3_defconfig
42 endif
43 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
44 CONFIG:= rpi_defconfig
45 endif
46 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
47 CONFIG:= rpi_defconfig
48 endif
49 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3),y)
50 CONFIG:= rpi_3_32b_defconfig
51 endif
52 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P),y)
53 CONFIG:= rpi_3_32b_defconfig
54 endif
55 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64),y)
56 CONFIG:= rpi_3_defconfig
57 endif
58 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64),y)
59 CONFIG:= rpi_3_defconfig
60 endif
61 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y)
62 CONFIG:= rock-pi-4-rk3399_defconfig
63 UBOOT:= u-boot.itb
64 endif
65 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
66 CONFIG:= Bananapro_defconfig
67 UBOOT:= u-boot-sunxi-with-spl.bin
68 endif
69 ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
70 CONFIG:= bananapi_m2_p2_zero_defconfig
71 UBOOT:= u-boot-sunxi-with-spl.bin
72 endif
73 ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
74 CONFIG:= orangepi_zero_defconfig
75 UBOOT:= u-boot-sunxi-with-spl.bin
76 endif
77 ifeq ($(ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK),y)
78 CONFIG:= am335x_evm_defconfig
79 UBOOT:= u-boot.img
80 endif
81 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20),y)
82 CONFIG:= ci20_mmc_defconfig
83 UBOOT:= u-boot-dtb.img
84 endif
85 ifeq ($(ADK_TARGET_SYSTEM_ST_STM32F746G),y)
86 CONFIG:= stm32f746-disco_defconfig
87 UBOOT:= u-boot-dtb.bin
88 endif
89 ifeq ($(ADK_TARGET_SYSTEM_STARFIVE_VISIONFIVE2),y)
90 CONFIG:= starfive_visionfive2_defconfig
91 UBOOT:= u-boot.itb
92 endif
94 HOST_MAKE_FLAGS+= HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" \
95 HOSTLDFLAGS="$(HOST_LDFLAGS) -ldl"
96 HOST_STYLE:= manual
97 CONFIG_STYLE:= manual
98 BUILD_STYLE:= manual
99 INSTALL_STYLE:= manual
101 ifeq ($(ADK_TARGET_BINFMT_FDPIC),y)
102 EXTRA_CFLAGS:= -mno-fdpic
103 endif
105 host-build:
106 (cd $(WRKBUILD) && env $(HOST_MAKE_ENV) $(MAKE) -f $(MAKE_FILE) \
107 $(HOST_MAKE_FLAGS) sandbox_defconfig )
108 (cd $(WRKBUILD) && env $(HOST_MAKE_ENV) $(MAKE) -f $(MAKE_FILE) \
109 $(HOST_MAKE_FLAGS) tools $(MAKE_TRACE) )
111 u-boot-hostinstall:
112 $(INSTALL_BIN) $(WRKBUILD)/tools/mk{,env}image \
113 $(STAGING_HOST_DIR)/usr/bin
115 do-configure:
116 (cd $(WRKBUILD) && PATH='$(HOST_PATH)' $(MAKE) $(CONFIG))
118 do-build:
119 (cd $(WRKBUILD) && env \
120 PKG_CONFIG="$(STAGING_HOST_DIR)/usr/bin/pkg-config" \
121 PKG_CONFIG_LIBDIR="$(STAGING_HOST_DIR)/lib/pkgconfig:$(STAGING_HOST_DIR)/share/pkgconfig" \
122 KBUILD_VERBOSE=1 \
123 KCFLAGS='$(EXTRA_CFLAGS)' \
124 PATH='$(HOST_PATH)' \
125 CROSS_COMPILE='$(TARGET_CROSS)' \
126 OPENSBI="$(FW_DIR)/fw_dynamic.bin" \
127 $(MAKE))
128 (cd $(WRKBUILD) && env \
129 PATH='$(HOST_PATH)' \
130 CROSS_COMPILE='$(TARGET_CROSS)' \
131 $(MAKE) envtools)
133 u-boot-install:
134 $(CP) $(WRKBUILD)/$(UBOOT) $(FW_DIR)
135 $(INSTALL_DIR) $(IDIR_U_BOOT)/etc
136 $(CP) ./files/fw_env.config $(IDIR_U_BOOT)/etc
137 $(INSTALL_DIR) $(IDIR_U_BOOT)/usr/bin
138 $(INSTALL_BIN) $(WRKBUILD)/tools/env/fw_printenv \
139 $(IDIR_U_BOOT)/usr/bin
140 cd $(IDIR_U_BOOT)/usr/bin && ln -fs fw_printenv fw_setenv
141 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y)
142 $(CP) $(WRKBUILD)/idbloader.img $(FW_DIR)
143 endif
144 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20),y)
145 $(CP) $(WRKBUILD)/spl/u-boot-spl.bin $(FW_DIR)
146 cat ./files/uboot-env.txt.ci20 | PATH='$(HOST_PATH)' mkenvimage -s "32768" -o $(FW_DIR)/uboot-env.bin -
147 endif
148 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
149 $(INSTALL_BIN) ./files/boot.script.bpi $(FW_DIR)
150 endif
151 ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO),y)
152 $(INSTALL_BIN) ./files/boot.script.bpizero $(FW_DIR)
153 endif
154 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y)
155 $(INSTALL_BIN) ./files/boot.script.rockpi4 $(FW_DIR)
156 endif
157 ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0),y)
158 $(INSTALL_BIN) ./files/boot.script.opi $(FW_DIR)
159 endif
160 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG),y)
161 $(INSTALL_BIN) ./files/boot.script.clearfog $(FW_DIR)
162 endif
163 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
164 $(INSTALL_BIN) $(WRKBUILD)/SPL $(FW_DIR)
165 $(INSTALL_BIN) ./files/boot.script.imx6 $(FW_DIR)
166 endif
167 ifeq ($(ADK_TARGET_SYSTEM_PHYTEC_IMX6),y)
168 $(INSTALL_BIN) $(WRKBUILD)/SPL $(FW_DIR)
169 $(INSTALL_BIN) ./files/boot.script.phytec $(FW_DIR)
170 endif
171 ifeq ($(ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK),y)
172 $(CP) ./files/uEnv.txt.bbb $(FW_DIR)/uEnv.txt
173 $(INSTALL_BIN) $(WRKBUILD)/MLO $(FW_DIR)
174 endif
175 ifeq ($(ADK_TARGET_SYSTEM_STARFIVE_VISIONFIVE2),y)
176 $(CP) $(WRKBUILD)/spl/u-boot-spl.bin.normal.out $(FW_DIR)
177 endif
179 include $(ADK_TOPDIR)/mk/host-bottom.mk
180 include $(ADK_TOPDIR)/mk/pkg-bottom.mk