2022-02-12 00:03:50 +01:00
|
|
|
# $NetBSD: u-boot-rockchip.mk,v 1.13 2022/02/11 23:03:50 mrg Exp $
|
2019-06-08 14:25:05 +02:00
|
|
|
#
|
2020-04-02 11:12:54 +02:00
|
|
|
# should be used by sysutils/u-boot-rock64/Makefile
|
2019-09-15 17:50:21 +02:00
|
|
|
# used by sysutils/u-boot-rockpro64/Makefile
|
2022-02-11 23:06:22 +01:00
|
|
|
# used by sysutils/u-boot-rockpro64-ayufan/Makefile
|
2020-04-02 11:12:54 +02:00
|
|
|
# used by sysutils/u-boot-pinebook-pro/Makefile
|
2019-09-15 17:50:21 +02:00
|
|
|
|
2019-06-08 14:25:05 +02:00
|
|
|
# Common makefile fragment for rockchip based u-boot targets.
|
|
|
|
#
|
|
|
|
# Set these variables:
|
|
|
|
#
|
2021-06-25 10:28:57 +02:00
|
|
|
# UBOOT_IMAGE_TYPE ("rk3399", "rk3328")
|
2019-06-08 14:25:05 +02:00
|
|
|
#
|
|
|
|
|
2022-02-12 00:03:50 +01:00
|
|
|
UBOOT_VERSION?= 2022.01
|
2019-06-08 14:25:05 +02:00
|
|
|
|
2022-02-11 23:06:22 +01:00
|
|
|
TFA= trusted-firmware-a
|
|
|
|
|
|
|
|
# Earlier SPIs were at sector 1024, but newer u-boot has a DT that
|
|
|
|
# loads them from 768. Until all are converted, leave the default
|
|
|
|
# at 1024.
|
|
|
|
UBOOT_RK_SPI_OFF?= 1024
|
|
|
|
|
|
|
|
MAKE_ENV+= BL31=${PREFIX}/share/${TFA}/${UBOOT_IMAGE_TYPE}/bl31.elf
|
2019-06-08 14:25:05 +02:00
|
|
|
|
|
|
|
post-build:
|
2022-02-11 23:06:22 +01:00
|
|
|
# wrap everything up into a single file that can be written to an SD card.
|
|
|
|
# note that the SD image starts at sector 64, and 64 + 448 = 512, so the
|
|
|
|
# u-boot.itb is loaded at 256KiB on the card iteslf.
|
2019-06-08 14:25:05 +02:00
|
|
|
cp ${WRKSRC}/idbloader.img ${WRKSRC}/rksd_loader.img
|
|
|
|
dd if=${WRKSRC}/u-boot.itb seek=448 conv=notrunc of=${WRKSRC}/rksd_loader.img
|
2022-02-11 23:06:22 +01:00
|
|
|
.if defined(UBOOT_MKIMAGE_RKSPI)
|
|
|
|
${WRKSRC}/tools/mkimage \
|
|
|
|
-n rk3399 \
|
|
|
|
-T rkspi \
|
|
|
|
-d ${WRKSRC}/tpl/u-boot-tpl.bin:${WRKSRC}/spl/u-boot-spl.bin \
|
|
|
|
${WRKSRC}/rkspi_loader.img
|
|
|
|
.else
|
2019-08-13 23:28:46 +02:00
|
|
|
# build SPI NOR flash image. See dev-ayufan/build.mk.
|
2020-04-02 11:12:54 +02:00
|
|
|
set -e; b=0; while [ "$$b" != 128 ]; do \
|
|
|
|
dd bs=2k count=1; \
|
|
|
|
dd if=/dev/zero bs=2k count=1; \
|
|
|
|
b=$$(expr $$b + 1); \
|
|
|
|
done < ${WRKSRC}/idbloader.img > ${WRKSRC}/rkspi_loader.img 2> /dev/null
|
2022-02-11 23:06:22 +01:00
|
|
|
.endif
|
|
|
|
dd if=${WRKSRC}/u-boot.itb seek=${UBOOT_RK_SPI_OFF} conv=notrunc of=${WRKSRC}/rkspi_loader.img
|
|
|
|
|
|
|
|
BUILD_TARGET+= V=1
|
2020-04-02 11:12:54 +02:00
|
|
|
|
2022-02-11 23:06:22 +01:00
|
|
|
.include "../../sysutils/${TFA}-${UBOOT_IMAGE_TYPE}/buildlink3.mk"
|
2020-04-02 11:12:54 +02:00
|
|
|
.include "../../sysutils/u-boot/u-boot-arm64.mk"
|