2019-01-20 06:51:02 -05:00
|
|
|
# $OpenBSD: Makefile,v 1.49 2019/01/20 11:51:02 jsg Exp $
|
2017-02-18 07:10:50 -05:00
|
|
|
|
|
|
|
BROKEN-sparc64= Error: the specified option is not accepted in ISB at operand 1 -- isb sy
|
2016-12-11 09:08:38 -05:00
|
|
|
|
|
|
|
FLAVORS= aarch64 arm
|
|
|
|
FLAVOR?= arm
|
2016-05-28 21:35:33 -04:00
|
|
|
|
|
|
|
COMMENT= U-Boot firmware
|
2019-01-15 00:44:18 -05:00
|
|
|
VERSION= 2019.01
|
2019-01-20 06:51:02 -05:00
|
|
|
REVISION= 2
|
2016-12-11 09:08:38 -05:00
|
|
|
DISTNAME= u-boot-${VERSION}
|
2017-03-05 11:28:14 -05:00
|
|
|
PKGNAME= u-boot-${FLAVOR}-${VERSION:S/-//}
|
2016-12-11 09:08:38 -05:00
|
|
|
FULLPKGNAME= ${PKGNAME}
|
2016-05-28 21:35:33 -04:00
|
|
|
CATEGORIES= sysutils
|
|
|
|
HOMEPAGE= http://www.denx.de/wiki/U-Boot
|
|
|
|
MAINTAINER= Jonathan Gray <jsg@openbsd.org>
|
|
|
|
|
|
|
|
# GPLv2
|
|
|
|
PERMIT_PACKAGE_CDROM= Yes
|
|
|
|
|
|
|
|
MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/
|
|
|
|
EXTRACT_SUFX= .tar.bz2
|
|
|
|
PKG_ARCH= *
|
|
|
|
|
2018-07-10 08:30:16 -04:00
|
|
|
BUILD_DEPENDS= devel/bison \
|
|
|
|
devel/dtc \
|
2017-07-30 01:53:03 -04:00
|
|
|
devel/swig \
|
|
|
|
textproc/gsed
|
2016-12-11 09:08:38 -05:00
|
|
|
|
2017-01-09 21:35:52 -05:00
|
|
|
MODULES= lang/python
|
2017-02-09 19:02:45 -05:00
|
|
|
MODPY_RUNDEP= No
|
2017-01-09 21:35:52 -05:00
|
|
|
|
2019-01-19 06:27:05 -05:00
|
|
|
MODPY_ADJ_FILES=\
|
|
|
|
arch/arm/mach-rockchip/make_fit_atf.py
|
|
|
|
|
2017-05-09 00:11:18 -04:00
|
|
|
MAKE_ENV= KBUILD_VERBOSE=1 \
|
|
|
|
PYTHON="${MODPY_BIN}"
|
|
|
|
|
2016-12-11 09:08:38 -05:00
|
|
|
.if "${FLAVOR}" == "aarch64"
|
2017-08-20 22:32:58 -04:00
|
|
|
BUILD_DEPENDS+= devel/arm-none-eabi/gcc-linaro,aarch64 \
|
2019-01-17 15:41:47 -05:00
|
|
|
devel/py-elftools \
|
|
|
|
sysutils/arm-trusted-firmware \
|
2017-08-20 22:32:58 -04:00
|
|
|
sysutils/atf-allwinner
|
2016-12-11 09:08:38 -05:00
|
|
|
MAKE_ENV+= CROSS_COMPILE="aarch64-none-elf-"
|
2019-01-17 15:41:47 -05:00
|
|
|
RK3399_BL31= "${LOCALBASE}/share/arm-trusted-firmware/rk3399-bl31.elf"
|
2017-08-20 22:32:58 -04:00
|
|
|
SUNXI_BL31= "${LOCALBASE}/share/atf-allwinner/bl31.bin"
|
2016-12-11 09:08:38 -05:00
|
|
|
.elif "${FLAVOR}" == "arm"
|
|
|
|
BUILD_DEPENDS+= devel/arm-none-eabi/gcc-linaro
|
|
|
|
MAKE_ENV+= CROSS_COMPILE="arm-none-eabi-"
|
|
|
|
.endif
|
|
|
|
|
2016-05-28 21:35:33 -04:00
|
|
|
USE_GMAKE= Yes
|
|
|
|
NO_TEST= Yes
|
|
|
|
|
2016-12-11 09:08:38 -05:00
|
|
|
.if "${FLAVOR}" == "aarch64"
|
2017-08-20 22:32:58 -04:00
|
|
|
SUNXI64=\
|
2017-08-29 03:14:50 -04:00
|
|
|
a64-olinuxino \
|
2017-07-30 01:53:03 -04:00
|
|
|
bananapi_m64 \
|
2017-08-29 03:14:50 -04:00
|
|
|
nanopi_a64 \
|
2017-07-30 01:53:03 -04:00
|
|
|
nanopi_neo2 \
|
2017-05-09 00:11:18 -04:00
|
|
|
orangepi_pc2 \
|
2017-07-30 01:53:03 -04:00
|
|
|
orangepi_prime \
|
|
|
|
orangepi_win \
|
2019-01-15 00:44:18 -05:00
|
|
|
pine64-lts \
|
2016-12-11 09:08:38 -05:00
|
|
|
pine64_plus \
|
2019-01-15 00:44:18 -05:00
|
|
|
pinebook \
|
2017-08-20 22:32:58 -04:00
|
|
|
sopine_baseboard
|
|
|
|
BOARDS=\
|
2019-01-17 15:41:47 -05:00
|
|
|
firefly-rk3399 \
|
2017-08-24 04:53:02 -04:00
|
|
|
mvebu_espressobin-88f3720 \
|
|
|
|
mvebu_mcbin-88f8040 \
|
2018-03-14 22:25:58 -04:00
|
|
|
qemu_arm64 \
|
2016-12-11 09:08:38 -05:00
|
|
|
rpi_3
|
|
|
|
.elif "${FLAVOR}" == "arm"
|
2017-01-08 09:49:18 -05:00
|
|
|
OMAP=\
|
2016-05-28 21:35:33 -04:00
|
|
|
omap4_panda \
|
2019-01-20 06:51:02 -05:00
|
|
|
am335x_boneblack \
|
|
|
|
am335x_evm
|
2017-08-20 22:32:58 -04:00
|
|
|
SUNXI64=
|
2017-01-08 09:49:18 -05:00
|
|
|
SUNXI=\
|
2016-05-28 21:35:33 -04:00
|
|
|
A10-OLinuXino-Lime \
|
2016-07-30 10:22:19 -04:00
|
|
|
A10s-OLinuXino-M \
|
2016-05-28 21:35:33 -04:00
|
|
|
A20-OLinuXino-Lime \
|
|
|
|
A20-OLinuXino-Lime2 \
|
2017-08-29 03:14:50 -04:00
|
|
|
A20-OLinuXino-Lime2-eMMC \
|
2016-05-28 21:35:33 -04:00
|
|
|
A20-OLinuXino_MICRO \
|
|
|
|
Bananapi \
|
2017-12-26 08:14:21 -05:00
|
|
|
Bananapi_m2m \
|
2019-01-15 09:20:09 -05:00
|
|
|
bananapi_m2_zero \
|
2016-05-28 21:35:33 -04:00
|
|
|
Bananapro \
|
2016-07-30 10:22:19 -04:00
|
|
|
CHIP \
|
2016-05-28 21:35:33 -04:00
|
|
|
Cubieboard \
|
|
|
|
Cubieboard2 \
|
2016-11-19 20:47:00 -05:00
|
|
|
Cubieboard4 \
|
2016-05-28 21:35:33 -04:00
|
|
|
Cubietruck \
|
|
|
|
Lamobo_R1 \
|
|
|
|
Linksprite_pcDuino \
|
|
|
|
Linksprite_pcDuino3 \
|
|
|
|
Linksprite_pcDuino3_Nano \
|
2017-01-08 09:49:18 -05:00
|
|
|
nanopi_neo \
|
|
|
|
Orangepi \
|
|
|
|
Orangepi_mini \
|
|
|
|
orangepi_2 \
|
|
|
|
orangepi_lite \
|
|
|
|
orangepi_one \
|
|
|
|
orangepi_pc \
|
|
|
|
orangepi_pc_plus \
|
|
|
|
orangepi_plus \
|
2017-01-09 21:35:52 -05:00
|
|
|
orangepi_plus2e \
|
2017-03-02 22:27:28 -05:00
|
|
|
orangepi_zero \
|
2017-07-30 01:53:03 -04:00
|
|
|
Sinovoip_BPI_M2_Plus
|
2017-01-08 09:49:18 -05:00
|
|
|
IMX=\
|
2016-05-28 21:35:33 -04:00
|
|
|
cm_fx6 \
|
|
|
|
mx6cuboxi \
|
2016-07-30 10:22:19 -04:00
|
|
|
mx6qsabrelite \
|
2016-05-28 21:35:33 -04:00
|
|
|
nitrogen6q \
|
|
|
|
novena \
|
|
|
|
udoo \
|
2017-01-08 09:49:18 -05:00
|
|
|
usbarmory \
|
|
|
|
wandboard
|
|
|
|
BOARDS=\
|
|
|
|
${OMAP} \
|
|
|
|
${SUNXI} \
|
|
|
|
${IMX} \
|
2017-08-24 04:53:02 -04:00
|
|
|
clearfog \
|
2018-03-14 22:25:58 -04:00
|
|
|
qemu_arm \
|
2016-05-28 21:35:33 -04:00
|
|
|
rpi_2 \
|
|
|
|
rpi_3_32b \
|
2017-05-09 00:11:18 -04:00
|
|
|
tinker-rk3288 \
|
2017-08-24 04:53:02 -04:00
|
|
|
turris_omnia \
|
2019-01-15 00:44:18 -05:00
|
|
|
vexpress_ca15_tc2
|
2016-12-11 09:08:38 -05:00
|
|
|
.endif
|
2016-05-28 21:35:33 -04:00
|
|
|
|
|
|
|
FILES=\
|
|
|
|
MLO \
|
|
|
|
SPL \
|
|
|
|
u-boot \
|
|
|
|
u-boot.img \
|
|
|
|
u-boot.bin \
|
|
|
|
u-boot-sunxi-with-spl.bin \
|
|
|
|
u-boot.imx \
|
2017-08-01 19:25:44 -04:00
|
|
|
u-boot-spl.kwb \
|
2017-08-20 22:32:58 -04:00
|
|
|
u-boot-with-spl.bin \
|
|
|
|
u-boot.itb \
|
2019-01-17 15:41:47 -05:00
|
|
|
idbspl.img \
|
|
|
|
spl/sunxi-spl.bin \
|
2016-05-28 21:35:33 -04:00
|
|
|
|
2017-03-03 18:46:25 -05:00
|
|
|
pre-build:
|
2017-07-30 01:53:03 -04:00
|
|
|
.for f in ${MODPY_ADJ_FILES}
|
|
|
|
${MODPY_BIN_ADJ} ${WRKSRC}/${f}
|
|
|
|
.endfor
|
2017-03-03 18:46:25 -05:00
|
|
|
|
2016-05-28 21:35:33 -04:00
|
|
|
do-build:
|
|
|
|
.for BOARD in ${BOARDS}
|
|
|
|
cd ${WRKSRC} && \
|
|
|
|
mkdir -p build/${BOARD} && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
|
|
|
|
O="build/${BOARD}" \
|
|
|
|
-f ${MAKE_FILE} "${BOARD}"_defconfig && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
|
|
|
|
O="build/${BOARD}" \
|
|
|
|
-f ${MAKE_FILE} ${ALL_TARGET}
|
2017-08-01 19:25:44 -04:00
|
|
|
.if "${BOARD}" == "tinker-rk3288"
|
|
|
|
cd ${WRKSRC}/build/${BOARD} && \
|
|
|
|
tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin \
|
2019-01-17 15:41:47 -05:00
|
|
|
u-boot-with-spl.bin && \
|
2017-08-01 19:25:44 -04:00
|
|
|
cat u-boot-dtb.bin >> u-boot-with-spl.bin
|
|
|
|
.endif
|
2019-01-17 15:41:47 -05:00
|
|
|
.if "${BOARD}" == "firefly-rk3399"
|
|
|
|
cd ${WRKSRC}/build/${BOARD} && \
|
|
|
|
ln -s ${RK3399_BL31} bl31.elf && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
|
|
|
|
O="build/${BOARD}" \
|
|
|
|
-f ${MAKE_FILE} u-boot.itb && \
|
|
|
|
tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
|
|
|
|
.endif
|
2016-05-28 21:35:33 -04:00
|
|
|
.endfor
|
2017-08-20 22:32:58 -04:00
|
|
|
.for BOARD in ${SUNXI64}
|
|
|
|
cd ${WRKSRC} && \
|
|
|
|
mkdir -p build/${BOARD} && \
|
|
|
|
${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
|
|
|
|
${MAKE_FLAGS} O="build/${BOARD}" \
|
|
|
|
-f ${MAKE_FILE} "${BOARD}"_defconfig && \
|
|
|
|
${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
|
|
|
|
${MAKE_FLAGS} O="build/${BOARD}" \
|
|
|
|
-f ${MAKE_FILE} ${ALL_TARGET}
|
|
|
|
if [[ -f ${WRKSRC}/build/${BOARD}/spl/sunxi-spl.bin && \
|
|
|
|
-f ${WRKSRC}/build/${BOARD}/u-boot.itb ]]; then \
|
|
|
|
cd ${WRKSRC}/build/${BOARD} && \
|
|
|
|
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin ; \
|
|
|
|
fi
|
|
|
|
.endfor
|
2016-05-28 21:35:33 -04:00
|
|
|
|
|
|
|
do-install:
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/u-boot
|
2017-08-20 22:32:58 -04:00
|
|
|
.for BOARD in ${BOARDS} ${SUNXI64}
|
2016-05-28 21:35:33 -04:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/u-boot/${BOARD}
|
|
|
|
-cd ${WRKSRC}/build/${BOARD} && \
|
|
|
|
cp ${FILES} ${PREFIX}/share/u-boot/${BOARD}/
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|