How to silence U-Boot SPL and ATF/BL31 output on i.MX93?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to silence U-Boot SPL and ATF/BL31 output on i.MX93?

145 次查看
pilotnite
Contributor III

Hello NXP Community,

I'm working with an i.MX93-based device that has a dual-purpose console port: it's used both for programming/debugging the device and as an outbound console connection to network equipment (Cisco, Fortigate, etc.).

Problem: When the console cable is connected to external network devices during boot, the U-Boot SPL and ATF/BL31 boot messages are echoed to the external device's console. If the external device is also booting, it can interpret these characters as input commands, potentially corrupting its bootloader or configuration.

What I've successfully silenced: I've successfully silenced U-Boot proper using the following configuration in my defconfig:

CONFIG_SILENT_CONSOLE=y
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=y
CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC=y
CONFIG_SILENT_U_BOOT_ONLY=y
CONFIG_SYS_DEVICE_NULLDEV=y
CONFIG_AUTOBOOT_KEYED=y
CONFIG_AUTOBOOT_STOP_STR="\x03"
CONFIG_AUTOBOOT_DELAY_STR=""

I also attempted to silence SPL by adding this to common/spl/spl.c:

void board_init_r(gd_t *dummy1, ulong dummy2)
{
/* Force silent console in SPL */
gd->flags |= GD_FLG_SILENT;

/* ... rest of code ... */
}
```

What still outputs:
Despite these changes, I'm still seeing SPL and ATF output on the console:

U-Boot SPL 2023.04+gf8a2983ec83+p0 (Mar 04 2024 - 07:25:04 +0000)
SOC: 0xa1009300
LC: 0x2040010
PMIC: Low Drive Voltage Mode
DDR: 3733MTS
M33 prepare ok
NOTICE: BL31: v2.8(release):lf-6.6.3-1.0.0-0-g8dbe28631
NOTICE: BL31: Built : 17:57:56, Jan 22 2024

Questions:

- For U-Boot SPL: Does CONFIG_SPL_SILENT_CONSOLE exist in U-Boot 2023.04 for i.MX93? If so, what additional configuration is needed beyond setting gd->flags |= GD_FLG_SILENT?
- For ATF/BL31: What is the recommended way to silence ATF NOTICE messages? Should I rebuild imx-atf with LOG_LEVEL=0? Are there any i.MX93-specific considerations?
- Alternative approaches: Is there a better way to prevent early boot stage output from affecting connected devices? I've considered disabling UART TX at the hardware register level, but I'm unsure if this is the recommended approach.

Environment:

- SoC: i.MX93
- U-Boot version: 2023.04+gf8a2983ec83+p0
- ATF version: v2.8 (lf-6.6.3-1.0.0-0-g8dbe28631)
- Build system: Yocto-based

Any guidance on silencing these early boot stages would be greatly appreciated!

Thank you,

Nitesh

标签 (2)
标记 (1)
0 项奖励
回复
3 回复数

61 次查看
SprunkiRetake
Contributor I

Sprunki Retake Yeah, I’ve dealt with this exact problem on NXP SoCs before—annoying when your boot logs confuse a Cisco switch! For SPL, CONFIG_SPL_SILENT_CONSOLE does exist in recent U-Boot versions (including 2023.04), but you also need to ensure it's respected early in the SPL console init path—some boards re-enable the console later. For ATF/BL31, you're spot on: rebuild with LOG_LEVEL=0 in the ATF make command (e.g., make PLAT=imx93 LOG_LEVEL=0)—no i.MX93-specific catches there, just make sure the Yocto recipe passes that flag.

 

0 项奖励
回复

116 次查看
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

There is no option to add CONFIG_SPL_SILENT_CONSOLE in U-boot.

Other recommendation that I can give is add the variable:

"silent=1\0"      \

And give it a value different from "0":

Here you can check the configuration:

Building uboot image with a silent console.

Regarding disable UART TX at the hardware level, it could be viable. Configure pad settings in ATF or SPL to keep TX inactive until U-Boot/Linux boot.

Best regards.

 

0 项奖励
回复

113 次查看
janmodaal
Contributor II
Hi Jorge,
I added several patches in arm-trusted-boot, you can change the macro NOTICE(...) , you can mux the UART TX pin to GPIO mode for example ...

[Wizard@Oz decoder]$ cat br-extrn/patches/arm-trusted-firmware/one-line-version-build-time.patch
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -124,8 +124,8 @@ void bl31_main(void)
/* Init per-world context registers for non-secure world */
manage_extensions_nonsecure_per_world();

- NOTICE("BL31: %s\n", version_string);
- NOTICE("BL31: %s\n", build_message);
+ NOTICE("BL31: %s", version_string);
+ /* NOTICE("BL31: %s\n", build_message); */

#if FEATURE_DETECTION
/* Detect if features enabled during compilation are supported by PE. */
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -436,7 +436,7 @@ endef
# Allow overriding the timestamp, for example for reproducible builds, or to
# synchronize timestamps across multiple projects.
# This must be set to a C string (including quotes where applicable).
-BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__
+BUILD_MESSAGE_TIMESTAMP ?= $(shell LC_ALL=C date -u +'(%Y-%m-%d %T)')

.PHONY: libraries

@@ -560,8 +560,8 @@ $(ELF): $(OBJS) $(DEFAULT_LINKER_SCRIPT)
ifdef MAKE_BUILD_STRINGS
$(call MAKE_BUILD_STRINGS,$(BUILD_DIR)/build_message.o)
else
- @echo 'const char build_message[] = "Built : "$(BUILD_MESSAGE_TIMESTAMP); \
- const char version_string[] = "${VERSION_STRING}"; \
+ @echo 'const char build_message[] = "Built : $(BUILD_MESSAGE_TIMESTAMP)"; \
+ const char version_string[] = "${VERSION_STRING} ${BUILD_MESSAGE_TIMESTAMP}"; \
const char version[] = "${VERSION}";' | \
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
endif
0 项奖励
回复