Skip to contentSkip to conversation

SMDK5250: FDT: Retrieve board model via DT

PATCH New Rajeshwari Shinde 3 participants 3 messages Feb 18, 2013 – Mar 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SMDK5250: FDT: Retrieve board model via DT

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

---
 board/samsung/smdk5250/smdk5250.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
board/samsung/smdk5250/smdk5250.c +10 -1
index 6f6f2c2..0097b3f 100644
@@ -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
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 SMDK5250: FDT: Retrieve board model via DT

Quoted 3 lines · Rajeshwari Shinde

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

Quoted 30 lines
---
 board/samsung/smdk5250/smdk5250.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
board/samsung/smdk5250/smdk5250.c +10 -2
index 6f6f2c2..0097b3f 100644
@@ -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

#2 lore raw

PATCH 1/1 SMDK5250: FDT: Retrieve board model via DT

In reply to Rajeshwari Shinde
Quoted 21 lines · Rajeshwari Shinde

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

---
 board/samsung/smdk5250/smdk5250.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
board/samsung/smdk5250/smdk5250.c +3 -1
index 6f6f2c2..0097b3f 100644
@@ -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);

board/samsung/smdk5250/smdk5250.c int board_eth_init(bd_t *bis) · line 352

Quoted 10 lines
board/samsung/smdk5250/smdk5250.c +7 -0
+	if (board_name == NULL)
+		printf("\nUnknown Board\n");
+	else
+		printf("\nBoard: %s\n", board_name);
+#else
+	printf("\nBoard: SMDK5250\n");
+#endif
 	return 0;
 }
 #endif

applied to u-boot-samsung.

Thanks,
Minkyu Kang.