blob: 053b07a0b70fa70f4ead2533826edd800f1ffa13 [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"
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
John Schmollerd9c2dd52010-10-22 00:20:24 -050010
11int checkboard(void)
12{
13 char name[] = CONFIG_SYS_BOARD_NAME;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000014 char buf[64];
John Schmollerd9c2dd52010-10-22 00:20:24 -050015 char *s;
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000016 int i;
John Schmollerd9c2dd52010-10-22 00:20:24 -050017
18#ifdef CONFIG_SYS_FORM_CUSTOM
19 s = "Custom";
20#elif CONFIG_SYS_FORM_6U_CPCI
21 s = "6U CompactPCI";
22#elif CONFIG_SYS_FORM_ATCA_PMC
23 s = "ATCA w/PMC";
24#elif CONFIG_SYS_FORM_ATCA_AMC
25 s = "ATCA w/AMC";
26#elif CONFIG_SYS_FORM_VME
27 s = "VME";
28#elif CONFIG_SYS_FORM_6U_VPX
29 s = "6U VPX";
30#elif CONFIG_SYS_FORM_PMC
31 s = "PMC";
32#elif CONFIG_SYS_FORM_PCI
33 s = "PCI";
34#elif CONFIG_SYS_FORM_3U_CPCI
35 s = "3U CompactPCI";
36#elif CONFIG_SYS_FORM_AMC
37 s = "AdvancedMC";
38#elif CONFIG_SYS_FORM_XMC
39 s = "XMC";
40#elif CONFIG_SYS_FORM_PMC_XMC
41 s = "PMC/XMC";
42#elif CONFIG_SYS_FORM_PCI_EXPRESS
43 s = "PCI Express";
44#elif CONFIG_SYS_FORM_3U_VPX
45 s = "3U VPX";
46#else
47#error "Form factor not defined"
48#endif
49
50 name[strlen(name) - 1] += get_board_derivative();
51 printf("Board: X-ES %s %s SBC\n", name, s);
52
53 /* Display board specific information */
54 puts(" ");
Simon Glass64b723f2017-08-03 12:22:12 -060055 i = env_get_f("board_rev", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000056 if (i > 0)
57 printf("Rev %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060058 i = env_get_f("serial#", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000059 if (i > 0)
60 printf("Serial# %s, ", buf);
Simon Glass64b723f2017-08-03 12:22:12 -060061 i = env_get_f("board_cfg", buf, sizeof(buf));
Wolfgang Denk5c1cfee2011-05-04 10:32:28 +000062 if (i > 0)
63 printf("Cfg %s", buf);
John Schmollerd9c2dd52010-10-22 00:20:24 -050064 puts("\n");
65
66 return 0;
67}