Skip to contentSkip to conversation

cmd: terminal: avoid serial_reinit_all() with DM_SERIAL enabled

PATCH In review Aditya Dutt 2 participants 3 messages Sep 5, 2025 – Sep 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: terminal: avoid serial_reinit_all() with DM_SERIAL enabled

serial_reinit_all() is only available when CONFIG DM_SERIAL is disabled and CONFIG_SERIAL is enabled.

---

Running the following:

  make am335x_evm_config
  scripts/config --enable CONFIG_DM_SERIAL
  make

Gives a linker error because serial_reinit_all() is not available in the case of DM_SERIAL.

cmd/terminal.o: in function `do_terminal':
cmd/terminal.c:28:(.text.do_terminal+0x12): undefined reference to `serial_reinit_all'

 cmd/terminal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/terminal.c +1 -1
index d803bc6c896..14610694255 100644
@@ -24,7 +24,7 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[])
 	if (!dev)
 		return -1;
 
-	if (IS_ENABLED(CONFIG_SERIAL))
+	if (IS_ENABLED(CONFIG_SERIAL) && !IS_ENABLED(CONFIG_DM_SERIAL))
 		serial_reinit_all();
 
 	printf("Entering terminal mode for port %s\n", dev->name);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Aditya Dutt

Running the following:

  make am335x_evm_config
  scripts/config --enable CONFIG_DM_SERIAL
  make

Sorry, there is a typo here.
Running the following:

  make am335x_evm_config
  scripts/config --enable CONFIG_CMD_TERMINAL
  make

gives the linker error.

---
Aditya Dutt <[email protected]>

#2 lore raw
In reply to Aditya Dutt
Quoted 4 lines · Aditya Dutt

serial_reinit_all() is only available when CONFIG DM_SERIAL is disabled and CONFIG_SERIAL is enabled.

Applied to u-boot/next, thanks!

[1/1] cmd: terminal: avoid serial_reinit_all() with DM_SERIAL enabled

      commit: bbc9347a98c3fb32610d4324c9e0f6239f013143
Signature · 1 line
Tom