diff --git a/conf/machine/include/st-machine-common-stm32mp.inc b/conf/machine/include/st-machine-common-stm32mp.inc index afb43ee..060ead4 100644 --- a/conf/machine/include/st-machine-common-stm32mp.inc +++ b/conf/machine/include/st-machine-common-stm32mp.inc @@ -381,6 +381,12 @@ TOOLCHAIN_HOST_TASK_remove_pn-buildtools-tarball = " ${ST_TOOLS_FOR_SDK_PERL} " TOOLCHAIN_TARGET_TASK += " bash-dev libgomp-dev" TOOLCHAIN_TARGET_TASK_remove_pn-buildtools-tarball = " bash-dev libgomp-dev" +# ========================================================================= +# Debug trace +# ========================================================================= +# acitvate/desactive the debug and trace on boot stage: tf-a, optee, u-boot and kernel +ST_DEBUG_TRACE ?= "1" + # ========================================================================= # Kernel # ========================================================================= @@ -412,6 +418,7 @@ ST_KERNEL_LOADADDR ?= "0xC2000040" # Define the devicetree for Linux A7 examples LINUX_A7_EXAMPLES_DT ?= "" +ST_CMD_LINE_DEBUG_TRACE ?= "loglevel=1 quiet" # ========================================================================= # u-boot # ========================================================================= @@ -465,6 +472,7 @@ MACHINE_EXTRA_RRECOMMENDS_append_stm32mp1common = " \ u-boot-fw-config-stm32mp \ " +ST_UBOOT_DEBUG_TRACE ?= "${@bb.utils.contains('ST_DEBUG_TRACE', '1', '1', '0', d)}" # ========================================================================= # trusted-firmware-a # ========================================================================= @@ -497,12 +505,14 @@ TF_A_MTD_START_OFFSET_NAND ?= "0x00200000" TF_A_MTD_START_OFFSET_NOR ?= "0x00080000" TF_A_MTD_START_OFFSET_SPINAND ?= "0x00200000" +ST_TF_A_DEBUG_TRACE ?= "${@bb.utils.contains('ST_DEBUG_TRACE', '1', '1', '0', d)}" # ========================================================================= # optee # ========================================================================= # Map OPTEE configuration to device tree list OPTEE_CONF = "${STM32MP_DEVICETREE}" +ST_OPTEE_DEBUG_TRACE ?= "${@bb.utils.contains('ST_DEBUG_TRACE', '1', '1', '0', d)}" # ========================================================================= # fip # ========================================================================= diff --git a/conf/machine/include/st-machine-extlinux-config-stm32mp.inc b/conf/machine/include/st-machine-extlinux-config-stm32mp.inc index d76e9d0..6ef8e12 100644 --- a/conf/machine/include/st-machine-extlinux-config-stm32mp.inc +++ b/conf/machine/include/st-machine-extlinux-config-stm32mp.inc @@ -12,6 +12,9 @@ UBOOT_EXTLINUX_DEFAULT_LABEL ?= "OpenSTLinux" INITRD_SHORTNAME ??= "" UBOOT_EXTLINUX_INITRD ?= "${@bb.utils.contains('COMBINED_FEATURES', 'autoresize', '/${INITRD_SHORTNAME}', '', d)}" +UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw" +UBOOT_EXTLINUX_KERNEL_ARGS_append += " ${@bb.utils.contains('ST_DEBUG_TRACE', '1', '', '${ST_CMD_LINE_DEBUG_TRACE}', d)} " + # ----------------------------------------------------------------------------- # Configurations # ----------------------------------------------------------------------------- diff --git a/recipes-bsp/trusted-firmware-a/tf-a-stm32mp-common.inc b/recipes-bsp/trusted-firmware-a/tf-a-stm32mp-common.inc index 95ca51e..bd18f70 100644 --- a/recipes-bsp/trusted-firmware-a/tf-a-stm32mp-common.inc +++ b/recipes-bsp/trusted-firmware-a/tf-a-stm32mp-common.inc @@ -32,11 +32,14 @@ EXTERNALSRC_BUILD_pn-${PN} = "${WORKDIR}/build" DEPENDS += "dtc-native" DEPENDS_append = " ${@bb.utils.contains('TF_A_ENABLE_DEBUG_WRAPPER', '1', 'stm32wrapper4dbg-native', '', d)}" +# Default log level +ST_TF_A_DEBUG_LOG_LEVEL ??= "40" + # Extra make settings EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX}' # Debug support -EXTRA_OEMAKE += 'DEBUG=1' -EXTRA_OEMAKE += 'LOG_LEVEL=40' +EXTRA_OEMAKE += '${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'DEBUG=1', '', d)}' +EXTRA_OEMAKE += '${@bb.utils.contains('ST_TF_A_DEBUG_TRACE', '1', 'LOG_LEVEL=${ST_TF_A_DEBUG_LOG_LEVEL}', '', d)}' # Define default TF-A namings TF_A_BASENAME ?= "tf-a" diff --git a/recipes-bsp/u-boot/u-boot-stm32mp-common_2020.10.inc b/recipes-bsp/u-boot/u-boot-stm32mp-common_2020.10.inc index 8e9bd7d..cb6567c 100644 --- a/recipes-bsp/u-boot/u-boot-stm32mp-common_2020.10.inc +++ b/recipes-bsp/u-boot/u-boot-stm32mp-common_2020.10.inc @@ -24,6 +24,9 @@ SRC_URI += "\ file://0099-Add-external-var-to-allow-build-of-new-devicetree-fi.patch \ " +# debug and trace +SRC_URI += "${@bb.utils.contains('ST_UBOOT_DEBUG_TRACE', '1', '', 'file://0098-silent_mode.patch', d)}" + U_BOOT_VERSION = "v2020.10" U_BOOT_SUBVERSION = "stm32mp" U_BOOT_RELEASE = "r1" diff --git a/recipes-bsp/u-boot/u-boot-stm32mp/0098-silent_mode.patch b/recipes-bsp/u-boot/u-boot-stm32mp/0098-silent_mode.patch new file mode 100644 index 0000000..2ab8842 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-stm32mp/0098-silent_mode.patch @@ -0,0 +1,24 @@ +From 2132a1ff883c92953e906ba8f32b13641bdb98c7 Mon Sep 17 00:00:00 2001 +From: Christophe Priouzeau +Date: Fri, 16 Jul 2021 16:25:20 +0200 +Subject: [PATCH 12/12] cpr_silent + +--- + include/configs/stm32mp1.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h +index 72424abb8b..0088ced206 100644 +--- a/include/configs/stm32mp1.h ++++ b/include/configs/stm32mp1.h +@@ -159,6 +159,7 @@ + "env_check=if env info -p -d -q; then env save; fi\0" \ + STM32MP_BOOTCMD \ + BOOTENV \ ++ "silent=1\0" \ + "boot_net_usb_start=true\0" + + #endif /* ifndef CONFIG_SPL_BUILD */ +-- +2.17.1 + diff --git a/recipes-security/optee/optee-os-stm32mp-common.inc b/recipes-security/optee/optee-os-stm32mp-common.inc index ed30659..6102739 100644 --- a/recipes-security/optee/optee-os-stm32mp-common.inc +++ b/recipes-security/optee/optee-os-stm32mp-common.inc @@ -16,6 +16,9 @@ inherit deploy python3native OPTEEMACHINE ?= "${MACHINE}" OPTEEOUTPUTMACHINE ?= "${MACHINE}" +# Default log level +ST_OPTEE_DEBUG_LOG_LEVEL ??= "2" + EXTRA_OEMAKE = "PLATFORM=${OPTEEMACHINE}" EXTRA_OEMAKE += "CROSS_COMPILE_core=${HOST_PREFIX}" EXTRA_OEMAKE += "CROSS_COMPILE_ta_arm64=${HOST_PREFIX}" @@ -23,11 +26,12 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', 'CFG_ARM64_cor EXTRA_OEMAKE += "NOWERROR=1" EXTRA_OEMAKE += "LDFLAGS=" EXTRA_OEMAKE += "LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_TARGET}" -EXTRA_OEMAKE += "CFG_TEE_CORE_LOG_LEVEL=2" -EXTRA_OEMAKE += "CFG_TEE_CORE_DEBUG=n" EXTRA_OEMAKE += "comp-cflagscore='--sysroot=${STAGING_DIR_TARGET}'" EXTRA_OEMAKE += "${@bb.utils.contains('MACHINE_FEATURES', 'fip', '', 'CFG_STM32MP15x_STM32IMAGE=y', d)}" +# debug and trace +EXTRA_OEMAKE += "${@bb.utils.contains('ST_OPTEE_DEBUG_TRACE', '1', 'CFG_TEE_CORE_LOG_LEVEL=${ST_OPTEE_DEBUG_LOG_LEVEL} CFG_TEE_CORE_DEBUG=n', '', d)}" + OPTEE_ARCH_armv7a = "arm32" OPTEE_ARCH_armv7ve = "arm32" OPTEE_ARCH_aarch64 = "arm64"