public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] boot: Pass baud rate to stdout-path
@ 2024-04-11  5:03 John Watts
  2024-04-11 15:11 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: John Watts @ 2024-04-11  5:03 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, John Watts

Linux might use the wrong baud rate such as 9600 by default, make sure
to specify it when passing the serial port over.

Signed-off-by: John Watts <contact@jookia.org>
---
On my board at least (a sunxi T113) the serial console will initialize
as 9600 baud instead of the set baud. Pass the baud with the serial
device to Linux to solve this issue.
---
 boot/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/fdt_support.c b/boot/fdt_support.c
index 090d82ee80..83e62f47b5 100644
--- a/boot/fdt_support.c
+++ b/boot/fdt_support.c
@@ -153,9 +153,9 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff)
 	}
 
 	/* fdt_setprop may break "path" so we copy it to tmp buffer */
-	memcpy(tmp, path, len);
+	len = sprintf(tmp, "%.*s:%d", len, (char *)path, CONFIG_BAUDRATE);
 
-	err = fdt_setprop(fdt, chosenoff, "linux,stdout-path", tmp, len);
+	err = fdt_setprop(fdt, chosenoff, "linux,stdout-path", tmp, len + 1);
 	if (err < 0)
 		printf("WARNING: could not set linux,stdout-path %s.\n",
 		       fdt_strerror(err));

---
base-commit: 777c28460947371ada40868dc994dfe8537d7115
change-id: 20240411-stdout-4f91b566a0f2

Best regards,
-- 
John Watts <contact@jookia.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-11 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  5:03 [PATCH] boot: Pass baud rate to stdout-path John Watts
2024-04-11 15:11 ` Mark Kettenis
2024-04-11 21:03   ` John Watts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox