192af6549SJohn Schmoller /*
292af6549SJohn Schmoller * Copyright 2009 Extreme Engineering Solutions, Inc.
392af6549SJohn Schmoller *
41a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+
592af6549SJohn Schmoller */
692af6549SJohn Schmoller
792af6549SJohn Schmoller #include <common.h>
892af6549SJohn Schmoller #include "fsl_8xxx_misc.h"
992af6549SJohn Schmoller
checkboard(void)1092af6549SJohn Schmoller int checkboard(void)
1192af6549SJohn Schmoller {
1292af6549SJohn Schmoller char name[] = CONFIG_SYS_BOARD_NAME;
13f0c0b3a9SWolfgang Denk char buf[64];
1492af6549SJohn Schmoller char *s;
15f0c0b3a9SWolfgang Denk int i;
1692af6549SJohn Schmoller
1792af6549SJohn Schmoller #ifdef CONFIG_SYS_FORM_CUSTOM
1892af6549SJohn Schmoller s = "Custom";
1992af6549SJohn Schmoller #elif CONFIG_SYS_FORM_6U_CPCI
2092af6549SJohn Schmoller s = "6U CompactPCI";
2192af6549SJohn Schmoller #elif CONFIG_SYS_FORM_ATCA_PMC
2292af6549SJohn Schmoller s = "ATCA w/PMC";
2392af6549SJohn Schmoller #elif CONFIG_SYS_FORM_ATCA_AMC
2492af6549SJohn Schmoller s = "ATCA w/AMC";
2592af6549SJohn Schmoller #elif CONFIG_SYS_FORM_VME
2692af6549SJohn Schmoller s = "VME";
2792af6549SJohn Schmoller #elif CONFIG_SYS_FORM_6U_VPX
2892af6549SJohn Schmoller s = "6U VPX";
2992af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PMC
3092af6549SJohn Schmoller s = "PMC";
3192af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PCI
3292af6549SJohn Schmoller s = "PCI";
3392af6549SJohn Schmoller #elif CONFIG_SYS_FORM_3U_CPCI
3492af6549SJohn Schmoller s = "3U CompactPCI";
3592af6549SJohn Schmoller #elif CONFIG_SYS_FORM_AMC
3692af6549SJohn Schmoller s = "AdvancedMC";
3792af6549SJohn Schmoller #elif CONFIG_SYS_FORM_XMC
3892af6549SJohn Schmoller s = "XMC";
3992af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PMC_XMC
4092af6549SJohn Schmoller s = "PMC/XMC";
4192af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PCI_EXPRESS
4292af6549SJohn Schmoller s = "PCI Express";
4392af6549SJohn Schmoller #elif CONFIG_SYS_FORM_3U_VPX
4492af6549SJohn Schmoller s = "3U VPX";
4592af6549SJohn Schmoller #else
4692af6549SJohn Schmoller #error "Form factor not defined"
4792af6549SJohn Schmoller #endif
4892af6549SJohn Schmoller
4992af6549SJohn Schmoller name[strlen(name) - 1] += get_board_derivative();
5092af6549SJohn Schmoller printf("Board: X-ES %s %s SBC\n", name, s);
5192af6549SJohn Schmoller
5292af6549SJohn Schmoller /* Display board specific information */
5392af6549SJohn Schmoller puts(" ");
54*00caae6dSSimon Glass i = env_get_f("board_rev", buf, sizeof(buf));
55f0c0b3a9SWolfgang Denk if (i > 0)
56f0c0b3a9SWolfgang Denk printf("Rev %s, ", buf);
57*00caae6dSSimon Glass i = env_get_f("serial#", buf, sizeof(buf));
58f0c0b3a9SWolfgang Denk if (i > 0)
59f0c0b3a9SWolfgang Denk printf("Serial# %s, ", buf);
60*00caae6dSSimon Glass i = env_get_f("board_cfg", buf, sizeof(buf));
61f0c0b3a9SWolfgang Denk if (i > 0)
62f0c0b3a9SWolfgang Denk printf("Cfg %s", buf);
6392af6549SJohn Schmoller puts("\n");
6492af6549SJohn Schmoller
6592af6549SJohn Schmoller return 0;
6692af6549SJohn Schmoller }
67