Add U-Boot for stm32mp machine

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
This commit is contained in:
Christophe Priouzeau committed 2019-02-04 15:32:39 +01:00
1 parent c999a3d877
commit a91a0e4488
17 files changed
+35947

No files matched your search

@@ -0,0 +1,46 @@
# Adaptation from u-boot-common_${PV}.inc
HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
SECTION = "bootloaders"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e"
DEPENDS += "dtc-native bc-native"
DEPENDS += "flex-native bison-native"
COMPATIBLE_MACHINE = "(stm32mpcommon)"
SRC_URI = "https://github.com/u-boot/u-boot/archive/v${PV}.tar.gz"
SRC_URI[md5sum] = "7ee14909d5d4d701fd3a6b12aad4d762"
SRC_URI[sha256sum] = "33b5cf99bac91d678ed6708be7b7cbbed36c45eb071e6228f83c25ad3a1de13a"
SRC_URI += " \
file://0001-ARM-v2018.11-stm32mp-r1-MACHINE.patch \
file://0002-ARM-v2018.11-stm32mp-r1-BOARD.patch \
file://0003-ARM-v2018.11-stm32mp-r1-DEVICETREE.patch \
file://0004-ARM-v2018.11-stm32mp-r1-CONFIG.patch \
file://0005-ARM-v2018.11-stm32mp-r1-MISC.patch \
file://0006-ARM-v2018.11-stm32mp-r2-MACHINE.patch \
file://0007-ARM-v2018.11-stm32mp-r2-DEVICETREE.patch \
file://0008-ARM-v2018.11-stm32mp-r2-MISC.patch \
"
PV = "2018.11"
S = "${WORKDIR}/u-boot-${PV}"
# ---------------------------------
# Configure devupstream class usage
# ---------------------------------
BBCLASSEXTEND = "devupstream:target"
SRC_URI_class-devupstream = "git://github.com/STMicroelectronics/u-boot.git;protocol=https;branch=v2018.11-stm32mp"
SRCREV_class-devupstream = "a120b9bdb3e656bb2f0485924d77d58e2281311a"
# ---------------------------------
# Configure default preference to manage dynamic selection between tarball and github
# ---------------------------------
STM32MP_SOURCE_SELECTION ?= "tarball"
DEFAULT_PREFERENCE = "${@bb.utils.contains('STM32MP_SOURCE_SELECTION', 'github', '-1', '1', d)}"
@@ -0,0 +1,40 @@
SUMMARY = "Provide 'extlinux.conf' file for U-Boot"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
DEPENDS += "u-boot-mkimage-native"
PACKAGE_ARCH = "${MACHINE_ARCH}"
SRC_URI = "file://boot.scr.cmd"
PV = "2.0"
inherit kernel-arch extlinuxconf-stm32mp
B = "${WORKDIR}/build"
UBOOT_EXTLINUX_BOOTSCR = "${WORKDIR}/boot.scr.cmd"
UBOOT_EXTLINUX_BOOTSCR_IMG = "${B}/boot.scr.uimg"
UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot"
do_compile() {
# Generate boot script only when multiple extlinux subdirs are set
if [ "$(find ${B}/* -maxdepth 0 -type d | wc -w)" -gt 1 ]; then
mkimage -C none -A ${UBOOT_ARCH} -T script -d ${UBOOT_EXTLINUX_BOOTSCR} ${UBOOT_EXTLINUX_BOOTSCR_IMG}
fi
}
do_install() {
install -d ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}
# Install boot script
if [ -e ${UBOOT_EXTLINUX_BOOTSCR_IMG} ]; then
install -m 755 ${UBOOT_EXTLINUX_BOOTSCR_IMG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}
fi
# Install extlinux files
if ! [ -z "$(ls -A ${B})" ]; then
cp -r ${B}/* ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}
fi
}
FILES_${PN} = "${UBOOT_EXTLINUX_INSTALL_DIR}"
@@ -0,0 +1,44 @@
# Generate boot.scr.uimg:
# ./tools/mkimage -C none -A arm -T script -d boot.src.cmd boot.scr.uimg
#
# M4 Firmware load
env set m4fw_name "rproc-m4-fw.elf"
env set m4fw_addr ${kernel_addr_r}
env set boot_m4fw 'rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc load_rsc 0 ${m4fw_addr} ${filesize}; rproc start 0'
# boot M4 Firmware when available
env set scan_m4fw 'if test -e ${devtype} ${devnum}:${distro_bootpart} ${m4fw_name};then echo Found M4 FW $m4fw_name; if load ${devtype} ${devnum}:${distro_bootpart} ${m4fw_addr} ${m4fw_name}; then run boot_m4fw; fi; fi;'
# Update DISTRO command= search in sub-directory and load M4 firmware
env set boot_prefixes "/${boot_device}${boot_instance}_${board_name}_"
env set boot_extlinux "run scan_m4fw;${boot_extlinux}"
if test ${boot_device} = mmc; then
if test ${distro_bootpart} > 4; then
env set boot_prefixes "/mmc${boot_instance}_${board_name}-optee_"
fi
#start the correct exlinux.conf
run scan_dev_for_boot_part
elif test ${boot_device} = nand; then
#start the correct exlinux.conf without remount UBI
run scan_dev_for_boot
elif test ${boot_device} = nor; then
#SDCARD boot
run bootcmd_mmc0
#NAND boot
env set boot_prefixes "/nand0_${board_name}_"
run bootcmd_ubifs0
#EMMC boot
env set boot_prefixes "/${boot_device}${boot_instance}-mmc1_${board_name}_"
run bootcmd_mmc1
fi
echo SCRIPT FAILED... ${boot_prefixes}extlinux/extlinux.conf not found !
@@ -0,0 +1 @@
No license to ST trademarks
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

@@ -0,0 +1,26 @@
SUMMARY = "Universal Boot Loader Splash Screen for stm32mp embedded devices"
#TODO Need to review the exact license we want to have for the specific BMP we provide.
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ac3e0fd89b582e9fc11d534a27636636"
SRC_URI = "${@bb.utils.contains('MACHINE_FEATURES', 'splashscreen', 'file://${UBOOT_SPLASH_SRC}', '', d)}"
SRC_URI += "${@bb.utils.contains('MACHINE_FEATURES', 'splashscreen', 'file://LICENSE', '', d)}"
S = "${WORKDIR}"
UBOOT_SPLASH_SRC = "stmicroelectronics.bmp"
UBOOT_SPLASH_IMAGE ?= "splash"
inherit deploy
do_compile[noexec] = "1"
do_install() {
install -d ${D}/boot
if [ -e "${S}/${UBOOT_SPLASH_SRC}" ]; then
install -m 644 ${S}/${UBOOT_SPLASH_SRC} ${D}/boot/${UBOOT_SPLASH_IMAGE}.bmp
fi
}
ALLOW_EMPTY_${PN} = "1"
FILES_${PN} = "/boot"
+293
View File
@@ -0,0 +1,293 @@
require recipes-bsp/u-boot/u-boot.inc
FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-stm32mp:"
# Configure build dir for externalsrc class usage through devtool
EXTERNALSRC_BUILD_pn-${PN} = "${WORKDIR}/build"
# Define dedicated var to configure SPL binary name to override U-Boot default
# configuration. By this way we allow to mix configuration with and without SPL
# binary generation without trouble with binary existence.
SPL_BINARY_STM32 = "spl/u-boot-spl.stm32"
SPL_BINARYNAME = "${@os.path.basename(d.getVar("SPL_BINARY_STM32"))}"
SPL_BINARYROOT = "${@d.getVar('SPL_BINARY_STM32').split('.')[0]}"
# Configure for debug elf
ELF_DEBUG_ENABLE ?= ""
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_NAME = "${@os.path.basename(d.getVar("SPL_ELF"))}.elf"
# Init UBOOT_DEVICETREE list if not configured
UBOOT_DEVICETREE ?= ""
# -----------------------------------------------
# Enable use of work-shared folder
STAGING_UBOOT_DIR = "${TMPDIR}/work-shared/${MACHINE}/uboot-source"
# Make sure to move ${S} to STAGING_UBOOT_DIR. We can't just
# create the symlink in advance as the git fetcher can't cope with
# the symlink.
do_unpack[cleandirs] += " ${S} ${STAGING_UBOOT_DIR}"
do_clean[cleandirs] += " ${S} ${STAGING_UBOOT_DIR}"
base_do_unpack_append () {
# Specific part to update devtool-source class
if bb.data.inherits_class('devtool-source', d):
# We don't want to move the source to STAGING_UBOOT_DIR here
if d.getVar('STAGING_UBOOT_DIR', d):
d.setVar('STAGING_UBOOT_DIR', '${S}')
# Copy/Paste from kernel class with adaptation to UBOOT var
s = d.getVar("S")
if s[-1] == '/':
# drop trailing slash, so that os.symlink(ubootsrc, s) doesn't use s as directory name and fail
s=s[:-1]
ubootsrc = d.getVar("STAGING_UBOOT_DIR")
if s != ubootsrc:
bb.utils.mkdirhier(ubootsrc)
bb.utils.remove(ubootsrc, recurse=True)
if d.getVar("EXTERNALSRC"):
# With EXTERNALSRC S will not be wiped so we can symlink to it
os.symlink(s, ubootsrc)
else:
import shutil
shutil.move(s, ubootsrc)
os.symlink(ubootsrc, s)
}
# -----------------------------------------------------------------------------
# Append compile to handle specific device tree compilation
#
do_compile_append() {
if [ -n "${UBOOT_DEVICETREE}" ]; then
for devicetree in ${UBOOT_DEVICETREE}; do
if [ -n "${UBOOT_CONFIG}" ]; then
unset i j k
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]; then
if [ -f ${B}/${config}/dts/dt.dtb ];
then
rm ${B}/${config}/dts/dt.dtb
fi
oe_runmake -C ${S} O=${B}/${config} DEVICE_TREE=${devicetree}
for binary in ${UBOOT_BINARIES}; do
binarysuffix=$(echo ${binary} | cut -d'.' -f2)
k=$(expr $k + 1);
if [ $k -eq $i ]; then
install -m 644 ${B}/${config}/${binary} ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix}
if [ -n "${UBOOT_ELF}" ]; then
install -m 644 ${B}/${config}/${UBOOT_ELF} ${B}/${config}/u-boot-${devicetree}-${type}.${UBOOT_ELF_SUFFIX}
fi
# As soon as SPL binary exists, copy it with specific binary_type name
# This allow to mix u-boot configuration, with and without SPL
if [ -f ${B}/${config}/${SPL_BINARY_STM32} ]; then
install -m 644 ${B}/${config}/${SPL_BINARY_STM32} ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type}
fi
if [ -n "${SPL_ELF}" ] && [ -f ${B}/${config}/${SPL_ELF} ]; then
install -m 644 ${B}/${config}/${SPL_ELF} ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type}
fi
fi
done
unset k
fi
done
unset j
done
unset i
else
bbfatal "Wrong u-boot-stm32mp configuration: please make sure to use UBOOT_CONFIG through BOOTSCHEME_LABELS config"
fi
done
fi
}
# -----------------------------------------------------------------------------
# Append deploy to handle specific device tree binary deployement
#
do_deploy_append() {
if [ -n "${UBOOT_DEVICETREE}" ]; then
# Clean deploydir from any available binary first
# This allows to only install the devicetree binary ones
rm -rf ${DEPLOYDIR}
# Install destination folder
install -d ${DEPLOYDIR}
for devicetree in ${UBOOT_DEVICETREE}; do
if [ -n "${UBOOT_CONFIG}" ]; then
unset i j k
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]; then
for binary in ${UBOOT_BINARIES}; do
binarysuffix=$(echo ${binary} | cut -d'.' -f2)
k=$(expr $k + 1);
if [ $k -eq $i ]; then
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${binarysuffix} ${DEPLOYDIR}
if [ -n "${UBOOT_ELF}" ]; then
install -m 644 ${B}/${config}/u-boot-${devicetree}-${type}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}
fi
# As soon as SPL binary exists, install it
# This allow to mix u-boot configuration, with and without SPL
if [ -f ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ]; then
install -m 644 ${B}/${config}/${SPL_BINARYNAME}-${devicetree}-${type} ${DEPLOYDIR}
fi
if [ -n "${SPL_ELF}" ] && [ -f ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ]; then
install -m 644 ${B}/${config}/${SPL_ELF_NAME}-${devicetree}-${type} ${DEPLOYDIR}
fi
fi
done
unset k
fi
done
unset j
done
unset i
else
bbfatal "Wrong u-boot-stm32mp configuration: please make sure to use UBOOT_CONFIG through BOOTSCHEME_LABELS config"
fi
done
fi
}
# -----------------------------------------------------------------------------
# ARCHIVER
#
inherit archiver
ARCHIVER_MODE[src] = "${@'original' if d.getVar('ST_ARCHIVER_ENABLE') == '1' else ''}"
SRC_URI += " file://README.HOW_TO.txt "
inherit archiver_stm32mp_clean
archiver_create_makefile_for_sdk() {
# Init internal var for uboot_configs: should be 'defconfig,type,binary'
if [ -n "${UBOOT_CONFIG}" ]; then
unset i j k
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]; then
for binary in ${UBOOT_BINARIES}; do
k=$(expr $k + 1);
if [ $k -eq $i ]; then
uboot_configs="${uboot_configs} ${config},${type},${binary}"
fi
done
unset k
fi
done
unset j
done
unset i
else
uboot_configs="${UBOOT_MACHINE},,${UBOOT_BINARY}"
fi
mkdir -p ${ARCHIVER_OUTDIR}
# Remove default variable
echo "LDFLAGS=" > ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "CFLAGS=" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "CPPFLAGS=" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "LOCAL_PATH=\$(PWD)" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo -n "EXTRA_OEMAKE=" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "${EXTRA_OEMAKE}" | sed "s|HOSTCC=${BUILD_CC}||" | sed "s|STAGING_INCDIR=${STAGING_INCDIR_NATIVE}||" | sed "s|STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}||" | sed "s|${BUILD_CFLAGS} ||" | sed "s|${BUILD_LDFLAGS}||" |sed "s|CC=\([^ ]*\) --sysroot=[^ ]* |CC=\"\1 \$(KCFLAGS)\" |" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "UBOOT_LOCALVERSION=${UBOOT_LOCALVERSION}" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Configure default U-Boot configs
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
echo " @echo" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " @echo \"Configured U-Boot config(s):\"" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
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
echo " @if test ! -e .scmversion ; then echo \$(UBOOT_LOCALVERSION) > \$(LOCAL_PATH)/.scmversion; fi" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo "all: version" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " for config in \$(UBOOT_CONFIGS); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " uboot_config=\$\$(echo \$\$config | cut -d',' -f1) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " uboot_type=-\$\$(echo \$\$config | cut -d',' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " uboot_binary=\$\$(echo \$\$config | cut -d',' -f3) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " uboot_suffix=\$\$(echo \$\$uboot_binary | cut -d'.' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Make sure about configuration set
echo " if test -z \"\$\$uboot_config\" -o -z \"\$\$uboot_type\" -o -z \"\$\$uboot_binary\"; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \"[ERROR] UBOOT_CONFIGS wrongly configured. It should be space separated list of element <defconfig>,<type>,<binary>\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " exit 1 ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Init folder and defconfig selected
echo " if [ ! -d \$(LOCAL_PATH)/../build\$\$uboot_type ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " mkdir -p \$(LOCAL_PATH)/../build\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \$(UBOOT_LOCALVERSION) > \$(LOCAL_PATH)/../build\$\$uboot_type/.scmversion ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " \$(MAKE) \$(EXTRA_OEMAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type \$\$uboot_config ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " fi ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
# Build binaries
echo " if [ -z \"\$(DEVICE_TREE)\" ]; then \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " \$(MAKE) \$(EXTRA_OEMAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type ${UBOOT_MAKE_TARGET} ; \\" >> ${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\$\$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\$\$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}\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
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) \$(EXTRA_OEMAKE) -C \$(LOCAL_PATH) O=\$(LOCAL_PATH)/../build\$\$uboot_type ${UBOOT_MAKE_TARGET} DEVICE_TREE=\$\$devicetree ; \\" >> ${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
echo " @for config in \$(UBOOT_CONFIGS); do \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " uboot_type=-\$\$(echo \$\$config | cut -d',' -f2) ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " echo \"Removing \$(LOCAL_PATH)/../build\$\$uboot_type ...\" ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " rm -rf \$(LOCAL_PATH)/../build\$\$uboot_type ; \\" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
echo " done" >> ${ARCHIVER_OUTDIR}/Makefile.sdk
}
do_ar_original[prefuncs] += "archiver_create_makefile_for_sdk"
# ---------------------------------------------------------------------
# Avoid QA Issue: No GNU_HASH in the elf binary
INSANE_SKIP_${PN} += "ldflags"
# ---------------------------------------------------------------------
# Avoid QA Issue: ELF binary has relocations in .text
# (uboot no need -fPIC option : remove check)
INSANE_SKIP_${PN} += "textrel"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,378 @@
From b8317d14837ab109d5063c84a8cde6c6de474970 Mon Sep 17 00:00:00 2001
From: christophe montaud <christophe.montaud@st.com>
Date: Fri, 4 Jan 2019 15:08:43 +0100
Subject: [PATCH 4/5] ARM v2018.11 stm32mp r1 CONFIG
---
configs/sandbox_defconfig | 2 +
configs/stm32mp15_basic_defconfig | 71 ++++++++++++++++++++----
configs/stm32mp15_optee_defconfig | 105 ++++++++++++++++++++++++++++++++++++
configs/stm32mp15_trusted_defconfig | 104 +++++++++++++++++++++++++++++++++++
4 files changed, 273 insertions(+), 9 deletions(-)
create mode 100644 configs/stm32mp15_optee_defconfig
create mode 100644 configs/stm32mp15_trusted_defconfig
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 5a744f4..587e2aa 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -215,3 +215,5 @@ CONFIG_UT_TIME=y
CONFIG_UT_DM=y
CONFIG_UT_ENV=y
CONFIG_UT_OVERLAY=y
+CONFIG_DM_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_SANDBOX=y
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index 3bf7538..ad3424e 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -1,14 +1,18 @@
CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_MALLOC_F_LEN=0x3000
CONFIG_SPL_MMC_SUPPORT=y
CONFIG_SPL=y
CONFIG_TARGET_STM32MP1=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+# CONFIG_ARMV7_VIRT is not set
CONFIG_DISTRO_DEFAULTS=y
-CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
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_PROMPT="STM32MP> "
# CONFIG_CMD_BOOTD is not set
@@ -18,48 +22,97 @@ CONFIG_SYS_PROMPT="STM32MP> "
# 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_REMOTEPROC=y
+CONFIG_CMD_SF=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_SPL_DOS_PARTITION is not set
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_STM32_ADC=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_STM32_SDMMC2=y
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_NAND_STM32_FMC2=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=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_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_DWC_ETH_QOS=y
CONFIG_PHY=y
CONFIG_PHY_STM32_USBPHYC=y
-# CONFIG_PINCTRL_FULL is not set
+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_STPMU1=y
+CONFIG_PMIC_STPMIC1=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
-CONFIG_DM_REGULATOR_STPMU1=y
+CONFIG_DM_REGULATOR_STPMIC1=y
+CONFIG_STM32MP1_DDR_INTERACTIVE=y
+CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_SERIAL_RX_BUFFER=y
-CONFIG_STM32_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_STM32_QSPI=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
-CONFIG_USB_DWC2=y
CONFIG_USB_STORAGE=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_USB_GADGET_DOWNLOAD=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_STM32MP_WATCHDOG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
+# CONFIG_EFI_LOADER is not set
diff --git a/configs/stm32mp15_optee_defconfig b/configs/stm32mp15_optee_defconfig
new file mode 100644
index 0000000..a24727c
--- /dev/null
+++ b/configs/stm32mp15_optee_defconfig
@@ -0,0 +1,105 @@
+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_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_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
+CONFIG_CMD_SF=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_STM32_ADC=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_STM32_SDMMC2=y
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_NAND_STM32_FMC2=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=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_PHY_FIXED=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_SERIAL_RX_BUFFER=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_STM32_QSPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=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_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_STM32MP_WATCHDOG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
+# CONFIG_EFI_LOADER is not set
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
new file mode 100644
index 0000000..e41506b
--- /dev/null
+++ b/configs/stm32mp15_trusted_defconfig
@@ -0,0 +1,104 @@
+CONFIG_ARM=y
+CONFIG_ARCH_STM32MP=y
+CONFIG_SYS_MALLOC_F_LEN=0x3000
+CONFIG_TARGET_STM32MP1=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+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_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
+CONFIG_CMD_SF=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_STM32_ADC=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_STM32_SDMMC2=y
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_NAND_STM32_FMC2=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=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_PHY_FIXED=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_SERIAL_RX_BUFFER=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_STM32_QSPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=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_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_STM32MP_WATCHDOG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
+# CONFIG_EFI_LOADER is not set
--
2.7.4
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,237 @@
From 761f1ccf48cd083baa2bf3a120f8f1da993af217 Mon Sep 17 00:00:00 2001
From: christophe montaud <christophe.montaud@st.com>
Date: Mon, 28 Jan 2019 11:04:22 +0100
Subject: [PATCH 6/8] ARM v2018.11 stm32mp r2 MACHINE
---
arch/arm/mach-stm32mp/Kconfig | 13 +++
arch/arm/mach-stm32mp/Makefile | 1 +
.../arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 22 ++++
arch/arm/mach-stm32mp/include/mach/stm32.h | 3 +
arch/arm/mach-stm32mp/stm32mp1_helper_dgb.S | 124 +++++++++++++++++++++
5 files changed, 163 insertions(+)
create mode 100644 arch/arm/mach-stm32mp/stm32mp1_helper_dgb.S
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 0c68c24..fbc8195 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -47,6 +47,19 @@ config TARGET_STM32MP1
STMicroelectronics MPU with core ARMv7
dual core A7 for STM32MP153, monocore for STM32MP151
+config STM32MP1_RESET_HALT_WORKAROUND
+ bool "workaround for reset halt deubg on stm32mp15x"
+ depends on TARGET_STM32MP1
+ default y
+ help
+ Activate a workaround for current STM32MP15x revision B
+ limitation on debug reset halt not handle by ROM code:
+ add a delay loop early in the SPL boot process to wait for
+ the debugger to attach
+ it can be removed when using the Soc revision
+ that fixes the limitation.
+
+
config STM32MP1_TRUSTED
bool "Support trusted boot with TF-A"
default y if !SPL
diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
index 09636db..c67bcce 100644
--- a/arch/arm/mach-stm32mp/Makefile
+++ b/arch/arm/mach-stm32mp/Makefile
@@ -9,6 +9,7 @@ obj-y += syscon.o
ifdef CONFIG_SPL_BUILD
obj-y += spl.o
+obj-$(CONFIG_STM32MP1_RESET_HALT_WORKAROUND) += stm32mp1_helper_dgb.o
else
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index d1c07dc..a6ee0f2 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -10,6 +10,26 @@
DECLARE_GLOBAL_DATA_PTR;
+static void enable_vidconsole(void)
+{
+#ifdef CONFIG_DM_VIDEO
+ char *stdname;
+ char buf[64];
+
+ stdname = env_get("stdout");
+ if (!strstr(stdname, "vidconsole")) {
+ snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
+ env_set("stdout", buf);
+ }
+
+ stdname = env_get("stderr");
+ if (!strstr(stdname, "vidconsole")) {
+ snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
+ env_set("stderr", buf);
+ }
+#endif
+}
+
static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
@@ -44,6 +64,8 @@ static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
if (argc > 4)
size = simple_strtoul(argv[4], NULL, 16);
+ enable_vidconsole();
+
data = stm32prog_init(link, dev, addr, size);
if (!data)
return CMD_RET_FAILURE;
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 4147873..36b885b 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -35,6 +35,9 @@
#define STM32_DDR_BASE 0xC0000000
#define STM32_DDR_SIZE SZ_1G
+#define STM32_RETRAM_BASE 0x38000000
+#define STM32_RETRAM_SIZE 0x00010000
+
#ifndef __ASSEMBLY__
#include <asm/types.h>
diff --git a/arch/arm/mach-stm32mp/stm32mp1_helper_dgb.S b/arch/arm/mach-stm32mp/stm32mp1_helper_dgb.S
new file mode 100644
index 0000000..29f8e1f
--- /dev/null
+++ b/arch/arm/mach-stm32mp/stm32mp1_helper_dgb.S
@@ -0,0 +1,124 @@
+/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
+/*
+ * Copyright (c) 2019, STMicroelectronics - All Rights Reserved
+ *
+ */
+
+/*****************************************************************************
+ * This file is only needed for current Soc revision which has a limitation on
+ * debug reset halt. This can be removed when using the Soc revision that
+ * fixes the limitation. Anyway, this source code identifies the Soc revision
+ * and is only executed if it corresponds, so it can be kept on other
+ * revisions without any consequence.
+ ****************************************************************************/
+
+#include <linux/linkage.h>
+#include <asm/macro.h>
+
+#define BIT(nr) (1 << (nr))
+
+#define DBG_DSCR_ADDR 0x500D0088
+#define DBG_DSCR_HDBGEN BIT(14)
+
+#define RCC_DBGCFGR_ADDR 0x5000080C
+#define RCC_DBGCFGR_DBGCKEN BIT(8)
+
+#define PWR_CR1_ADDR 0x50001000
+#define PWR_CR1_DBP BIT(8)
+
+#define DBGMCU_IDC_ADDR 0x50081000
+#define DBGMCU_IDC_MASK 0xFFFF0FFF
+#define DBGMCU_IDC_VALUE 0x20000500
+
+#define TAMP_BKP_REGISTER_20 (0x5C00A100 + (20 << 2))
+
+
+ .globl save_boot_params
+
+ENTRY(save_boot_params)
+ /*
+ * This function is the first call after reset.
+ * Boot rom parameters are stored in r0..r3, so we mustn't use them
+ * here. And because they are saved in r9..r12 just after the
+ * execution of this function, we should firstly use these registers.
+ * And then, if more registers needed, we have to start by using
+ * r8, and then r7 and so on. By this way, debug will be done in
+ * conditions closed to the initial context.
+ */
+
+ /* Check Soc revision */
+ ldr r12, =RCC_DBGCFGR_ADDR
+ ldr r11, [r12] /* read RCC_DBGCFGR (r11) */
+ orr r10, r11, #RCC_DBGCFGR_DBGCKEN
+ str r10, [r12] /* update RCC_DBGCFGR */
+ ldr r10, =DBGMCU_IDC_ADDR
+ ldr r10, [r10] /* read DBGMCU_IDC (r10) */
+ str r11, [r12] /* restore RCC_DBGCFGR (r11) */
+ ldr r12, =DBGMCU_IDC_MASK
+ and r10, r12 /* mask reserved bits */
+ ldr r11, =DBGMCU_IDC_VALUE
+ teq r10, r11 /* test DBGMCU_IDC */
+ bne func_exit
+
+ /* Disable the backup domain write protection */
+ ldr r12, =PWR_CR1_ADDR
+ ldr r11, [r12]
+ orr r11, r11, #PWR_CR1_DBP
+ str r11, [r12]
+poll_dbp:
+ ldr r11, [r12]
+ tst r11, #PWR_CR1_DBP
+ beq poll_dbp
+
+ /* Clear tamper 20 bit 16 if set */
+ ldr r12, =TAMP_BKP_REGISTER_20
+ ldr r11, [r12]
+ tst r11, #(BIT(16))
+ beq func_exit
+ bic r11, #(BIT(16))
+ str r11, [r12]
+
+ /* Re-enable the backup domain write protection */
+ ldr r12, =PWR_CR1_ADDR
+ ldr r11, [r12]
+ bic r11, #PWR_CR1_DBP
+ str r11, [r12]
+poll_dbp_2:
+ ldr r11, [r12]
+ tst r11, #PWR_CR1_DBP
+ bne poll_dbp_2
+
+ /* Get current time + 1 second */
+ /* CNTFRQ */
+ mrc p15, 0, r12, c14, c0, 0
+ /* CNTPCT_64 */
+ mrrc p15, 0, r11, r10, c14
+ add r12, r12, r11
+
+loop:
+ /* Check A7 DBG_DSCR HDBGEN bit value */
+ ldr r10, =DBG_DSCR_ADDR
+ ldr r10, [r10]
+ tst r10, #DBG_DSCR_HDBGEN
+ beq loop_continue
+ /* Sw break */
+ bkpt 5
+ /* Jump entrypoint */
+ b reset
+loop_continue:
+ /* Check 1 second expiration */
+ mrrc p15, 0, r10, r9, c14
+ /* Check if MSB 64-bit increment needed */
+ cmp r12, r11
+ bmi msb_incr
+ cmp r12, r10
+ bmi func_exit
+ b loop
+msb_incr:
+ cmp r12, r10
+ bpl loop
+ cmp r11, r10
+ bmi loop
+func_exit:
+ b save_boot_params_ret
+ENDPROC(save_boot_params)
--
2.7.4
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,290 @@
From 8db9dfe442ded4ec2d320d61a5b92d9bc1c771d4 Mon Sep 17 00:00:00 2001
From: christophe montaud <christophe.montaud@st.com>
Date: Mon, 28 Jan 2019 11:07:22 +0100
Subject: [PATCH 8/8] ARM v2018.11 stm32mp r2 MISC
---
Makefile | 2 +-
drivers/remoteproc/rproc-uclass.c | 10 +++++++--
drivers/remoteproc/stm32_copro.c | 44 +++++++++++++++------------------------
drivers/video/stm32/stm32_dsi.c | 41 ++++++++++++++++++++++--------------
4 files changed, 51 insertions(+), 46 deletions(-)
diff --git a/Makefile b/Makefile
index 84cb372..693ffae 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
VERSION = 2018
PATCHLEVEL = 11
SUBLEVEL =
-EXTRAVERSION = -stm32mp-r1
+EXTRAVERSION = -stm32mp-r2
NAME =
# *DOCUMENTATION*
diff --git a/drivers/remoteproc/rproc-uclass.c b/drivers/remoteproc/rproc-uclass.c
index 8ea92f7..204e6e8 100644
--- a/drivers/remoteproc/rproc-uclass.c
+++ b/drivers/remoteproc/rproc-uclass.c
@@ -449,7 +449,10 @@ static int rproc_load_elf_image(struct udevice *dev, unsigned long addr,
if (phdr->p_filesz != phdr->p_memsz)
memset(dst + phdr->p_filesz, 0x00,
phdr->p_memsz - phdr->p_filesz);
- flush_cache((unsigned long)dst, phdr->p_filesz);
+ flush_cache(rounddown((int)dst, ARCH_DMA_MINALIGN),
+ roundup((int)dst + phdr->p_filesz,
+ ARCH_DMA_MINALIGN) -
+ rounddown((int)dst, ARCH_DMA_MINALIGN));
++phdr;
}
@@ -561,7 +564,10 @@ static int rproc_elf_find_load_rsc_table(struct udevice *dev,
src = (void *)fw_addr + shdr->sh_offset;
memcpy(dst, src, shdr->sh_size);
- flush_cache((unsigned long)dst, shdr->sh_size);
+ flush_cache(rounddown((int)dst, ARCH_DMA_MINALIGN),
+ roundup((int)dst + shdr->sh_size,
+ ARCH_DMA_MINALIGN) -
+ rounddown((int)dst, ARCH_DMA_MINALIGN));
return 0;
}
diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c
index 310d077..44230ff 100644
--- a/drivers/remoteproc/stm32_copro.c
+++ b/drivers/remoteproc/stm32_copro.c
@@ -18,7 +18,6 @@
/**
* struct stm32_copro_privdata - power processor private data
- * @loadaddr: base address for loading the power processor
* @reset_ctl: reset controller handle
* @hold_boot_regmap
* @hold_boot_offset
@@ -26,7 +25,6 @@
* @secured_soc: TZEN flag (register protection)
*/
struct stm32_copro_privdata {
- phys_addr_t loadaddr;
struct reset_ctl reset_ctl;
struct regmap *hold_boot_regmap;
uint hold_boot_offset;
@@ -46,21 +44,9 @@ static int st_of_to_priv(struct udevice *dev,
{
struct regmap *regmap;
const fdt32_t *cell;
- const void *blob = gd->fdt_blob;
uint tz_offset, tz_mask, tzen;
int len, ret;
- if (!blob) {
- dev_dbg(dev, "no dt?\n");
- return -EINVAL;
- }
-
- priv->loadaddr = dev_read_addr(dev);
- if (priv->loadaddr == FDT_ADDR_T_NONE) {
- dev_dbg(dev, "no 'reg' property\n");
- return -EINVAL;
- }
-
regmap = syscon_phandle_to_regmap(dev, "st,syscfg-holdboot");
if (IS_ERR(regmap)) {
dev_dbg(dev, "unable to find holdboot regmap (%ld)\n",
@@ -123,8 +109,7 @@ static int stm32_copro_probe(struct udevice *dev)
ret = st_of_to_priv(dev, priv);
- dev_dbg(dev, "probed with slave_addr=0x%08lX (%d)\n",
- priv->loadaddr, ret);
+ dev_dbg(dev, "probed (%d)\n", ret);
return ret;
}
@@ -163,6 +148,17 @@ static int stm32_copro_set_hold_boot(struct udevice *dev, bool hold)
return ret;
}
+static ulong stm32_copro_da_to_pa(struct udevice *dev, ulong da)
+{
+ /* to update with address translate by DT range */
+
+ /* CM4 boot at address 0x0 = RETRAM alias, not available for CA7 load */
+ if (da >= 0 && da < STM32_RETRAM_SIZE)
+ return (da + STM32_RETRAM_BASE);
+
+ return da;
+}
+
/**
* stm32_copro_load() - Loadup the STM32 Cortex-M4 remote processor
* @dev: corresponding STM32 remote processor device
@@ -174,6 +170,7 @@ static int stm32_copro_set_hold_boot(struct udevice *dev, bool hold)
static int stm32_copro_load(struct udevice *dev, ulong addr, ulong size)
{
struct stm32_copro_privdata *priv;
+ phys_addr_t loadaddr;
int ret;
priv = dev_get_priv(dev);
@@ -186,10 +183,12 @@ static int stm32_copro_load(struct udevice *dev, ulong addr, ulong size)
return ret;
}
+ /* by default load for copro BOOT address = 0x0 */
+ loadaddr = stm32_copro_da_to_pa(dev, 0x0);
dev_dbg(dev, "Loading binary from 0x%08lX, size 0x%08lX to 0x%08lX\n",
- addr, size, priv->loadaddr);
+ addr, size, loadaddr);
- memcpy((void *)priv->loadaddr, (void *)addr, size);
+ memcpy((void *)loadaddr, (void *)addr, size);
dev_dbg(dev, "Complete!\n");
return 0;
@@ -241,15 +240,6 @@ static int stm32_copro_reset(struct udevice *dev)
return 0;
}
-ulong stm32_copro_da_to_pa(struct udevice *dev, ulong da)
-{
- /* to update according to lastest DT */
- if (da >= 0 && da < 0x10000)
- return (da + 0x38000000);
-
- return da;
-}
-
static const struct dm_rproc_ops stm32_copro_ops = {
.load = stm32_copro_load,
.start = stm32_copro_start,
diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c
index 09266fe..f8f7c83 100644
--- a/drivers/video/stm32/stm32_dsi.c
+++ b/drivers/video/stm32/stm32_dsi.c
@@ -242,7 +242,6 @@ static int dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,
u32 val;
/* Update lane capabilities according to hw version */
- dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
dsi->lane_min_kbps = LANE_MIN_KBPS;
dsi->lane_max_kbps = LANE_MAX_KBPS;
if (dsi->hw_version == HWVER_131) {
@@ -310,9 +309,9 @@ static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_stm_phy_ops = {
static int stm32_dsi_attach(struct udevice *dev)
{
- struct stm32_dsi_priv *priv = dev_get_priv(dev);
+ struct stm32_dsi_priv *dsi = dev_get_priv(dev);
struct dw_mipi_dsi_plat_data *platdata = dev_get_platdata(dev);
- struct mipi_dsi_device *device = &priv->device;
+ struct mipi_dsi_device *device = &dsi->device;
int ret;
platdata->max_data_lanes = 2;
@@ -336,8 +335,8 @@ static int stm32_dsi_attach(struct udevice *dev)
static int stm32_dsi_set_backlight(struct udevice *dev, int percent)
{
struct dw_mipi_dsi_plat_data *dplat = dev_get_platdata(dev);
- struct stm32_dsi_priv *priv = dev_get_priv(dev);
- struct mipi_dsi_device *device = &priv->device;
+ struct stm32_dsi_priv *dsi = dev_get_priv(dev);
+ struct mipi_dsi_device *device = &dsi->device;
struct udevice *panel = dplat->panel;
struct mipi_dsi_panel_plat *mplat;
int ret;
@@ -359,29 +358,29 @@ static int stm32_dsi_set_backlight(struct udevice *dev, int percent)
static int stm32_dsi_probe(struct udevice *dev)
{
- struct stm32_dsi_priv *priv = dev_get_priv(dev);
- struct mipi_dsi_device *device = &priv->device;
+ struct stm32_dsi_priv *dsi = dev_get_priv(dev);
+ struct mipi_dsi_device *device = &dsi->device;
struct reset_ctl rst;
struct clk clk;
int ret;
device->dev = dev;
- priv->base = (void *)dev_read_addr(dev);
- if ((fdt_addr_t)priv->base == FDT_ADDR_T_NONE) {
+ dsi->base = (void *)dev_read_addr(dev);
+ if ((fdt_addr_t)dsi->base == FDT_ADDR_T_NONE) {
dev_err(dev, "dsi dt register address error\n");
return -EINVAL;
}
if (IS_ENABLED(CONFIG_DM_REGULATOR)) {
ret = device_get_supply_regulator(dev, "phy-dsi-supply",
- &priv->vdd_reg);
+ &dsi->vdd_reg);
if (ret && ret != -ENOENT) {
dev_err(dev, "Warning: cannot get phy dsi supply\n");
return -ENODEV;
}
- ret = regulator_set_enable(priv->vdd_reg, true);
+ ret = regulator_set_enable(dsi->vdd_reg, true);
if (ret)
return -ENODEV;
}
@@ -389,14 +388,14 @@ static int stm32_dsi_probe(struct udevice *dev)
ret = clk_get_by_name(device->dev, "pclk", &clk);
if (ret) {
dev_err(dev, "peripheral clock get error %d\n", ret);
- regulator_set_enable(priv->vdd_reg, false);
+ regulator_set_enable(dsi->vdd_reg, false);
return -ENODEV;
}
ret = clk_enable(&clk);
if (ret) {
dev_err(dev, "peripheral clock enable error %d\n", ret);
- regulator_set_enable(priv->vdd_reg, false);
+ regulator_set_enable(dsi->vdd_reg, false);
return -ENODEV;
}
@@ -404,23 +403,33 @@ static int stm32_dsi_probe(struct udevice *dev)
if (ret) {
dev_err(dev, "pll reference clock get error %d\n", ret);
clk_disable(&clk);
- regulator_set_enable(priv->vdd_reg, false);
+ regulator_set_enable(dsi->vdd_reg, false);
return ret;
}
- priv->pllref_clk = (unsigned int)clk_get_rate(&clk);
+ dsi->pllref_clk = (unsigned int)clk_get_rate(&clk);
ret = reset_get_by_index(device->dev, 0, &rst);
if (ret) {
dev_err(dev, "missing dsi hardware reset\n");
clk_disable(&clk);
- regulator_set_enable(priv->vdd_reg, false);
+ regulator_set_enable(dsi->vdd_reg, false);
return -ENODEV;
}
/* Reset */
reset_deassert(&rst);
+ /* check hardware version */
+ dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
+ if (dsi->hw_version != HWVER_130 &&
+ dsi->hw_version != HWVER_131) {
+ dev_err(dev, "bad dsi hardware version\n");
+ clk_disable(&clk);
+ regulator_set_enable(dsi->vdd_reg, false);
+ return -ENODEV;
+ }
+
return 0;
}
--
2.7.4
@@ -0,0 +1,183 @@
Compilation of U-Boot:
1. Pre-requisite
2. Initialise cross-compilation via SDK
3. Prepare U-Boot source code
4. Management of U-Boot source code
5. Compile U-Boot source code
6. Update software on board
1. Pre-requisite:
-----------------
OpenSTLinux SDK must be installed.
For U-Boot build you need to install:
* libncurses and libncursesw dev package
- Ubuntu: sudo apt-get install libncurses5-dev libncursesw5-dev
- Fedora: sudo yum install ncurses-devel
* git:
- Ubuntu: sudo apt-get install git-core gitk
- Fedora: sudo yum install git
If you have never configured you git configuration:
$> git config --global user.name "your_name"
$> git config --global user.email "your_email@example.com"
2. Initialise cross-compilation via SDK:
---------------------------------------
* Source SDK environment:
$> source <path to SDK>/environment-setup-cortexa9hf-neon-openstlinux_weston-linux-gnueabi
* To verify if you cross-compilation environment are put in place:
$> set | grep CROSS
CROSS_COMPILE=arm-openstlinux_weston-linux-gnueabi-
Warning: the environment are valid only on the shell session where you have
sourced the sdk environment.
3. Prepare U-Boot source:
------------------------
If you have the tarball and the list of patch then you must extract the
tarball and apply the patch.
$> tar xfz <U-Boot source>.tar.gz
or
$> tar xfj <U-Boot source>.tar.bz2
or
$> tar xfJ <U-Boot source>.tar.xz
$> cd <directory to U-Boot source code>
NB: if there is no git management on source code and you would like to have a
git management on the code see section 4 [Management of U-Boot source code]
if there is some patch, please apply it on source code
$> for p in `ls -1 <path to patch>/*.patch`; do patch -p1 < $p; done
4. Management of U-Boot source code:
-----------------------------------
If you like to have a better management of change made on U-Boot source, you
can use git:
$> tar xfz <U-Boot source>.tar.gz
$> cd <directory of U-Boot source code>
$> test -d .git || git init . && git add . && git commit -m "U-Boot source code" && git gc
$> git checkout -b WORKING
$> for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
NB: you can use directly the source from the community:
URL: git://git.denx.de/u-boot.git
Branch: ##GIT_BRANCH##
Revision: ##GIT_SRCREV##
$> git clone git://git.denx.de/u-boot.git
$> cd <directory of U-Boot source code>
$> git checkout -b WORKING ##GIT_SRCREV##
$> for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
5. Compilation U-Boot source code:
--------------------------------
To compile U-Boot source code, first move to U-Boot source:
$> cd <directory to U-Boot source code>
You can call the specific 'Makefile.sdk' provided to compile U-Boot:
- Display 'Makefile.sdk' file default configuration and targets:
$> make -f $PWD/../Makefile.sdk help
- Compile default U-Boot configuration:
$> make -f $PWD/../Makefile.sdk all
Default U-Boot configuration is done in 'Makefile.sdk' file through two specific
variables 'DEVICE_TREE' and 'UBOOT_CONFIGS':
- 'DEVICE_TREE' is a list of device tree to build, using 'space' as separator.
ex: DEVICE_TREE="<devicetree1> <devicetree2>"
- 'UBOOT_CONFIGS' is a list of '<defconfig>,<type>,<binary>' configurations,
<defconfig> is the u-boot defconfig to use to build
<type> is the name append to u-boot binaries (ex: 'trusted', 'basic', 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"
You can override the default U-Boot configuration if you specify these variables:
- Compile default U-Boot configuration but applying specific devicetree(s):
$> make -f $PWD/../Makefile.sdk all DEVICE_TREE="<devicetree1> <devicetree2>"
- Compile for a specific U-Boot configuration:
$> make -f $PWD/../Makefile.sdk all UBOOT_CONFIGS=<u-boot defconfig>,<u-boot type>,<u-boot binary>
- Compile for a specific U-Boot configuration and applying specific devicetree(s):
$> make -f $PWD/../Makefile.sdk all UBOOT_CONFIGS=<u-boot defconfig>,<u-boot type>,<u-boot binary> DEVICE_TREE="<devicetree1> <devicetree2>"
6. Update software on board:
----------------------------
6.1. partitioning of binaries:
-----------------------------
There are two possible configurations available:
- Basic configuration
- Trusted configuration
U-Boot build provides binaries for each configuration:
- Basic configuration: U-Boot SPL and U-Boot imgage (for FSBL and SSBL)
- Trusted configuration: U-Boot binary with ".stm32" extension (for SSBL)
Basic configuration:
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"
Trusted configuration:
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:
-----------------------
Basic configuration
* 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
Trusted configuration
* 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
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:
-------------------------------------------
* 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
ums <USB controller> <dev type: mmc|usb> <dev[:part]>
ex.:
ums 0 mmc 0
ums 0 usb 0
* Follow section 6.2 to put U-Boot SPL binary and U-Boot binary (*.img or *.stm32)
on SDCARD/USB disk.
@@ -0,0 +1,5 @@
require u-boot-stm32mp-common_${PV}.inc
require u-boot-stm32mp.inc
SUMMARY = "Universal Boot Loader for embedded devices for stm32mp"
LICENSE = "GPLv2+"