xref: /openbmc/u-boot/board/xes/common/board.c (revision be059e88)
1 /*
2  * Copyright 2009 Extreme Engineering Solutions, Inc.
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include "fsl_8xxx_misc.h"
9 
10 int checkboard(void)
11 {
12 	char name[] = CONFIG_SYS_BOARD_NAME;
13 	char buf[64];
14 	char *s;
15 	int i;
16 
17 #ifdef CONFIG_SYS_FORM_CUSTOM
18 	s = "Custom";
19 #elif CONFIG_SYS_FORM_6U_CPCI
20 	s = "6U CompactPCI";
21 #elif CONFIG_SYS_FORM_ATCA_PMC
22 	s = "ATCA w/PMC";
23 #elif CONFIG_SYS_FORM_ATCA_AMC
24 	s = "ATCA w/AMC";
25 #elif CONFIG_SYS_FORM_VME
26 	s = "VME";
27 #elif CONFIG_SYS_FORM_6U_VPX
28 	s = "6U VPX";
29 #elif CONFIG_SYS_FORM_PMC
30 	s = "PMC";
31 #elif CONFIG_SYS_FORM_PCI
32 	s = "PCI";
33 #elif CONFIG_SYS_FORM_3U_CPCI
34 	s = "3U CompactPCI";
35 #elif CONFIG_SYS_FORM_AMC
36 	s = "AdvancedMC";
37 #elif CONFIG_SYS_FORM_XMC
38 	s = "XMC";
39 #elif CONFIG_SYS_FORM_PMC_XMC
40 	s = "PMC/XMC";
41 #elif CONFIG_SYS_FORM_PCI_EXPRESS
42 	s = "PCI Express";
43 #elif CONFIG_SYS_FORM_3U_VPX
44 	s = "3U VPX";
45 #else
46 #error "Form factor not defined"
47 #endif
48 
49 	name[strlen(name) - 1] += get_board_derivative();
50 	printf("Board: X-ES %s %s SBC\n", name, s);
51 
52 	/* Display board specific information */
53 	puts("       ");
54 	i = getenv_f("board_rev", buf, sizeof(buf));
55 	if (i > 0)
56 		printf("Rev %s, ", buf);
57 	i = getenv_f("serial#", buf, sizeof(buf));
58 	if (i > 0)
59 		printf("Serial# %s, ", buf);
60 	i = getenv_f("board_cfg", buf, sizeof(buf));
61 	if (i > 0)
62 		printf("Cfg %s", buf);
63 	puts("\n");
64 
65 	return 0;
66 }
67