111 lines
3.5 KiB
BlitzBasic
Executable File
111 lines
3.5 KiB
BlitzBasic
Executable File
SUMMARY = "U-Boot bootloader for uboot22 UNISOC Development Platform"
|
|
require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
|
|
PROVIDES = "virtual/bootloader_uboot22"
|
|
|
|
FILESEXTRAPATHS:prepend := "${U_BOOT_PATCH_FILEPATH}:"
|
|
FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot22:"
|
|
SRC_URI = " \
|
|
${U_BOOT_MACHINE_PATCH} \
|
|
"
|
|
|
|
LICENSE = "GPLv2+"
|
|
LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
|
|
|
|
# u-boot needs devtree compiler to parse dts files
|
|
DEPENDS += "dtc-native bc-native"
|
|
DEPENDS += "${@bb.utils.contains('STORAGE_TYPE', 'nand', 'mcp-gen-native', '', d)}"
|
|
|
|
# need bison for YACC
|
|
DEPENDS += "bison-native"
|
|
|
|
PV = "v2023.01+git${SRCPV}"
|
|
UBOOT_INITIAL_ENV = ""
|
|
#S = "${WORKDIR}/git"
|
|
#B = "${WORKDIR}/build"
|
|
|
|
### for uboot export variables
|
|
UBOOT_TOS_TRUSTY = "${@bb.utils.contains('TEE_CONFIG','trusty','true','',d)}"
|
|
export BSP_CONFIG_TOS_TRUSTY="${UBOOT_TOS_TRUSTY}"
|
|
|
|
UBOOT_TEECFG_CUSTOM = "${@bb.utils.contains('TEECFG_CUSTOM','true','true','',d)}"
|
|
export BSP_CONFIG_TEECFG_CUSTOM="${UBOOT_TEECFG_CUSTOM}"
|
|
export TEECFG_MEM_ADDR
|
|
|
|
UBOOT_DEBUG ?="${@bb.utils.contains('USERDEBUG', 'userdebug', 'DEBUG', '', d)}"
|
|
export BSP_CONFIG_DEBUG="${UBOOT_DEBUG}"
|
|
export BSP_CONFIG_SECBOOT="${@bb.utils.contains('SECBOOT_ENABLE', 'sec', 'sec', '', d)}"
|
|
export BSP_CONFIG_SEC_PKCS="${@bb.utils.contains('UBOOT22_PKCS1','true','true','',d)}"
|
|
export BSP_CONFIG_SEC_WCN_GNSS="${@bb.utils.contains('SECURE_WCN_GNSS_ENABLE', 'true', 'true', '', d)}"
|
|
export BSP_CONFIG_SEC_DMVERITY="${@bb.utils.contains('SEC_DMVERITY_TYPE_INITRAMFS', 'false', bb.utils.contains('SECURE_DMVERITY_ENABLE','true','true','false',d), 'false', d)}"
|
|
export UBOOT_SECURE_BOOT_FLAG="${UBOOT_SECSET}"
|
|
export UBOOT_MODEM_FLAG="${UBOOT_REMOVE_MODEM}"
|
|
|
|
unset CFLAGS
|
|
|
|
### sign image
|
|
inherit sign_unisoc_binary
|
|
UNISOC_SIGN_ENABLE ?= "no"
|
|
DEPENDS += "unisoc-sign-native"
|
|
|
|
EXTRA_OEMAKE += 'ARCH=arm'
|
|
UBOOT_BINARY = "u-boot.bin"
|
|
FDL2_BINARY = "fdl2.bin"
|
|
|
|
addtask delete_uboot_patch before do_patch after do_unpack
|
|
do_delete_uboot_patch(){
|
|
rm -rf ${S}patches
|
|
}
|
|
|
|
do_compile:prepend() {
|
|
if [ ${STORAGE_TYPE} = "nand" ]; then
|
|
#add include file of nand paramters before compiling
|
|
perl ${STAGING_BINDIR_NATIVE}/nandgen.pl \
|
|
-h ${EXTERNALSRC}/drivers/mtd/nand/raw/sprd_nand_param.h \
|
|
-x ${STAGING_BINDIR_NATIVE}/mcp.xls
|
|
fi
|
|
|
|
oe_runmake ARCH=arm -C ${S} O=${B} ${UBOOT_MACHINE}
|
|
oe_runmake ARCH=arm -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
|
|
|
|
if [ ${ENABLE_UBOOT_MKENVIMAGE} = "yes" ]; then
|
|
${B}/${UBOOT_MKENVIMAGE_CMD} ${B}/${UBOOT_ENV_BINARY} ${UBOOT_ENVCONF_DIR}/${UBOOT_ENV_TXT}
|
|
fi
|
|
|
|
if [ ${AB_PARTITIONS} = "true" ]; then
|
|
export CONFIG_AB_PARTITIONS=true
|
|
fi
|
|
|
|
if [ ${SUPPORT_EMMC_UFS_SDBOOT} = "yes" ]; then
|
|
export BOOT_SDBOOT=true
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
do_compile () {
|
|
oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
|
|
oe_runmake -C ${S} O=${B} DEVICE_TREE="${UBOOT_TARGET_DTB}"
|
|
sign_unisoc_bin "${B}/${UBOOT_BINARY}"
|
|
|
|
cp ${B}/${UBOOT_BINARY} ${B}/${FDL2_BINARY}
|
|
sign_unisoc_bin "${B}/${FDL2_BINARY}"
|
|
}
|
|
|
|
do_install () {
|
|
|
|
}
|
|
|
|
# for temp compiled uboot22, not affect uboot15
|
|
do_deploy () {
|
|
if [ -f "${B}/${UBOOT_BINARY}" ]; then
|
|
install -d ${DEPLOY_DIR_IMAGE}
|
|
install ${B}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${UBOOT_BINARY}
|
|
sign_unisoc_bin "${DEPLOY_DIR_IMAGE}/${UBOOT_BINARY}"
|
|
|
|
install ${B}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${FDL2_BINARY}
|
|
sign_unisoc_bin "${DEPLOY_DIR_IMAGE}/${FDL2_BINARY}"
|
|
fi
|
|
}
|
|
|
|
addtask do_deploy after do_compile
|