ARCHIVER: Update for fip build and release information

Change-Id: I8ddd8c61ff7488ce40f87a160f603de32425386a
This commit is contained in:
Lionel VITTE 2021-11-16 08:12:34 +01:00
parent cc43f8cd6e
commit fef27aed02
12 changed files with 210 additions and 66 deletions

View File

@ -27,6 +27,7 @@ python archiver_clean_tarball() {
do_ar_original[postfuncs] =+ "archiver_clean_tarball" do_ar_original[postfuncs] =+ "archiver_clean_tarball"
ARCHIVER_README = "README.HOW_TO.txt" ARCHIVER_README = "README.HOW_TO.txt"
archiver_git_uri() { archiver_git_uri() {
ret=`echo "${SRC_URI}" | grep branch | wc -l` ret=`echo "${SRC_URI}" | grep branch | wc -l`
if [ $ret -gt 0 ]; then if [ $ret -gt 0 ]; then
@ -35,7 +36,14 @@ archiver_git_uri() {
BRANCH=master BRANCH=master
fi fi
sed -i -e "s|##GIT_BRANCH##|$BRANCH|g" -e "s|##GIT_SRCREV##|${SRCREV}|g" -e "s|##BP##|${BP}|g" -e "s|##PV##|${PV}|g" -e "s|##PR##|${PR}|g" ${ARCHIVER_OUTDIR}/${ARCHIVER_README} if [ -z "${ARCHIVER_ST_BRANCH}" ]; then
ARCHIVER_ST_BRANCH="${BRANCH}"
fi
if [ -z "${ARCHIVER_ST_REVISION}" ]; then
ARCHIVER_ST_REVISION="${SRCREV}"
fi
sed -i -e "s|##LINUX_TARNAME##|${LINUX_TARNAME}|g" -e "s|##ARCHIVER_COMMUNITY_BRANCH##|${ARCHIVER_COMMUNITY_BRANCH}|g" -e "s|##ARCHIVER_COMMUNITY_REVISION##|${ARCHIVER_COMMUNITY_REVISION}|g" -e "s|##ARCHIVER_ST_BRANCH##|${ARCHIVER_ST_BRANCH}|g" -e "s|##ARCHIVER_ST_REVISION##|${ARCHIVER_ST_REVISION}|g" -e "s|##BP##|${BP}|g" -e "s|##PV##|${PV}|g" -e "s|##PR##|${PR}|g" ${ARCHIVER_OUTDIR}/${ARCHIVER_README}
} }
do_ar_original[postfuncs] =+ "archiver_git_uri" do_ar_original[postfuncs] =+ "archiver_git_uri"

View File

@ -27,7 +27,11 @@ TF_A_ENABLE_DEBUG_WRAPPER ?= ${TF_A_ENABLE_DEBUG_WRAPPER}
ENABLE_FIP ?= ${@bb.utils.contains('MACHINE_FEATURES', 'fip', '1', '', d)} ENABLE_FIP ?= ${@bb.utils.contains('MACHINE_FEATURES', 'fip', '1', '', d)}
# Set default TF-A config # Set default TF-A config
ifeq (\$(ENABLE_FIP), 1)
TF_A_CONFIG ?= ${TF_A_CONFIG} TF_A_CONFIG ?= ${TF_A_CONFIG}
else
TF_A_CONFIG ?= ${BOOTSCHEME_LABELS} ${TF_A_CONFIG_4LEGACY}
endif
# Default TF-A overall settings to null # Default TF-A overall settings to null
TF_A_BINARY ?= TF_A_BINARY ?=
@ -35,6 +39,8 @@ TF_A_DEVICETREE ?=
TF_A_MAKE_TARGET ?= TF_A_MAKE_TARGET ?=
TF_A_EXTRA_OPTFLAGS ?= TF_A_EXTRA_OPTFLAGS ?=
ifeq (\$(ENABLE_FIP), 1)
EOF EOF
unset i unset i
for config in ${TF_A_CONFIG}; do for config in ${TF_A_CONFIG}; do
@ -49,6 +55,46 @@ TF_A_MAKE_TARGET_$config ?= $(echo ${TF_A_MAKE_TARGET} | cut -d',' -f${i})
EOF EOF
done done
cat << EOF >> ${ARCHIVER_OUTDIR}/Makefile.sdk 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 # Reset default variables
LDFLAGS = LDFLAGS =
CFLAGS = CFLAGS =
@ -84,7 +130,7 @@ tf-\$(1): \$2
DTB_FILE_NAME=\$(dt).dtb \\ DTB_FILE_NAME=\$(dt).dtb \\
\$(if \$(TF_A_EXTRA_OPTFLAGS),\$(TF_A_EXTRA_OPTFLAGS),\$(TF_A_EXTRA_OPTFLAGS_\$(1))) \\ \$(if \$(TF_A_EXTRA_OPTFLAGS),\$(TF_A_EXTRA_OPTFLAGS),\$(TF_A_EXTRA_OPTFLAGS_\$(1))) \\
\$(if \$(TF_A_MAKE_TARGET),\$(TF_A_MAKE_TARGET),\$(TF_A_MAKE_TARGET_\$(1))) \\ \$(if \$(TF_A_MAKE_TARGET),\$(TF_A_MAKE_TARGET),\$(TF_A_MAKE_TARGET_\$(1))) \\
\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),\$(shell echo \$(soc) | tr a-z A-Z)=1,)) ; \\ \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),\$(shell echo \$(soc) | tr a-z A-Z)=1,)) ; \\
) )
endef endef
@ -102,13 +148,13 @@ deploy-\$(1): tf-\$(1)
fi ; \\ fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/${BL32_BASENAME}.${BL32_SUFFIX} ] ; then \\ if [ -f \$(BLD_PATH)/\$(1)/${BL32_BASENAME}.${BL32_SUFFIX} ] ; then \\
mkdir -p \$(BL32_DEPLOYDIR) ; \\ mkdir -p \$(BL32_DEPLOYDIR) ; \\
cp -f \$(BLD_PATH)/\$(1)/${BL32_BASENAME}.${BL32_SUFFIX} \$(BL32_DEPLOYDIR)/\$(2)-${BL32_BASENAME}\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),-\$(soc),)).${BL32_SUFFIX} ; \\ cp -f \$(BLD_PATH)/\$(1)/${BL32_BASENAME}.${BL32_SUFFIX} \$(BL32_DEPLOYDIR)/\$(2)-${BL32_BASENAME}\$(strip \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),-\$(soc),))).${BL32_SUFFIX} ; \\
if [ -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${BL32_BASENAME}.${DT_SUFFIX} ]; then \\ if [ -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${BL32_BASENAME}.${DT_SUFFIX} ]; then \\
cp -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${BL32_BASENAME}.${DT_SUFFIX} \$(BL32_DEPLOYDIR)/ ; \\ cp -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${BL32_BASENAME}.${DT_SUFFIX} \$(BL32_DEPLOYDIR)/ ; \\
fi ; \\ fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/${BL32_ELF} ]; then \\ if [ -f \$(BLD_PATH)/\$(1)/${BL32_ELF} ]; then \\
mkdir -p \$(BL32_DEPLOYDIR)/debug ; \\ mkdir -p \$(BL32_DEPLOYDIR)/debug ; \\
mv -f \$(BLD_PATH)/\$(1)/${BL32_ELF} \$(BL32_DEPLOYDIR)/debug/\$(2)-${BL32_BASENAME}\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),-\$(soc),)).${TF_A_ELF_SUFFIX} ; \\ mv -f \$(BLD_PATH)/\$(1)/${BL32_ELF} \$(BL32_DEPLOYDIR)/debug/\$(2)-${BL32_BASENAME}\$(strip \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),-\$(soc),))).${TF_A_ELF_SUFFIX} ; \\
fi ; \\ fi ; \\
fi ; \\ fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${FWCONFIG_NAME}.${DT_SUFFIX} ]; then \\ if [ -f \$(BLD_PATH)/\$(1)/fdts/\$(dt)-${FWCONFIG_NAME}.${DT_SUFFIX} ]; then \\
@ -124,6 +170,12 @@ deploy-\$(1): tf-\$(1)
) )
endef endef
# Set dependencies list for building all
DEPS = \$(addprefix deploy-,\$(TF_A_CONFIG))
ifeq (\$(ENABLE_FIP), 1)
DEPS += fip
endif
help: help:
@echo @echo
@echo "TF-A configuration:" @echo "TF-A configuration:"
@ -160,7 +212,7 @@ endif
@echo " clean : clean build directories from generated files" @echo " clean : clean build directories from generated files"
@echo @echo
all: \$(addprefix deploy-,\$(TF_A_CONFIG)) \$(if \$(ENABLE_FIP),fip) all: \$(DEPS)
host_tools: host_tools:
@\$(MAKE) --no-print-directory -C \$(SRC_PATH)/tools/stm32image @\$(MAKE) --no-print-directory -C \$(SRC_PATH)/tools/stm32image

View File

@ -47,20 +47,32 @@ git management on the code see section 4 [Management of tf-a source code]
4. Management of tf-a source code: 4. Management of tf-a source code:
----------------------------------- -----------------------------------
If you like to have a better management of change made on tf-a source, you If you like to have a better management of change made on tf-a source, you
can use git: 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##
$ git clone https://github.com/STMicroelectronics/arm-trusted-firmware.git
$ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
4.2 Create Git from tarball
$ cd <directory to tf-a source code> $ cd <directory to tf-a source code>
$ test -d .git || git init . && git add . && git commit -m "tf-a source code" && git gc $ test -d .git || git init . && git add . && git commit -m "tf-a source code" && git gc
$ git checkout -b WORKING $ git checkout -b WORKING
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done $ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
NB: you can use directly the source from the community: 4.3 Get Git from community and apply STMicroelectronics patches
URL: git://github.com/ARM-software/arm-trusted-firmware.git
Branch: ##GIT_BRANCH##
Revision: ##GIT_SRCREV##
$ git clone git://github.com/ARM-software/arm-trusted-firmware.git -b ##GIT_BRANCH## 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 <directory to tf-a source code>
$ git checkout -b WORKING ##GIT_SRCREV## $ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done $ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
5. Build tf-a source code: 5. Build tf-a source code:
@ -72,9 +84,9 @@ Since OpenSTLinux has activated FIP by default, so the FIP_artifacts should be s
To compile tf-a source code To compile tf-a source code
$> make -f $PWD/../Makefile.sdk all $> make -f $PWD/../Makefile.sdk all
or for a specific config : or for a specific config :
$ make -f $PWD/../Makefile.sdk TFA_DEVICETREE=stm32mp157c-ev1 TF_A_CONFIG=trusted ELF_DEBUG_ENABLE='1' all $ make -f $PWD/../Makefile.sdk TF_A_DEVICETREE=stm32mp157c-ev1 TF_A_CONFIG=trusted ELF_DEBUG_ENABLE='1' all
NB: TFA_DEVICETREE flag must be set to switch to correct board configuration. NB: TF_A_DEVICETREE flag must be set to switch to correct board configuration.
The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip

View File

@ -16,8 +16,15 @@ SRC_URI += " \
file://0001-st-update-v2.4-r1.0.0.patch \ file://0001-st-update-v2.4-r1.0.0.patch \
" "
TF_VERSION = "2.4" TF_A_VERSION = "v2.4"
PV = "${TF_VERSION}.r1" TF_A_SUBVERSION = "stm32mp"
TF_A_RELEASE = "r1"
PV = "${TF_A_VERSION}-${TF_A_SUBVERSION}-${TF_A_RELEASE}"
ARCHIVER_ST_BRANCH = "${TF_A_VERSION}-${TF_A_SUBVERSION}"
ARCHIVER_ST_REVISION = "${PV}"
ARCHIVER_COMMUNITY_BRANCH = "master"
ARCHIVER_COMMUNITY_REVISION = "${TF_A_VERSION}"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
@ -39,7 +46,7 @@ include ${@oe.utils.ifelse(d.getVar('ST_ARCHIVER_ENABLE') == '1', 'tf-a-stm32mp-
# --------------------------------- # ---------------------------------
BBCLASSEXTEND = "devupstream:target" BBCLASSEXTEND = "devupstream:target"
SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/arm-trusted-firmware.git;protocol=https;branch=v${TF_VERSION}-stm32mp" SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/arm-trusted-firmware.git;protocol=https;branch=${ARCHIVER_ST_BRANCH}"
SRCREV_class-devupstream = "40572e4067f205691a4dca3b5fdabe3a40c69594" SRCREV_class-devupstream = "40572e4067f205691a4dca3b5fdabe3a40c69594"
# --------------------------------- # ---------------------------------

View File

@ -70,7 +70,7 @@ CPPFLAGS =
UBOOT_LOCALVERSION = ${UBOOT_LOCALVERSION} UBOOT_LOCALVERSION = ${UBOOT_LOCALVERSION}
# Configure default fip feature # Configure default fip feature
ENABLE_FIP ?= "${@bb.utils.contains('MACHINE_FEATURES','fip','1','',d)}" ENABLE_FIP ?= ${@bb.utils.contains('MACHINE_FEATURES','fip','1','',d)}
# Display U-Boot config details # Display U-Boot config details
define uboot-configs define uboot-configs
@ -85,7 +85,7 @@ endef
# Configure U-Boot configure rules (configure-DEFCONFIG-CONFIG) # Configure U-Boot configure rules (configure-DEFCONFIG-CONFIG)
define configure-rules define configure-rules
configure-\$(1)-\$(2): version configure-\$(1)-\$(2): version
ifeq (\$(ENABLE_FIP),) ifeq (\$(ENABLE_FIP),0)
@if ! grep -q 'CONFIG_STM32MP15x_STM32IMAGE=y' \$(SRC_PATH)/configs/\$(1); then \\ @if ! grep -q 'CONFIG_STM32MP15x_STM32IMAGE=y' \$(SRC_PATH)/configs/\$(1); then \\
echo "CONFIG_STM32MP15x_STM32IMAGE=y" >> \$(SRC_PATH)/configs/\$(1) ; \\ echo "CONFIG_STM32MP15x_STM32IMAGE=y" >> \$(SRC_PATH)/configs/\$(1) ; \\
fi fi
@ -98,11 +98,19 @@ endef
# Configure U-Boot make rules (uboot-DEFCONFIG-CONFIG) # Configure U-Boot make rules (uboot-DEFCONFIG-CONFIG)
define uboot-rules define uboot-rules
uboot-\$(1)-\$(2): configure-\$(1)-\$(2) uboot-\$(1)-\$(2): configure-\$(1)-\$(2)
@mkdir -p \$(DEPLOYDIR)
@\$(foreach dt, \$(if \$(DEVICETREE),\$(DEVICETREE),\$(UBOOT_DEVICETREE_\$(1))), \\ @\$(foreach dt, \$(if \$(DEVICETREE),\$(DEVICETREE),\$(UBOOT_DEVICETREE_\$(1))), \\
\$(MAKE) -C \$(SRC_PATH) ${UBOOT_MAKE_TARGET} \\ \$(MAKE) -C \$(SRC_PATH) ${UBOOT_MAKE_TARGET} \\
O=\$(BLD_PATH)/\$(1) \\ O=\$(BLD_PATH)/\$(1) \\
DEVICE_TREE=\$(dt) \\ DEVICE_TREE=\$(dt) \\
DEVICE_TREE_EXT=\$(dt).dtb ; \\ DEVICE_TREE_EXT=\$(dt).dtb ; \\
cp -f \$(BLD_PATH)/\$(1)/\$(3) \$(DEPLOYDIR)/u-boot-\$(dt)-\$(2).\$(shell echo \$(3) | cut -d'.' -f2) ; \\
if [ -f \$(BLD_PATH)/\$(1)/\$(shell echo \$(3) | cut -d'.' -f1).stm32 ]; then \\
cp -f \$(BLD_PATH)/\$(1)/\$(shell echo \$(3) | cut -d'.' -f1).stm32 \$(DEPLOYDIR)/u-boot-\$(dt)-\$(2).stm32 ; \\
fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/${SPL_BINARY_STM32} ]; then \\
cp -f \$(BLD_PATH)/\$(1)/${SPL_BINARY_STM32} \$(DEPLOYDIR)/${SPL_BINARYNAME}-\$(dt)-\$(2) ; \\
fi ; \\
) )
endef endef
@ -112,18 +120,14 @@ deploy-\$(1)-\$(2): uboot-\$(1)-\$(2)
@mkdir -p \$(DEPLOYDIR) @mkdir -p \$(DEPLOYDIR)
@mkdir -p \$(DEPLOYDIR)/debug @mkdir -p \$(DEPLOYDIR)/debug
@\$(foreach dt, \$(if \$(DEVICETREE),\$(DEVICETREE),\$(UBOOT_DEVICETREE_\$(1))), \\ @\$(foreach dt, \$(if \$(DEVICETREE),\$(DEVICETREE),\$(UBOOT_DEVICETREE_\$(1))), \\
cp -f \$(BLD_PATH)/\$(1)/\$(3) \$(DEPLOYDIR)/u-boot-\$(dt)-\$(2).\$(shell echo \$(3) | cut -d'.' -f2) ; \\
if [ -f \$(BLD_PATH)/\$(1)/${SPL_BINARY_STM32} ]; then \\
cp -f \$(BLD_PATH)/\$(1)/${SPL_BINARY_STM32} \$(DEPLOYDIR)/${SPL_BINARYNAME}-\$(dt)-\$(2) ; \\
fi ; \\
if [ "\$(shell echo \$(3) | cut -d'.' -f2)" = "dtb" ]; then \\ if [ "\$(shell echo \$(3) | cut -d'.' -f2)" = "dtb" ]; then \\
cp -f \$(BLD_PATH)/\$(1)/u-boot-nodtb.bin \$(DEPLOYDIR)/u-boot-nodtb\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),-\$(soc),)).bin ; \\ cp -f \$(BLD_PATH)/\$(1)/u-boot-nodtb.bin \$(DEPLOYDIR)/u-boot-nodtb\$(strip \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),-\$(soc),))).bin ; \\
fi ; \\ fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/${UBOOT_ELF} ]; then \\ if [ -f \$(BLD_PATH)/\$(1)/${UBOOT_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$(1)/${UBOOT_ELF} \$(DEPLOYDIR)/debug/u-boot\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),-\$(soc),))-\$(2).${UBOOT_ELF_SUFFIX} ; \\ cp -f \$(BLD_PATH)/\$(1)/${UBOOT_ELF} \$(DEPLOYDIR)/debug/u-boot\$(strip \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),-\$(soc),)))-\$(2).${UBOOT_ELF_SUFFIX} ; \\
fi ; \\ fi ; \\
if [ -f \$(BLD_PATH)/\$(1)/${SPL_ELF} ]; then \\ if [ -f \$(BLD_PATH)/\$(1)/${SPL_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$(1)/${SPL_ELF} \$(DEPLOYDIR)/debug/${SPL_ELF_NAME}\$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(shell echo \$(dt) | grep -c \$(soc)),-\$(soc),))-\$(2) ; \\ cp -f \$(BLD_PATH)/\$(1)/${SPL_ELF} \$(DEPLOYDIR)/debug/${SPL_ELF_NAME}\$(strip \$(foreach soc,${STM32MP_SOC_NAME},\$(if \$(findstring \$(soc),\$(dt)),-\$(soc),)))-\$(2) ; \\
fi ; \\ fi ; \\
) )
endef endef
@ -133,6 +137,12 @@ deploy-targets := \$(foreach config, \$(if \$(UBOOT_CONFIG),\$(UBOOT_CONFIG),\$(
\$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), deploy-\$(defconfig)-\$(config)) \\ \$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), deploy-\$(defconfig)-\$(config)) \\
) )
# Set dependencies list for building all
DEPS = \$(deploy-targets)
ifeq (\$(ENABLE_FIP), 1)
DEPS += fip
endif
help: help:
@echo @echo
@echo "U-Boot configuration:" @echo "U-Boot configuration:"
@ -161,7 +171,7 @@ endif
@echo " fip : build FIP binaries" @echo " fip : build FIP binaries"
@echo " clean : clean build directories from generated files" @echo " clean : clean build directories from generated files"
all: \$(deploy-targets) \$(if \$(ENABLE_FIP),fip) all: \$(DEPS)
clean: clean:
@for config in \$(UBOOT_CONFIGS); do \\ @for config in \$(UBOOT_CONFIGS); do \\
@ -174,7 +184,7 @@ clean:
@echo @echo
fip: \$(deploy-targets) fip: \$(deploy-targets)
FIP_DEPLOYDIR_UBOOT=\$(DEPLOYDIR) FIP_DEVICETREE="\$(DEVICE_TREE)" fiptool-stm32mp FIP_DEPLOYDIR_UBOOT=\$(DEPLOYDIR) FIP_DEVICETREE="\$(DEVICETREE)" fiptool-stm32mp
version: version:
@if test ! -e \$(SRC_PATH)/.scmversion ; then echo \$(UBOOT_LOCALVERSION) > \$(SRC_PATH)/.scmversion; fi @if test ! -e \$(SRC_PATH)/.scmversion ; then echo \$(UBOOT_LOCALVERSION) > \$(SRC_PATH)/.scmversion; fi
@ -184,7 +194,8 @@ version:
\$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \$(eval \$(call configure-rules,\$(defconfig),\$(config))))) \$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \$(eval \$(call configure-rules,\$(defconfig),\$(config)))))
# Set U-Boot make rules # Set U-Boot make rules
\$(foreach config, \$(if \$(UBOOT_CONFIG),\$(UBOOT_CONFIG),\$(UBOOT_CONFIGS)), \\ \$(foreach config, \$(if \$(UBOOT_CONFIG),\$(UBOOT_CONFIG),\$(UBOOT_CONFIGS)), \\
\$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \$(eval \$(call uboot-rules,\$(defconfig),\$(config))))) \$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \\
\$(eval \$(call uboot-rules,\$(defconfig),\$(config),\$(if \$(UBOOT_BINARY),\$(UBOOT_BINARY),\$(UBOOT_BINARY_\$(defconfig)))))))
# Set U-Boot deploy rules # Set U-Boot deploy rules
\$(foreach config, \$(if \$(UBOOT_CONFIG),\$(UBOOT_CONFIG),\$(UBOOT_CONFIGS)), \\ \$(foreach config, \$(if \$(UBOOT_CONFIG),\$(UBOOT_CONFIG),\$(UBOOT_CONFIGS)), \\
\$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \\ \$(foreach defconfig, \$(if \$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG),\$(UBOOT_DEFCONFIG_\$(config))), \\

View File

@ -24,8 +24,15 @@ SRC_URI += "\
file://0099-Add-external-var-to-allow-build-of-new-devicetree-fi.patch \ file://0099-Add-external-var-to-allow-build-of-new-devicetree-fi.patch \
" "
U_BOOT_VERSION = "2020.10" U_BOOT_VERSION = "v2020.10"
PV = "${U_BOOT_VERSION}.r1" U_BOOT_SUBVERSION = "stm32mp"
U_BOOT_RELEASE = "r1"
PV = "${U_BOOT_VERSION}-${U_BOOT_SUBVERSION}-${U_BOOT_RELEASE}"
ARCHIVER_ST_BRANCH = "${U_BOOT_VERSION}-${U_BOOT_SUBVERSION}"
ARCHIVER_ST_REVISION = "${PV}"
ARCHIVER_COMMUNITY_BRANCH = "master"
ARCHIVER_COMMUNITY_REVISION = "${U_BOOT_VERSION}"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
@ -34,7 +41,7 @@ S = "${WORKDIR}/git"
# --------------------------------- # ---------------------------------
BBCLASSEXTEND = "devupstream:target" BBCLASSEXTEND = "devupstream:target"
SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/u-boot.git;protocol=https;branch=v${U_BOOT_VERSION}-stm32mp" SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/u-boot.git;protocol=https;branch=${ARCHIVER_ST_BRANCH}"
SRCREV_class-devupstream = "d2c99cb7e5b7dc74236f67fcced156956155cd71" SRCREV_class-devupstream = "d2c99cb7e5b7dc74236f67fcced156956155cd71"
# --------------------------------- # ---------------------------------

View File

@ -63,11 +63,11 @@ you have 3 solutions to use git
4.1 Get STMicroelectronics U-Boot source from GitHub 4.1 Get STMicroelectronics U-Boot source from GitHub
URL: https://github.com/STMicroelectronics/u-boot.git URL: https://github.com/STMicroelectronics/u-boot.git
Branch: v##PV##-stm32mp Branch: ##ARCHIVER_ST_BRANCH##
Revision: v##PV##-stm32mp-##PR## Revision: ##ARCHIVER_ST_REVISION##
$ git clone https://github.com/STMicroelectronics/u-boot.git $ git clone https://github.com/STMicroelectronics/u-boot.git
$ git checkout -b WORKING v##PV##-stm32mp-##PR## $ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
4.2 Create Git from tarball 4.2 Create Git from tarball
@ -80,15 +80,15 @@ you have 3 solutions to use git
4.3 Get Git from community and apply STMicroelectronics patches 4.3 Get Git from community and apply STMicroelectronics patches
URL: git://git.denx.de/u-boot.git URL: git://git.denx.de/u-boot.git
Branch: master Branch: ##ARCHIVER_COMMUNITY_BRANCH##
Revision: v##PV## Revision: ##ARCHIVER_COMMUNITY_REVISION##
$ git clone git://git.denx.de/u-boot.git $ git clone git://git.denx.de/u-boot.git
or or
$ git clone http://git.denx.de/u-boot.git $ git clone http://git.denx.de/u-boot.git
$ cd u-boot $ cd u-boot
$ git checkout -b WORKING v##PV## $ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
$ for p in `ls -1 ../*.patch`; do git am $p; done $ for p in `ls -1 ../*.patch`; do git am $p; done
5. Compilation U-Boot source code: 5. Compilation U-Boot source code:
@ -141,7 +141,7 @@ The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip
You can override the default U-Boot configuration if you specify these variables: You can override the default U-Boot configuration if you specify these variables:
- Compile default U-Boot configuration but applying specific devicetree(s): - Compile default U-Boot configuration but applying specific devicetree(s):
$ make -f $PWD/../Makefile.sdk all UBOOT_DEVICETREE="<devicetree1> <devicetree2>" $ make -f $PWD/../Makefile.sdk all DEVICETREE="<devicetree1> <devicetree2>"
- Compile for a specific U-Boot configuration: - Compile for a specific U-Boot configuration:
$ make -f $PWD/../Makefile.sdk all UBOOT_CONFIG=trusted UBOOT_DEFCONFIG=stm32mp15_trusted_defconfig UBOOT_BINARY=u-boot.dtb DEVICETREE=stm32mp157f-dk2 $ make -f $PWD/../Makefile.sdk all UBOOT_CONFIG=trusted UBOOT_DEFCONFIG=stm32mp15_trusted_defconfig UBOOT_BINARY=u-boot.dtb DEVICETREE=stm32mp157f-dk2

View File

@ -49,9 +49,9 @@ sourced the SDK environment.
------------------------- -------------------------
If you have the tarball and the list of patches, then you must extract the If you have the tarball and the list of patches, then you must extract the
tarball and apply the patches. tarball and apply the patches.
$> tar xfJ linux-##PV##.tar.xz $> tar xfJ ##LINUX_TARNAME##.tar.xz
A new directory containing kernel standard source code will be created, go into it: A new directory containing kernel standard source code will be created, go into it:
$> cd linux-##PV## $> cd ##LINUX_TARNAME##
NB: if you like to have a git management of the code, see section 4 [Manage the NB: if you like to have a git management of the code, see section 4 [Manage the
kernel source code] kernel source code]
@ -60,10 +60,20 @@ kernel source code]
4. Manage the kernel source code: 4. Manage the kernel source code:
--------------------------------- ---------------------------------
4.1 Setup kernel source code under git If you like to have a better management of change made on kernel source, you
-------------------------------------- have 3 solutions to use git.
If you like to have a better management of change made on kernel source, you can
use git. 4.1 Get STMicroelectronics kernel source code from GitHub
URL: https://github.com/STMicroelectronics/linux.git
Branch: ##ARCHIVER_ST_BRANCH##
Revision: ##ARCHIVER_ST_REVISION##
$ git clone https://github.com/STMicroelectronics/linux.git
$ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
4.2 Create Git from tarball
* With the kernel source code extracted in the section 3 [Prepare kernel source] * With the kernel source code extracted in the section 3 [Prepare kernel source]
$ cd <directory to kernel source code> $ cd <directory to kernel source code>
@ -73,16 +83,16 @@ use git.
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done $ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
NB: this is the fastest way to get your kernel source code ready for development NB: this is the fastest way to get your kernel source code ready for development
Or 4.3 Get Git from community and apply STMicroelectronics patches
* With the kernel source code from the Linux kernel git repositories: * With the kernel source code from the Linux kernel git repositories:
URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Branch: ##GIT_BRANCH## Branch: ##ARCHIVER_COMMUNITY_BRANCH##
Revision: ##GIT_SRCREV## Revision: ##ARCHIVER_COMMUNITY_REVISION##
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git $ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
$ cd <kernel source> $ cd <kernel source>
$ git checkout -b WORKING ##GIT_SRCREV## $ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done $ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
NB: this way is slightly slower than the tarball extraction but you get NB: this way is slightly slower than the tarball extraction but you get
advantage of all git history. advantage of all git history.

View File

@ -8,7 +8,8 @@ include linux-stm32mp.inc
LINUX_VERSION = "5.10" LINUX_VERSION = "5.10"
LINUX_SUBVERSION = "10" LINUX_SUBVERSION = "10"
SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${LINUX_VERSION}.${LINUX_SUBVERSION}.tar.xz;name=kernel" LINUX_TARNAME = "linux-${LINUX_VERSION}.${LINUX_SUBVERSION}"
SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v5.x/${LINUX_TARNAME}.tar.xz;name=kernel"
#SRC_URI = "https://git.kernel.org/torvalds/t/linux-${LINUX_VERSION}-${LINUX_SUBVERSION}.tar.gz;name=kernel" #SRC_URI = "https://git.kernel.org/torvalds/t/linux-${LINUX_VERSION}-${LINUX_SUBVERSION}.tar.gz;name=kernel"
SRC_URI[kernel.sha256sum] = "60ed866fa951522a5255ea37ec3ac2006d3f3427d4783a13ef478464f37cdb19" SRC_URI[kernel.sha256sum] = "60ed866fa951522a5255ea37ec3ac2006d3f3427d4783a13ef478464f37cdb19"
@ -38,18 +39,24 @@ SRC_URI += " \
file://${LINUX_VERSION}/${LINUX_VERSION}.${LINUX_SUBVERSION}/0022-ARM-5.10.10-stm32mp1-r1-CONFIG.patch \ file://${LINUX_VERSION}/${LINUX_VERSION}.${LINUX_SUBVERSION}/0022-ARM-5.10.10-stm32mp1-r1-CONFIG.patch \
" "
PV = "${LINUX_VERSION}.${LINUX_SUBVERSION}" LINUX_TARGET = "stm32mp"
LINUX_RELEASE = "r1"
PV = "${LINUX_VERSION}.${LINUX_SUBVERSION}-${LINUX_TARGET}-${LINUX_RELEASE}"
ARCHIVER_ST_BRANCH = "v${LINUX_VERSION}-${LINUX_TARGET}"
ARCHIVER_ST_REVISION = "v${LINUX_VERSION}-${LINUX_TARGET}-${LINUX_RELEASE}"
ARCHIVER_COMMUNITY_BRANCH = "linux-${LINUX_VERSION}.y"
ARCHIVER_COMMUNITY_REVISION = "v${LINUX_VERSION}.${LINUX_SUBVERSION}"
S = "${WORKDIR}/linux-${LINUX_VERSION}.${LINUX_SUBVERSION}" S = "${WORKDIR}/linux-${LINUX_VERSION}.${LINUX_SUBVERSION}"
#S = "${WORKDIR}/linux-${LINUX_VERSION}-${LINUX_SUBVERSION}"
#S = "${WORKDIR}/linux-${LINUX_VERSION}"
# --------------------------------- # ---------------------------------
# Configure devupstream class usage # Configure devupstream class usage
# --------------------------------- # ---------------------------------
BBCLASSEXTEND = "devupstream:target" BBCLASSEXTEND = "devupstream:target"
SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/linux.git;protocol=https;branch=v${LINUX_VERSION}-stm32mp" SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/linux.git;protocol=https;branch=${ARCHIVER_ST_BRANCH}"
SRCREV_class-devupstream = "ce6891abb1c895d4849e6f784615687341b3dbde" SRCREV_class-devupstream = "ce6891abb1c895d4849e6f784615687341b3dbde"
# --------------------------------- # ---------------------------------

View File

@ -30,10 +30,22 @@ CFLAGS =
CPPFLAGS = CPPFLAGS =
# Define default make options # Define default make options
EXTRA_OEMAKE = $(echo "${EXTRA_OEMAKE}" | sed "s|LIBGCC_LOCATE_CFLAGS=[^ ]* |LIBGCC_LOCATE_CFLAGS=\$(KCFLAGS) |;s|comp-cflagscore='[^']*'|comp-cflagscore='\$(KCFLAGS)'|") EXTRA_OEMAKE = $(echo "${EXTRA_OEMAKE}" | sed "s|LIBGCC_LOCATE_CFLAGS=[^ ]* |LIBGCC_LOCATE_CFLAGS=\$(KCFLAGS) |;s|comp-cflagscore='[^']*'|comp-cflagscore='\$(KCFLAGS)'|")
EXTRA_OEMAKE += \$(if \$(ENABLE_FIP),,CFG_STM32MP15x_STM32IMAGE=y) ifeq (\$(ENABLE_FIP), 0)
EXTRA_OEMAKE += CFG_STM32MP15x_STM32IMAGE=y
endif
# Configure default optee-os features # Configure default optee-os features
OPTEE_SUFFIX ?= \$(if \$(ENABLE_FIP),bin,stm32) ifeq (\$(ENABLE_FIP), 1)
OPTEE_SUFFIX ?= bin
else
OPTEE_SUFFIX ?= stm32
endif
# Set dependencies list for building all
DEPS = optee
ifeq (\$(ENABLE_FIP), 1)
DEPS += fip
endif
help: help:
@echo @echo
@ -56,7 +68,7 @@ endif
@echo " clean : clean build directories from generated files" @echo " clean : clean build directories from generated files"
@echo @echo
all: optee \$(if \$(ENABLE_FIP),fip) all: \$(DEPS)
optee: optee:
@mkdir -p \$(DEPLOYDIR) @mkdir -p \$(DEPLOYDIR)

View File

@ -10,7 +10,15 @@ SRC_URI += " \
" "
OPTEE_VERSION = "3.12.0" OPTEE_VERSION = "3.12.0"
PV = "${OPTEE_VERSION}.r1" OPTEE_SUBVERSION = "stm32mp"
OPTEE_RELEASE = "r1"
PV = "${OPTEE_VERSION}-${OPTEE_SUBVERSION}-${OPTEE_RELEASE}"
ARCHIVER_ST_BRANCH = "${OPTEE_VERSION}-${OPTEE_SUBVERSION}"
ARCHIVER_ST_REVISION = "${PV}"
ARCHIVER_COMMUNITY_BRANCH = "master"
ARCHIVER_COMMUNITY_REVISION = "${OPTEE_VERSION}"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
@ -38,7 +46,7 @@ include ${@oe.utils.ifelse(d.getVar('ST_ARCHIVER_ENABLE') == '1', 'optee-os-stm3
# --------------------------------- # ---------------------------------
BBCLASSEXTEND = "devupstream:target" BBCLASSEXTEND = "devupstream:target"
SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/optee_os.git;protocol=https;branch=${OPTEE_VERSION}-stm32mp" SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/optee_os.git;protocol=https;branch=${ARCHIVER_ST_BRANCH}"
SRCREV_class-devupstream = "0bd33404e9581d00514034b7b05a2cbe8649c1fd" SRCREV_class-devupstream = "0bd33404e9581d00514034b7b05a2cbe8649c1fd"
# --------------------------------- # ---------------------------------

View File

@ -41,8 +41,18 @@ on the code see section 4 [Management of optee-os source code]
4. Management of optee-os source code: 4. Management of optee-os source code:
----------------------------------- -----------------------------------
If you like to have a better management of change made on optee-os source, you If you like to have a better management of change made on optee-os source,
can use git: you have 3 solutions to use git
4.1 Get STMicroelectronics optee-os source from GitHub
URL: https://github.com/STMicroelectronics/optee_os.git
Branch: ##ARCHIVER_ST_BRANCH##
Revision: ##ARCHIVER_ST_REVISION##
$ git clone https://github.com/STMicroelectronics/optee_os.git
$ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
4.2 Create Git from tarball
$ cd <optee-os source> $ cd <optee-os source>
$ test -d .git || git init . && git add . && git commit -m "optee-os source code" && git gc $ test -d .git || git init . && git add . && git commit -m "optee-os source code" && git gc
$ git checkout -b WORKING $ git checkout -b WORKING
@ -52,14 +62,14 @@ MANDATORY: You must update sources
$ cd <directory to optee-os source code> $ cd <directory to optee-os source code>
$ chmod 755 scripts/bin_to_c.py $ chmod 755 scripts/bin_to_c.py
NB: you can use directly the source from the community: 4.3 Get Git from community and apply STMicroelectronics patches
URL: git://github.com/OP-TEE/optee_os.git URL: git://github.com/OP-TEE/optee_os.git
Branch: ##GIT_BRANCH## Branch: ##ARCHIVER_COMMUNITY_BRANCH##
Revision: ##GIT_SRCREV## Revision: ##ARCHIVER_COMMUNITY_REVISION##
$ git clone git://github.com/OP-TEE/optee_os.git $ git clone git://github.com/OP-TEE/optee_os.git
$ cd <optee-os source> $ cd <optee-os source>
$ git checkout -b WORKING ##GIT_SRCREV## $ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done $ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
MANDATORY: You must update sources MANDATORY: You must update sources