[U-Boot] [PATCH] SMDK5250: FDT: Retrieve board model via DT

Rajeshwari Shinde rajeshwari.s at samsung.com
Mon Feb 18 13:51:49 CET 2013


Print out the board model by parsing the device tree file.

Signed-off-by: Rajeshwari Shinde <rajeshwari.s at samsung.com>
---
 board/samsung/smdk5250/smdk5250.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index 6f6f2c2..0097b3f 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -336,8 +336,17 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-	printf("\nBoard: SMDK5250\n");
+#ifdef CONFIG_OF_CONTROL
+	const char *board_name;
 
+	board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	if (board_name == NULL)
+		printf("\nUnknown Board\n");
+	else
+		printf("\nBoard: %s\n", board_name);
+#else
+	printf("\nBoard: SMDK5250\n");
+#endif
 	return 0;
 }
 #endif
-- 
1.7.4.4



More information about the U-Boot mailing list