U-BOOT-STM32MP: update to v2020.10-stm32mp-r1

Change-Id: I0daab68bd2d82f12b3ed0bcb99dcf683d95ffdc6
This commit is contained in:
Romuald JEANNE 2021-03-15 16:15:10 +01:00
parent b986ba2af3
commit ee3b4ddd69
23 changed files with 14930 additions and 39392 deletions

View File

@ -1,27 +0,0 @@
SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " \
file://fw_env.config.mmc \
file://fw_env.config.nand \
file://fw_env.config.nor \
"
DEPENDS += "u-boot-fw-utils"
# Specific function to manage any trial for source code extraction through
# devtool which can not be supported as we're sharing original source from
# virtual/bootloader provider via STAGING_UBOOT_DIR shared folder
python () {
if bb.data.inherits_class('devtool-source', d):
bb.fatal('The %s recipe does not actually check out own source and thus cannot be supported by devtool.' % d.getVar("BPN"))
}
do_install () {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/fw_env.config.* ${D}${sysconfdir}/
}
FILES_${PN} += "${sysconfdir}/"
RDEPENDS_${PN} += "u-boot-fw-utils"

View File

@ -0,0 +1,24 @@
SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " \
file://fw_env.config.mmc \
file://fw_env.config.nand \
file://fw_env.config.nor \
"
DEPENDS += "u-boot-fw-utils"
do_install () {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/fw_env.config.* ${D}${sysconfdir}/
if ${@bb.utils.contains('MACHINE_FEATURES','fip','true','false',d)}; then
sed -i 's/ssbl/fip/g' ${D}${sysconfdir}/fw_env.config.mmc
sed -i 's/0x280000/0x480000/g' ${D}${sysconfdir}/fw_env.config.nor
sed -i 's/0x2C0000/0x4C0000/g' ${D}${sysconfdir}/fw_env.config.nor
fi
}
FILES_${PN} += "${sysconfdir}/"
RDEPENDS_${PN} += "u-boot-fw-utils"

View File

@ -35,94 +35,153 @@ archiver_create_makefile_for_sdk() {
mkdir -p ${ARCHIVER_OUTDIR} mkdir -p ${ARCHIVER_OUTDIR}
# Remove default variable cat << EOF > ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "LDFLAGS=" > ${ARCHIVER_OUTDIR}/Makefile.sdk # Set default path
echo "CFLAGS=" >> ${ARCHIVER_OUTDIR}/Makefile.sdk SRC_PATH ?= \$(PWD)
echo "CPPFLAGS=" >> ${ARCHIVER_OUTDIR}/Makefile.sdk BLD_PATH ?= \$(SRC_PATH)/../build
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk DEPLOYDIR ?= \$(SRC_PATH)/../deploy
echo "LOCAL_PATH=\$(PWD)" >> ${ARCHIVER_OUTDIR}/Makefile.sdk # Remove default variables
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk LDFLAGS =
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk CFLAGS =
echo "UBOOT_LOCALVERSION=${UBOOT_LOCALVERSION}" >> ${ARCHIVER_OUTDIR}/Makefile.sdk CPPFLAGS =
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Configure default U-Boot configs UBOOT_LOCALVERSION = ${UBOOT_LOCALVERSION}
echo "UBOOT_CONFIGS ?= ${uboot_configs}" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "DEVICE_TREE ?= ${UBOOT_DEVICETREE}" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "help:" >> ${ARCHIVER_OUTDIR}/Makefile.sdk # Configure default U-Boot configs
echo " @echo" >> ${ARCHIVER_OUTDIR}/Makefile.sdk UBOOT_CONFIGS ?= ${uboot_configs}
echo " @echo \"Configured U-Boot config(s):\"" >> ${ARCHIVER_OUTDIR}/Makefile.sdk DEVICE_TREE ?= ${UBOOT_DEVICETREE}
echo " @for config in \$(UBOOT_CONFIGS); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " defconfig=\$\$(echo \$\$config | cut -d',' -f1) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " type=\$\$(echo \$\$config | cut -d',' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " binary=\$\$(echo \$\$config | cut -d',' -f3) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \" \$\$defconfig config (\$\$type type) for \$\$binary binary\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " for devicetree in \$(DEVICE_TREE); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \" with device tree: \$\$devicetree\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " @echo" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " @echo \"Available targets:\"" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " @echo \" all : build U-Boot binaries for defined config(s)\"" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " @echo \" clean : clean build directories from generated files\"" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "version:" >> ${ARCHIVER_OUTDIR}/Makefile.sdk # Configure default fip feature
echo " @if test ! -e .scmversion ; then echo \$(UBOOT_LOCALVERSION) > \$(LOCAL_PATH)/.scmversion; fi" >> ${ARCHIVER_OUTDIR}/Makefile.sdk ENABLE_FIP ?= "${@bb.utils.contains('MACHINE_FEATURES','fip','1','',d)}"
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "all: version" >> ${ARCHIVER_OUTDIR}/Makefile.sdk help:
echo " for config in \$(UBOOT_CONFIGS); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo
echo " uboot_config=\$\$(echo \$\$config | cut -d',' -f1) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo "Configured U-Boot config(s):"
echo " uboot_type=-\$\$(echo \$\$config | cut -d',' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @for config in \$(UBOOT_CONFIGS); do \\
echo " uboot_binary=\$\$(echo \$\$config | cut -d',' -f3) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk defconfig=\$\$(echo \$\$config | cut -d',' -f1) ; \\
echo " uboot_suffix=\$\$(echo \$\$uboot_binary | cut -d'.' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk type=\$\$(echo \$\$config | cut -d',' -f2) ; \\
# Make sure about configuration set binary=\$\$(echo \$\$config | cut -d',' -f3) ; \\
echo " if test -z \"\$\$uboot_config\" -o -z \"\$\$uboot_type\" -o -z \"\$\$uboot_binary\"; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk echo " \$\$defconfig config (\$\$type type) for \$\$binary binary" ; \\
echo " echo ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk for devicetree in \$(DEVICE_TREE); do \\
echo " echo \"[ERROR] UBOOT_CONFIGS wrongly configured. It should be space separated list of element <defconfig>,<type>,<binary>\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk echo " with device tree: \$\$devicetree" ; \\
echo " echo ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk done ; \\
echo " exit 1 ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk done
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo
# Init folder and defconfig selected @echo "U-Boot folder configuration:"
echo " if [ ! -d \$(LOCAL_PATH)/../build\$\$uboot_type ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " SRC_PATH = \$(SRC_PATH)"
echo " mkdir -p \$(LOCAL_PATH)/../build\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " BLD_PATH = \$(BLD_PATH)"
echo " echo \$(UBOOT_LOCALVERSION) > \$(LOCAL_PATH)/../build\$\$uboot_type/.scmversion ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " DEPLOYDIR = \$(DEPLOYDIR)"
echo " \$(MAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type \$\$uboot_config ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo "FIP configuration:"
# Build binaries @echo " ENABLE_FIP = \$(ENABLE_FIP) ('1' to generate fip binary)"
echo " if [ -z \"\$(DEVICE_TREE)\" ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk ifeq (\$(ENABLE_FIP),1)
echo " \$(MAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type ${UBOOT_MAKE_TARGET} ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " Do not forget to set FIP deploydir folders (such as FIP_DEPLOYDIR_ROOT) to provide path to needed binaries"
# Copy binary files with explicit name endif
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/\$\$uboot_binary \$(LOCAL_PATH)/../build\$\$uboot_type/u-boot\$\$uboot_type.\$\$uboot_suffix ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${UBOOT_ELF} \$(LOCAL_PATH)/../build\$\$uboot_type/u-boot\$\$uboot_type.${UBOOT_ELF_SUFFIX} ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo "Available targets:"
echo " if [ -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARY_STM32} ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " all : build U-Boot binaries for defined config(s)"
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARY_STM32} \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARYNAME}\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @echo " clean : clean build directories from generated files"
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_ELF} \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_ELF_NAME}\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " else \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " for devicetree in \$(DEVICE_TREE); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " \$(MAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type ${UBOOT_MAKE_TARGET} DEVICE_TREE=\$\$devicetree DEVICE_TREE_EXT=\$\$devicetree.dtb; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Copy binary files with explicit name
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/\$\$uboot_binary \$(LOCAL_PATH)/../build\$\$uboot_type/u-boot-\$\$devicetree\$\$uboot_type.\$\$uboot_suffix ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${UBOOT_ELF} \$(LOCAL_PATH)/../build\$\$uboot_type/u-boot-\$\$devicetree\$\$uboot_type.${UBOOT_ELF_SUFFIX} ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " if [ -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARY_STM32} ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARY_STM32} \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_BINARYNAME}-\$\$devicetree\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " cp -f \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_ELF} \$(LOCAL_PATH)/../build\$\$uboot_type/${SPL_ELF_NAME}-\$\$devicetree\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "clean:" >> ${ARCHIVER_OUTDIR}/Makefile.sdk version:
echo " @for config in \$(UBOOT_CONFIGS); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk @if test ! -e .scmversion ; then echo \$(UBOOT_LOCALVERSION) > \$(SRC_PATH)/.scmversion; fi
echo " uboot_type=-\$\$(echo \$\$config | cut -d',' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \"Removing \$(LOCAL_PATH)/../build\$\$uboot_type ...\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk all: uboot \$(if \$(ENABLE_FIP),fip)
echo " rm -rf \$(LOCAL_PATH)/../build\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done" >> ${ARCHIVER_OUTDIR}/Makefile.sdk uboot: version
@for config in \$(UBOOT_CONFIGS); do \\
uboot_config=\$\$(echo \$\$config | cut -d',' -f1) ; \\
uboot_type=\$\$(echo \$\$config | cut -d',' -f2) ; \\
uboot_binary=\$\$(echo \$\$config | cut -d',' -f3) ; \\
uboot_suffix=\$\$(echo \$\$uboot_binary | cut -d'.' -f2) ; \\
# Configure destination folder \\
if [ "\$\$uboot_suffix" = "img" ]; then \\
subfolder=/\$\$uboot_type ; \\
else \\
subfolder= ; \\
fi ; \\
mkdir -p \$(DEPLOYDIR)\$\$subfolder ; \\
mkdir -p \$(DEPLOYDIR)\$\$subfolder/debug ; \\
# Make sure about configuration set \\
if test -z "\$\$uboot_config" -o -z "\$\$uboot_type" -o -z "\$\$uboot_binary"; then \\
echo ; \\
echo "[ERROR] UBOOT_CONFIGS wrongly configured. It should be space separated list of element <defconfig>,<type>,<binary>" ; \\
echo ; \\
exit 1 ; \\
fi ; \\
# Dynamic update for defconfig file \\
if [ "\$\$uboot_suffix" = "stm32" ]; then \\
if ! grep -q 'CONFIG_STM32MP15x_STM32IMAGE=y' "\$(SRC_PATH)/configs/\$\$uboot_config"; then \\
echo "CONFIG_STM32MP15x_STM32IMAGE=y" >> "\$(SRC_PATH)/configs/\$\$uboot_config" ; \\
fi ; \\
fi ; \\
# Init folder and defconfig selected \\
if [ ! -d \$(BLD_PATH)/\$\$uboot_type ]; then \\
mkdir -p \$(BLD_PATH)/\$\$uboot_type ; \\
echo \$(UBOOT_LOCALVERSION) > \$(BLD_PATH)/\$\$uboot_type/.scmversion ; \\
\$(MAKE) -C \$(SRC_PATH) O=\$(BLD_PATH)/\$\$uboot_type \$\$uboot_config ; \\
fi ; \\
# Build binaries \\
if [ -z "\$(DEVICE_TREE)" ]; then \\
\$(MAKE) -C \$(SRC_PATH) O=\$(BLD_PATH)/\$\$uboot_type ${UBOOT_MAKE_TARGET} ; \\
# Copy binary files with explicit name \\
cp -f \$(BLD_PATH)/\$\$uboot_type/\$\$uboot_binary \$(DEPLOYDIR)\$\$subfolder/u-boot-\$\$uboot_type.\$\$uboot_suffix ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${SPL_BINARY_STM32} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${SPL_BINARY_STM32} \$(DEPLOYDIR)\$\$subfolder/${SPL_BINARYNAME}-\$\$uboot_type ; \\
fi ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${UBOOT_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${UBOOT_ELF} \$(DEPLOYDIR)\$\$subfolder/debug/u-boot-\$\$uboot_type.${UBOOT_ELF_SUFFIX} ; \\
fi ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${SPL_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${SPL_ELF} \$(DEPLOYDIR)\$\$subfolder/debug/${SPL_ELF_NAME}-\$\$uboot_type ; \\
fi ; \\
# Install 'u-boot-nodtb.bin' binary in case '*.dtb' binary installation configured \\
if [ "\$\$uboot_suffix" = "dtb" ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/u-boot-nodtb.bin \$(DEPLOYDIR)\$\$subfolder/u-boot-nodtb.bin ; \\
fi ; \\
else \\
for devicetree in \$(DEVICE_TREE); do \\
\$(MAKE) -C \$(SRC_PATH) O=\$(BLD_PATH)/\$\$uboot_type ${UBOOT_MAKE_TARGET} DEVICE_TREE=\$\$devicetree DEVICE_TREE_EXT=\$\$devicetree.dtb; \\
# Copy binary files with explicit name \\
cp -f \$(BLD_PATH)/\$\$uboot_type/\$\$uboot_binary \$(DEPLOYDIR)\$\$subfolder/u-boot-\$\$devicetree-\$\$uboot_type.\$\$uboot_suffix ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${SPL_BINARY_STM32} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${SPL_BINARY_STM32} \$(DEPLOYDIR)\$\$subfolder/${SPL_BINARYNAME}-\$\$devicetree-\$\$uboot_type ; \\
fi ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${UBOOT_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${UBOOT_ELF} \$(DEPLOYDIR)\$\$subfolder/debug/u-boot-\$\$devicetree-\$\$uboot_type.${UBOOT_ELF_SUFFIX} ; \\
fi ; \\
if [ -f \$(BLD_PATH)/\$\$uboot_type/${SPL_ELF} ]; then \\
cp -f \$(BLD_PATH)/\$\$uboot_type/${SPL_ELF} \$(DEPLOYDIR)\$\$subfolder/debug/${SPL_ELF_NAME}-\$\$devicetree-\$\$uboot_type ; \\
fi ; \\
# Install ''u-boot-nodtb.bin' binary in case '*.dtb' binary installation configured \\
if [ "\$\$uboot_suffix" = "dtb" ]; then \\
# Init soc suffix \\
soc_suffix="" ; \\
if [ -n "${STM32MP_SOC_NAME}" ]; then \\
for soc in ${STM32MP_SOC_NAME}; do \\
if [ "\$\$(echo \$\$devicetree | grep -c \$\$soc)" -eq 1 ]; then \\
soc_suffix="-\$\$soc" ; \\
fi ; \\
done ; \\
fi ; \\
cp -f \$(BLD_PATH)/\$\$uboot_type/u-boot-nodtb.bin \$(DEPLOYDIR)\$\$subfolder/u-boot-nodtb\$\$soc_suffix.bin ; \\
fi ; \\
done ; \\
fi ; \\
done
fip: uboot
FIP_DEPLOYDIR_UBOOT=\$(DEPLOYDIR) FIP_DEVICETREE="\$(DEVICE_TREE)" fiptool-stm32mp
clean:
@for config in \$(UBOOT_CONFIGS); do \\
uboot_type=\$\$(echo \$\$config | cut -d',' -f2) ; \\
echo "Removing \$(BLD_PATH)/\$\$uboot_type ..." ; \\
rm -rf \$(BLD_PATH)/\$\$uboot_type ; \\
done
@echo "Removing \$(DEPLOYDIR) ..."
@rm -rf \$(DEPLOYDIR)
@echo
EOF
} }
do_ar_original[prefuncs] += "archiver_create_makefile_for_sdk" do_ar_original[prefuncs] += "archiver_create_makefile_for_sdk"

View File

@ -4,7 +4,7 @@ HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
SECTION = "bootloaders" SECTION = "bootloaders"
LICENSE = "GPLv2+" LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e" LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
DEPENDS += "dtc-native bc-native" DEPENDS += "dtc-native bc-native"
DEPENDS += "flex-native bison-native" DEPENDS += "flex-native bison-native"
@ -12,27 +12,20 @@ DEPENDS += "flex-native bison-native"
COMPATIBLE_MACHINE = "(stm32mpcommon)" COMPATIBLE_MACHINE = "(stm32mpcommon)"
SRC_URI = "git://github.com/u-boot/u-boot.git;protocol=https" SRC_URI = "git://github.com/u-boot/u-boot.git;protocol=https"
SRCREV = "0b0c6af38738f2c132cfd41a240889acaa031c8f" SRCREV = "050acee119b3757fee3bd128f55d720fdd9bb890"
SRC_URI += "\ SRC_URI += "\
file://0001-ARM-v2020.01-stm32mp-r1-MACHINE.patch \ file://0001-ARM-v2020.10-stm32mp-r1-MACHINE.patch \
file://0002-ARM-v2020.01-stm32mp-r1-BOARD.patch \ file://0002-ARM-v2020.10-stm32mp-r1-BOARD.patch \
file://0003-ARM-v2020.01-stm32mp-r1-MISC-DRIVERS.patch \ file://0003-ARM-v2020.10-stm32mp-r1-MISC-DRIVERS.patch \
file://0004-ARM-v2020.01-stm32mp-r1-DEVICETREE.patch \ file://0004-ARM-v2020.10-stm32mp-r1-DEVICETREE.patch \
file://0005-ARM-v2020.01-stm32mp-r1-CONFIG.patch \ file://0005-ARM-v2020.10-stm32mp-r1-CONFIG.patch \
\
file://0006-ARM-v2020.01-stm32mp-r2-DEVICETREE.patch \
file://0007-ARM-v2020.01-stm32mp-r2-MACHINE.patch \
file://0008-ARM-v2020.01-stm32mp-r2-BOARD.patch \
file://0009-ARM-v2020.01-stm32mp-r2-MISC-DRIVERS.patch \
file://0010-ARM-v2020.01-stm32mp-r2-CONFIG.patch \
\ \
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 \
file://remove-redundant-yyloc-global.patch \
" "
U_BOOT_VERSION = "2020.01" U_BOOT_VERSION = "2020.10"
PV = "${U_BOOT_VERSION}.r2" PV = "${U_BOOT_VERSION}.r1"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
@ -42,7 +35,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=v${U_BOOT_VERSION}-stm32mp"
SRCREV_class-devupstream = "7d786860495d4d121a13f949cdca589ebfb281bf" SRCREV_class-devupstream = "d2c99cb7e5b7dc74236f67fcced156956155cd71"
# --------------------------------- # ---------------------------------
# Configure default preference to manage dynamic selection between tarball and github # Configure default preference to manage dynamic selection between tarball and github

View File

@ -14,7 +14,7 @@ SPL_BINARYNAME = "${@os.path.basename(d.getVar("SPL_BINARY_STM32"))}"
SPL_BINARYROOT = "${@d.getVar('SPL_BINARY_STM32').split('.')[0]}" SPL_BINARYROOT = "${@d.getVar('SPL_BINARY_STM32').split('.')[0]}"
# Configure for debug elf # Configure for debug elf
ELF_DEBUG_ENABLE ?= "" ELF_DEBUG_ENABLE ?= "1"
UBOOT_ELF = "${@'u-boot' if d.getVar('ELF_DEBUG_ENABLE') == '1' else ''}" UBOOT_ELF = "${@'u-boot' if d.getVar('ELF_DEBUG_ENABLE') == '1' else ''}"
SPL_ELF = "${@'${SPL_BINARYROOT}' if d.getVar('ELF_DEBUG_ENABLE') == '1' else ''}" SPL_ELF = "${@'${SPL_BINARYROOT}' if d.getVar('ELF_DEBUG_ENABLE') == '1' else ''}"
SPL_ELF_NAME = "${@os.path.basename(d.getVar("SPL_ELF"))}.elf" SPL_ELF_NAME = "${@os.path.basename(d.getVar("SPL_ELF"))}.elf"
@ -22,6 +22,10 @@ SPL_ELF_NAME = "${@os.path.basename(d.getVar("SPL_ELF"))}.elf"
# Init UBOOT_DEVICETREE list if not configured # Init UBOOT_DEVICETREE list if not configured
UBOOT_DEVICETREE ?= "" UBOOT_DEVICETREE ?= ""
# Init default MTDPART configurations
UBOOT_MTDPART_CHECK_ENABLE ??= ""
UBOOT_MTDPART_CHECK ??= ""
# ----------------------------------------------- # -----------------------------------------------
# Enable use of work-shared folder # Enable use of work-shared folder
STAGING_UBOOT_DIR = "${TMPDIR}/work-shared/${MACHINE}/uboot-source" STAGING_UBOOT_DIR = "${TMPDIR}/work-shared/${MACHINE}/uboot-source"
@ -55,6 +59,84 @@ base_do_unpack_append () {
os.symlink(ubootsrc, s) os.symlink(ubootsrc, s)
} }
# -----------------------------------------------------------------------------
# Prepend configure to handle specific configuration (here fip)
#
do_configure_prepend() {
if [ -n "${UBOOT_CONFIG}" ]; then
unset i j
for config in ${UBOOT_MACHINE}; do
if [ -f "${S}/configs/${config}" ]; then
# Create copy of original defconfig
cp -f "${S}/configs/${config}" "${WORKDIR}/"
i=$(expr $i + 1);
for binary in ${UBOOT_BINARIES}; do
j=$(expr $j + 1);
if [ $j -eq $i ]; then
binarysuffix=$(echo ${binary} | cut -d'.' -f2)
# Make sure to select STM32IMAGE if requested
if [ "${binarysuffix}" = "stm32" ]; then
if ! grep -q 'CONFIG_STM32MP15x_STM32IMAGE=y' "${S}/configs/${config}"; then
echo "CONFIG_STM32MP15x_STM32IMAGE=y" >> "${S}/configs/${config}"
fi
fi
fi
done
unset j
fi
done
unset i
fi
}
# -----------------------------------------------------------------------------
# Append configure to handle specific MTDPART check if required
#
do_configure_append() {
if [ -n "${UBOOT_MTDPART_CHECK_ENABLE}" ]; then
if [ -n "${UBOOT_CONFIG}" ]; then
for config in ${UBOOT_MACHINE}; do
for mtdpart_check_config in ${UBOOT_MTDPART_CHECK_ENABLE}; do
if [ "${mtdpart_check_config}" = "${config}" ]; then
if [ -f "${B}/${config}/.config" ]; then
for mtdpart_chk in $(echo "${UBOOT_MTDPART_CHECK}"); do
mtdpart_conf=$(echo ${mtdpart_chk} | cut -d'=' -f1)
mtdpart_set=$(echo ${mtdpart_chk} | cut -d'=' -f2)
if grep -q "${mtdpart_conf}=" "${B}/${config}/.config"; then
bbnote "Found ${mtdpart_conf} definition in '.config' file from '${config}/' build folder"
# Get the current MTDPART configuration settings (and remove the double quotes)
mtdpart_cur=$(grep "${mtdpart_conf}=" "${B}/${config}/.config" | cut -d'=' -f2 | sed 's/"//g')
# Init for loop on configured partition list
i=0
mtdpart_count=$(echo "${mtdpart_cur}" | awk -F',' '{print NF-1}')
while [ ${i} -lt "${mtdpart_count}" ]; do
i=$(expr $i + 1)
mtdpart_cur_size=$(echo ${mtdpart_cur} | cut -d',' -f${i} | sed 's/\([0-9]*[mk]\).*/\1/')
mtdpart_set_size=$(echo ${mtdpart_set} | cut -d',' -f${i} | sed 's/\([0-9]*\).*/\1/')
# Make sure to use KiB format for partition size
if [ -z "$(echo ${mtdpart_cur_size} | grep m)" ]; then
cur_size_kb=$(echo ${mtdpart_cur_size} | sed 's/k//')
else
cur_size_kb=$(expr $(echo ${mtdpart_cur_size} | sed 's/m//') \* 1024)
fi
# Compare partition size
if [ "${mtdpart_set_size}" != "${cur_size_kb}" ]; then
bbfatal "The default settings for ${mtdpart_conf} (${mtdpart_cur}) is different from the one configured (${mtdpart_set}) : ${mtdpart_set_size}k versus ${mtdpart_cur_size}"
fi
done
bbnote "Found ${mtdpart_set} settings for ${mtdpart_conf} in '.config' file from '${config}/' build folder : configuration is ok"
else
bbfatal "${mtdpart_conf} definition not found in '.config' file from '${config}/' build folder : may need update for CONFIG name..."
fi
done
fi
fi
done
done
fi
fi
}
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Append compile to handle specific device tree compilation # Append compile to handle specific device tree compilation
# #
@ -75,6 +157,7 @@ do_compile_append() {
oe_runmake -C ${S} O=${B}/${config} DEVICE_TREE=${devicetree} DEVICE_TREE_EXT=${devicetree}.dtb oe_runmake -C ${S} O=${B}/${config} DEVICE_TREE=${devicetree} DEVICE_TREE_EXT=${devicetree}.dtb
for binary in ${UBOOT_BINARIES}; do for binary in ${UBOOT_BINARIES}; do
binarysuffix=$(echo ${binary} | cut -d'.' -f2) binarysuffix=$(echo ${binary} | cut -d'.' -f2)
binaryprefix=$(echo ${binary} | cut -d'.' -f1)
k=$(expr $k + 1); k=$(expr $k + 1);
if [ $k -eq $i ]; then if [ $k -eq $i ]; then
install -m 644 ${B}/${config}/${binary} ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix} install -m 644 ${B}/${config}/${binary} ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix}
@ -107,16 +190,13 @@ do_compile_append() {
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Append deploy to handle specific device tree binary deployement # Append deploy to handle specific device tree binary deployement
# #
do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}/bootloader" do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}/u-boot"
do_deploy_append() { do_deploy_append() {
if [ -n "${UBOOT_DEVICETREE}" ]; then if [ -n "${UBOOT_DEVICETREE}" ]; then
# Clean deploydir from any available binary first # Clean deploydir from any available binary first
# This allows to only install the devicetree binary ones # This allows to only install the devicetree binary ones
rm -rf ${DEPLOYDIR} rm -rf ${DEPLOYDIR}
# Install destination folder
install -d ${DEPLOYDIR}
for devicetree in ${UBOOT_DEVICETREE}; do for devicetree in ${UBOOT_DEVICETREE}; do
if [ -n "${UBOOT_CONFIG}" ]; then if [ -n "${UBOOT_CONFIG}" ]; then
unset i j k unset i j k
@ -129,17 +209,43 @@ do_deploy_append() {
binarysuffix=$(echo ${binary} | cut -d'.' -f2) binarysuffix=$(echo ${binary} | cut -d'.' -f2)
k=$(expr $k + 1); k=$(expr $k + 1);
if [ $k -eq $i ]; then if [ $k -eq $i ]; then
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix} ${DEPLOYDIR} # Manage subfolder in case of u-boot.img
if [ "${binarysuffix}" = "img" ]; then
SUBFOLDER=/${type}
else
SUBFOLDER=""
fi
# Install destination folder
install -d ${DEPLOYDIR}${SUBFOLDER}
if [ -n "${ELF_DEBUG_ENABLE}" ]; then
install -d ${DEPLOYDIR}${SUBFOLDER}/debug
fi
# Install u-boot binary
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix} ${DEPLOYDIR}${SUBFOLDER}
if [ -n "${UBOOT_ELF}" ]; then if [ -n "${UBOOT_ELF}" ]; then
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR} install -d ${DEPLOYDIR}${SUBFOLDER}/debug
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}${SUBFOLDER}/debug/
fi
# Install 'u-boot-nodtb.bin' binary in case '*.dtb' binary installation configured
if [ "${binarysuffix}" = "dtb" ]; then
# Init soc suffix
soc_suffix=""
if [ -n "${STM32MP_SOC_NAME}" ]; then
for soc in ${STM32MP_SOC_NAME}; do
if [ "$(echo ${devicetree} | grep -c ${soc})" -eq 1 ]; then
soc_suffix="-${soc}"
fi
done
fi
install -m 644 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}${SUBFOLDER}/u-boot-nodtb${soc_suffix}.bin
fi fi
# As soon as SPL binary exists, install it # As soon as SPL binary exists, install it
# This allow to mix u-boot configuration, with and without SPL # This allow to mix u-boot configuration, with and without SPL
if [ -f ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ]; then if [ -f ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ]; then
install -m 644 ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ${DEPLOYDIR} install -m 644 ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ${DEPLOYDIR}${SUBFOLDER}/
fi fi
if [ -n "${SPL_ELF}" ] && [ -f ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ]; then if [ -n "${SPL_ELF}" ] && [ -f ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ]; then
install -m 644 ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ${DEPLOYDIR} install -m 644 ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ${DEPLOYDIR}${SUBFOLDER}/debug
fi fi
fi fi
done done

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,811 @@
From f792f9d20e0a99373263c540b271adc8143de743 Mon Sep 17 00:00:00 2001
From: Romuald JEANNE <romuald.jeanne@st.com>
Date: Tue, 16 Mar 2021 08:16:11 +0100
Subject: [PATCH 2/5] ARM v2020.10-stm32mp-r1 BOARD
Signed-off-by: Romuald JEANNE <romuald.jeanne@st.com>
---
board/st/common/Kconfig | 21 +++-
board/st/common/stm32mp_dfu.c | 9 +-
board/st/common/stm32mp_mtdparts.c | 47 +++++---
board/st/stm32mp1/fit_copro_kernel_dtb.its | 18 ++-
board/st/stm32mp1/fit_kernel_dtb.its | 6 +-
board/st/stm32mp1/stm32mp1.c | 134 +++++++++++++--------
doc/board/st/stm32mp1.rst | 124 +++++++++++--------
7 files changed, 227 insertions(+), 132 deletions(-)
diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
index ddcf33a122..2f57118bb2 100644
--- a/board/st/common/Kconfig
+++ b/board/st/common/Kconfig
@@ -8,18 +8,22 @@ config CMD_STBOARD
config MTDPARTS_NAND0_BOOT
string "mtd boot partitions for nand0"
- default "2m(fsbl),2m(ssbl1),2m(ssbl2)"
+ default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || \
+ !TFABOOT
+ default "2m(fsbl),4m(fip1),4m(fip2)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
help
This define the partitions of nand0 used to build mtparts dynamically
for boot from nand0.
Each partition need to be aligned with the device erase block size,
512KB is the max size for the NAND supported by stm32mp1 platform.
+ The fsbl partition support multiple copy of the same binary, one by
+ erase block.
config MTDPARTS_NAND0_TEE
string "mtd tee partitions for nand0"
default "512k(teeh),512k(teed),512k(teex)"
- depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
+ depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
help
This define the tee partitions added in mtparts dynamically
when tee is supported with boot from nand0.
@@ -28,7 +32,9 @@ config MTDPARTS_NAND0_TEE
config MTDPARTS_NOR0_BOOT
string "mtd boot partitions for nor0"
- default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)"
+ default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)" if STM32MP15x_STM32IMAGE || \
+ !TFABOOT
+ default "256k(fsbl1),256k(fsbl2),4m(fip),512k(u-boot-env)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
help
This define the partitions of nand0 used to build mtparts dynamically
@@ -40,24 +46,27 @@ config MTDPARTS_NOR0_BOOT
config MTDPARTS_NOR0_TEE
string "mtd tee partitions for nor0"
default "256k(teeh),512k(teed),256k(teex)"
- depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
+ depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
help
This define the tee partitions added in mtparts dynamically
when tee is supported with boot from nor0.
config MTDPARTS_SPINAND0_BOOT
string "mtd boot partitions for spi-nand0"
- default "2m(fsbl),2m(ssbl1),2m(ssbl2)"
+ default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || !TFABOOT
+ default "2m(fsbl),4m(fip1),4m(fip2)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
help
This define the partitions of nand0 used to build mtparts dynamically
for boot from spi-nand0,
512KB is the max size for the NAND supported by stm32mp1 platform.
+ The fsbl partition support multiple copy of the same binary, one by
+ erase block.
config MTDPARTS_SPINAND0_TEE
string "mtd tee partitions for spi-nand0"
default "512k(teeh),512k(teed),512k(teex)"
- depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
+ depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
help
This define the tee partitions added in mtparts dynamically
when tee is supported with boot from spi-nand0,
diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
index aab7d741ac..09913f6ec7 100644
--- a/board/st/common/stm32mp_dfu.c
+++ b/board/st/common/stm32mp_dfu.c
@@ -142,7 +142,8 @@ void set_dfu_alt_info(char *interface, char *devstr)
board_get_alt_info_mtd(mtd, buf);
}
- if (IS_ENABLED(CONFIG_DFU_VIRT)) {
+ if (IS_ENABLED(CONFIG_DFU_VIRT) &&
+ IS_ENABLED(CMD_STM32PROG_USB)) {
strncat(buf, "&virt 0=OTP", DFU_ALT_BUF_LEN);
if (IS_ENABLED(CONFIG_PMIC_STPMIC1))
@@ -216,7 +217,7 @@ int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
return dfu_pmic_read(offset, buf, len);
}
- if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
+ if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_read_medium_virt(dfu, offset, buf, len);
@@ -227,7 +228,7 @@ int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
void *buf, long *len)
{
- if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
+ if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_write_medium_virt(dfu, offset, buf, len);
@@ -236,7 +237,7 @@ int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
int __weak dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
{
- if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
+ if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_get_medium_size_virt(dfu, size);
diff --git a/board/st/common/stm32mp_mtdparts.c b/board/st/common/stm32mp_mtdparts.c
index 9f5897f8c8..baddadc3a5 100644
--- a/board/st/common/stm32mp_mtdparts.c
+++ b/board/st/common/stm32mp_mtdparts.c
@@ -10,7 +10,9 @@
#include <env_internal.h>
#include <mtd.h>
#include <mtd_node.h>
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
#include <tee.h>
+#endif
#include <asm/arch/stm32prog.h>
#include <asm/arch/sys_proto.h>
@@ -29,7 +31,9 @@ static void board_set_mtdparts(const char *dev,
char *mtdids,
char *mtdparts,
const char *boot,
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
const char *tee,
+#endif
const char *user)
{
/* mtdids: "<dev>=<dev>, ...." */
@@ -53,10 +57,12 @@ static void board_set_mtdparts(const char *dev,
strncat(mtdparts, ",", MTDPARTS_LEN);
}
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
if (tee) {
strncat(mtdparts, tee, MTDPARTS_LEN);
strncat(mtdparts, ",", MTDPARTS_LEN);
}
+#endif
strncat(mtdparts, user, MTDPARTS_LEN);
}
@@ -68,7 +74,10 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
static char parts[3 * MTDPARTS_LEN + 1];
static char ids[MTDIDS_LEN + 1];
static bool mtd_initialized;
- bool tee, nor, nand, spinand, serial;
+ bool nor, nand, spinand, serial;
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
+ bool tee = false;
+#endif
if (mtd_initialized) {
*mtdids = ids;
@@ -76,7 +85,6 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
return;
}
- tee = false;
nor = false;
nand = false;
spinand = false;
@@ -87,7 +95,9 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
case BOOT_SERIAL_USB:
serial = true;
if (CONFIG_IS_ENABLED(CMD_STM32PROG)) {
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
tee = stm32prog_get_tee_partitions();
+#endif
nor = stm32prog_get_fsbl_nor();
}
nand = true;
@@ -106,9 +116,11 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
break;
}
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
if (!serial && CONFIG_IS_ENABLED(OPTEE) &&
tee_find_device(NULL, NULL, NULL, NULL))
tee = true;
+#endif
memset(parts, 0, sizeof(parts));
memset(ids, 0, sizeof(ids));
@@ -120,29 +132,27 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
pr_debug("mtd device = %s\n", dev->name);
}
- if (nor || nand) {
+ if (nand) {
mtd = get_mtd_device_nm("nand0");
if (!IS_ERR_OR_NULL(mtd)) {
- const char *mtd_boot = CONFIG_MTDPARTS_NAND0_BOOT;
- const char *mtd_tee = CONFIG_MTDPARTS_NAND0_TEE;
-
board_set_mtdparts("nand0", ids, parts,
- !nor ? mtd_boot : NULL,
- !nor && tee ? mtd_tee : NULL,
+ CONFIG_MTDPARTS_NAND0_BOOT,
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
+ !nor && tee ? CONFIG_MTDPARTS_NAND0_TEE : NULL,
+#endif
"-(UBI)");
put_mtd_device(mtd);
}
}
- if (nor || spinand) {
+ if (spinand) {
mtd = get_mtd_device_nm("spi-nand0");
if (!IS_ERR_OR_NULL(mtd)) {
- const char *mtd_boot = CONFIG_MTDPARTS_SPINAND0_BOOT;
- const char *mtd_tee = CONFIG_MTDPARTS_SPINAND0_TEE;
-
board_set_mtdparts("spi-nand0", ids, parts,
- !nor ? mtd_boot : NULL,
- !nor && tee ? mtd_tee : NULL,
+ CONFIG_MTDPARTS_SPINAND0_BOOT,
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
+ !nor && tee ? CONFIG_MTDPARTS_SPINAND0_TEE : NULL,
+#endif
"-(UBI)");
put_mtd_device(mtd);
}
@@ -150,12 +160,11 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
if (nor) {
if (!uclass_get_device(UCLASS_SPI_FLASH, 0, &dev)) {
- const char *mtd_boot = CONFIG_MTDPARTS_NOR0_BOOT;
- const char *mtd_tee = CONFIG_MTDPARTS_NOR0_TEE;
-
board_set_mtdparts("nor0", ids, parts,
- mtd_boot,
- tee ? mtd_tee : NULL,
+ CONFIG_MTDPARTS_NOR0_BOOT,
+#ifdef CONFIG_STM32MP15x_STM32IMAGE
+ tee ? CONFIG_MTDPARTS_NOR0_TEE : NULL,
+#endif
"-(nor_user)");
}
}
diff --git a/board/st/stm32mp1/fit_copro_kernel_dtb.its b/board/st/stm32mp1/fit_copro_kernel_dtb.its
index 3e08fd943e..dc43639af4 100644
--- a/board/st/stm32mp1/fit_copro_kernel_dtb.its
+++ b/board/st/stm32mp1/fit_copro_kernel_dtb.its
@@ -1,6 +1,20 @@
/*
* Compilation:
* mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb
+ *
+ * M4 firmware to load with remoteproc: rproc-m4-fw.elf
+ *
+ * Files in linux build dir:
+ * - arch/arm/boot/zImage
+ * - arch/arm/boot/dts/stm32mp157c-dk2.dtb
+ * - arch/arm/boot/dts/stm32mp157c-ev1.dtb
+ *
+ * load mmc 0:4 $kernel_addr_r fit_copro_kernel_dtb.itb
+ * bootm $kernel_addr_r
+ * bootm $kernel_addr_r#dk2
+ * bootm $kernel_addr_r#ev1
+ * bootm $kernel_addr_r#dk2-m4
+ * bootm $kernel_addr_r#ev1-m4
*/
/dts-v1/;
@@ -29,8 +43,8 @@
arch = "arm";
os = "linux";
compression = "none";
- load = <0xC0008000>;
- entry = <0xC0008000>;
+ load = <0xC4000000>;
+ entry = <0xC4000000>;
hash-1 {
algo = "sha1";
};
diff --git a/board/st/stm32mp1/fit_kernel_dtb.its b/board/st/stm32mp1/fit_kernel_dtb.its
index 18d03ebf3c..8456a3c460 100644
--- a/board/st/stm32mp1/fit_kernel_dtb.its
+++ b/board/st/stm32mp1/fit_kernel_dtb.its
@@ -3,7 +3,7 @@
* mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb
*
* Files in linux build dir:
- * - arch/arm/boot/zImage
+ * - arch/arm/boot/Image (gzipped in Image.gz)
* - arch/arm/boot/dts/stm32mp157c-dk2.dtb
* - arch/arm/boot/dts/stm32mp157c-ev1.dtb
*
@@ -23,11 +23,11 @@
images {
kernel {
description = "Linux kernel";
- data = /incbin/("zImage");
+ data = /incbin/("Image.gz");
type = "kernel";
arch = "arm";
os = "linux";
- compression = "none";
+ compression = "gzip";
load = <0xC0008000>;
entry = <0xC0008000>;
hash-1 {
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 3b677d339b..9a02e14ba5 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -101,7 +101,9 @@ int checkboard(void)
const char *fdt_compat;
int fdt_compat_len;
- if (IS_ENABLED(CONFIG_TFABOOT))
+ if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE))
+ mode = "trusted - stm32image";
+ else if (IS_ENABLED(CONFIG_TFABOOT))
mode = "trusted";
else
mode = "basic";
@@ -288,42 +290,13 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
hang();
}
-static int board_check_usb_power(void)
+static int adc_measurement(ofnode node, int adc_count, int *min_uV, int *max_uV)
{
struct ofnode_phandle_args adc_args;
struct udevice *adc;
- ofnode node;
unsigned int raw;
- int max_uV = 0;
- int min_uV = USB_START_HIGH_THRESHOLD_UV;
- int ret, uV, adc_count;
- u32 nb_blink;
- u8 i;
-
- if (!IS_ENABLED(CONFIG_ADC))
- return -ENODEV;
-
- node = ofnode_path("/config");
- if (!ofnode_valid(node)) {
- debug("%s: no /config node?\n", __func__);
- return -ENOENT;
- }
-
- /*
- * Retrieve the ADC channels devices and get measurement
- * for each of them
- */
- adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
- "#io-channel-cells");
- if (adc_count < 0) {
- if (adc_count == -ENOENT)
- return 0;
-
- pr_err("%s: can't find adc channel (%d)\n", __func__,
- adc_count);
-
- return adc_count;
- }
+ int ret, uV;
+ int i;
for (i = 0; i < adc_count; i++) {
if (ofnode_parse_phandle_with_args(node, "st,adc_usb_pd",
@@ -352,10 +325,10 @@ static int board_check_usb_power(void)
}
/* Convert to uV */
if (!adc_raw_to_uV(adc, raw, &uV)) {
- if (uV > max_uV)
- max_uV = uV;
- if (uV < min_uV)
- min_uV = uV;
+ if (uV > *max_uV)
+ *max_uV = uV;
+ if (uV < *min_uV)
+ *min_uV = uV;
pr_debug("%s: %s[%02d] = %u, %d uV\n", __func__,
adc->name, adc_args.args[0], raw, uV);
} else {
@@ -364,18 +337,66 @@ static int board_check_usb_power(void)
}
}
+ return 0;
+}
+
+static int board_check_usb_power(void)
+{
+ ofnode node;
+ int max_uV = 0;
+ int min_uV = USB_START_HIGH_THRESHOLD_UV;
+ int adc_count, ret;
+ u32 nb_blink;
+ u8 i;
+
+ if (!IS_ENABLED(CONFIG_ADC))
+ return -ENODEV;
+
+ node = ofnode_path("/config");
+ if (!ofnode_valid(node)) {
+ debug("%s: no /config node?\n", __func__);
+ return -ENOENT;
+ }
+
/*
- * If highest value is inside 1.23 Volts and 2.10 Volts, that means
- * board is plugged on an USB-C 3A power supply and boot process can
- * continue.
+ * Retrieve the ADC channels devices and get measurement
+ * for each of them
*/
- if (max_uV > USB_START_LOW_THRESHOLD_UV &&
- max_uV <= USB_START_HIGH_THRESHOLD_UV &&
- min_uV <= USB_LOW_THRESHOLD_UV)
- return 0;
+ adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
+ "#io-channel-cells");
+ if (adc_count < 0) {
+ if (adc_count == -ENOENT)
+ return 0;
- pr_err("****************************************************\n");
+ pr_err("%s: can't find adc channel (%d)\n", __func__,
+ adc_count);
+
+ return adc_count;
+ }
+
+ /* perform maximum of 2 ADC measurement to detect power supply current */
+ for (i = 0; i < 2; i++) {
+ ret = adc_measurement(node, adc_count, &min_uV, &max_uV);
+ if (ret)
+ return ret;
+
+ /*
+ * If highest value is inside 1.23 Volts and 2.10 Volts, that means
+ * board is plugged on an USB-C 3A power supply and boot process can
+ * continue.
+ */
+ if (max_uV > USB_START_LOW_THRESHOLD_UV &&
+ max_uV <= USB_START_HIGH_THRESHOLD_UV &&
+ min_uV <= USB_LOW_THRESHOLD_UV)
+ return 0;
+ if (i == 0) {
+ pr_debug("Previous ADC measurements was not the one expected, retry in 20ms\n");
+ mdelay(20); /* equal to max tPDDebounce duration (min 10ms - max 20ms) */
+ }
+ }
+
+ pr_err("****************************************************\n");
/*
* If highest and lowest value are either both below
* USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
@@ -583,7 +604,8 @@ error:
static bool board_is_dk2(void)
{
if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
- of_machine_is_compatible("st,stm32mp157c-dk2"))
+ (of_machine_is_compatible("st,stm32mp157c-dk2") ||
+ of_machine_is_compatible("st,stm32mp157f-dk2")))
return true;
return false;
@@ -832,10 +854,17 @@ const char *env_ext4_get_dev_part(void)
return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
}
+
int mmc_get_env_dev(void)
{
- u32 bootmode = get_bootmode();
+ u32 bootmode;
+
+ if (CONFIG_SYS_MMC_ENV_DEV >= 0)
+ return CONFIG_SYS_MMC_ENV_DEV;
+ bootmode = get_bootmode();
+
+ /* use boot instance to select the correct mmc device identifier */
return (bootmode & TAMP_BOOT_INSTANCE_MASK) - 1;
}
@@ -848,9 +877,14 @@ int ft_board_setup(void *blob, struct bd_info *bd)
{ "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, },
{ "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, },
};
-
- if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS))
- fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+ char *boot_device;
+
+ /* Check the boot-source and don't update MTD for serial or usb boot */
+ boot_device = env_get("boot_device");
+ if (!boot_device ||
+ (strcmp(boot_device, "serial") && strcmp(boot_device, "usb")))
+ if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS))
+ fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
return 0;
}
diff --git a/doc/board/st/stm32mp1.rst b/doc/board/st/stm32mp1.rst
index e74f7afdae..ad95e12068 100644
--- a/doc/board/st/stm32mp1.rst
+++ b/doc/board/st/stm32mp1.rst
@@ -52,15 +52,23 @@ And the necessary drivers
Currently the following boards are supported:
+ stm32mp157a-dk1.dts
+ + stm32mp157a-ed1.dts
+ + stm32mp157a-ev1.dts
+ stm32mp157c-dk2.dts
+ stm32mp157c-ed1.dts
+ stm32mp157c-ev1.dts
+ + stm32mp157d-dk1.dts
+ + stm32mp157d-ed1.dts
+ + stm32mp157d-ev1.dts
+ + stm32mp157f-dk2.dts
+ + stm32mp157f-ed1.dts
+ + stm32mp157f-ev1.dts
+ stm32mp15xx-dhcor-avenger96.dts
Boot Sequences
--------------
-3 boot configurations are supported with:
+2 boot configurations are supported with:
+----------+------------------------+-------------------------+--------------+
| **ROM** | **FSBL** | **SSBL** | **OS** |
@@ -83,14 +91,10 @@ defconfig_file : stm32mp15_trusted_defconfig
| TrustZone |secure monitor |
+-------------+-------------------------+------------+-------+
-TF-A performs a full initialization of Secure peripherals and installs a
-secure monitor, BL32:
-
- * SPMin provided by TF-A or
- * OP-TEE from specific partitions (teeh, teed, teex).
-
-U-Boot is running in normal world and uses the secure monitor to access
-to secure resources.
+TF-A (BL2) initialize the DDR and loads the next stage binaries from a FIP file:
+ + BL32: a secure monitor BL32 = SPMin provided by TF-A or OP-TEE : performs a full initialization of Secure peripherals and provides service to normal world
+ + BL33: a non-trusted firmware = U-Boot, running in normal world and uses the secure monitor to access to secure resources.
+ + HW_CONFIG: The hardware configuration file = the U-Boot device tree
The **Basic** boot chain
````````````````````````
@@ -123,19 +127,27 @@ the supported device trees for STM32MP15x are:
+ ev1: eval board with pmic stpmic1 (ev1 = mother board + daughter ed1)
+ + stm32mp157a-ev1
+ stm32mp157c-ev1
+ + stm32mp157d-ev1
+ + stm32mp157f-ev1
+ ed1: daughter board with pmic stpmic1
+ + stm32mp157a-ed1
+ stm32mp157c-ed1
+ + stm32mp157d-ed1
+ + stm32mp157f-ed1
+ dk1: Discovery board
+ stm32mp157a-dk1
+ + stm32mp157d-dk1
+ dk2: Discovery board = dk1 with a BT/WiFI combo and a DSI panel
+ stm32mp157c-dk2
+ + stm32mp157f-dk2
+ avenger96: Avenger96 board from Arrow Electronics based on DH Elec. DHCOR SoM
@@ -223,16 +235,24 @@ Build Procedure
6. Output files
- BootRom and TF-A expect binaries with STM32 image header
- SPL expects file with U-Boot uImage header
+ The ROM code expects FSBL binaries with STM32 image header.
+ TF-A expect a FIP binary, with OS monitor (SPmin or OP-TEE) and with U-Boot binary + device tree.
+ SPL expects file with U-Boot uImage header.
So in the output directory (selected by KBUILD_OUTPUT),
you can found the needed files:
- For **Trusted** boot (with or without OP-TEE)
- - FSBL = **tf-a.stm32** (provided by TF-A compilation)
- - SSBL = **u-boot.stm32**
+ - FSBL = **tf-a.stm32** and **tf-a-fip.bin** (provided by TF-A compilation)
+ - SSBL = **u-boot-nodtb.bin** and **u-boot.dtb**
+
+ The file tf-a-fip.bin includes the 2 U-Boot files, u-boot-nodtb.bin and u-boot.dtb;
+ they are needed during the TF-A compilation(BL33=u-boot-nodtb.bin BL33_CFG=u-boot.dtb).
+
+ You can also update a existing it with the tools provided by TF-A:
+
+ # fiptool update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb tf-a-fip-stm32mp157c-ev1.bin
- For Basic boot
@@ -298,22 +318,24 @@ Prepare an SD card
The minimal requirements for STMP32MP15x boot up to U-Boot are:
- GPT partitioning (with gdisk or with sgdisk)
-- 2 fsbl partitions, named fsbl1 and fsbl2, size at least 256KiB
-- one ssbl partition for U-Boot
+- 2 fsbl partitions, named "fsbl1" and "fsbl2", size at least 256KiB
+- one partition named "fip" for FIP or U-Boot (TF-A search the "fip"
+ partition and SPL search the 3th partition, because
+ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3)
Then the minimal GPT partition is:
- +-------+--------+---------+-------------+
- | *Num* | *Name* | *Size* | *Content* |
- +=======+========+=========+=============+
- | 1 | fsbl1 | 256 KiB | TF-A or SPL |
- +-------+--------+---------+-------------+
- | 2 | fsbl2 | 256 KiB | TF-A or SPL |
- +-------+--------+---------+-------------+
- | 3 | ssbl | enought | U-Boot |
- +-------+--------+---------+-------------+
- | 4 | <any> | <any> | Rootfs |
- +-------+--------+---------+-------------+
+ +-------+--------+---------+------------------------------+
+ | *Num* | *Name* | *Size* | *Content* |
+ +=======+========+=========+==============================+
+ | 1 | fsbl1 | 256 KiB | TF-A BL2 (tf-a.stm32) or SPL |
+ +-------+--------+---------+------------------------------+
+ | 2 | fsbl2 | 256 KiB | TF-A BL2 (tf-a.stm32) or SPL |
+ +-------+--------+---------+------------------------------+
+ | 3 | fip | enought | tf-a-fip.bin or u-boot.img |
+ +-------+--------+---------+------------------------------+
+ | 4 | <any> | <any> | Rootfs |
+ +-------+--------+---------+------------------------------+
Add a 4th partition (Rootfs) marked bootable with a file extlinux.conf
following the Generic Distribution feature (doc/README.distro for use).
@@ -334,7 +356,7 @@ b) create minimal image::
# sgdisk --resize-table=128 -a 1 \
-n 1:34:545 -c 1:fsbl1 \
-n 2:546:1057 -c 2:fsbl2 \
- -n 3:1058:5153 -c 3:ssbl \
+ -n 3:1058:5153 -c 3:fip \
-n 4:5154: -c 4:rootfs \
-p /dev/<SD card dev>
@@ -353,7 +375,7 @@ c) copy the FSBL (2 times) and SSBL file on the correct partition.
# dd if=tf-a.stm32 of=/dev/mmcblk0p1
# dd if=tf-a.stm32 of=/dev/mmcblk0p2
- # dd if=u-boot.stm32 of=/dev/mmcblk0p3
+ # dd if=tf-a-fip.bin of=/dev/mmcblk0p3
To boot from SD card, select BootPinMode = 1 0 1 and reset.
@@ -363,8 +385,8 @@ Prepare eMMC
You can use U-Boot to copy binary in eMMC.
In the next example, you need to boot from SD card and the images
-(u-boot-spl.stm32, u-boot.img) are presents on SD card (mmc 0)
-in ext4 partition 4 (bootfs).
+(tf-a.stm32, tf-a-fip.bin / u-boot-spl.stm32, u-boot.img) are presents
+on SD card (mmc 0) in ext4 partition 4 (bootfs).
To boot from SD card, select BootPinMode = 1 0 1 and reset.
@@ -373,13 +395,16 @@ Then you update the eMMC with the next U-Boot command :
a) prepare GPT on eMMC,
example with 2 partitions, bootfs and roots::
- # setenv emmc_part "name=ssbl,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
+ # setenv emmc_part "name=fip,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
# gpt write mmc 1 ${emmc_part}
b) copy SPL on eMMC on firts boot partition
(SPL max size is 256kB, with LBA 512, 0x200)::
+ # ext4load mmc 0:4 0xC0000000 tf-a.stm32
+ or
# ext4load mmc 0:4 0xC0000000 u-boot-spl.stm32
+
# mmc dev 1
# mmc partconf 1 1 1 1
# mmc write ${fileaddr} 0 200
@@ -387,7 +412,10 @@ b) copy SPL on eMMC on firts boot partition
c) copy U-Boot in first GPT partition of eMMC::
- # ext4load mmc 0:4 0xC0000000 u-boo t.img
+ # ext4load mmc 0:4 0xC0000000 tf-a-fip.bin
+ or
+ # ext4load mmc 0:4 0xC0000000 u-boot.img
+
# mmc dev 1
# part start mmc 1 1 partstart
# mmc write ${fileaddr} ${partstart} ${filesize}
@@ -520,14 +548,14 @@ On EV1 board, booting from SD card, without OP-TEE::
dev: RAM alt: 2 name: uramdisk.image.gz layout: RAM_ADDR
dev: eMMC alt: 3 name: mmc0_fsbl1 layout: RAW_ADDR
dev: eMMC alt: 4 name: mmc0_fsbl2 layout: RAW_ADDR
- dev: eMMC alt: 5 name: mmc0_ssbl layout: RAW_ADDR
+ dev: eMMC alt: 5 name: mmc0_fip layout: RAW_ADDR
dev: eMMC alt: 6 name: mmc0_bootfs layout: RAW_ADDR
dev: eMMC alt: 7 name: mmc0_vendorfs layout: RAW_ADDR
dev: eMMC alt: 8 name: mmc0_rootfs layout: RAW_ADDR
dev: eMMC alt: 9 name: mmc0_userfs layout: RAW_ADDR
dev: eMMC alt: 10 name: mmc1_boot1 layout: RAW_ADDR
dev: eMMC alt: 11 name: mmc1_boot2 layout: RAW_ADDR
- dev: eMMC alt: 12 name: mmc1_ssbl layout: RAW_ADDR
+ dev: eMMC alt: 12 name: mmc1_fip layout: RAW_ADDR
dev: eMMC alt: 13 name: mmc1_bootfs layout: RAW_ADDR
dev: eMMC alt: 14 name: mmc1_vendorfs layout: RAW_ADDR
dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR
@@ -548,14 +576,14 @@ All the supported device are exported for dfu-util tool::
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=14, name="mmc1_vendorfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=13, name="mmc1_bootfs", serial="002700333338511934383330"
- Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=12, name="mmc1_ssbl", serial="002700333338511934383330"
+ Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=12, name="mmc1_fip", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=11, name="mmc1_boot2", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=10, name="mmc1_boot1", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=9, name="mmc0_userfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=8, name="mmc0_rootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=7, name="mmc0_vendorfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=6, name="mmc0_bootfs", serial="002700333338511934383330"
- Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=5, name="mmc0_ssbl", serial="002700333338511934383330"
+ Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=5, name="mmc0_fip", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=4, name="mmc0_fsbl2", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=3, name="mmc0_fsbl1", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=2, name="uramdisk.image.gz", serial="002700333338511934383330"
@@ -566,9 +594,9 @@ You can update the boot device:
- SD card (mmc0) ::
- $> dfu-util -d 0483:5720 -a 3 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 4 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 5 -D u-boot-stm32mp157c-ev1-trusted.img
+ $> dfu-util -d 0483:5720 -a 3 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 4 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 5 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 6 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 7 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 8 -D st-image-weston-openstlinux-weston-stm32mp1.ext4
@@ -576,9 +604,9 @@ You can update the boot device:
- EMMC (mmc1)::
- $> dfu-util -d 0483:5720 -a 10 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 11 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 12 -D u-boot-stm32mp157c-ev1-trusted.img
+ $> dfu-util -d 0483:5720 -a 10 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 11 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 12 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 13 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 14 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 15 -D st-image-weston-openstlinux-weston-stm32mp1.ext4
@@ -595,14 +623,14 @@ only the MTD partition on the boot devices are available, for example:
- NOR (nor0 = alt 20) & NAND (nand0 = alt 26) ::
- $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 23 -D u-boot-stm32mp157c-ev1-trusted.img
+ $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 23 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 27 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
- NAND (nand0 = alt 21)::
- $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1-trusted.stm32
- $> dfu-util -d 0483:5720 -a 23 -D u-boot-stm32mp157c-ev1-trusted.img
- $> dfu-util -d 0483:5720 -a 24 -D u-boot-stm32mp157c-ev1-trusted.img
+ $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
+ $> dfu-util -d 0483:5720 -a 23 -D tf-a-fip-stm32mp157c-ev1.bin
+ $> dfu-util -d 0483:5720 -a 24 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 25 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
--
2.17.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,545 +0,0 @@
From 5731d9684c509e5d8920ad4b94391fd6aa310323 Mon Sep 17 00:00:00 2001
From: Romuald JEANNE <romuald.jeanne@st.com>
Date: Fri, 5 Jun 2020 13:46:04 +0200
Subject: [PATCH 5/5] ARM v2020.01-stm32mp-r1 CONFIG
---
configs/stm32mp15_basic_defconfig | 36 +++++---
configs/stm32mp15_dhcom_basic_defconfig | 141 ++++++++++++++++++++++++++++++++
configs/stm32mp15_optee_defconfig | 129 -----------------------------
configs/stm32mp15_trusted_defconfig | 41 +++++++---
4 files changed, 194 insertions(+), 153 deletions(-)
create mode 100644 configs/stm32mp15_dhcom_basic_defconfig
delete mode 100644 configs/stm32mp15_optee_defconfig
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index 713a7e6..cf28217 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -2,8 +2,12 @@ CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
CONFIG_SYS_MALLOC_F_LEN=0x3000
CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_ENV_OFFSET=0x280000
CONFIG_SPL=y
-CONFIG_TARGET_STM32MP1=y
+CONFIG_TARGET_ST_STM32MP15x=y
+CONFIG_CMD_STM32PROG=y
+CONFIG_ENV_SECT_SIZE=0x40000
+CONFIG_ENV_OFFSET_REDUND=0x2C0000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI_SUPPORT=y
# CONFIG_ARMV7_VIRT is not set
@@ -19,11 +23,13 @@ CONFIG_SPL_POWER_SUPPORT=y
CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
CONFIG_SYS_PROMPT="STM32MP> "
# CONFIG_CMD_BOOTD is not set
+CONFIG_CMD_DTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EXPORTENV is not set
# CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_ADC=y
@@ -31,10 +37,8 @@ CONFIG_CMD_CLK=y
CONFIG_CMD_DFU=y
CONFIG_CMD_FUSE=y
CONFIG_CMD_GPIO=y
-CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
-CONFIG_CMD_MTD=y
CONFIG_CMD_REMOTEPROC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
@@ -52,29 +56,31 @@ CONFIG_CMD_UBI=y
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended interrupt-controller \\\#interrupt-cells interrupt-parent dmas dma-names assigned-clocks assigned-clock-rates assigned-clock-parents hwlocks"
CONFIG_ENV_IS_NOWHERE=y
-CONFIG_ENV_IS_IN_EXT4=y
+CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_IS_IN_UBI=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
-CONFIG_ENV_EXT4_INTERFACE="mmc"
-CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
-CONFIG_ENV_EXT4_FILE="/uboot.env"
-CONFIG_ENV_OFFSET_REDUND=0x2C0000
CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_STM32_ADC=y
-CONFIG_DFU_MMC=y
-CONFIG_DFU_RAM=y
-CONFIG_DFU_MTD=y
-CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
CONFIG_FASTBOOT_USB_DEV=1
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_BOOT1_NAME="mmc1boot0"
+CONFIG_FASTBOOT_MMC_BOOT2_NAME="mmc1boot1"
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_NAME="mmc1"
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y
+CONFIG_FASTBOOT_CMD_OEM_BOOTBUS=y
+CONFIG_GPIO_HOG=y
CONFIG_DM_HWSPINLOCK=y
CONFIG_HWSPINLOCK_STM32=y
CONFIG_DM_I2C=y
@@ -88,6 +94,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_STM32_SDMMC2=y
CONFIG_MTD=y
CONFIG_DM_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
CONFIG_MTD_RAW_NAND=y
CONFIG_NAND_STM32_FMC2=y
CONFIG_MTD_SPI_NAND=y
@@ -99,6 +106,7 @@ CONFIG_SPI_FLASH_WINBOND=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_SPI_FLASH_MTD=y
CONFIG_SPL_SPI_FLASH_MTD=y
+CONFIG_PHY_REALTEK=y
CONFIG_DM_ETH=y
CONFIG_DWC_ETH_QOS=y
CONFIG_PHY=y
@@ -113,6 +121,7 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_STM32MP1_DDR_INTERACTIVE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_DM_RTC=y
CONFIG_RTC_STM32=y
@@ -142,4 +151,7 @@ CONFIG_VIDEO_STM32=y
CONFIG_VIDEO_STM32_DSI=y
CONFIG_VIDEO_STM32_MAX_XRES=1280
CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_WDT=y
+CONFIG_WDT_STM32MP=y
+CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig
new file mode 100644
index 0000000..ed3504d
--- /dev/null
+++ b/configs/stm32mp15_dhcom_basic_defconfig
@@ -0,0 +1,141 @@
+CONFIG_ARM=y
+CONFIG_ARCH_STM32MP=y
+CONFIG_SYS_MALLOC_F_LEN=0x3000
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
+CONFIG_SPL=y
+CONFIG_TARGET_DH_STM32MP1_PDK2=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+# CONFIG_ARMV7_VIRT is not set
+CONFIG_SPL_TEXT_BASE=0x2FFC2500
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
+CONFIG_SYS_PROMPT="STM32MP> "
+# CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EXPORTENV is not set
+CONFIG_CMD_EEPROM=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_ADC=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_DFU=y
+CONFIG_CMD_FUSE=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_REMOTEPROC=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_MTDPARTS=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_DEFAULT_DEVICE_TREE="stm32mp15xx-dhcom-pdk2"
+CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended interrupt-controller \\\#interrupt-cells interrupt-parent dmas dma-names assigned-clocks assigned-clock-rates assigned-clock-parents hwlocks"
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_USE_ENV_SPI_BUS=y
+CONFIG_ENV_SPI_BUS=0
+CONFIG_USE_ENV_SPI_CS=y
+CONFIG_ENV_SPI_CS=0
+CONFIG_USE_ENV_SPI_MAX_HZ=y
+CONFIG_ENV_SPI_MAX_HZ=10000000
+CONFIG_USE_ENV_SPI_MODE=y
+CONFIG_ENV_SPI_MODE=0x0
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_IP_DEFRAG=y
+CONFIG_TFTP_BLOCKSIZE=1536
+CONFIG_STM32_ADC=y
+CONFIG_SPL_BLOCK_CACHE=y
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
+CONFIG_GPIO_HOG=y
+CONFIG_DM_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_STM32=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_STM32F7=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_DM_MAILBOX=y
+CONFIG_STM32_IPCC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_DM_MMC=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_STM32_SDMMC2=y
+CONFIG_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_WINBOND=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_SPL_SPI_FLASH_MTD=y
+CONFIG_DM_ETH=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_PHY=y
+CONFIG_PHY_STM32_USBPHYC=y
+CONFIG_PINCONF=y
+# CONFIG_SPL_PINCTRL_FULL is not set
+CONFIG_PINCTRL_STMFX=y
+CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
+CONFIG_PMIC_STPMIC1=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_REGULATOR_STM32_VREFBUF=y
+CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_REMOTEPROC_STM32_COPRO=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_STM32=y
+CONFIG_SERIAL_RX_BUFFER=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_STM32_QSPI=y
+CONFIG_STM32_SPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="dh"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0483
+CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
+CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
+CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
+CONFIG_VIDEO_STM32=y
+CONFIG_VIDEO_STM32_DSI=y
+CONFIG_VIDEO_STM32_MAX_XRES=1280
+CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_LZO=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/stm32mp15_optee_defconfig b/configs/stm32mp15_optee_defconfig
deleted file mode 100644
index f9161fd..0000000
--- a/configs/stm32mp15_optee_defconfig
+++ /dev/null
@@ -1,129 +0,0 @@
-CONFIG_ARM=y
-CONFIG_ARCH_STM32MP=y
-CONFIG_SYS_MALLOC_F_LEN=0x3000
-CONFIG_TARGET_STM32MP1=y
-CONFIG_STM32MP1_OPTEE=y
-CONFIG_DISTRO_DEFAULTS=y
-CONFIG_FIT=y
-CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
-CONFIG_SYS_PROMPT="STM32MP> "
-# CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMI is not set
-# CONFIG_CMD_XIMG is not set
-# CONFIG_CMD_EXPORTENV is not set
-# CONFIG_CMD_IMPORTENV is not set
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_MEMTEST=y
-CONFIG_CMD_ADC=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_DFU=y
-CONFIG_CMD_FUSE=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_GPT=y
-CONFIG_CMD_I2C=y
-CONFIG_CMD_MMC=y
-CONFIG_CMD_MTD=y
-CONFIG_CMD_REMOTEPROC=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_USB=y
-CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_BMP=y
-CONFIG_CMD_CACHE=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_TIMER=y
-CONFIG_CMD_PMIC=y
-CONFIG_CMD_REGULATOR=y
-CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_MTDPARTS=y
-CONFIG_CMD_UBI=y
-CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
-CONFIG_ENV_IS_NOWHERE=y
-CONFIG_ENV_IS_IN_EXT4=y
-CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_ENV_IS_IN_UBI=y
-CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
-CONFIG_ENV_EXT4_INTERFACE="mmc"
-CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
-CONFIG_ENV_EXT4_FILE="/uboot.env"
-CONFIG_ENV_OFFSET_REDUND=0x2C0000
-CONFIG_ENV_UBI_PART="UBI"
-CONFIG_ENV_UBI_VOLUME="uboot_config"
-CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
-CONFIG_SYS_RELOC_GD_ENV_ADDR=y
-CONFIG_STM32_ADC=y
-CONFIG_DFU_MMC=y
-CONFIG_DFU_RAM=y
-CONFIG_DFU_MTD=y
-CONFIG_DFU_VIRT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
-CONFIG_FASTBOOT_BUF_SIZE=0x02000000
-CONFIG_FASTBOOT_USB_DEV=1
-CONFIG_FASTBOOT_FLASH=y
-CONFIG_FASTBOOT_FLASH_MMC_DEV=1
-CONFIG_DM_HWSPINLOCK=y
-CONFIG_HWSPINLOCK_STM32=y
-CONFIG_DM_I2C=y
-CONFIG_SYS_I2C_STM32F7=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_DM_MAILBOX=y
-CONFIG_STM32_IPCC=y
-CONFIG_DM_MMC=y
-CONFIG_SUPPORT_EMMC_BOOT=y
-CONFIG_STM32_SDMMC2=y
-CONFIG_MTD=y
-CONFIG_DM_MTD=y
-CONFIG_MTD_RAW_NAND=y
-CONFIG_NAND_STM32_FMC2=y
-CONFIG_MTD_SPI_NAND=y
-CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH_MACRONIX=y
-CONFIG_SPI_FLASH_SPANSION=y
-CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_SPI_FLASH_WINBOND=y
-# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
-CONFIG_SPI_FLASH_MTD=y
-CONFIG_DM_ETH=y
-CONFIG_DWC_ETH_QOS=y
-CONFIG_PHY=y
-CONFIG_PHY_STM32_USBPHYC=y
-CONFIG_PINCONF=y
-CONFIG_PINCTRL_STMFX=y
-CONFIG_DM_PMIC=y
-CONFIG_PMIC_STPMIC1=y
-CONFIG_DM_REGULATOR_FIXED=y
-CONFIG_DM_REGULATOR_GPIO=y
-CONFIG_DM_REGULATOR_STM32_VREFBUF=y
-CONFIG_DM_REGULATOR_STPMIC1=y
-CONFIG_REMOTEPROC_STM32_COPRO=y
-CONFIG_DM_RTC=y
-CONFIG_RTC_STM32=y
-CONFIG_SERIAL_RX_BUFFER=y
-CONFIG_SPI=y
-CONFIG_DM_SPI=y
-CONFIG_STM32_QSPI=y
-CONFIG_STM32_SPI=y
-CONFIG_USB=y
-CONFIG_DM_USB=y
-CONFIG_DM_USB_GADGET=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_GENERIC=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
-CONFIG_USB_GADGET_VENDOR_NUM=0x0483
-CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
-CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_DM_VIDEO=y
-CONFIG_BACKLIGHT_GPIO=y
-CONFIG_VIDEO_BPP8=y
-CONFIG_VIDEO_BPP16=y
-CONFIG_VIDEO_BPP32=y
-CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
-CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
-CONFIG_VIDEO_STM32=y
-CONFIG_VIDEO_STM32_DSI=y
-CONFIG_VIDEO_STM32_MAX_XRES=1280
-CONFIG_VIDEO_STM32_MAX_YRES=800
-CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
index a5ea528..e248b7d 100644
--- a/configs/stm32mp15_trusted_defconfig
+++ b/configs/stm32mp15_trusted_defconfig
@@ -1,17 +1,23 @@
CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
CONFIG_SYS_MALLOC_F_LEN=0x3000
-CONFIG_TARGET_STM32MP1=y
+CONFIG_ENV_OFFSET=0x280000
+CONFIG_TARGET_ST_STM32MP15x=y
+CONFIG_CMD_STM32PROG=y
+CONFIG_ENV_SECT_SIZE=0x40000
+CONFIG_ENV_OFFSET_REDUND=0x2C0000
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_SYS_PROMPT="STM32MP> "
# CONFIG_CMD_BOOTD is not set
+CONFIG_CMD_DTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EXPORTENV is not set
# CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_ADC=y
@@ -19,10 +25,8 @@ CONFIG_CMD_CLK=y
CONFIG_CMD_DFU=y
CONFIG_CMD_FUSE=y
CONFIG_CMD_GPIO=y
-CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
-CONFIG_CMD_MTD=y
CONFIG_CMD_REMOTEPROC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
@@ -38,29 +42,32 @@ CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_UBI=y
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_ENV_IS_NOWHERE=y
-CONFIG_ENV_IS_IN_EXT4=y
+CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_IS_IN_UBI=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
-CONFIG_ENV_EXT4_INTERFACE="mmc"
-CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
-CONFIG_ENV_EXT4_FILE="/uboot.env"
-CONFIG_ENV_OFFSET_REDUND=0x2C0000
CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_STM32_ADC=y
-CONFIG_DFU_MMC=y
-CONFIG_DFU_RAM=y
-CONFIG_DFU_MTD=y
-CONFIG_DFU_VIRT=y
+CONFIG_CLK_SCMI=y
+CONFIG_SET_DFU_ALT_INFO=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
CONFIG_FASTBOOT_USB_DEV=1
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_BOOT1_NAME="mmc1boot0"
+CONFIG_FASTBOOT_MMC_BOOT2_NAME="mmc1boot1"
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_NAME="mmc1"
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y
+CONFIG_FASTBOOT_CMD_OEM_BOOTBUS=y
+CONFIG_GPIO_HOG=y
CONFIG_DM_HWSPINLOCK=y
CONFIG_HWSPINLOCK_STM32=y
CONFIG_DM_I2C=y
@@ -69,11 +76,13 @@ CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_DM_MAILBOX=y
CONFIG_STM32_IPCC=y
+CONFIG_ARM_SMC_MAILBOX=y
CONFIG_DM_MMC=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_STM32_SDMMC2=y
CONFIG_MTD=y
CONFIG_DM_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
CONFIG_MTD_RAW_NAND=y
CONFIG_NAND_STM32_FMC2=y
CONFIG_MTD_SPI_NAND=y
@@ -84,6 +93,7 @@ CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_WINBOND=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_SPI_FLASH_MTD=y
+CONFIG_PHY_REALTEK=y
CONFIG_DM_ETH=y
CONFIG_DWC_ETH_QOS=y
CONFIG_PHY=y
@@ -97,6 +107,7 @@ CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
CONFIG_REMOTEPROC_STM32_COPRO=y
+CONFIG_RESET_SCMI=y
CONFIG_DM_RTC=y
CONFIG_RTC_STM32=y
CONFIG_SERIAL_RX_BUFFER=y
@@ -104,6 +115,9 @@ CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_STM32_QSPI=y
CONFIG_STM32_SPI=y
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+# CONFIG_OPTEE_TA_AVB is not set
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_DM_USB_GADGET=y
@@ -125,4 +139,7 @@ CONFIG_VIDEO_STM32=y
CONFIG_VIDEO_STM32_DSI=y
CONFIG_VIDEO_STM32_MAX_XRES=1280
CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_WDT=y
+CONFIG_WDT_STM32MP=y
+CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
--
2.7.4

View File

@ -0,0 +1,165 @@
From b5b052fb24a4d593ad0e3facfd365e1d33e4083f Mon Sep 17 00:00:00 2001
From: Romuald JEANNE <romuald.jeanne@st.com>
Date: Tue, 16 Mar 2021 08:14:57 +0100
Subject: [PATCH 5/5] ARM v2020.10-stm32mp-r1 CONFIG
---
configs/sandbox_defconfig | 4 ++++
configs/stm32mp15_basic_defconfig | 6 ++++--
configs/stm32mp15_dhcom_basic_defconfig | 1 +
configs/stm32mp15_dhcor_basic_defconfig | 1 +
configs/stm32mp15_trusted_defconfig | 12 ++++++++----
5 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 6e9f029cc9..a2ebb3c971 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -122,6 +122,7 @@ CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
CONFIG_CLK_COMPOSITE_CCF=y
+CONFIG_CLK_SCMI=y
CONFIG_SANDBOX_CLK_CCF=y
CONFIG_CPU=y
CONFIG_DM_DEMO=y
@@ -132,6 +133,8 @@ CONFIG_BOARD_SANDBOX=y
CONFIG_DMA=y
CONFIG_DMA_CHANNELS=y
CONFIG_SANDBOX_DMA=y
+CONFIG_FIRMWARE=y
+CONFIG_SCMI_FIRMWARE=y
CONFIG_GPIO_HOG=y
CONFIG_DM_GPIO_LOOKUP_LABEL=y
CONFIG_PM8916_GPIO=y
@@ -217,6 +220,7 @@ CONFIG_REMOTEPROC_SANDBOX=y
CONFIG_DM_RESET=y
CONFIG_SANDBOX_RESET=y
CONFIG_RESET_SYSCON=y
+CONFIG_RESET_SCMI=y
CONFIG_DM_RNG=y
CONFIG_DM_RTC=y
CONFIG_RTC_RV8803=y
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index a8c4112dbe..c08d06474b 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -18,6 +18,7 @@ CONFIG_SPL_SPI_SUPPORT=y
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
+CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
@@ -31,8 +32,6 @@ CONFIG_SPL_SPI_FLASH_MTD=y
CONFIG_SYS_PROMPT="STM32MP> "
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
-# CONFIG_CMD_EXPORTENV is not set
-# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@@ -69,6 +68,7 @@ CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_MMC_ENV_DEV=-1
# CONFIG_SPL_ENV_IS_NOWHERE is not set
# CONFIG_SPL_ENV_IS_IN_SPI_FLASH is not set
CONFIG_STM32_ADC=y
@@ -121,6 +121,7 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_STM32MP1_DDR_INTERACTIVE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_DM_RNG=y
CONFIG_RNG_STM32MP1=y
@@ -153,3 +154,4 @@ CONFIG_WDT=y
CONFIG_WDT_STM32MP=y
CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
+CONFIG_LMB_RESERVED_REGIONS=16
diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig
index 7668fd01cd..c0282fa9fb 100644
--- a/configs/stm32mp15_dhcom_basic_defconfig
+++ b/configs/stm32mp15_dhcom_basic_defconfig
@@ -17,6 +17,7 @@ CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its"
# CONFIG_USE_SPL_FIT_GENERATOR is not set
+CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig
index aa384517c3..ba1be446e7 100644
--- a/configs/stm32mp15_dhcor_basic_defconfig
+++ b/configs/stm32mp15_dhcor_basic_defconfig
@@ -17,6 +17,7 @@ CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its"
# CONFIG_USE_SPL_FIT_GENERATOR is not set
+CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
index 0792884a9d..5b4cfc4ca3 100644
--- a/configs/stm32mp15_trusted_defconfig
+++ b/configs/stm32mp15_trusted_defconfig
@@ -2,21 +2,20 @@ CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
CONFIG_TFABOOT=y
CONFIG_SYS_MALLOC_F_LEN=0x3000
-CONFIG_ENV_OFFSET=0x280000
+CONFIG_ENV_OFFSET=0x480000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_TARGET_ST_STM32MP15x=y
CONFIG_CMD_STM32PROG=y
CONFIG_TYPEC_STUSB160X=y
-CONFIG_ENV_OFFSET_REDUND=0x2C0000
+CONFIG_ENV_OFFSET_REDUND=0x4C0000
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
+CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_SYS_PROMPT="STM32MP> "
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
-# CONFIG_CMD_EXPORTENV is not set
-# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@@ -51,7 +50,9 @@ CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_MMC_ENV_DEV=-1
CONFIG_STM32_ADC=y
+CONFIG_CLK_SCMI=y
CONFIG_SET_DFU_ALT_INFO=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
@@ -99,7 +100,9 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_REMOTEPROC_OPTEE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
+CONFIG_RESET_SCMI=y
CONFIG_DM_RNG=y
CONFIG_RNG_STM32MP1=y
CONFIG_DM_RTC=y
@@ -134,3 +137,4 @@ CONFIG_WDT=y
CONFIG_WDT_STM32MP=y
CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
+CONFIG_LMB_RESERVED_REGIONS=16
--
2.17.1

View File

@ -1,778 +0,0 @@
From 1f4593f966441e5ea3477f974eea8043b75c003c Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@st.com>
Date: Tue, 27 Oct 2020 11:47:53 +0100
Subject: [PATCH 06/10] ARM-v2020.01-stm32mp-r2-DEVICETREE
---
arch/arm/dts/stm32mp15-no-scmi.dtsi | 11 ++--
arch/arm/dts/stm32mp15-pinctrl.dtsi | 8 +--
arch/arm/dts/stm32mp15-u-boot.dtsi | 57 +++++++++++------
arch/arm/dts/stm32mp151.dtsi | 81 +++++++++++++++---------
arch/arm/dts/stm32mp157a-avenger96.dts | 3 +
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 15 +++++
arch/arm/dts/stm32mp157a-dk1.dts | 9 ---
arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi | 14 ++++
arch/arm/dts/stm32mp157a-ed1.dts | 9 ---
arch/arm/dts/stm32mp157c-dk2.dts | 13 ----
arch/arm/dts/stm32mp157c-ed1.dts | 9 ---
arch/arm/dts/stm32mp157d-dk1.dts | 9 ---
arch/arm/dts/stm32mp157d-ed1.dts | 9 ---
arch/arm/dts/stm32mp157f-dk2.dts | 14 ----
arch/arm/dts/stm32mp157f-ed1.dts | 9 ---
arch/arm/dts/stm32mp15xd.dtsi | 2 +-
arch/arm/dts/stm32mp15xx-dkx.dtsi | 2 +
arch/arm/dts/stm32mp15xx-edx.dtsi | 1 -
arch/arm/dts/stm32mp15xx-evx.dtsi | 25 +++++---
19 files changed, 147 insertions(+), 153 deletions(-)
diff --git a/arch/arm/dts/stm32mp15-no-scmi.dtsi b/arch/arm/dts/stm32mp15-no-scmi.dtsi
index 3bb96ab8a2..b58b4b0526 100644
--- a/arch/arm/dts/stm32mp15-no-scmi.dtsi
+++ b/arch/arm/dts/stm32mp15-no-scmi.dtsi
@@ -61,11 +61,15 @@
clocks = <&rcc CRYP1>;
resets = <&rcc CRYP1_R>;
};
+
+ dsi: dsi@5a000000 {
+ clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
+ };
};
mlahb {
m4_rproc: m4@10000000 {
- resets = <&rcc MCU_R>;
+ resets = <&rcc MCU_R>, <&rcc MCU_HOLD_BOOT_R>;
m4_system_resources {
m4_cec: cec@40016000 {
@@ -100,10 +104,6 @@
clocks = <&rcc DDRPERFM>, <&rcc PLL2_R>;
};
-&dsi {
- clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
-};
-
&gpioz {
clocks = <&rcc GPIOZ>;
};
@@ -153,5 +153,4 @@
&usart1 {
clocks = <&rcc USART1_K>;
- resets = <&rcc USART1_R>;
};
diff --git a/arch/arm/dts/stm32mp15-pinctrl.dtsi b/arch/arm/dts/stm32mp15-pinctrl.dtsi
index b8e82adeca..9d51384c18 100644
--- a/arch/arm/dts/stm32mp15-pinctrl.dtsi
+++ b/arch/arm/dts/stm32mp15-pinctrl.dtsi
@@ -1225,7 +1225,7 @@
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>; /* USART7_RX */
- bias-disable;
+ bias-pull-up;
};
};
@@ -1235,7 +1235,7 @@
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>; /* USART7_RX */
- bias-disable;
+ bias-pull-up;
};
};
@@ -1329,7 +1329,7 @@
pins2 {
pinmux = <STM32_PINMUX('B', 12, AF8)>, /* USART3_RX */
<STM32_PINMUX('B', 13, AF7)>; /* USART3_CTS_NSS */
- bias-disable;
+ bias-pull-up;
};
};
@@ -1341,7 +1341,7 @@
};
pins2 {
pinmux = <STM32_PINMUX('B', 12, AF8)>; /* USART3_RX */
- bias-disable;
+ bias-pull-up;
};
};
diff --git a/arch/arm/dts/stm32mp15-u-boot.dtsi b/arch/arm/dts/stm32mp15-u-boot.dtsi
index 823e281906..02f9d836ec 100644
--- a/arch/arm/dts/stm32mp15-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp15-u-boot.dtsi
@@ -164,6 +164,38 @@
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
};
+&usart1 {
+ resets = <&scmi0_reset RST_SCMI0_USART1>;
+};
+
+&usart2 {
+ resets = <&rcc USART2_R>;
+};
+
+&usart3 {
+ resets = <&rcc USART3_R>;
+};
+
+&uart4 {
+ resets = <&rcc UART4_R>;
+};
+
+&uart5 {
+ resets = <&rcc UART5_R>;
+};
+
+&usart6 {
+ resets = <&rcc USART6_R>;
+};
+
+&uart7 {
+ resets = <&rcc UART7_R>;
+};
+
+&uart8{
+ resets = <&rcc UART8_R>;
+};
+
/* NO MORE USE SCMI SUPPORT for BASIC boot chain */
#ifndef CONFIG_STM32MP1_TRUSTED
@@ -172,26 +204,6 @@
/ {
clocks {
u-boot,dm-pre-reloc;
-
- clk_hse: clk-hse {
- u-boot,dm-pre-reloc;
- };
-
- clk_hsi: clk-hsi {
- u-boot,dm-pre-reloc;
- };
-
- clk_lse: clk-lse {
- u-boot,dm-pre-reloc;
- };
-
- clk_lsi: clk-lsi {
- u-boot,dm-pre-reloc;
- };
-
- clk_csi: clk-csi {
- u-boot,dm-pre-reloc;
- };
};
reboot {
@@ -228,4 +240,9 @@
u-boot,dm-spl;
};
};
+
+&usart1 {
+ resets = <&rcc USART1_R>;
+};
+
#endif /* CONFIG_STM32MP1_TRUSTED */
diff --git a/arch/arm/dts/stm32mp151.dtsi b/arch/arm/dts/stm32mp151.dtsi
index c516e2ed03..f0211917bb 100644
--- a/arch/arm/dts/stm32mp151.dtsi
+++ b/arch/arm/dts/stm32mp151.dtsi
@@ -106,12 +106,6 @@
#clock-cells = <1>;
};
};
-
- optee: optee {
- compatible = "linaro,optee-tz";
- method = "smc";
- status = "disabled";
- };
};
psci {
@@ -444,8 +438,11 @@
#size-cells = <0>;
compatible = "st,stm32-lptimer";
reg = <0x40009000 0x400>;
+ interrupts-extended = <&exti 47 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc LPTIM1_K>;
clock-names = "mux";
+ power-domains = <&pd_core>;
+ wakeup-source;
status = "disabled";
pwm {
@@ -536,7 +533,6 @@
reg = <0x4000e000 0x400>;
interrupts-extended = <&exti 27 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc USART2_K>;
- resets = <&rcc USART2_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 43 0x400 0x5>,
@@ -550,7 +546,6 @@
reg = <0x4000f000 0x400>;
interrupts-extended = <&exti 28 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc USART3_K>;
- resets = <&rcc USART3_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 45 0x400 0x5>,
@@ -564,7 +559,6 @@
reg = <0x40010000 0x400>;
interrupts-extended = <&exti 30 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc UART4_K>;
- resets = <&rcc UART4_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 63 0x400 0x5>,
@@ -578,7 +572,6 @@
reg = <0x40011000 0x400>;
interrupts-extended = <&exti 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc UART5_K>;
- resets = <&rcc UART5_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 65 0x400 0x5>,
@@ -701,7 +694,6 @@
reg = <0x40018000 0x400>;
interrupts-extended = <&exti 32 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc UART7_K>;
- resets = <&rcc UART7_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 79 0x400 0x5>,
@@ -715,7 +707,6 @@
reg = <0x40019000 0x400>;
interrupts-extended = <&exti 33 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc UART8_K>;
- resets = <&rcc UART8_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 81 0x400 0x5>,
@@ -801,7 +792,6 @@
reg = <0x44003000 0x400>;
interrupts-extended = <&exti 29 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc USART6_K>;
- resets = <&rcc USART6_R>;
wakeup-source;
power-domains = <&pd_core>;
dmas = <&dmamux1 71 0x400 0x5>,
@@ -1365,8 +1355,11 @@
#size-cells = <0>;
compatible = "st,stm32-lptimer";
reg = <0x50021000 0x400>;
+ interrupts-extended = <&exti 48 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc LPTIM2_K>;
clock-names = "mux";
+ power-domains = <&pd_core>;
+ wakeup-source;
status = "disabled";
pwm {
@@ -1392,8 +1385,11 @@
#size-cells = <0>;
compatible = "st,stm32-lptimer";
reg = <0x50022000 0x400>;
+ interrupts-extended = <&exti 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc LPTIM3_K>;
clock-names = "mux";
+ power-domains = <&pd_core>;
+ wakeup-source;
status = "disabled";
pwm {
@@ -1412,8 +1408,11 @@
lptimer4: timer@50023000 {
compatible = "st,stm32-lptimer";
reg = <0x50023000 0x400>;
+ interrupts-extended = <&exti 52 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc LPTIM4_K>;
clock-names = "mux";
+ power-domains = <&pd_core>;
+ wakeup-source;
status = "disabled";
pwm {
@@ -1426,8 +1425,11 @@
lptimer5: timer@50024000 {
compatible = "st,stm32-lptimer";
reg = <0x50024000 0x400>;
+ interrupts-extended = <&exti 53 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc LPTIM5_K>;
clock-names = "mux";
+ power-domains = <&pd_core>;
+ wakeup-source;
status = "disabled";
pwm {
@@ -1526,23 +1528,38 @@
dma-requests = <48>;
};
- fmc: nand-controller@58002000 {
- compatible = "st,stm32mp15-fmc2";
- reg = <0x58002000 0x1000>,
- <0x80000000 0x1000>,
- <0x88010000 0x1000>,
- <0x88020000 0x1000>,
- <0x81000000 0x1000>,
- <0x89010000 0x1000>,
- <0x89020000 0x1000>;
- interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
- dmas = <&mdma1 20 0x2 0x12000a02 0x0 0x0 0x0>,
- <&mdma1 20 0x2 0x12000a08 0x0 0x0 0x0>,
- <&mdma1 21 0x2 0x12000a0a 0x0 0x0 0x0>;
- dma-names = "tx", "rx", "ecc";
+ fmc: memory-controller@58002000 {
+ #address-cells = <2>;
+ #size-cells = <1>;
+ compatible = "st,stm32mp1-fmc2-ebi";
+ reg = <0x58002000 0x1000>;
clocks = <&rcc FMC_K>;
resets = <&rcc FMC_R>;
status = "disabled";
+
+ ranges = <0 0 0x60000000 0x04000000>, /* EBI CS 1 */
+ <1 0 0x64000000 0x04000000>, /* EBI CS 2 */
+ <2 0 0x68000000 0x04000000>, /* EBI CS 3 */
+ <3 0 0x6c000000 0x04000000>, /* EBI CS 4 */
+ <4 0 0x80000000 0x10000000>; /* NAND */
+
+ nand-controller@4,0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "st,stm32mp1-fmc2-nfc";
+ reg = <4 0x00000000 0x1000>,
+ <4 0x08010000 0x1000>,
+ <4 0x08020000 0x1000>,
+ <4 0x01000000 0x1000>,
+ <4 0x09010000 0x1000>,
+ <4 0x09020000 0x1000>;
+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&mdma1 20 0x2 0x12000a02 0x0 0x0 0x0>,
+ <&mdma1 20 0x2 0x12000a08 0x0 0x0 0x0>,
+ <&mdma1 21 0x2 0x12000a0a 0x0 0x0 0x0>;
+ dma-names = "tx", "rx", "ecc";
+ status = "disabled";
+ };
};
qspi: spi@58003000 {
@@ -1703,7 +1720,6 @@
reg = <0x5c000000 0x400>;
interrupts-extended = <&exti 26 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&scmi0_clk CK_SCMI0_USART1>;
- resets = <&scmi0_reset RST_SCMI0_USART1>;
wakeup-source;
power-domains = <&pd_core>;
status = "disabled";
@@ -1768,6 +1784,9 @@
ts_cal2: calib@5e {
reg = <0x5e 0x2>;
};
+ ethernet_mac_address: mac@e4 {
+ reg = <0xe4 0x6>;
+ };
};
i2c6: i2c@5c009000 {
@@ -1980,9 +1999,9 @@
reg = <0x10000000 0x40000>,
<0x30000000 0x40000>,
<0x38000000 0x10000>;
- resets = <&scmi0_reset RST_SCMI0_MCU>;
- st,syscfg-holdboot = <&rcc 0x10C 0x1>;
- st,syscfg-tz = <&rcc 0x000 0x1>;
+ resets = <&scmi0_reset RST_SCMI0_MCU>,
+ <&scmi0_reset RST_SCMI0_MCU_HOLD_BOOT>;
+ reset-names = "mcu_rst", "hold_boot";
st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>;
st,syscfg-copro-state = <&tamp 0x148 0xFFFFFFFF>;
st,syscfg-pdds = <&pwr_mcu 0x0 0x1>;
diff --git a/arch/arm/dts/stm32mp157a-avenger96.dts b/arch/arm/dts/stm32mp157a-avenger96.dts
index 941963ccc2..75efd45179 100644
--- a/arch/arm/dts/stm32mp157a-avenger96.dts
+++ b/arch/arm/dts/stm32mp157a-avenger96.dts
@@ -92,6 +92,9 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
+ reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
+ reset-delay-us = <1000>;
+
phy0: ethernet-phy@7 {
reg = <7>;
};
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
index 62d7062885..0edcbe9620 100644
--- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
@@ -21,6 +21,7 @@
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
};
+
led {
red {
label = "error";
@@ -29,6 +30,20 @@
status = "okay";
};
};
+
+ firmware {
+ optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
+
+ reserved-memory {
+ optee@de000000 {
+ reg = <0xde000000 0x02000000>;
+ no-map;
+ };
+ };
};
&adc {
diff --git a/arch/arm/dts/stm32mp157a-dk1.dts b/arch/arm/dts/stm32mp157a-dk1.dts
index baff3f6944..1f265fed2c 100644
--- a/arch/arm/dts/stm32mp157a-dk1.dts
+++ b/arch/arm/dts/stm32mp157a-dk1.dts
@@ -31,14 +31,5 @@
reg = <0xda000000 0x4000000>;
no-map;
};
-
- optee_memory: optee@0xde000000 {
- reg = <0xde000000 0x02000000>;
- no-map;
- };
};
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi
index 0f163bc566..23affacad0 100644
--- a/arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi
@@ -30,6 +30,20 @@
status = "okay";
};
};
+
+ firmware {
+ optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
+
+ reserved-memory {
+ optee@fe000000 {
+ reg = <0xfe000000 0x02000000>;
+ no-map;
+ };
+ };
};
#ifndef CONFIG_STM32MP1_TRUSTED
diff --git a/arch/arm/dts/stm32mp157a-ed1.dts b/arch/arm/dts/stm32mp157a-ed1.dts
index 5dca956843..e7fad7d394 100644
--- a/arch/arm/dts/stm32mp157a-ed1.dts
+++ b/arch/arm/dts/stm32mp157a-ed1.dts
@@ -30,11 +30,6 @@
reg = <0xf6000000 0x8000000>;
no-map;
};
-
- optee_memory: optee@fe000000 {
- reg = <0xfe000000 0x02000000>;
- no-map;
- };
};
};
@@ -46,7 +41,3 @@
contiguous-area = <&gpu_reserved>;
status = "okay";
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157c-dk2.dts b/arch/arm/dts/stm32mp157c-dk2.dts
index a7d5e86a14..ba1d15de2f 100644
--- a/arch/arm/dts/stm32mp157c-dk2.dts
+++ b/arch/arm/dts/stm32mp157c-dk2.dts
@@ -34,11 +34,6 @@
reg = <0xda000000 0x4000000>;
no-map;
};
-
- optee_memory: optee@0xde000000 {
- reg = <0xde000000 0x02000000>;
- no-map;
- };
};
wifi_pwrseq: wifi-pwrseq {
@@ -174,11 +169,3 @@
vddio-supply = <&v3v3>;
};
};
-
-&optee_memory {
- status = "okay";
-};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157c-ed1.dts b/arch/arm/dts/stm32mp157c-ed1.dts
index bf2d7e7b7d..16ddc0e9f8 100644
--- a/arch/arm/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/dts/stm32mp157c-ed1.dts
@@ -30,11 +30,6 @@
reg = <0xf6000000 0x8000000>;
no-map;
};
-
- optee_memory: optee@fe000000 {
- reg = <0xfe000000 0x02000000>;
- no-map;
- };
};
};
@@ -50,7 +45,3 @@
contiguous-area = <&gpu_reserved>;
status = "okay";
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157d-dk1.dts b/arch/arm/dts/stm32mp157d-dk1.dts
index c7d65a65e4..aa98012fd3 100644
--- a/arch/arm/dts/stm32mp157d-dk1.dts
+++ b/arch/arm/dts/stm32mp157d-dk1.dts
@@ -31,14 +31,5 @@
reg = <0xda000000 0x4000000>;
no-map;
};
-
- optee_memory: optee@0xde000000 {
- reg = <0xde000000 0x02000000>;
- no-map;
- };
};
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157d-ed1.dts b/arch/arm/dts/stm32mp157d-ed1.dts
index ee55ac8f33..aaf9adf51c 100644
--- a/arch/arm/dts/stm32mp157d-ed1.dts
+++ b/arch/arm/dts/stm32mp157d-ed1.dts
@@ -30,11 +30,6 @@
reg = <0xf6000000 0x8000000>;
no-map;
};
-
- optee_memory: optee@fe000000 {
- reg = <0xfe000000 0x02000000>;
- no-map;
- };
};
};
@@ -46,7 +41,3 @@
contiguous-area = <&gpu_reserved>;
status = "okay";
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157f-dk2.dts b/arch/arm/dts/stm32mp157f-dk2.dts
index b57db3037d..1123d0f3ed 100644
--- a/arch/arm/dts/stm32mp157f-dk2.dts
+++ b/arch/arm/dts/stm32mp157f-dk2.dts
@@ -34,12 +34,6 @@
reg = <0xda000000 0x4000000>;
no-map;
};
-
- optee_memory: optee@0xde000000 {
- reg = <0xde000000 0x02000000>;
- no-map;
- status = "disabled";
- };
};
wifi_pwrseq: wifi-pwrseq {
@@ -175,11 +169,3 @@
vddio-supply = <&v3v3>;
};
};
-
-&optee_memory {
- status = "okay";
-};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp157f-ed1.dts b/arch/arm/dts/stm32mp157f-ed1.dts
index 65380693c8..7ddb96a0ef 100644
--- a/arch/arm/dts/stm32mp157f-ed1.dts
+++ b/arch/arm/dts/stm32mp157f-ed1.dts
@@ -30,11 +30,6 @@
reg = <0xf6000000 0x8000000>;
no-map;
};
-
- optee_memory: optee@0xfe000000 {
- reg = <0xfe000000 0x02000000>;
- no-map;
- };
};
};
@@ -50,7 +45,3 @@
contiguous-area = <&gpu_reserved>;
status = "okay";
};
-
-&optee {
- status = "okay";
-};
diff --git a/arch/arm/dts/stm32mp15xd.dtsi b/arch/arm/dts/stm32mp15xd.dtsi
index faa039ea24..e2f8b1297c 100644
--- a/arch/arm/dts/stm32mp15xd.dtsi
+++ b/arch/arm/dts/stm32mp15xd.dtsi
@@ -27,7 +27,7 @@
};
cpu_alert: cpu-alert {
- temperature = <950000>;
+ temperature = <95000>;
hysteresis = <10000>;
type = "passive";
};
diff --git a/arch/arm/dts/stm32mp15xx-dkx.dtsi b/arch/arm/dts/stm32mp15xx-dkx.dtsi
index 35169385fd..685a82161c 100644
--- a/arch/arm/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/dts/stm32mp15xx-dkx.dtsi
@@ -163,6 +163,8 @@
phy-mode = "rgmii-id";
max-speed = <1000>;
phy-handle = <&phy0>;
+ nvmem-cells = <&ethernet_mac_address>;
+ nvmem-cell-names = "mac-address";
mdio0 {
#address-cells = <1>;
diff --git a/arch/arm/dts/stm32mp15xx-edx.dtsi b/arch/arm/dts/stm32mp15xx-edx.dtsi
index 7ed6b14d77..c67d57cc02 100644
--- a/arch/arm/dts/stm32mp15xx-edx.dtsi
+++ b/arch/arm/dts/stm32mp15xx-edx.dtsi
@@ -389,7 +389,6 @@
pinctrl-0 = <&uart4_pins_a>;
pinctrl-1 = <&uart4_sleep_pins_a>;
pinctrl-2 = <&uart4_idle_pins_a>;
- pinctrl-3 = <&uart4_pins_a>;
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
diff --git a/arch/arm/dts/stm32mp15xx-evx.dtsi b/arch/arm/dts/stm32mp15xx-evx.dtsi
index 07cb93db93..1a2b49cada 100644
--- a/arch/arm/dts/stm32mp15xx-evx.dtsi
+++ b/arch/arm/dts/stm32mp15xx-evx.dtsi
@@ -223,11 +223,12 @@
dfsdm1: filter@1 {
compatible = "st,stm32-dfsdm-dmic";
- st,adc-channels = <1>;
+ st,adc-channels = <0>;
st,adc-channel-names = "dmic_u2";
st,adc-channel-types = "SPI_F";
st,adc-channel-clk-src = "CLKOUT";
st,filter-order = <3>;
+ st,adc-alt-channel = <1>;
status = "okay";
asoc_pdm1: dfsdm-dai {
@@ -246,10 +247,11 @@
dfsdm2: filter@2 {
compatible = "st,stm32-dfsdm-dmic";
- st,adc-channels = <3>;
+ st,adc-channels = <2>;
st,adc-channel-names = "dmic_u3";
st,adc-channel-types = "SPI_F";
st,adc-channel-clk-src = "CLKOUT";
+ st,adc-alt-channel = <1>;
st,filter-order = <3>;
status = "okay";
@@ -299,6 +301,8 @@
phy-mode = "rgmii-id";
max-speed = <1000>;
phy-handle = <&phy0>;
+ nvmem-cells = <&ethernet_mac_address>;
+ nvmem-cell-names = "mac-address";
mdio0 {
#address-cells = <1>;
@@ -315,14 +319,16 @@
pinctrl-0 = <&fmc_pins_a>;
pinctrl-1 = <&fmc_sleep_pins_a>;
status = "okay";
- #address-cells = <1>;
- #size-cells = <0>;
- nand@0 {
- reg = <0>;
- nand-on-flash-bbt;
- #address-cells = <1>;
- #size-cells = <1>;
+ nand-controller@4,0 {
+ status = "okay";
+
+ nand@0 {
+ reg = <0>;
+ nand-on-flash-bbt;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ };
};
};
@@ -673,6 +679,7 @@
&usbphyc_port0 {
st,phy-tuning = <&usb_phy_tuning>;
+ vbus-supply = <&vbus_sw>;
};
&usbphyc_port1 {
--
2.17.1

View File

@ -1,529 +0,0 @@
From 84a856108aaf180a2cfda252a9b952b55062442e Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@st.com>
Date: Tue, 27 Oct 2020 11:48:20 +0100
Subject: [PATCH 07/10] ARM-v2020.01-stm32mp-r2-MACHINE
---
Makefile | 2 +-
arch/arm/Kconfig | 28 ++++++++++
arch/arm/include/asm/iproc-common/configs.h | 1 -
arch/arm/include/asm/system.h | 11 ++++
arch/arm/lib/cache-cp15.c | 29 +++++++---
arch/arm/lib/cache.c | 13 +++--
arch/arm/mach-stm32mp/Kconfig | 13 +++++
.../mach-stm32mp/cmd_stm32prog/stm32prog.c | 2 +-
arch/arm/mach-stm32mp/cpu.c | 53 ++++++++++++++++---
arch/arm/mach-stm32mp/fdt.c | 14 +++--
.../mach-stm32mp/include/mach/stm32mp1_smc.h | 48 ++++++++++++-----
.../arm/mach-stm32mp/include/mach/sys_proto.h | 2 +
arch/arm/mach-stm32mp/spl.c | 20 +++++++
13 files changed, 197 insertions(+), 39 deletions(-)
diff --git a/Makefile b/Makefile
index 8b390bc5a3..64b0560af5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
VERSION = 2020
PATCHLEVEL = 01
SUBLEVEL =
-EXTRAVERSION = -stm32mp-r1
+EXTRAVERSION = -stm32mp-r2
NAME =
# *DOCUMENTATION*
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 36c9c2fecd..f04c37c88c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -329,6 +329,34 @@ config SYS_CACHELINE_SIZE
default 64 if SYS_CACHE_SHIFT_6
default 32 if SYS_CACHE_SHIFT_5
+choice
+ prompt "Select the ARM data write cache policy"
+ default SYS_ARM_CACHE_WRITETHROUGH if TARGET_BCMCYGNUS || \
+ TARGET_BCMNSP || CPU_PXA || RZA1
+ default SYS_ARM_CACHE_WRITEBACK
+
+config SYS_ARM_CACHE_WRITEBACK
+ bool "Write-back (WB)"
+ help
+ A write updates the cache only and marks the cache line as dirty.
+ External memory is updated only when the line is evicted or explicitly
+ cleaned.
+
+config SYS_ARM_CACHE_WRITETHROUGH
+ bool "Write-through (WT)"
+ help
+ A write updates both the cache and the external memory system.
+ This does not mark the cache line as dirty.
+
+config SYS_ARM_CACHE_WRITEALLOC
+ bool "Write allocation (WA)"
+ help
+ A cache line is allocated on a write miss. This means that executing a
+ store instruction on the processor might cause a burst read to occur.
+ There is a linefill to obtain the data for the cache line, before the
+ write is performed.
+endchoice
+
config ARCH_CPU_INIT
bool "Enable ARCH_CPU_INIT"
help
diff --git a/arch/arm/include/asm/iproc-common/configs.h b/arch/arm/include/asm/iproc-common/configs.h
index 96c4f54f4a..4733c0793c 100644
--- a/arch/arm/include/asm/iproc-common/configs.h
+++ b/arch/arm/include/asm/iproc-common/configs.h
@@ -10,7 +10,6 @@
/* Architecture, CPU, chip, etc */
#define CONFIG_IPROC
-#define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
/* Memory Info */
#define CONFIG_SYS_SDRAM_BASE 0x61000000
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index a1a5e35ef6..9fd3b321fc 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -447,6 +447,7 @@ static inline void set_dacr(unsigned int val)
/* options available for data cache on each page */
enum dcache_option {
+ INVALID_ENTRY = 0,
DCACHE_OFF = TTB_SECT | TTB_SECT_MAIR(0) | TTB_SECT_XN_MASK,
DCACHE_WRITETHROUGH = TTB_SECT | TTB_SECT_MAIR(1),
DCACHE_WRITEBACK = TTB_SECT | TTB_SECT_MAIR(2),
@@ -468,6 +469,7 @@ enum dcache_option {
/* options available for data cache on each page */
enum dcache_option {
+ INVALID_ENTRY = 0,
DCACHE_OFF = TTB_SECT_DOMAIN(0) | TTB_SECT_XN_MASK | TTB_SECT,
DCACHE_WRITETHROUGH = DCACHE_OFF | TTB_SECT_C_MASK,
DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK,
@@ -477,6 +479,7 @@ enum dcache_option {
#define TTB_SECT_AP (3 << 10)
/* options available for data cache on each page */
enum dcache_option {
+ INVALID_ENTRY = 0,
DCACHE_OFF = 0x12,
DCACHE_WRITETHROUGH = 0x1a,
DCACHE_WRITEBACK = 0x1e,
@@ -484,6 +487,14 @@ enum dcache_option {
};
#endif
+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
+#define DCACHE_DEFAULT_OPTION DCACHE_WRITETHROUGH
+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
+#define DCACHE_DEFAULT_OPTION DCACHE_WRITEALLOC
+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEBACK)
+#define DCACHE_DEFAULT_OPTION DCACHE_WRITEBACK
+#endif
+
/* Size of an MMU section */
enum {
#ifdef CONFIG_ARMV7_LPAE
diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index f8d20960da..16067cf8da 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <cpu_func.h>
+#include <lmb.h>
#include <asm/system.h>
#include <asm/cache.h>
#include <linux/compiler.h>
@@ -61,8 +62,11 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
unsigned long startpt, stoppt;
unsigned long upto, end;
- end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
+ /* div by 2 before start + size to avoid phys_addr_t overflow */
+ end = ALIGN((start / 2) + (size / 2), MMU_SECTION_SIZE / 2)
+ >> (MMU_SECTION_SHIFT - 1);
start = start >> MMU_SECTION_SHIFT;
+
#ifdef CONFIG_ARMV7_LPAE
debug("%s: start=%pa, size=%zu, option=%llx\n", __func__, &start, size,
option);
@@ -89,20 +93,29 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
__weak void dram_bank_mmu_setup(int bank)
{
bd_t *bd = gd->bd;
+ struct lmb lmb;
int i;
+ /* bd->bi_dram is available only after relocation */
+ if ((gd->flags & GD_FLG_RELOC) == 0)
+ return;
+
+ /*
+ * don't allow cache on reserved memory tagged 'no-map' in DT
+ * => avoid speculative access to "secure" data
+ */
+ lmb_init_and_reserve(&lmb, bd, (void *)gd->fdt_blob);
+
debug("%s: bank: %d\n", __func__, bank);
for (i = bd->bi_dram[bank].start >> MMU_SECTION_SHIFT;
i < (bd->bi_dram[bank].start >> MMU_SECTION_SHIFT) +
(bd->bi_dram[bank].size >> MMU_SECTION_SHIFT);
i++) {
-#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
- set_section_dcache(i, DCACHE_WRITETHROUGH);
-#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
- set_section_dcache(i, DCACHE_WRITEALLOC);
-#else
- set_section_dcache(i, DCACHE_WRITEBACK);
-#endif
+ if (lmb_is_reserved_flags(&lmb, i << MMU_SECTION_SHIFT,
+ LMB_NOMAP))
+ set_section_dcache(i, INVALID_ENTRY);
+ else
+ set_section_dcache(i, DCACHE_DEFAULT_OPTION);
}
}
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 007d4ebc49..7f3cfb407c 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -73,6 +73,15 @@ static unsigned long noncached_start;
static unsigned long noncached_end;
static unsigned long noncached_next;
+void noncached_set_region(void)
+{
+#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
+ mmu_set_region_dcache_behaviour(noncached_start,
+ noncached_end - noncached_start,
+ DCACHE_OFF);
+#endif
+}
+
void noncached_init(void)
{
phys_addr_t start, end;
@@ -89,9 +98,7 @@ void noncached_init(void)
noncached_end = end;
noncached_next = start;
-#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
- mmu_set_region_dcache_behaviour(noncached_start, size, DCACHE_OFF);
-#endif
+ noncached_set_region();
}
phys_addr_t noncached_alloc(size_t size, size_t align)
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index f9f79437e4..c24717d36d 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -103,6 +103,19 @@ config SYS_TEXT_BASE
config NR_DRAM_BANKS
default 1
+config DDR_CACHEABLE_SIZE
+ hex "Size of the DDR marked cacheable in pre-reloc stage"
+ default 0x10000000 if TFABOOT
+ default 0x40000000
+ help
+ Define the size of the DDR marked as cacheable in U-Boot
+ pre-reloc stage.
+ This option can be useful to avoid speculatif access
+ to secured area of DDR used by TF-A or OP-TEE before U-Boot
+ initialization.
+ The areas marked "no-map" in device tree should be located
+ before this limit: STM32_DDR_BASE + DDR_CACHEABLE_SIZE.
+
config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
hex "Partition on MMC2 to use to load U-Boot from"
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index f2f9ed9f36..531df60404 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -560,7 +560,7 @@ static int init_device(struct stm32prog_data *data,
#ifdef CONFIG_MMC
case STM32PROG_MMC:
mmc = find_mmc_device(dev->dev_id);
- if (mmc_init(mmc)) {
+ if (!mmc || mmc_init(mmc)) {
stm32prog_err("mmc device %d not found", dev->dev_id);
return -ENODEV;
}
diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index 305534f2ba..aee0f2bf81 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -76,6 +76,12 @@
#define PKG_SHIFT 27
#define PKG_MASK GENMASK(2, 0)
+/*
+ * early TLB into the .data section so that it not get cleared
+ * with 16kB allignment (see TTBR0_BASE_ADDR_MASK)
+ */
+u8 early_tlb[PGTABLE_SIZE] __section(".data") __aligned(0x4000);
+
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
#ifndef CONFIG_STM32MP1_TRUSTED
static void security_init(void)
@@ -142,17 +148,17 @@ static void security_init(void)
/*
* Debug init
*/
-static void dbgmcu_init(void)
+void dbgmcu_init(void)
{
- setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN);
-
/*
* Freeze IWDG2 if Cortex-A7 is in debug mode
* done in TF-A for TRUSTED boot and
* DBGMCU access is controlled by BSEC_DENABLE.DBGSWENABLE
*/
- if (!CONFIG_IS_ENABLED(STM32MP1_TRUSTED) && bsec_dbgswenable())
+ if (!IS_ENABLED(CONFIG_STM32MP1_TRUSTED) && bsec_dbgswenable()) {
+ setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN);
setbits_le32(DBGMCU_APB4FZ1, DBGMCU_APB4FZ1_IWDG2);
+ }
}
#endif /* !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) */
@@ -192,6 +198,33 @@ u32 get_bootmode(void)
TAMP_BOOT_MODE_SHIFT;
}
+/*
+ * initialize the MMU and activate cache in SPL or in U-Boot pre-reloc stage
+ * MMU/TLB is updated in enable_caches() for U-Boot after relocation
+ * or is deactivated in U-Boot entry function start.S::cpu_init_cp15
+ */
+static void early_enable_caches(void)
+{
+ /* I-cache is already enabled in start.S: cpu_init_cp15 */
+
+ if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+ return;
+
+ gd->arch.tlb_size = PGTABLE_SIZE;
+ gd->arch.tlb_addr = (unsigned long)&early_tlb;
+
+ dcache_enable();
+
+ if (IS_ENABLED(CONFIG_SPL_BUILD))
+ mmu_set_region_dcache_behaviour(STM32_SYSRAM_BASE,
+ STM32_SYSRAM_SIZE,
+ DCACHE_DEFAULT_OPTION);
+ else
+ mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
+ CONFIG_DDR_CACHEABLE_SIZE,
+ DCACHE_DEFAULT_OPTION);
+}
+
/*
* Early system init
*/
@@ -199,11 +232,12 @@ int arch_cpu_init(void)
{
u32 boot_mode;
+ early_enable_caches();
+
/* early armv7 timer init: needed for polling */
timer_init();
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
- dbgmcu_init();
#ifndef CONFIG_STM32MP1_TRUSTED
security_init();
update_bootmode();
@@ -231,7 +265,14 @@ int arch_cpu_init(void)
void enable_caches(void)
{
- /* Enable D-cache. I-cache is already enabled in start.S */
+ /* I-cache is already enabled in start.S: icache_enable() not needed */
+
+ /* deactivate the data cache, early enabled in arch_cpu_init() */
+ dcache_disable();
+ /*
+ * update MMU after relocation and enable the data cache
+ * warning: the TLB location udpated in board_f.c::reserve_mmu
+ */
dcache_enable();
}
diff --git a/arch/arm/mach-stm32mp/fdt.c b/arch/arm/mach-stm32mp/fdt.c
index 21b5f09728..8d9a58186d 100644
--- a/arch/arm/mach-stm32mp/fdt.c
+++ b/arch/arm/mach-stm32mp/fdt.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
- * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
+ * Copyright (C) 2019-2020, STMicroelectronics - All Rights Reserved
*/
#include <common.h>
@@ -223,19 +223,23 @@ static void stm32_fdt_disable_optee(void *blob)
{
int off, node;
+ /* Delete "optee" firmware node */
off = fdt_node_offset_by_compatible(blob, -1, "linaro,optee-tz");
if (off >= 0 && fdtdec_get_is_enabled(blob, off))
- fdt_status_disabled(blob, off);
+ fdt_del_node(blob, off);
- /* Disabled "optee@..." reserved-memory node */
+ /* Delete "optee@..." reserved-memory node */
off = fdt_path_offset(blob, "/reserved-memory/");
if (off < 0)
return;
for (node = fdt_first_subnode(blob, off);
node >= 0;
node = fdt_next_subnode(blob, node)) {
- if (!strncmp(fdt_get_name(blob, node, NULL), "optee@", 6))
- fdt_status_disabled(blob, node);
+ if (strncmp(fdt_get_name(blob, node, NULL), "optee@", 6))
+ continue;
+
+ if (fdt_del_node(blob, node))
+ printf("Failed to remove optee reserved-memory node\n");
}
}
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h b/arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h
index dea5b4a6b4..d72747ca31 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h
@@ -8,27 +8,53 @@
#include <linux/arm-smccc.h>
+/* SMC service generic return codes */
+#define STM32_SMC_OK 0x00000000U
+#define STM32_SMC_NOT_SUPPORTED 0xFFFFFFFFU
+#define STM32_SMC_FAILED 0xFFFFFFFEU
+#define STM32_SMC_INVALID_PARAMS 0xFFFFFFFDU
+
/*
- * SMC function IDs for STM32 Service queries
+ * SMC function IDs for STM32 Service queries.
* STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
* like this is defined in SMC calling Convention by ARM
- * for SiP (silicon Partner)
- * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
+ * for SiP (silicon Partner).
+ * https://developer.arm.com/docs/den0028/latest
*/
-#define STM32_SMC_VERSION 0x82000000
/* Secure Service access from Non-secure */
-#define STM32_SMC_RCC 0x82001000
+
+/*
+ * SMC function STM32_SMC_PWR.
+ *
+ * Argument a0: (input) SMCC ID.
+ * (output) Status return code.
+ * Argument a1: (input) Service ID (STM32_SMC_REG_xxx).
+ * Argument a2: (input) Register offset or physical address.
+ * (output) Register read value, if applicable.
+ * Argument a3: (input) Register target value if applicable.
+ */
#define STM32_SMC_PWR 0x82001001
-#define STM32_SMC_RTC 0x82001002
+
+/*
+ * SMC functions STM32_SMC_BSEC.
+ *
+ * Argument a0: (input) SMCC ID.
+ * (output) Status return code.
+ * Argument a1: (input) Service ID (STM32_SMC_READ_xxx/_PROG_xxx/_WRITE_xxx).
+ * (output) OTP read value, if applicable.
+ * Argument a2: (input) OTP index.
+ * Argument a3: (input) OTP value if applicable.
+ */
#define STM32_SMC_BSEC 0x82001003
-/* Register access service use for RCC/RTC/PWR */
+/* Service ID for STM32_SMC_PWR */
+#define STM32_SMC_REG_READ 0x0
#define STM32_SMC_REG_WRITE 0x1
#define STM32_SMC_REG_SET 0x2
#define STM32_SMC_REG_CLEAR 0x3
-/* Service for BSEC */
+/* Service ID for STM32_SMC_BSEC */
#define STM32_SMC_READ_SHADOW 0x01
#define STM32_SMC_PROG_OTP 0x02
#define STM32_SMC_WRITE_SHADOW 0x03
@@ -37,12 +63,6 @@
#define STM32_SMC_WRITE_ALL 0x06
#define STM32_SMC_WRLOCK_OTP 0x07
-/* SMC error codes */
-#define STM32_SMC_OK 0x0
-#define STM32_SMC_NOT_SUPPORTED -1
-#define STM32_SMC_FAILED -2
-#define STM32_SMC_INVALID_PARAMS -3
-
#define stm32_smc_exec(svc, op, data1, data2) \
stm32_smc(svc, op, data1, data2, NULL)
diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
index b6ad3c67ae..c5cab9f21b 100644
--- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
+++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
@@ -52,3 +52,5 @@ int setup_mac_address(void);
/* board power management : configure vddcore according OPP */
void board_vddcore_init(u32 voltage_mv);
int board_vddcore_set(void);
+
+void dbgmcu_init(void);
diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index f4b4c3bd82..41f3fd4b7c 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <dm.h>
#include <spl.h>
#include <asm/io.h>
@@ -123,4 +124,23 @@ void board_init_f(ulong dummy)
printf("DRAM init failed: %d\n", ret);
hang();
}
+
+ /*
+ * activate cache on DDR only when DDR is fully initialized
+ * to avoid speculative access and issue in get_ram_size()
+ */
+ if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+ mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
+ CONFIG_DDR_CACHEABLE_SIZE,
+ DCACHE_DEFAULT_OPTION);
+}
+
+void spl_board_prepare_for_boot(void)
+{
+ dcache_disable();
+}
+
+void spl_board_prepare_for_boot_linux(void)
+{
+ dcache_disable();
}
--
2.17.1

View File

@ -1,247 +0,0 @@
From c4ead8e3640dd3d0810bff2cbd4b6c14c2139a04 Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@st.com>
Date: Tue, 27 Oct 2020 11:48:28 +0100
Subject: [PATCH 08/10] ARM-v2020.01-stm32mp-r2-BOARD
---
board/st/stm32mp1/spl.c | 4 ++
board/st/stm32mp1/stm32mp1.c | 136 +++++++++++++++++++++++------------
2 files changed, 95 insertions(+), 45 deletions(-)
diff --git a/board/st/stm32mp1/spl.c b/board/st/stm32mp1/spl.c
index e65ff288ea..058d47e0e7 100644
--- a/board/st/stm32mp1/spl.c
+++ b/board/st/stm32mp1/spl.c
@@ -12,9 +12,13 @@
#include <power/pmic.h>
#include <power/stpmic1.h>
#include <asm/arch/ddr.h>
+#include <asm/arch/sys_proto.h>
void spl_board_init(void)
{
+ /* init DBGMU */
+ dbgmcu_init();
+
/* Keep vdd on during the reset cycle */
#if defined(CONFIG_PMIC_STPMIC1) && defined(CONFIG_SPL_POWER_SUPPORT)
struct udevice *dev;
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 617d05d209..6dad00600e 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -22,6 +22,7 @@
#include <remoteproc.h>
#include <reset.h>
#include <syscon.h>
+#include <tee.h>
#include <usb.h>
#include <watchdog.h>
#include <asm/io.h>
@@ -118,7 +119,7 @@ int checkboard(void)
const char *fdt_compat;
int fdt_compat_len;
- if (CONFIG_IS_ENABLED(STM32MP1_TRUSTED))
+ if (IS_ENABLED(CONFIG_STM32MP1_TRUSTED))
mode = "trusted";
else
mode = "basic";
@@ -362,38 +363,14 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
}
#ifdef CONFIG_ADC
-static int board_check_usb_power(void)
+
+static int adc_measurement(ofnode node, int adc_count, int *min_uV, int *max_uV)
{
struct ofnode_phandle_args adc_args;
struct udevice *adc;
- ofnode node;
unsigned int raw;
- int max_uV = 0;
- int min_uV = USB_START_HIGH_THRESHOLD_UV;
- int ret, uV, adc_count;
- u32 nb_blink;
- u8 i;
- node = ofnode_path("/config");
- if (!ofnode_valid(node)) {
- debug("%s: no /config node?\n", __func__);
- return -ENOENT;
- }
-
- /*
- * Retrieve the ADC channels devices and get measurement
- * for each of them
- */
- adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
- "#io-channel-cells");
- if (adc_count < 0) {
- if (adc_count == -ENOENT)
- return 0;
-
- pr_err("%s: can't find adc channel (%d)\n", __func__,
- adc_count);
-
- return adc_count;
- }
+ int ret, uV;
+ int i;
for (i = 0; i < adc_count; i++) {
if (ofnode_parse_phandle_with_args(node, "st,adc_usb_pd",
@@ -422,10 +399,10 @@ static int board_check_usb_power(void)
}
/* Convert to uV */
if (!adc_raw_to_uV(adc, raw, &uV)) {
- if (uV > max_uV)
- max_uV = uV;
- if (uV < min_uV)
- min_uV = uV;
+ if (uV > *max_uV)
+ *max_uV = uV;
+ if (uV < *min_uV)
+ *min_uV = uV;
pr_debug("%s: %s[%02d] = %u, %d uV\n", __func__,
adc->name, adc_args.args[0], raw, uV);
} else {
@@ -433,19 +410,62 @@ static int board_check_usb_power(void)
__func__, adc->name, adc_args.args[0]);
}
}
+ return 0;
+}
+
+static int board_check_usb_power(void)
+{
+ ofnode node;
+ int max_uV = 0;
+ int min_uV = USB_START_HIGH_THRESHOLD_UV;
+ int adc_count, ret;
+ u32 nb_blink;
+ u8 i;
+ node = ofnode_path("/config");
+ if (!ofnode_valid(node)) {
+ debug("%s: no /config node?\n", __func__);
+ return -ENOENT;
+ }
/*
- * If highest value is inside 1.23 Volts and 2.10 Volts, that means
- * board is plugged on an USB-C 3A power supply and boot process can
- * continue.
+ * Retrieve the ADC channels devices and get measurement
+ * for each of them
*/
- if (max_uV > USB_START_LOW_THRESHOLD_UV &&
- max_uV <= USB_START_HIGH_THRESHOLD_UV &&
- min_uV <= USB_LOW_THRESHOLD_UV)
- return 0;
+ adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
+ "#io-channel-cells");
+ if (adc_count < 0) {
+ if (adc_count == -ENOENT)
+ return 0;
- pr_err("****************************************************\n");
+ pr_err("%s: can't find adc channel (%d)\n", __func__,
+ adc_count);
+
+ return adc_count;
+ }
+
+ /* perform maximum of 2 ADC measurement to detect power supply current */
+ for (i = 0; i < 2; i++) {
+ ret = adc_measurement(node, adc_count, &min_uV, &max_uV);
+ if (ret)
+ return ret;
+
+ /*
+ * If highest value is inside 1.23 Volts and 2.10 Volts, that means
+ * board is plugged on an USB-C 3A power supply and boot process can
+ * continue.
+ */
+ if (max_uV > USB_START_LOW_THRESHOLD_UV &&
+ max_uV <= USB_START_HIGH_THRESHOLD_UV &&
+ min_uV <= USB_LOW_THRESHOLD_UV)
+ return 0;
+
+ if (i == 0) {
+ pr_debug("Previous ADC measurements was not the one expected, retry in 20ms\n");
+ mdelay(20); /* equal to max tPDDebounce duration (min 10ms - max 20ms) */
+ }
+ }
+ pr_err("****************************************************\n");
/*
* If highest and lowest value are either both below
* USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
@@ -737,7 +757,7 @@ int board_init(void)
int board_late_init(void)
{
- char *boot_device;
+ char *boot_device, *boot_instance;
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
const void *fdt_compat;
int fdt_compat_len;
@@ -770,7 +790,7 @@ int board_late_init(void)
if (!ret)
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
&otp, sizeof(otp));
- if (!ret && otp) {
+ if (ret > 0 && otp) {
snprintf(buf, sizeof(buf), "0x%04x", otp >> 16);
env_set("board_id", buf);
@@ -791,6 +811,25 @@ int board_late_init(void)
(!strcmp(boot_device, "serial") || !strcmp(boot_device, "usb")))
env_set("bootdelay", "0");
+ /* define dynamic variables for FASTBOOT and ANDROID bootargs*/
+ if (CONFIG_IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC) &&
+ boot_device && !strcmp(boot_device, "mmc")) {
+ boot_instance = env_get("boot_instance");
+ env_set("fastboot.boot_instance", boot_instance);
+ }
+ if (CONFIG_IS_ENABLED(OPTEE) &&
+ tee_find_device(NULL, NULL, NULL, NULL)) {
+ if (CONFIG_IS_ENABLED(CONFIG_CMD_DTIMG))
+ env_set("android_bootargs", "androidboot.optee=true");
+ if (CONFIG_IS_ENABLED(FASTBOOT))
+ env_set("fastboot.boot_mode", "optee");
+ } else {
+ if (CONFIG_IS_ENABLED(CONFIG_CMD_DTIMG))
+ env_set("android_bootargs", "");
+ if (CONFIG_IS_ENABLED(FASTBOOT))
+ env_set("fastboot.boot_mode", "trusted");
+ }
+
return 0;
}
@@ -939,12 +978,19 @@ int mmc_get_env_dev(void)
int ft_board_setup(void *blob, bd_t *bd)
{
#ifdef CONFIG_FDT_FIXUP_PARTITIONS
- struct node_info nodes[] = {
+ static const struct node_info nodes[] = {
{ "st,stm32f469-qspi", MTD_DEV_TYPE_NOR, },
{ "st,stm32f469-qspi", MTD_DEV_TYPE_SPINAND},
{ "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, },
+ { "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, },
};
- fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+ char *boot_device;
+
+ /* Check the boot-source and don't update MTD for serial or usb boot */
+ boot_device = env_get("boot_device");
+ if (!boot_device ||
+ (strcmp(boot_device, "serial") && strcmp(boot_device, "usb")))
+ fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
#endif
return 0;
--
2.17.1

View File

@ -1,63 +0,0 @@
From 881509572b6d9fac6dc570b710e89d47cabbf05b Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@st.com>
Date: Tue, 27 Oct 2020 11:49:05 +0100
Subject: [PATCH 10/10] ARM-v2020.01-stm32mp-r2-CONFIG
---
configs/stm32mp15_basic_defconfig | 3 +--
configs/stm32mp15_trusted_defconfig | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index cf282177f7..79e77e122c 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -27,8 +27,6 @@ CONFIG_CMD_DTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_XIMG is not set
-# CONFIG_CMD_EXPORTENV is not set
-# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@@ -89,6 +87,7 @@ CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_DM_MAILBOX=y
CONFIG_STM32_IPCC=y
+CONFIG_STM32_FMC2_EBI=y
CONFIG_DM_MMC=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_STM32_SDMMC2=y
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
index e248b7d1d3..b5069bc6d5 100644
--- a/configs/stm32mp15_trusted_defconfig
+++ b/configs/stm32mp15_trusted_defconfig
@@ -15,8 +15,6 @@ CONFIG_CMD_DTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_XIMG is not set
-# CONFIG_CMD_EXPORTENV is not set
-# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@@ -77,6 +75,7 @@ CONFIG_LED_GPIO=y
CONFIG_DM_MAILBOX=y
CONFIG_STM32_IPCC=y
CONFIG_ARM_SMC_MAILBOX=y
+CONFIG_STM32_FMC2_EBI=y
CONFIG_DM_MMC=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_STM32_SDMMC2=y
@@ -106,6 +105,7 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_REMOTEPROC_OPTEE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_RESET_SCMI=y
CONFIG_DM_RTC=y
--
2.17.1

View File

@ -98,7 +98,7 @@ To compile U-Boot source code, first move to U-Boot source:
or or
$ cd u-boot $ cd u-boot
5.1 Compilation for one target (one defconfig, one device tree) 5.1 Compilation for one target (one defconfig, one device tree) - and no FIP
see <U-Boot source>/board/st/stm32mp1/README for details see <U-Boot source>/board/st/stm32mp1/README for details
@ -115,11 +115,14 @@ To compile U-Boot source code, first move to U-Boot source:
$ make stm32mp15_basic_defconfig $ make stm32mp15_basic_defconfig
$ make DEVICE_TREE=stm32mp157c-dk2 all $ make DEVICE_TREE=stm32mp157c-dk2 all
5.2 Compilation for several targets: use Makefile.sdk 5.2 Compilation for several targets: use Makefile.sdk (with FIP)
Calls the specific 'Makefile.sdk' provided to compile U-Boot: Calls the specific 'Makefile.sdk' provided to compile U-Boot:
- Display 'Makefile.sdk' file default configuration and targets: - Display 'Makefile.sdk' file default configuration and targets:
$> make -f $PWD/../Makefile.sdk help $ make -f $PWD/../Makefile.sdk help
As mentionned in help, OpenSTLinux has activated FIP by default, so the FIP_artifacts should be specified
- In case of using SOURCES-xxxx.tar.gz of Developer package the FIP_DEPLOYDIR_ROOT should be set as below:
$> export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts
- Compile default U-Boot configuration: - Compile default U-Boot configuration:
$> make -f $PWD/../Makefile.sdk all $> make -f $PWD/../Makefile.sdk all
@ -133,15 +136,7 @@ variables 'DEVICE_TREE' and 'UBOOT_CONFIGS':
<binary> is the u-boot binary to export (ex: 'u-boot.bin', 'u-boot.stm32', etc) <binary> is the u-boot binary to export (ex: 'u-boot.bin', 'u-boot.stm32', etc)
ex: UBOOT_CONFIGS="<defconfig1>,basic,u-boot.bin <defconfig1>,trusted,u-boot.stm32" ex: UBOOT_CONFIGS="<defconfig1>,basic,u-boot.bin <defconfig1>,trusted,u-boot.stm32"
The generated binary files are available in ../build-${config}. The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip
by default we define 3 configs: basic, trusted, optee for the several boards
The generated files are :
for trusted and optee configs:
#> ../build-{trusted,optee}/*.stm32
for basic config
#> ../build-basic/u-boot-spl.elf-*-basic
#> ../build-basic/u-boot-*-basic.img
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):
@ -153,101 +148,5 @@ You can override the default U-Boot configuration if you specify these variables
6. Update software on board: 6. Update software on board:
---------------------------- ----------------------------
Please use STM32CubeProgrammer and only tick the ssbl-boot and fip partition (more informations on the wiki website http://wiki.st.com/stm32mpu)
see also <U-Boot source>/board/st/stm32mp1/README
6.1. partitioning of binaries:
------------------------------
There are two possible boot chains available:
- Basic boot chain (for basic configuration)
- Trusted boot chain (for trusted and optee configuration)
U-Boot build provides binaries for each configuration:
- Basic boot chain: U-Boot SPL and U-Boot imgage (for FSBL and SSBL)
- Trusted boot chain: U-Boot binary with ".stm32" extension (for SSBL, FSBL is provided by TF-A)
6.1.1. Basic boot chain:
On this configuration, we use U-Boot SPL as First Stage Boot Loader (FSBL) and
U-Boot as Second Stage Boot Loader (SSBL).
U-Boot SPL (u-boot-spl.stm32-*) MUST be copied on a dedicated partition named "fsbl1"
U-Boot image (u-boot*.img) MUST be copied on a dedicated partition named "ssbl"
6.1.2. Trusted boot chain:
On this configuration, U-Boot is associated to Trusted Firmware (TF-A) and only
U-Boot image is used as Second Stage Boot Loader (SSBL).
TF-A binary (tf-a-*.stm32) MUST be copied on a dedicated partition named "fsbl1"
U-boot binary (u-boot*.stm32) MUST be copied on a dedicated partition named "ssbl"
6.2. Update via SDCARD:
-----------------------
6.2.1. Basic boot chain
* u-boot-spl.stm32-*
Copy the binary on the dedicated partition, on SDCARD/USB disk the partition
"fsbl1" is the partition 1:
- SDCARD: /dev/mmcblkXp1 (where X is the instance number)
- SDCARD via USB reader: /dev/sdX1 (where X is the instance number)
$ dd if=<U-Boot SPL file> of=/dev/<device partition> bs=1M conv=fdatasync
* u-boot*.img
Copy the binary on the dedicated partition, on SDCARD/USB disk the partition
"ssbl" is the partition 4:
- SDCARD: /dev/mmcblkXp3 (where X is the instance number)
- SDCARD via USB reader: /dev/sdX3 (where X is the instance number)
$ dd if=<U-Boot image file> of=/dev/<device partition> bs=1M conv=fdatasync
6.2.2. Trusted boot chain
* tf-a-*.stm32
Copy the binary on the dedicated partition, on SDCARD/USB disk the partition
"fsbl1" is the partition 1:
- SDCARD: /dev/mmcblkXp1 (where X is the instance number)
- SDCARD via USB reader: /dev/sdX1 (where X is the instance number)
$ dd if=<TF-A binary file> of=/dev/<device partition> bs=1M conv=fdatasync
* u-boot*.stm32
Copy the binary on the dedicated partition, on SDCARD/USB disk the partition
"ssbl" is the partition 4:
- SDCARD: /dev/mmcblkXp3 (where X is the instance number)
- SDCARD via USB reader: /dev/sdX3 (where X is the instance number)
$ dd if=<U-Boot stm32 binary file> of=/dev/<device partition> bs=1M conv=fdatasync
6.2.3. FAQ
to found the partition associated to a specific label, just plug the
SDCARD/USB disk on your PC and call the following command:
$ ls -l /dev/disk/by-partlabel/
total 0
lrwxrwxrwx 1 root root 10 Jan 17 17:38 bootfs -> ../../mmcblk0p4
lrwxrwxrwx 1 root root 10 Jan 17 17:38 fsbl1 -> ../../mmcblk0p1 ➔ FSBL (TF-A)
lrwxrwxrwx 1 root root 10 Jan 17 17:38 fsbl2 -> ../../mmcblk0p2 ➔ FSBL backup (TF-A backup same content as FSBL)
lrwxrwxrwx 1 root root 10 Jan 17 17:38 rootfs -> ../../mmcblk0p5
lrwxrwxrwx 1 root root 10 Jan 17 17:38 ssbl -> ../../mmcblk0p3 ➔ SSBL (U-Boot)
lrwxrwxrwx 1 root root 10 Jan 17 17:38 userfs -> ../../mmcblk0p6
6.3. Update via USB mass storage on U-Boot:
-------------------------------------------
We are using the U-Boot command ums
STM32MP> help ums
ums - Use the UMS [USB Mass Storage]
Usage:
ums <USB_controller> [<devtype>] <dev[:part]> e.g. ums 0 mmc 0
devtype defaults to mmc
ums <USB controller> <dev type: mmc|usb> <dev[:part]>
By default on STMicroelectronics board, "mmc 0" is SD card on SDMMC1.
* Plug the SDCARD on Board.
* Start the board and stop on U-Boot shell:
Hit any key to stop autoboot: 0
STM32MP>
* plug an USB cable between the PC and the board via USB OTG port.
* On U-Boot shell, call the usb mass storage functionality:
STM32MP> ums 0 mmc 0
* After a delay (of up to 15 seconds), the host sees the exported block device.
* Follow section 6.2 to put U-Boot SPL binary and U-Boot binary
(*.img or *.stm32) on SDCARD/USB disk.
PS: A Ctrl-C is needed to stop the command.

View File

@ -1,27 +0,0 @@
From 018921ee79d3f30893614b3b2b63b588d8544f73 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 30 Jan 2020 09:37:15 +0000
Subject: [PATCH] Remove redundant YYLOC global declaration
Same as the upstream fix for building dtc with gcc 10.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
scripts/dtc/dtc-lexer.l | 1 -
1 file changed, 1 deletion(-)
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index fd825ebba6..24af549977 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
extern bool treesource_error;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--
2.26.2