blob: 43575bc302d6b58692657c49274d1a32c12ffed6 [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>
Simon Glassdb229612019-08-01 09:46:42 -06007#include <env.h>
John Schmollerd9c2dd52010-10-22 00:20:24 -05008#include "fsl_8xxx_misc.h"
9
10int checkboard(void)
11{
12 char name[] = CONFIG_SYS_BOARD_NAME;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000013 char buf[64];
John Schmollerd9c2dd52010-10-22 00:20:24 -050014 char *s;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000015 int i;
John Schmollerd9c2dd52010-10-22 00:20:24 -050016
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(" ");
Simon Glass64b723f2017-08-03 12:22:12 -060054 i = env_get_f("board_rev", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000055 if (i > 0)
56 printf("Rev %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060057 i = env_get_f("serial#", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000058 if (i > 0)
59 printf("Serial# %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060060 i = env_get_f("board_cfg", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000061 if (i > 0)
62 printf("Cfg %s", buf);
John Schmollerd9c2dd52010-10-22 00:20:24 -050063 puts("\n");
64
65 return 0;
66}