[Concept,16/18] ulib: Drop DRAM announcements for the library

Message ID 20250904130459.848794-17-sjg@u-boot.org
State New
Headers
Series ulib: Introduce building U-Boot as a shared library |

Commit Message

Simon Glass Sept. 4, 2025, 1:04 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

We don't want any initial console output from the library, so check the
ULIB flag and skip any output related to DRAM.

Note that debug output is unaffected, but this is only visible if debug
is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/board_f.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
  

Patch

diff --git a/common/board_f.c b/common/board_f.c
index eac51d61fa1..ef8b0ff7ef1 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -181,7 +181,9 @@  static int print_cpuinfo(void)
 
 static int announce_dram_init(void)
 {
-	puts("DRAM:  ");
+	if (!gd_ulib())
+		puts("DRAM:  ");
+
 	return 0;
 }
 
@@ -231,13 +233,15 @@  static int show_dram_config(void)
 	}
 	debug("\nDRAM:  ");
 
-	print_size(gd->ram_size, "");
-	if (!sizes_near(gd->ram_size, size)) {
-		printf(" (total ");
-		print_size(size, ")");
+	if (!gd_ulib()) {
+		print_size(gd->ram_size, "");
+		if (!sizes_near(gd->ram_size, size)) {
+			printf(" (total ");
+			print_size(size, ")");
+		}
+		board_add_ram_info(0);
+		putc('\n');
 	}
-	board_add_ram_info(0);
-	putc('\n');
 
 	return 0;
 }