TF-A: v2.6-stm32mp1-r1
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com> Change-Id: I23dff9a9a33a1094bfcf01c2fa8e555f349d0782
This commit is contained in:
parent
10b737d31d
commit
4e63a23ff6
|
|
@ -23,15 +23,8 @@ FWCONFIG_DEPLOYDIR ?= \$(DEPLOYDIR)/fwconfig
|
|||
# Configure default TF-A features
|
||||
TF_A_ENABLE_DEBUG_WRAPPER ?= ${TF_A_ENABLE_DEBUG_WRAPPER}
|
||||
|
||||
# Configure FIP
|
||||
ENABLE_FIP ?= ${@bb.utils.contains('MACHINE_FEATURES', 'fip', '1', '', d)}
|
||||
|
||||
# Set default TF-A config
|
||||
ifeq (\$(ENABLE_FIP), 1)
|
||||
TF_A_CONFIG ?= ${TF_A_CONFIG}
|
||||
else
|
||||
TF_A_CONFIG ?= ${BOOTSCHEME_LABELS} ${TF_A_CONFIG_4LEGACY}
|
||||
endif
|
||||
|
||||
# Default TF-A overall settings to null
|
||||
TF_A_BINARY ?=
|
||||
|
|
@ -39,7 +32,8 @@ TF_A_DEVICETREE ?=
|
|||
TF_A_MAKE_TARGET ?=
|
||||
TF_A_EXTRA_OPTFLAGS ?=
|
||||
|
||||
ifeq (\$(ENABLE_FIP), 1)
|
||||
# Default TF-A metadata template
|
||||
TF_A_METADATA_JSON ?= \$(SRC_PATH)/${TF_A_METADATA_JSON}
|
||||
|
||||
EOF
|
||||
unset i
|
||||
|
|
@ -55,45 +49,6 @@ TF_A_MAKE_TARGET_$config ?= $(echo ${TF_A_MAKE_TARGET} | cut -d',' -f${i})
|
|||
EOF
|
||||
done
|
||||
cat << EOF >> ${ARCHIVER_OUTDIR}/Makefile.sdk
|
||||
else
|
||||
|
||||
EOF
|
||||
for bootscheme in ${BOOTSCHEME_LABELS}; do
|
||||
unset i
|
||||
for config in ${TF_A_CONFIG}; do
|
||||
i=$(expr $i + 1)
|
||||
if [ "$bootscheme" = "$config" ]; then
|
||||
cat << EOF >> ${ARCHIVER_OUTDIR}/Makefile.sdk
|
||||
# Init default config settings
|
||||
TF_A_DEVICETREE_$config ?= $(echo ${TF_A_DEVICETREE} | cut -d',' -f${i})
|
||||
TF_A_EXTRA_OPTFLAGS_$config ?= $(echo ${TF_A_EXTRA_OPTFLAGS} | cut -d',' -f${i}) ${TF_A_EXTRACONF_LEGACY}
|
||||
TF_A_BINARY_$config ?= $(echo ${TF_A_BINARIES} | cut -d',' -f${i})
|
||||
TF_A_MAKE_TARGET_$config ?=
|
||||
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
cat << EOF >> ${ARCHIVER_OUTDIR}/Makefile.sdk
|
||||
TF_A_DEVICETREE_$(echo ${TF_A_CONFIG_4LEGACY} | xargs) ?=
|
||||
TF_A_EXTRA_OPTFLAGS_$(echo ${TF_A_CONFIG_4LEGACY} | xargs) ?=
|
||||
TF_A_BINARY_$(echo ${TF_A_CONFIG_4LEGACY} | xargs) ?=
|
||||
TF_A_MAKE_TARGET_$(echo ${TF_A_CONFIG_4LEGACY} | xargs) ?=
|
||||
|
||||
ifeq (\$(TF_A_DEVICETREE_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)),)
|
||||
\$(error "Please, define the variable TF_A_DEVICETREE_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)")
|
||||
endif
|
||||
|
||||
ifeq (\$(TF_A_EXTRA_OPTFLAGS_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)),)
|
||||
\$(error "Please, define the variable TF_A_EXTRA_OPTFLAGS_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)")
|
||||
endif
|
||||
|
||||
ifeq (\$(TF_A_BINARY_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)),)
|
||||
\$(error "Please, define the variable TF_A_BINARY_$(echo ${TF_A_CONFIG_4LEGACY} | xargs)")
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
# Reset default variables
|
||||
LDFLAGS =
|
||||
|
|
@ -108,9 +63,6 @@ NM =
|
|||
# Define default make options
|
||||
EXTRA_OEMAKE ?= ${EXTRA_OEMAKE}
|
||||
|
||||
# Configure overall devicetree list for FIP
|
||||
TF_A_DEVICETREE_ALL = $(echo "${TF_A_DEVICETREE}" | sed 's/,/ /g' | xargs -n1 | sort -u | xargs)
|
||||
|
||||
# Display TF-A config details
|
||||
define tf-configs
|
||||
echo " \$(1)" ; \\
|
||||
|
|
@ -172,9 +124,8 @@ endef
|
|||
|
||||
# Set dependencies list for building all
|
||||
DEPS = \$(addprefix deploy-,\$(TF_A_CONFIG))
|
||||
ifeq (\$(ENABLE_FIP), 1)
|
||||
DEPS += fip
|
||||
endif
|
||||
DEPS += metadata
|
||||
|
||||
help:
|
||||
@echo
|
||||
|
|
@ -200,16 +151,17 @@ help:
|
|||
@echo " FWCONFIG_DEPLOYDIR = \$(DEPLOYDIR)/fwconfig"
|
||||
@echo
|
||||
@echo "FIP configuration:"
|
||||
@echo " ENABLE_FIP = \$(ENABLE_FIP) ('1' to generate fip binary)"
|
||||
ifeq (\$(ENABLE_FIP),1)
|
||||
@echo " Do not forget to set FIP deploydir folders (such as FIP_DEPLOYDIR_ROOT) to provide path to needed binaries"
|
||||
endif
|
||||
@echo
|
||||
@echo "METADATA configuration:"
|
||||
@echo " TF_A_METADATA_JSON = \$(TF_A_METADATA_JSON)"
|
||||
@echo
|
||||
@echo "Available targets:"
|
||||
@echo " all : build TF-A binaries for defined config(s)"
|
||||
@echo " fip : build FIP binaries"
|
||||
@echo " stm32 : build TF-A stm32 binaries"
|
||||
@echo " clean : clean build directories from generated files"
|
||||
@echo " all : build TF-A binaries for defined config(s)"
|
||||
@echo " fip : build FIP binaries"
|
||||
@echo " metadata : build the TF-A metadata binary"
|
||||
@echo " stm32 : build TF-A stm32 binaries"
|
||||
@echo " clean : clean build directories from generated files"
|
||||
@echo
|
||||
|
||||
all: \$(DEPS)
|
||||
|
|
@ -224,10 +176,21 @@ host_tools:
|
|||
\$(foreach config, \$(TF_A_CONFIG), \$(eval \$(call deploy-rules,\$(config),\$(if \$(TF_A_BINARY),\$(TF_A_BINARY),\$(TF_A_BINARY_\$(config))))))
|
||||
|
||||
fip: \$(addprefix deploy-,\$(TF_A_CONFIG))
|
||||
FIP_DEPLOYDIR_TFA=\$(BL32_DEPLOYDIR) FIP_DEPLOYDIR_FWCONF=\$(FWCONFIG_DEPLOYDIR) FIP_DEVICETREE="\$(if \$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE_ALL))" fiptool-stm32mp
|
||||
for config in \$(TF_A_CONFIG) ; do \\
|
||||
if [ "\$\$config" = "trusted" ]; then \\
|
||||
FIP_DEPLOYDIR_TFA=\$(BL32_DEPLOYDIR) FIP_DEPLOYDIR_FWCONF=\$(FWCONFIG_DEPLOYDIR) FIP_DEVICETREE="\$(if \$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE_trusted))" FIP_CONFIG="trusted" FIP_BL32_CONF="tfa" fiptool-stm32mp ; \\
|
||||
fi ; \\
|
||||
if [ "\$\$config" = "optee" ]; then \\
|
||||
FIP_DEPLOYDIR_TFA=\$(BL32_DEPLOYDIR) FIP_DEPLOYDIR_FWCONF=\$(FWCONFIG_DEPLOYDIR) FIP_DEVICETREE="\$(if \$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE),\$(TF_A_DEVICETREE_optee))" FIP_CONFIG="optee" FIP_BL32_CONF="optee" fiptool-stm32mp ; \\
|
||||
fi ; \\
|
||||
done
|
||||
|
||||
stm32: \$(addprefix deploy-,\$(TF_A_CONFIG))
|
||||
|
||||
metadata:
|
||||
@mkdir -p \$(DEPLOYDIR)
|
||||
\$(SRC_PATH)/${TF_A_METADATA_TOOL} jsonparse "\$(TF_A_METADATA_JSON)" -b \$(DEPLOYDIR)/${TF_A_METADATA_BINARY}
|
||||
|
||||
clean:
|
||||
@for config in \$(TF_A_CONFIG) ; do \\
|
||||
echo "Removing \$(BLD_PATH)/\$\$config ..." ; \\
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|||
FILESEXTRAPATHS:prepend := "${THISDIR}/tf-a-stm32mp:"
|
||||
|
||||
inherit deploy
|
||||
inherit ${@bb.utils.contains('MACHINE_FEATURES', 'fip', 'fip-utils-stm32mp', '', d)}
|
||||
inherit fip-utils-stm32mp
|
||||
|
||||
# Include TF-A config definitions
|
||||
include tf-a-stm32mp-config.inc
|
||||
|
|
@ -33,7 +33,9 @@ DEPENDS += "dtc-native"
|
|||
DEPENDS:append = " ${@bb.utils.contains('TF_A_ENABLE_DEBUG_WRAPPER', '1', 'stm32wrapper4dbg-native', '', d)}"
|
||||
|
||||
# Default log level
|
||||
ST_TF_A_DEBUG_LOG_LEVEL ??= "40"
|
||||
ST_TF_A_DEBUG ??= "1"
|
||||
ST_TF_A_LOG_LEVEL_RELEASE ??= "20"
|
||||
ST_TF_A_LOG_LEVEL_DEBUG ??= "40"
|
||||
|
||||
# Configure make settings
|
||||
EXTRA_OEMAKE += 'PLAT=${TFA_PLATFORM}'
|
||||
|
|
@ -41,8 +43,8 @@ EXTRA_OEMAKE += 'ARCH=${TFA_ARM_ARCH}'
|
|||
EXTRA_OEMAKE += 'ARM_ARCH_MAJOR=${TFA_ARM_MAJOR}'
|
||||
EXTRA_OEMAKE += 'CROSS_COMPILE=${TARGET_PREFIX}'
|
||||
# Debug support
|
||||
EXTRA_OEMAKE += '${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'DEBUG=1', '', d)}'
|
||||
EXTRA_OEMAKE += '${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'LOG_LEVEL=${ST_TF_A_DEBUG_LOG_LEVEL}', '', d)}'
|
||||
EXTRA_OEMAKE += "${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'DEBUG=${ST_TF_A_DEBUG}', '', d)}"
|
||||
EXTRA_OEMAKE += "${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'LOG_LEVEL=${ST_TF_A_LOG_LEVEL_DEBUG}', 'LOG_LEVEL=${ST_TF_A_LOG_LEVEL_RELEASE}', d)}"
|
||||
|
||||
# Define default TF-A namings
|
||||
TF_A_BASENAME ?= "tf-a"
|
||||
|
|
@ -85,10 +87,21 @@ TF_A_ENABLE_DEBUG_WRAPPER ??= "1"
|
|||
|
||||
# Set default configuration to allow signing
|
||||
TF_A_SIGN_ENABLE ??= "0"
|
||||
TF_A_ENCRYPTED_ENABLE ??= "0"
|
||||
|
||||
# Set metadata generation
|
||||
TF_A_ENABLE_METADATA ??= "${@bb.utils.contains('MACHINE_FEATURES', 'fw-update', '1', '0', 'd')}"
|
||||
TF_A_METADATA_NAME ?= "metadata"
|
||||
TF_A_METADATA_SUFFIX ?= "bin"
|
||||
TF_A_METADATA_BINARY ??= "${TF_A_METADATA_NAME}.${TF_A_METADATA_SUFFIX}"
|
||||
|
||||
TF_A_METADATA_TOOL ?= "tools/fwu_gen_metadata/fwumd_tool.py"
|
||||
TF_A_METADATA_JSON ?= "plat/st/stm32mp1/default_metadata.json"
|
||||
|
||||
# Configure specific build flags
|
||||
EXTRA_OEMAKE += "${@bb.utils.contains('TF_A_SIGN_ENABLE', '1', 'TRUSTED_BOARD_BOOT=1', '', d)}"
|
||||
EXTRA_OEMAKE += "${@bb.utils.contains('TF_A_SIGN_ENABLE', '1', 'MBEDTLS_DIR=${TFA_MBEDTLS_DIR}', '', d)}"
|
||||
EXTRA_OEMAKE += "${@bb.utils.contains('TF_A_ENCRYPTED_ENABLE', '1', 'DECRYPTION_SUPPORT=aes_gcm ENCRYPT_BL32=1', '', d)}"
|
||||
|
||||
# -----------------------------------------------
|
||||
# Handle TF-A config and set internal vars
|
||||
|
|
@ -152,6 +165,14 @@ python () {
|
|||
else:
|
||||
d.appendVar('TF_A_FILES', 'bl2' + ',')
|
||||
break
|
||||
|
||||
# Manage case of signature:
|
||||
# If signature are activated, for winning space, the debug parameter will be remove and levele of trace decrease
|
||||
signature_val = d.getVar('TF_A_SIGN_ENABLE')
|
||||
if signature_val and signature_val == "1":
|
||||
bb.warn("TF-A SIGNATURE: force to disable DEBUG and decrease log level")
|
||||
# force no debug and log level to release
|
||||
d.setVar('ST_TF_A_DEBUG_TRACE', "0")
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
|
|
@ -217,24 +238,29 @@ do_compile() {
|
|||
fi
|
||||
done
|
||||
fi
|
||||
oe_runmake -C ${S} BUILD_PLAT=${B}/${config}${soc_suffix} DTB_FILE_NAME=${dt}.dtb ${extra_opt} ${soc_extra_opt} ${tf_a_make_target}
|
||||
mkdir -p ${B}/${config}${soc_suffix}
|
||||
oe_runmake -C "${S}" BUILD_PLAT="${B}/${config}${soc_suffix}" DTB_FILE_NAME="${dt}.dtb" ${extra_opt} ${soc_extra_opt} ${tf_a_make_target}
|
||||
# Copy TF-A binary with explicit devicetree filename
|
||||
if [ -f ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX} ]; then
|
||||
cp ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX} ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX}" ]; then
|
||||
cp "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX}" "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}"
|
||||
if [ "${TF_A_ENABLE_DEBUG_WRAPPER}" = "1" ]; then
|
||||
stm32wrapper4dbg -s ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX} -d ${B}/${config}${soc_suffix}/debug-${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}
|
||||
stm32wrapper4dbg -s "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}.${TF_A_SUFFIX}" -d "${B}/${config}${soc_suffix}/debug-${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
# Specific for bl32 target
|
||||
if [ "$(echo ${tf_a_make_target} | grep -cw 'bl32')" = "1" ]; then
|
||||
# Move 'bl32.elf' file to explicit file name with 'soc_suffix' info (same file for all devicetree build)
|
||||
# This avoid unexpected deployment for other config (cf. do_deploy task)
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL32_ELF} ]; then
|
||||
mv -f ${B}/${config}${soc_suffix}/${BL32_ELF} ${B}/${config}${soc_suffix}/${TF_A_BASENAME}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL32_ELF}" ]; then
|
||||
mv -f "${B}/${config}${soc_suffix}/${BL32_ELF}" "${B}/${config}${soc_suffix}/${TF_A_BASENAME}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [ "${TF_A_ENABLE_METADATA}" = "1" ]; then
|
||||
${S}/${TF_A_METADATA_TOOL} jsonparse "${S}/${TF_A_METADATA_JSON}" -b "${B}/${TF_A_METADATA_NAME}.${TF_A_METADATA_SUFFIX}"
|
||||
fi
|
||||
}
|
||||
|
||||
do_deploy() {
|
||||
|
|
@ -257,83 +283,90 @@ do_deploy() {
|
|||
done
|
||||
fi
|
||||
for file_type in ${tfa_file_type}; do
|
||||
case ${file_type} in
|
||||
case "${file_type}" in
|
||||
bl2)
|
||||
# Install TF-A binary
|
||||
if [ -f ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/
|
||||
if [ -f "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/"
|
||||
if [ "${TF_A_ENABLE_DEBUG_WRAPPER}" = "1" ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/debug
|
||||
install -m 644 ${B}/${config}${soc_suffix}/debug-${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/debug/
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/debug"
|
||||
install -m 644 "${B}/${config}${soc_suffix}/debug-${tfa_basename}-${dt}-${config}.${TF_A_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/debug/"
|
||||
fi
|
||||
fi
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/debug
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL2_ELF} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL2_ELF} ${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL2_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL2_ELF}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL2_ELF}" "${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL2_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
bl31)
|
||||
# Install BL31 files
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL31_BASENAME}.${BL31_SUFFIX} ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/bl31
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL31_BASENAME}.${BL31_SUFFIX}" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/bl31"
|
||||
# Install BL31 binary
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL31_BASENAME}.${BL31_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/bl31/${tfa_basename}-${BL31_BASENAME_DEPLOY}${soc_suffix}.${BL31_SUFFIX}
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL31_BASENAME}.${BL31_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/bl31/${tfa_basename}-${BL31_BASENAME_DEPLOY}${soc_suffix}.${BL31_SUFFIX}"
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
if [ -f ${B}/${config}${soc_suffix}/${tfa_basename}-${BL31_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX} ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/bl32/debug
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${tfa_basename}-${BL31_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/bl31/debug/${tfa_basename}-${BL31_BASENAME_DEPLOY}${soc_suffix}.${TF_A_ELF_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/${tfa_basename}-${BL31_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/bl32/debug"
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${tfa_basename}-${BL31_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/bl31/debug/${tfa_basename}-${BL31_BASENAME_DEPLOY}${soc_suffix}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/debug
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL31_ELF} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL31_ELF} ${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL31_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/debug"
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL31_ELF}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL31_ELF}" "${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL31_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
bl32)
|
||||
# Install BL32 files
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL32_BASENAME}.${BL32_SUFFIX} ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/bl32
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL32_BASENAME}.${BL32_SUFFIX}" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/bl32"
|
||||
# Install BL32 binary
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL32_BASENAME}.${BL32_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/bl32/${tfa_basename}-${BL32_BASENAME_DEPLOY}${soc_suffix}.${BL32_SUFFIX}
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL32_BASENAME}.${BL32_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/bl32/${tfa_basename}-${BL32_BASENAME_DEPLOY}${soc_suffix}.${BL32_SUFFIX}"
|
||||
# Install BL32 devicetree
|
||||
if [ -f ${B}/${config}${soc_suffix}/fdts/${dt}-${BL32_BASENAME}.${DT_SUFFIX} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/fdts/${dt}-${BL32_BASENAME}.${DT_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/bl32/${dt}-${BL32_BASENAME}.${DT_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/fdts/${dt}-${BL32_BASENAME}.${DT_SUFFIX}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/fdts/${dt}-${BL32_BASENAME}.${DT_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/bl32/${dt}-${BL32_BASENAME}.${DT_SUFFIX}"
|
||||
fi
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
if [ -f ${B}/${config}${soc_suffix}/${tfa_basename}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX} ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/bl32/debug
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${tfa_basename}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/bl32/debug/${tfa_basename}-${BL32_BASENAME_DEPLOY}${soc_suffix}.${TF_A_ELF_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/${tfa_basename}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/bl32/debug"
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${tfa_basename}-${BL32_BASENAME}${soc_suffix}.${TF_A_ELF_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/bl32/debug/${tfa_basename}-${BL32_BASENAME_DEPLOY}${soc_suffix}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/debug
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL32_ELF} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL32_ELF} ${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL32_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/debug"
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL32_ELF}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL32_ELF}" "${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL32_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
fwconfig)
|
||||
# Install fwconfig
|
||||
if [ -f ${B}/${config}${soc_suffix}/fdts/${dt}-${FWCONFIG_NAME}.${DT_SUFFIX} ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/fwconfig
|
||||
install -m 644 ${B}/${config}${soc_suffix}/fdts/${dt}-${FWCONFIG_NAME}.${DT_SUFFIX} ${DEPLOYDIR}/arm-trusted-firmware/fwconfig/${dt}-${FWCONFIG_NAME}-${config}.${DT_SUFFIX}
|
||||
if [ -f "${B}/${config}${soc_suffix}/fdts/${dt}-${FWCONFIG_NAME}.${DT_SUFFIX}" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/fwconfig"
|
||||
install -m 644 "${B}/${config}${soc_suffix}/fdts/${dt}-${FWCONFIG_NAME}.${DT_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/fwconfig/${dt}-${FWCONFIG_NAME}-${config}.${DT_SUFFIX}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done # for file_type in ${tfa_file_type}
|
||||
done # for dt in ${dt_config}
|
||||
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
|
||||
install -d ${DEPLOYDIR}/arm-trusted-firmware/debug
|
||||
if [ -f ${B}/${config}${soc_suffix}/${BL1_ELF} ]; then
|
||||
install -m 644 ${B}/${config}${soc_suffix}/${BL1_ELF} ${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL1_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware/debug"
|
||||
if [ -f "${B}/${config}${soc_suffix}/${BL1_ELF}" ]; then
|
||||
install -m 644 "${B}/${config}${soc_suffix}/${BL1_ELF}" "${DEPLOYDIR}/arm-trusted-firmware/debug/${tfa_basename}-${BL1_BASENAME_DEPLOY}-${config}.${TF_A_ELF_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
done # for config in ${TF_A_CONFIG}
|
||||
|
||||
if [ "${TF_A_ENABLE_METADATA}" = "1" ]; then
|
||||
install -d "${DEPLOYDIR}/arm-trusted-firmware"
|
||||
if [ -f "${B}/${TF_A_METADATA_NAME}.${TF_A_METADATA_SUFFIX}" ]; then
|
||||
install -m 644 "${B}/${TF_A_METADATA_NAME}.${TF_A_METADATA_SUFFIX}" "${DEPLOYDIR}/arm-trusted-firmware/${TF_A_METADATA_BIN}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
addtask deploy before do_build after do_compile
|
||||
|
|
|
|||
|
|
@ -1,23 +1,15 @@
|
|||
# Configure default mode (All supported device type)
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_SDMMC=1"
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_EMMC=1"
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_SPI_NOR=1"
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_RAW_NAND=1"
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_SPI_NAND=1"
|
||||
TF_A_EXTRACONF_LEGACY += "STM32MP_USE_STM32IMAGE=1"
|
||||
|
||||
# Define config for each TF_A_CONFIG
|
||||
# TF_A_CONFIG[config] ?= "<list of devicetree>,<extra opt flags>,<binary basename (default: 'tf-a')>,<make target (default: 'all')>,<type of binary to deploy: [bl2 bl31 bl32 fwconfig] (default 'bl2')>"
|
||||
|
||||
TF_A_CONFIG[optee] ?= "${STM32MP_DEVICETREE},AARCH32_SP=optee ${@bb.utils.contains('MACHINE_FEATURES', 'fip', '', '${TF_A_EXTRACONF_LEGACY}', d)},,${@bb.utils.contains('MACHINE_FEATURES', 'fip', bb.utils.contains('FIP_BL31_ENABLE', '1', 'bl31 dtbs', 'dtbs', d), '', d)},${@bb.utils.contains('MACHINE_FEATURES', 'fip', bb.utils.contains('FIP_BL31_ENABLE', '1', 'bl31 fwconfig', 'fwconfig', d), '', d)}"
|
||||
TF_A_CONFIG[trusted] ?= "${STM32MP_DEVICETREE},AARCH32_SP=sp_min ${@bb.utils.contains('MACHINE_FEATURES', 'fip', '', '${TF_A_EXTRACONF_LEGACY}', d)},,${@bb.utils.contains('MACHINE_FEATURES', 'fip', 'bl32 dtbs', '', d)},${@bb.utils.contains('MACHINE_FEATURES', 'fip', 'bl32 fwconfig', '', d)}"
|
||||
TF_A_CONFIG[optee] ?= "${STM32MP_DEVICETREE},AARCH32_SP=optee,,${@bb.utils.contains('FIP_BL31_ENABLE', '1', 'bl31 dtbs', 'dtbs', d)},${@bb.utils.contains('FIP_BL31_ENABLE', '1', 'bl31 fwconfig', 'fwconfig', d)}"
|
||||
TF_A_CONFIG[trusted] ?= "${@' '.join(d for d in '${STM32MP_DEVICETREE}'.split() if 'stm32mp15' in d)},AARCH32_SP=sp_min,,bl32 dtbs,bl32 fwconfig"
|
||||
|
||||
TF_A_CONFIG[serialboot] ?= "${STM32MP_DEVICETREE},AARCH32_SP=sp_min STM32MP_UART_PROGRAMMER=1 STM32MP_USB_PROGRAMMER=1 STM32MP_USE_STM32IMAGE=1"
|
||||
|
||||
TF_A_CONFIG[emmc] ?= "${DEVICE_BOARD_ENABLE:EMMC},STM32MP_EMMC=1"
|
||||
TF_A_CONFIG[emmc] ?= "${DEVICE_BOARD_ENABLE:EMMC},STM32MP_EMMC=1 ${@bb.utils.contains('MACHINE_FEATURES', 'fw-update', 'PSA_FWU_SUPPORT=1', '', d)}"
|
||||
TF_A_CONFIG[nand] ?= "${DEVICE_BOARD_ENABLE:NAND},STM32MP_RAW_NAND=1 ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_NAND}' if ${TF_A_MTD_START_OFFSET_NAND} else ''}"
|
||||
TF_A_CONFIG[nor] ?= "${DEVICE_BOARD_ENABLE:NOR},STM32MP_SPI_NOR=1 ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_NOR}' if ${TF_A_MTD_START_OFFSET_NOR} else ''}"
|
||||
TF_A_CONFIG[sdcard] ?= "${DEVICE_BOARD_ENABLE:SDCARD},STM32MP_SDMMC=1"
|
||||
TF_A_CONFIG[nor] ?= "${DEVICE_BOARD_ENABLE:NOR},STM32MP_SPI_NOR=1 ${@bb.utils.contains('MACHINE_FEATURES', 'fw-update', 'PSA_FWU_SUPPORT=1', '', d)} ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_NOR}' if ${TF_A_MTD_START_OFFSET_NOR} else ''}"
|
||||
TF_A_CONFIG[sdcard] ?= "${DEVICE_BOARD_ENABLE:SDCARD},STM32MP_SDMMC=1 ${@bb.utils.contains('MACHINE_FEATURES', 'fw-update', 'PSA_FWU_SUPPORT=1', '', d)}"
|
||||
TF_A_CONFIG[spinand] ?= "${DEVICE_BOARD_ENABLE:SPINAND},STM32MP_SPI_NAND=1 ${@'STM32MP_FORCE_MTD_START_OFFSET=${TF_A_MTD_START_OFFSET_SPINAND}' if ${TF_A_MTD_START_OFFSET_SPINAND} else ''}"
|
||||
TF_A_CONFIG[uart] ?= "${STM32MP_DEVICETREE},STM32MP_UART_PROGRAMMER=1"
|
||||
TF_A_CONFIG[usb] ?= "${STM32MP_DEVICETREE},STM32MP_USB_PROGRAMMER=1"
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
From a9163bb270c27524c36cfc216ddb61169a7ccef8 Mon Sep 17 00:00:00 2001
|
||||
From: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
|
||||
Date: Fri, 29 Apr 2022 16:57:28 +0200
|
||||
Subject: [PATCH] correct DTC version detection
|
||||
|
||||
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
|
||||
---
|
||||
plat/st/stm32mp1/platform.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk
|
||||
index 55acd6742..2db7b506c 100644
|
||||
--- a/plat/st/stm32mp1/platform.mk
|
||||
+++ b/plat/st/stm32mp1/platform.mk
|
||||
@@ -109,7 +109,7 @@ endif
|
||||
endif
|
||||
|
||||
$(eval DTC_V = $(shell $(DTC) -v | awk '{print $$NF}'))
|
||||
-$(eval DTC_VERSION = $(shell printf "%d" $(shell echo ${DTC_V} | cut -d- -f1 | sed "s/\./0/g")))
|
||||
+$(eval DTC_VERSION = $(shell printf "%d" $(shell echo ${DTC_V} | cut -d- -f1 | sed "s/\./0/g" | grep -o [0-9]*)))
|
||||
DTC_CPPFLAGS += ${INCLUDES}
|
||||
DTC_FLAGS += -Wno-unit_address_vs_reg
|
||||
ifeq ($(shell test $(DTC_VERSION) -ge 10601; echo $$?),0)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,157 +0,0 @@
|
|||
From 903a55e874e91ccd1fb435bea3a675e2eb4257fa Mon Sep 17 00:00:00 2001
|
||||
From: Romuald JEANNE <romuald.jeanne@st.com>
|
||||
Date: Wed, 2 Jun 2021 16:45:18 +0200
|
||||
Subject: [PATCH 2/3] v2.4-stm32mp-r1.1-rc1
|
||||
|
||||
---
|
||||
docs/plat/stm32mp1.rst | 9 ++++++---
|
||||
drivers/st/clk/stm32mp1_clk.c | 4 ++--
|
||||
include/drivers/st/stm32mp1_rcc.h | 16 ++++++++++++++++
|
||||
plat/st/common/stm32mp_crypto_lib.c | 5 ++++-
|
||||
plat/st/stm32mp1/stm32mp1_def.h | 2 ++
|
||||
plat/st/stm32mp1/stm32mp1_helper.S | 13 +++++++++++++
|
||||
6 files changed, 43 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/docs/plat/stm32mp1.rst b/docs/plat/stm32mp1.rst
|
||||
index fb7afdbbb0..95f4a186f5 100644
|
||||
--- a/docs/plat/stm32mp1.rst
|
||||
+++ b/docs/plat/stm32mp1.rst
|
||||
@@ -153,7 +153,10 @@ To build TF-A BL2 with its STM32 header for SD-card boot:
|
||||
.. code:: bash
|
||||
|
||||
make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
|
||||
- DTB_FILE_NAME=stm32mp157c-ev1.dtb
|
||||
+ DTB_FILE_NAME=stm32mp157c-ev1.dtb STM32MP_SDMMC=1
|
||||
+
|
||||
+For other boot devices, you have to replace STM32MP_SDMMC in the previous command
|
||||
+with the desired devive flag.
|
||||
|
||||
This BL2 is independent of the BL32 used (SP_min or OP-TEE)
|
||||
|
||||
@@ -204,14 +207,14 @@ __________________
|
||||
--nt-fw <u-boot_directory>/u-boot-nodtb.bin \
|
||||
--nt-fw-cert build/stm32mp1/cert_images/u-boot.bin.crt \
|
||||
--nt-fw-key-cert build/stm32mp1/cert_images/u-boot.bin.key-crt \
|
||||
- --hw-config <u-boot_directory>/u-boot.dtb
|
||||
+ --hw-config <u-boot_directory>/u-boot.dtb \
|
||||
--fw-config build/stm32mp1/debug/fdts/fw-config.dtb
|
||||
|
||||
tools/fiptool/fiptool create --tos-fw <optee_directory>/tee-header_v2.bin \
|
||||
--tos-fw-extra1 <optee_directory>/tee-pager_v2.bin \
|
||||
--tos-fw-extra2 <optee_directory>/tee-pageable_v2.bin \
|
||||
--nt-fw <u-boot_directory>/u-boot-nodtb.bin \
|
||||
- --hw-config <u-boot_directory>/uboot-nodtb.dtb \
|
||||
+ --hw-config <u-boot_directory>/u-boot.dtb \
|
||||
--tos-fw-cert build/stm32mp1/cert_images/tee-header_v2.bin.crt \
|
||||
--tos-fw-key-cert build/stm32mp1/cert_images/tee-header_v2.bin.key-crt \
|
||||
--nt-fw-cert build/stm32mp1/cert_images/u-boot.bin.crt \
|
||||
diff --git a/drivers/st/clk/stm32mp1_clk.c b/drivers/st/clk/stm32mp1_clk.c
|
||||
index 00954cb2e8..d074a1568c 100644
|
||||
--- a/drivers/st/clk/stm32mp1_clk.c
|
||||
+++ b/drivers/st/clk/stm32mp1_clk.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (C) 2018-2020, STMicroelectronics - All Rights Reserved
|
||||
+ * Copyright (C) 2018-2021, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
*/
|
||||
@@ -1853,7 +1853,7 @@ static void stm32mp1_set_rtcsrc(unsigned int clksrc, bool lse_css)
|
||||
(clksrc != (uint32_t)CLK_RTC_DISABLED)) {
|
||||
mmio_clrsetbits_32(address,
|
||||
RCC_BDCR_RTCSRC_MASK,
|
||||
- clksrc << RCC_BDCR_RTCSRC_SHIFT);
|
||||
+ (clksrc & RCC_SELR_SRC_MASK) << RCC_BDCR_RTCSRC_SHIFT);
|
||||
|
||||
mmio_setbits_32(address, RCC_BDCR_RTCCKEN);
|
||||
}
|
||||
diff --git a/include/drivers/st/stm32mp1_rcc.h b/include/drivers/st/stm32mp1_rcc.h
|
||||
index feaac43a13..616051e772 100644
|
||||
--- a/include/drivers/st/stm32mp1_rcc.h
|
||||
+++ b/include/drivers/st/stm32mp1_rcc.h
|
||||
@@ -576,6 +576,22 @@
|
||||
#define RCC_FMCCKSELR_FMCSRC_MASK GENMASK(1, 0)
|
||||
#define RCC_FMCCKSELR_FMCSRC_SHIFT 0
|
||||
|
||||
+/* RCC_APB1RSTSETR register fields */
|
||||
+#define RCC_APB1RSTSETR_USART2RST BIT(14)
|
||||
+#define RCC_APB1RSTSETR_USART3RST BIT(15)
|
||||
+#define RCC_APB1RSTSETR_UART4RST BIT(16)
|
||||
+#define RCC_APB1RSTSETR_UART5RST BIT(17)
|
||||
+#define RCC_APB1RSTSETR_UART7RST BIT(18)
|
||||
+#define RCC_APB1RSTSETR_UART8RST BIT(19)
|
||||
+
|
||||
+/* RCC_APB1RSTCLRR register fields */
|
||||
+#define RCC_APB1RSTCLRR_USART2RST BIT(14)
|
||||
+#define RCC_APB1RSTCLRR_USART3RST BIT(15)
|
||||
+#define RCC_APB1RSTCLRR_UART4RST BIT(16)
|
||||
+#define RCC_APB1RSTCLRR_UART5RST BIT(17)
|
||||
+#define RCC_APB1RSTCLRR_UART7RST BIT(18)
|
||||
+#define RCC_APB1RSTCLRR_UART8RST BIT(19)
|
||||
+
|
||||
/* RCC_USBCKSELR register fields */
|
||||
#define RCC_USBCKSELR_USBPHYSRC_MASK GENMASK(1, 0)
|
||||
#define RCC_USBCKSELR_USBPHYSRC_SHIFT 0
|
||||
diff --git a/plat/st/common/stm32mp_crypto_lib.c b/plat/st/common/stm32mp_crypto_lib.c
|
||||
index de9601d2b8..9582162813 100644
|
||||
--- a/plat/st/common/stm32mp_crypto_lib.c
|
||||
+++ b/plat/st/common/stm32mp_crypto_lib.c
|
||||
@@ -40,6 +40,7 @@ static void crypto_lib_init(void)
|
||||
{
|
||||
boot_api_context_t *boot_context =
|
||||
(boot_api_context_t *)stm32mp_get_boot_ctx_address();
|
||||
+ int ret;
|
||||
|
||||
if (!stm32mp_is_auth_supported()) {
|
||||
return;
|
||||
@@ -48,7 +49,9 @@ static void crypto_lib_init(void)
|
||||
auth_ops.verify_signature =
|
||||
boot_context->bootrom_ecdsa_verify_signature;
|
||||
|
||||
- if (stm32_hash_register() != 0) {
|
||||
+ ret = stm32_hash_register();
|
||||
+ if (ret != 0) {
|
||||
+ ERROR("HASH init (%d)\n", ret);
|
||||
panic();
|
||||
}
|
||||
}
|
||||
diff --git a/plat/st/stm32mp1/stm32mp1_def.h b/plat/st/stm32mp1/stm32mp1_def.h
|
||||
index 027dba1bde..326b227842 100644
|
||||
--- a/plat/st/stm32mp1/stm32mp1_def.h
|
||||
+++ b/plat/st/stm32mp1/stm32mp1_def.h
|
||||
@@ -433,6 +433,8 @@ enum ddr_type {
|
||||
#define DEBUG_UART_TX_CLKSRC RCC_UART24CKSELR_HSI
|
||||
#define DEBUG_UART_TX_EN_REG RCC_MP_APB1ENSETR
|
||||
#define DEBUG_UART_TX_EN RCC_MP_APB1ENSETR_UART4EN
|
||||
+#define DEBUG_UART_RST_REG RCC_APB1RSTSETR
|
||||
+#define DEBUG_UART_RST_BIT RCC_APB1RSTSETR_UART4RST
|
||||
|
||||
/*******************************************************************************
|
||||
* STM32MP1 ETZPC
|
||||
diff --git a/plat/st/stm32mp1/stm32mp1_helper.S b/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
index bc2d73cebb..315a67f2cf 100644
|
||||
--- a/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
+++ b/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
@@ -245,6 +245,19 @@ endfunc plat_my_core_pos
|
||||
* ---------------------------------------------
|
||||
*/
|
||||
func plat_crash_console_init
|
||||
+ /* Reset UART peripheral */
|
||||
+ ldr r1, =(RCC_BASE + DEBUG_UART_RST_REG)
|
||||
+ ldr r2, =DEBUG_UART_RST_BIT
|
||||
+ str r2, [r1]
|
||||
+1:
|
||||
+ ldr r0, [r1]
|
||||
+ ands r0, r2
|
||||
+ beq 1b
|
||||
+ str r2, [r1, #4] /* RSTCLR register */
|
||||
+2:
|
||||
+ ldr r0, [r1]
|
||||
+ ands r0, r2
|
||||
+ bne 2b
|
||||
/* Enable GPIOs for UART TX */
|
||||
ldr r1, =(RCC_BASE + DEBUG_UART_TX_GPIO_BANK_CLK_REG)
|
||||
ldr r2, [r1]
|
||||
--
|
||||
2.17.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,25 @@
|
|||
From f83c3e1e478fa7dfd8ee41b3c7b0c0c32341d954 Mon Sep 17 00:00:00 2001
|
||||
From: Lionel VITTE <lionel.vitte@st.com>
|
||||
Date: Thu, 24 Mar 2022 13:48:26 +0100
|
||||
Subject: [PATCH] Modify 'Reset reason' trace level
|
||||
|
||||
---
|
||||
plat/st/stm32mp1/bl2_plat_setup.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
index 57aa5590a..b248d17ff 100644
|
||||
--- a/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
@@ -66,7 +66,7 @@ static void print_reset_reason(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- INFO("Reset reason (0x%x):\n", rstsr);
|
||||
+ NOTICE("Reset reason (0x%x):\n", rstsr);
|
||||
|
||||
if ((rstsr & RCC_MP_RSTSCLRR_PADRSTF) == 0U) {
|
||||
if ((rstsr & RCC_MP_RSTSCLRR_STDBYRSTF) != 0U) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -1,16 +1,17 @@
|
|||
Compilation of TF-A (Trusted Firmware-A):
|
||||
1. Pre-requisite
|
||||
2. Initialise cross-compilation via SDK
|
||||
3. Prepare tf-a source code
|
||||
4. Management of tf-a source code
|
||||
5. Compile tf-a source code
|
||||
2. Initialize cross-compilation via SDK
|
||||
3. Prepare TF-A source code
|
||||
4. Manage TF-A source code with GIT
|
||||
5. Compile TF-A source code
|
||||
6. Update software on board
|
||||
|
||||
1. Pre-requisite:
|
||||
-----------------
|
||||
----------------
|
||||
1. Pre-requisite
|
||||
----------------
|
||||
OpenSTLinux SDK must be installed.
|
||||
|
||||
For tf-a build you need to install:
|
||||
For TF-A build you need to install:
|
||||
- git:
|
||||
Ubuntu: sudo apt-get install git-core gitk
|
||||
Fedora: sudo yum install git
|
||||
|
|
@ -19,7 +20,8 @@ If you have never configured you git configuration:
|
|||
$ git config --global user.name "your_name"
|
||||
$ git config --global user.email "your_email@example.com"
|
||||
|
||||
2. Initialise cross-compilation via SDK:
|
||||
---------------------------------------
|
||||
2. Initialize cross-compilation via SDK
|
||||
---------------------------------------
|
||||
Source SDK environment:
|
||||
$ source <path to SDK>/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
|
||||
|
|
@ -31,26 +33,38 @@ To verify if your cross-compilation environment have put in place:
|
|||
Warning: the environment are valid only on the shell session where you have
|
||||
sourced the sdk environment.
|
||||
|
||||
3. Prepare tf-a source:
|
||||
------------------------
|
||||
If you have the tarball and the list of patch then you must extract the tarball
|
||||
and apply the patch.
|
||||
$> tar xfz ##BP##-##PR##.tar.gz
|
||||
A new directory containing tf-a standard source code will be created, go into it:
|
||||
$> cd ##BP##
|
||||
----------------------
|
||||
3. Prepare TF-A source
|
||||
----------------------
|
||||
If not already done, extract the sources from Developer Package tarball, for example:
|
||||
$ tar xfJ en.SOURCES-stm32mp1-*.tar.xz
|
||||
|
||||
NB: if there is no git management on source code and you would like to have a
|
||||
git management on the code see section 4 [Management of tf-a source code]
|
||||
if there is some patch, please apply it on source code
|
||||
In the TF-A source directory (sources/*/##BP##-##PR##),
|
||||
you have one TF-A source tarball, the patches and one Makefile:
|
||||
- ##BP##-##PR##.tar.xz
|
||||
- 00*.patch
|
||||
- Makefile.sdk
|
||||
|
||||
If you would like to have a git management for the source code move to
|
||||
to section 4 [Management of TF-A source code with GIT].
|
||||
|
||||
Otherwise, to manage TF-A source code without git, you must extract the
|
||||
tarball now and apply the patch:
|
||||
|
||||
$> tar xf ##BP##-##PR##.tar.xz
|
||||
$> cd ##BP##
|
||||
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
|
||||
|
||||
4. Management of tf-a source code:
|
||||
You can now move to section 5 [Compile TF-A source code].
|
||||
|
||||
-----------------------------------
|
||||
If you like to have a better management of change made on tf-a source, you
|
||||
4. Manage TF-A source code with GIT
|
||||
-----------------------------------
|
||||
If you like to have a better management of change made on TF-A source, you
|
||||
have 3 solutions to use git:
|
||||
|
||||
4.1 Get STMicroelectronics TF-A source from GitHub
|
||||
|
||||
--------------------------------------------------
|
||||
URL: https://github.com/STMicroelectronics/arm-trusted-firmware.git
|
||||
Branch: ##ARCHIVER_ST_BRANCH##
|
||||
Revision: ##ARCHIVER_ST_REVISION##
|
||||
|
|
@ -59,38 +73,45 @@ have 3 solutions to use git:
|
|||
$ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
|
||||
|
||||
4.2 Create Git from tarball
|
||||
---------------------------
|
||||
$ cd <directory to tf-a source code>
|
||||
$ test -d .git || git init . && git add . && git commit -m "tf-a source code" && git gc
|
||||
$ git checkout -b WORKING
|
||||
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
|
||||
|
||||
4.3 Get Git from community and apply STMicroelectronics patches
|
||||
$ for p in `ls -1 ../*.patch`; do git am $p; done
|
||||
|
||||
4.3 Get Git from Arm Software community and apply STMicroelectronics patches
|
||||
---------------------------------------------------------------
|
||||
URL: git://github.com/ARM-software/arm-trusted-firmware.git
|
||||
Branch: ##ARCHIVER_COMMUNITY_BRANCH##
|
||||
Revision: ##ARCHIVER_COMMUNITY_REVISION##
|
||||
|
||||
$ git clone git://github.com/ARM-software/arm-trusted-firmware.git
|
||||
$ cd <directory to tf-a source code>
|
||||
$ cd arm-trusted-firmware
|
||||
$ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
|
||||
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
|
||||
|
||||
5. Build tf-a source code:
|
||||
--------------------------------
|
||||
Since OpenSTLinux has activated FIP by default, so the FIP_artifacts should be specified before launching compilation
|
||||
- In case of using SOURCES-xxxx.tar.gz of Developer package the FIP_DEPLOYDIR_ROOT should be set as below:
|
||||
---------------------------
|
||||
5. Compile TF-A source code
|
||||
---------------------------
|
||||
Since OpenSTLinux activates FIP by default, FIP_artifacts directory path must be specified before launching compilation
|
||||
- In case of using SOURCES-xxxx.tar.gz of Developer package the FIP_DEPLOYDIR_ROOT must be set as below:
|
||||
$> export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts
|
||||
|
||||
To compile tf-a source code
|
||||
To compile TF-A source code
|
||||
$> make -f $PWD/../Makefile.sdk all
|
||||
or for a specific config :
|
||||
$ make -f $PWD/../Makefile.sdk TF_A_DEVICETREE=stm32mp157c-ev1 TF_A_CONFIG=trusted ELF_DEBUG_ENABLE='1' all
|
||||
|
||||
NB: TF_A_DEVICETREE flag must be set to switch to correct board configuration.
|
||||
|
||||
By default, the build results for this component are available in $PWD/../deploy directory.
|
||||
If needed, this deploy directory can be specified by added "DEPLOYDIR=<your_deploy_dir_path>" compilation option to the build command line above.
|
||||
In case DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware it overwrites files directly in FIP artifacts directory.
|
||||
|
||||
The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip
|
||||
|
||||
6. Update software on board:
|
||||
----------------------------
|
||||
---------------------------
|
||||
6. Update software on board
|
||||
---------------------------
|
||||
Please use STM32CubeProgrammer then only tick the boot partitions means patitions 0x1 to 0x6 (more informations on the wiki website http://wiki.st.com/stm32mpu)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
SRC_URI += " \
|
||||
file://0099-Modify-Reset-reason-trace-level.patch \
|
||||
"
|
||||
|
|
@ -7,22 +7,18 @@ LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"
|
|||
|
||||
PROVIDES += "virtual/trusted-firmware-a"
|
||||
|
||||
FILESEXTRAPATHS:prepend_stm32mpcommon := "${THISDIR}/tf-a-stm32mp:"
|
||||
FILESEXTRAPATHS:prepend:stm32mpcommon := "${THISDIR}/tf-a-stm32mp:"
|
||||
|
||||
SRC_URI = "git://github.com/ARM-software/arm-trusted-firmware.git;protocol=https;nobranch=1"
|
||||
SRCREV = "e2c509a39c6cc4dda8734e6509cdbe6e3603cdfc"
|
||||
SRCREV = "a1f02f4f3daae7e21ee58b4c93ec3e46b8f28d15"
|
||||
|
||||
SRC_URI += " \
|
||||
file://0001-st-update-v2.4-r1.0.0.patch \
|
||||
file://0002-v2.4-stm32mp-r1.1-rc1.patch \
|
||||
file://0003-v2.4-stm32mp-r2.patch \
|
||||
\
|
||||
file://0001-correct-DTC-version-detection.patch \
|
||||
"
|
||||
file://0001-v2.6-stm32mp-r1.patch \
|
||||
"
|
||||
|
||||
TF_A_VERSION = "v2.4"
|
||||
TF_A_SUBVERSION = "stm32mp"
|
||||
TF_A_RELEASE = "r2"
|
||||
TF_A_VERSION = "v2.6"
|
||||
TF_A_SUBVERSION = "stm32mp1"
|
||||
TF_A_RELEASE = "r1"
|
||||
PV = "${TF_A_VERSION}-${TF_A_SUBVERSION}-${TF_A_RELEASE}"
|
||||
|
||||
ARCHIVER_ST_BRANCH = "${TF_A_VERSION}-${TF_A_SUBVERSION}"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From a1a1376cd1cc5ef232258e3302596f6a2fb9b8e4 Mon Sep 17 00:00:00 2001
|
||||
From 63e10c11b0fb33e0343d6ffc81fd214e81903f36 Mon Sep 17 00:00:00 2001
|
||||
From: Lionel Debieve <lionel.debieve@st.com>
|
||||
Date: Tue, 19 Jan 2021 15:40:36 +0100
|
||||
Subject: [PATCH] tools: allow to use a root key password from command line
|
||||
|
|
@ -9,24 +9,17 @@ root key password. Useful for build system management.
|
|||
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
|
||||
Change-Id: Ie692c5c6db5ddb093ca7659d80f6137a978aa7bf
|
||||
---
|
||||
make_helpers/tbbr/tbbr_tools.mk | 4 +++-
|
||||
tools/cert_create/include/key.h | 4 ++--
|
||||
tools/cert_create/src/key.c | 6 +++---
|
||||
tools/cert_create/src/main.c | 18 ++++++++++++++----
|
||||
4 files changed, 22 insertions(+), 10 deletions(-)
|
||||
make_helpers/tbbr/tbbr_tools.mk | 2 ++
|
||||
tools/cert_create/include/key.h | 2 +-
|
||||
tools/cert_create/src/key.c | 4 ++--
|
||||
tools/cert_create/src/main.c | 16 +++++++++++++---
|
||||
4 files changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/make_helpers/tbbr/tbbr_tools.mk b/make_helpers/tbbr/tbbr_tools.mk
|
||||
index 853ad11bef..0aab592228 100644
|
||||
index 0a280b4ed..226d460f1 100644
|
||||
--- a/make_helpers/tbbr/tbbr_tools.mk
|
||||
+++ b/make_helpers/tbbr/tbbr_tools.mk
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
-# Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
|
||||
+# Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
@@ -24,6 +24,7 @@
|
||||
@@ -25,6 +25,7 @@
|
||||
# KEY_SIZE
|
||||
# ROT_KEY
|
||||
# PROT_KEY
|
||||
|
|
@ -34,7 +27,7 @@ index 853ad11bef..0aab592228 100644
|
|||
# TRUSTED_WORLD_KEY
|
||||
# NON_TRUSTED_WORLD_KEY
|
||||
# SCP_BL2_KEY
|
||||
@@ -62,6 +63,7 @@ $(if ${HASH_ALG},$(eval $(call CERT_ADD_CMD_OPT,${HASH_ALG},--hash-alg,FWU_)))
|
||||
@@ -63,6 +64,7 @@ $(if ${HASH_ALG},$(eval $(call CERT_ADD_CMD_OPT,${HASH_ALG},--hash-alg,FWU_)))
|
||||
$(if ${ROT_KEY},$(eval $(call CERT_ADD_CMD_OPT,${ROT_KEY},--rot-key)))
|
||||
$(if ${ROT_KEY},$(eval $(call CERT_ADD_CMD_OPT,${ROT_KEY},--rot-key,FWU_)))
|
||||
$(if ${PROT_KEY},$(eval $(call CERT_ADD_CMD_OPT,${PROT_KEY},--prot-key)))
|
||||
|
|
@ -43,17 +36,10 @@ index 853ad11bef..0aab592228 100644
|
|||
$(if ${NON_TRUSTED_WORLD_KEY},$(eval $(call CERT_ADD_CMD_OPT,${NON_TRUSTED_WORLD_KEY},--non-trusted-world-key)))
|
||||
|
||||
diff --git a/tools/cert_create/include/key.h b/tools/cert_create/include/key.h
|
||||
index 3409502d82..1a03201560 100644
|
||||
index 128e7f7b4..5860abb4e 100644
|
||||
--- a/tools/cert_create/include/key.h
|
||||
+++ b/tools/cert_create/include/key.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
|
||||
+ * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ int key_init(void);
|
||||
@@ -68,7 +68,7 @@ int key_init(void);
|
||||
key_t *key_get_by_opt(const char *opt);
|
||||
int key_new(key_t *key);
|
||||
int key_create(key_t *key, int type, int key_bits);
|
||||
|
|
@ -63,17 +49,10 @@ index 3409502d82..1a03201560 100644
|
|||
|
||||
/* Macro to register the keys used in the CoT */
|
||||
diff --git a/tools/cert_create/src/key.c b/tools/cert_create/src/key.c
|
||||
index 25d7d4bd9b..9ba5028af7 100644
|
||||
index 64359756f..e2a1a4541 100644
|
||||
--- a/tools/cert_create/src/key.c
|
||||
+++ b/tools/cert_create/src/key.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
|
||||
+ * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@@ -137,7 +137,7 @@ int key_create(key_t *key, int type, int key_bits)
|
||||
@@ -128,7 +128,7 @@ int key_create(key_t *key, int type, int key_bits)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +61,7 @@ index 25d7d4bd9b..9ba5028af7 100644
|
|||
{
|
||||
FILE *fp;
|
||||
EVP_PKEY *k;
|
||||
@@ -146,7 +146,7 @@ int key_load(key_t *key, unsigned int *err_code)
|
||||
@@ -137,7 +137,7 @@ int key_load(key_t *key, unsigned int *err_code)
|
||||
/* Load key from file */
|
||||
fp = fopen(key->fn, "r");
|
||||
if (fp) {
|
||||
|
|
@ -92,17 +71,10 @@ index 25d7d4bd9b..9ba5028af7 100644
|
|||
if (k) {
|
||||
*err_code = KEY_ERR_NONE;
|
||||
diff --git a/tools/cert_create/src/main.c b/tools/cert_create/src/main.c
|
||||
index 8a1e02e62f..e79e72745b 100644
|
||||
index b39378ca9..71bf85722 100644
|
||||
--- a/tools/cert_create/src/main.c
|
||||
+++ b/tools/cert_create/src/main.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
|
||||
+ * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@@ -289,7 +289,12 @@ static const cmd_opt_t common_cmd_opt[] = {
|
||||
@@ -288,7 +288,12 @@ static const cmd_opt_t common_cmd_opt[] = {
|
||||
{
|
||||
{ "print-cert", no_argument, NULL, 'p' },
|
||||
"Print the certificates in the standard output"
|
||||
|
|
@ -116,7 +88,7 @@ index 8a1e02e62f..e79e72745b 100644
|
|||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -308,6 +313,7 @@ int main(int argc, char *argv[])
|
||||
@@ -307,6 +312,7 @@ int main(int argc, char *argv[])
|
||||
unsigned char md[SHA512_DIGEST_LENGTH];
|
||||
unsigned int md_len;
|
||||
const EVP_MD *md_info;
|
||||
|
|
@ -124,7 +96,7 @@ index 8a1e02e62f..e79e72745b 100644
|
|||
|
||||
NOTICE("CoT Generation Tool: %s\n", build_msg);
|
||||
NOTICE("Target platform: %s\n", platform_msg);
|
||||
@@ -345,7 +351,7 @@ int main(int argc, char *argv[])
|
||||
@@ -344,7 +350,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (1) {
|
||||
/* getopt_long stores the option index here. */
|
||||
|
|
@ -133,7 +105,7 @@ index 8a1e02e62f..e79e72745b 100644
|
|||
|
||||
/* Detect the end of the options. */
|
||||
if (c == -1) {
|
||||
@@ -379,6 +385,10 @@ int main(int argc, char *argv[])
|
||||
@@ -378,6 +384,10 @@ int main(int argc, char *argv[])
|
||||
case 'p':
|
||||
print_cert = 1;
|
||||
break;
|
||||
|
|
@ -144,7 +116,7 @@ index 8a1e02e62f..e79e72745b 100644
|
|||
case 's':
|
||||
hash_alg = get_hash_alg(optarg);
|
||||
if (hash_alg < 0) {
|
||||
@@ -437,7 +447,7 @@ int main(int argc, char *argv[])
|
||||
@@ -436,7 +446,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* First try to load the key from disk */
|
||||
|
|
@ -154,5 +126,5 @@ index 8a1e02e62f..e79e72745b 100644
|
|||
continue;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
2.25.1
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ LICENSE = "BSD-3-Clause"
|
|||
LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"
|
||||
|
||||
SRC_URI = "git://github.com/ARM-software/arm-trusted-firmware.git;protocol=https;nobranch=1"
|
||||
#SRCREV corresponds to v2.4
|
||||
SRCREV = "e2c509a39c6cc4dda8734e6509cdbe6e3603cdfc"
|
||||
#SRCREV corresponds to v2.6
|
||||
SRCREV = "a1f02f4f3daae7e21ee58b4c93ec3e46b8f28d15"
|
||||
|
||||
# Mandatory fix to allow feeding password through command line
|
||||
SRC_URI += "file://0099-tools-allow-to-use-a-root-key-password-from-command-.patch"
|
||||
Loading…
Reference in New Issue