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