blob: 66467c6485eac384a54361ac85ffca7c36689cc4 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
John Schmollerd9c2dd52010-10-22 00:20:24 -05002/*
3 * Copyright 2009 Extreme Engineering Solutions, Inc.
John Schmollerd9c2dd52010-10-22 00:20:24 -05004 */
5
6#include <common.h>
7#include "fsl_8xxx_misc.h"
8
9int checkboard(void)
10{
11 char name[] = CONFIG_SYS_BOARD_NAME;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000012 char buf[64];
John Schmollerd9c2dd52010-10-22 00:20:24 -050013 char *s;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000014 int i;
John Schmollerd9c2dd52010-10-22 00:20:24 -050015
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(" ");
Simon Glass64b723f2017-08-03 12:22:12 -060053 i = env_get_f("board_rev", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000054 if (i > 0)
55 printf("Rev %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060056 i = env_get_f("serial#", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000057 if (i > 0)
58 printf("Serial# %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060059 i = env_get_f("board_cfg", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000060 if (i > 0)
61 printf("Cfg %s", buf);
John Schmollerd9c2dd52010-10-22 00:20:24 -050062 puts("\n");
63
64 return 0;
65}