From 57b06e572d7e46b953db5a32d96651066e9b3862 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Tue, 07 Nov 2023 06:17:22 +0000
Subject: [PATCH] enable led trigger
---
u-boot/arch/arm/mach-rockchip/fit_nodes.sh | 73 +++++++++++++++++++++++++++++-------
1 files changed, 59 insertions(+), 14 deletions(-)
diff --git a/u-boot/arch/arm/mach-rockchip/fit_nodes.sh b/u-boot/arch/arm/mach-rockchip/fit_nodes.sh
index be7d46d..4d39ea0 100755
--- a/u-boot/arch/arm/mach-rockchip/fit_nodes.sh
+++ b/u-boot/arch/arm/mach-rockchip/fit_nodes.sh
@@ -27,6 +27,10 @@
# nodes
function gen_uboot_node()
{
+ if [ -z ${UBOOT_LOAD_ADDR} ]; then
+ return
+ fi
+
UBOOT="u-boot-nodtb.bin"
echo " uboot {
description = \"U-Boot\";
@@ -53,10 +57,16 @@
algo = \"sha256\";
};
};"
+
+ LOADABLE_UBOOT="\"uboot\", "
}
function gen_fdt_node()
{
+ if [ -z ${UBOOT_LOAD_ADDR} ]; then
+ return
+ fi
+
echo " fdt {
description = \"U-Boot dtb\";
data = /incbin/(\"./u-boot.dtb\");
@@ -67,12 +77,19 @@
algo = \"sha256\";
};
};"
+
+ FDT_SIGN=", \"fdt\""
+ FDT="fdt = \"fdt\"${PROP_KERN_DTB};"
};
function gen_kfdt_node()
{
+ if [ -z ${UBOOT_LOAD_ADDR} ]; then
+ return
+ fi
+
KERN_DTB=`sed -n "/CONFIG_EMBED_KERNEL_DTB_PATH=/s/CONFIG_EMBED_KERNEL_DTB_PATH=//p" .config | tr -d '"'`
- if [ -z "${KERN_DTB}" ]; then
+ if [ -z ${KERN_DTB} ]; then
return;
fi
@@ -96,7 +113,7 @@
${srctree}/arch/arm/mach-rockchip/decode_bl31.py
NUM=1
- for ATF in `ls -l bl31_0x*.bin | sort --key=5 -nr | awk '{ print $9 }'`
+ for ATF in `ls -1 -S bl31_0x*.bin`
do
ATF_LOAD_ADDR=`echo ${ATF} | awk -F "_" '{ printf $2 }' | awk -F "." '{ printf $1 }'`
# only atf-1 support compress
@@ -135,7 +152,9 @@
};"
fi
- if [ ${NUM} -gt 1 ]; then
+ if [ ${NUM} -eq 2 ]; then
+ LOADABLE_ATF=${LOADABLE_ATF}"\"atf-${NUM}\""
+ elif [ ${NUM} -gt 2 ]; then
LOADABLE_ATF=${LOADABLE_ATF}", \"atf-${NUM}\""
fi
NUM=`expr ${NUM} + 1`
@@ -152,6 +171,12 @@
# If not AArch32 mode
if ! grep -q '^CONFIG_ARM64_BOOT_AARCH32=y' .config ; then
ENTRY="entry = <"${TEE_LOAD_ADDR}">;"
+
+ # if disable packing tee.bin
+ if ! grep -q '^CONFIG_SPL_OPTEE=y' .config ; then
+ return
+ fi
+
fi
fi
@@ -179,7 +204,7 @@
};"
LOADABLE_OPTEE=", \"optee\""
FIRMWARE_OPTEE="firmware = \"optee\";"
- FIRMWARE_SIGN=", \"firmware\""
+ FIRMWARE_SIGN="\"firmware\""
}
function gen_mcu_node()
@@ -314,8 +339,13 @@
function gen_arm64_configurations()
{
PLATFORM=`sed -n "/CONFIG_DEFAULT_DEVICE_TREE/p" .config | awk -F "=" '{ print $2 }' | tr -d '"'`
-if grep -q '^CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT=y' .config ; then
+if grep -q '^CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT=y' .config ; then
ALGO_PADDING=" padding = \"pss\";"
+fi
+if grep -q '^CONFIG_FIT_ENABLE_RSA4096_SUPPORT=y' .config ; then
+ ALGO_NAME=" algo = \"sha256,rsa4096\";"
+else
+ ALGO_NAME=" algo = \"sha256,rsa2048\";"
fi
echo " };
@@ -325,14 +355,14 @@
description = \"${PLATFORM}\";
rollback-index = <0x0>;
firmware = \"atf-1\";
- loadables = \"uboot\"${LOADABLE_ATF}${LOADABLE_OPTEE}${LOADABLE_OTHER};
+ loadables = ${LOADABLE_UBOOT}${LOADABLE_ATF}${LOADABLE_OPTEE}${LOADABLE_OTHER};
${STANDALONE_MCU}
- fdt = \"fdt\"${PROP_KERN_DTB};
+ ${FDT}
signature {
- algo = \"sha256,rsa2048\";
+ ${ALGO_NAME}
${ALGO_PADDING}
key-name-hint = \"dev\";
- sign-images = \"fdt\", \"firmware\", \"loadables\"${STANDALONE_SIGN};
+ sign-images = \"firmware\", \"loadables\"${FDT_SIGN}${STANDALONE_SIGN};
};
};
};
@@ -343,9 +373,24 @@
function gen_arm_configurations()
{
PLATFORM=`sed -n "/CONFIG_DEFAULT_DEVICE_TREE/p" .config | awk -F "=" '{ print $2 }' | tr -d '"'`
-if grep -q '^CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT=y' .config ; then
+if grep -q '^CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT=y' .config ; then
ALGO_PADDING=" padding = \"pss\";"
fi
+if grep -q '^CONFIG_FIT_ENABLE_RSA4096_SUPPORT=y' .config ; then
+ ALGO_NAME=" algo = \"sha256,rsa4096\";"
+else
+ ALGO_NAME=" algo = \"sha256,rsa2048\";"
+fi
+if [ ! -z "${LOADABLE_UBOOT}" ] || [ ! -z "${LOADABLE_OTHER}" ]; then
+ LOADABLE_UBOOT="\"uboot\""
+ LOADABLES="loadables = ${LOADABLE_UBOOT}${LOADABLE_OTHER};"
+ if [ -z ${FIRMWARE_SIGN} ]; then
+ LOADABLES_SIGN="\"loadables\""
+ else
+ LOADABLES_SIGN=", \"loadables\""
+ fi
+fi
+
echo " };
configurations {
@@ -354,14 +399,14 @@
description = \"${PLATFORM}\";
rollback-index = <0x0>;
${FIRMWARE_OPTEE}
- loadables = \"uboot\"${LOADABLE_OTHER};
+ ${LOADABLES}
${STANDALONE_MCU}
- fdt = \"fdt\"${PROP_KERN_DTB};
+ ${FDT}
signature {
- algo = \"sha256,rsa2048\";
+ ${ALGO_NAME}
${ALGO_PADDING}
key-name-hint = \"dev\";
- sign-images = \"fdt\", \"loadables\"${FIRMWARE_SIGN}${STANDALONE_SIGN};
+ sign-images = ${FIRMWARE_SIGN}${LOADABLES_SIGN}${FDT_SIGN}${STANDALONE_SIGN};
};
};
};
--
Gitblit v1.6.2