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
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
)))
28 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
),y
)
29 CONFIG
:= clearfog_defconfig
30 UBOOT
:= u-boot-with-spl.kwb
32 ifeq ($(ADK_TARGET_SYSTEM_PHYTEC_IMX6
),y
)
33 CONFIG
:= pcm058_defconfig
36 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
),y
)
37 CONFIG
:= mx6cuboxi_defconfig
40 ifeq ($(ADK_TARGET_SYSTEM_PCDUINO_3B
),y
)
41 CONFIG
:= Linksprite_pcDuino3_defconfig
43 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
44 CONFIG
:= rpi_defconfig
46 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2
),y
)
47 CONFIG
:= rpi_defconfig
49 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3
),y
)
50 CONFIG
:= rpi_3_32b_defconfig
52 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P
),y
)
53 CONFIG
:= rpi_3_32b_defconfig
55 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
),y
)
56 CONFIG
:= rpi_3_defconfig
58 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64
),y
)
59 CONFIG
:= rpi_3_defconfig
61 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS
),y
)
62 CONFIG
:= rock-pi-4-rk3399_defconfig
65 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO
),y
)
66 CONFIG
:= Bananapro_defconfig
67 UBOOT
:= u-boot-sunxi-with-spl.bin
69 ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO
),y
)
70 CONFIG
:= bananapi_m2_p2_zero_defconfig
71 UBOOT
:= u-boot-sunxi-with-spl.bin
73 ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0
),y
)
74 CONFIG
:= orangepi_zero_defconfig
75 UBOOT
:= u-boot-sunxi-with-spl.bin
77 ifeq ($(ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
),y
)
78 CONFIG
:= am335x_evm_defconfig
81 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20
),y
)
82 CONFIG
:= ci20_mmc_defconfig
83 UBOOT
:= u-boot-dtb.img
85 ifeq ($(ADK_TARGET_SYSTEM_ST_STM32F746G
),y
)
86 CONFIG
:= stm32f746-disco_defconfig
87 UBOOT
:= u-boot-dtb.bin
89 ifeq ($(ADK_TARGET_SYSTEM_STARFIVE_VISIONFIVE2
),y
)
90 CONFIG
:= starfive_visionfive2_defconfig
94 HOST_MAKE_FLAGS
+= HOSTCFLAGS
="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" \
95 HOSTLDFLAGS
="$(HOST_LDFLAGS) -ldl"
99 INSTALL_STYLE
:= manual
101 ifeq ($(ADK_TARGET_BINFMT_FDPIC
),y
)
102 EXTRA_CFLAGS
:= -mno-fdpic
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
) )
112 $(INSTALL_BIN
) $(WRKBUILD
)/tools
/mk
{,env
}image \
113 $(STAGING_HOST_DIR
)/usr
/bin
116 (cd
$(WRKBUILD
) && PATH
='$(HOST_PATH)' $(MAKE
) $(CONFIG
))
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" \
123 KCFLAGS
='$(EXTRA_CFLAGS)' \
124 PATH
='$(HOST_PATH)' \
125 CROSS_COMPILE
='$(TARGET_CROSS)' \
126 OPENSBI
="$(FW_DIR)/fw_dynamic.bin" \
128 (cd
$(WRKBUILD
) && env \
129 PATH
='$(HOST_PATH)' \
130 CROSS_COMPILE
='$(TARGET_CROSS)' \
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
)
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
-
148 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO
),y
)
149 $(INSTALL_BIN
) .
/files
/boot.script.bpi
$(FW_DIR
)
151 ifeq ($(ADK_TARGET_SYSTEM_BANANA_P2_ZERO
),y
)
152 $(INSTALL_BIN
) .
/files
/boot.script.bpizero
$(FW_DIR
)
154 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS
),y
)
155 $(INSTALL_BIN
) .
/files
/boot.script.rockpi4
$(FW_DIR
)
157 ifeq ($(ADK_TARGET_SYSTEM_ORANGE_PI0
),y
)
158 $(INSTALL_BIN
) .
/files
/boot.script.opi
$(FW_DIR
)
160 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
),y
)
161 $(INSTALL_BIN
) .
/files
/boot.script.clearfog
$(FW_DIR
)
163 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
),y
)
164 $(INSTALL_BIN
) $(WRKBUILD
)/SPL
$(FW_DIR
)
165 $(INSTALL_BIN
) .
/files
/boot.script.imx6
$(FW_DIR
)
167 ifeq ($(ADK_TARGET_SYSTEM_PHYTEC_IMX6
),y
)
168 $(INSTALL_BIN
) $(WRKBUILD
)/SPL
$(FW_DIR
)
169 $(INSTALL_BIN
) .
/files
/boot.script.phytec
$(FW_DIR
)
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
)
175 ifeq ($(ADK_TARGET_SYSTEM_STARFIVE_VISIONFIVE2
),y
)
176 $(CP
) $(WRKBUILD
)/spl
/u-boot-spl.bin.normal.out
$(FW_DIR
)
179 include $(ADK_TOPDIR
)/mk
/host-bottom.mk
180 include $(ADK_TOPDIR
)/mk
/pkg-bottom.mk