xref: /rk3399_rockchip-uboot/board/xes/common/board.c (revision 92af6549b8c52e9c973e4e197aa4d1edf4df5803)
1*92af6549SJohn Schmoller /*
2*92af6549SJohn Schmoller  * Copyright 2009 Extreme Engineering Solutions, Inc.
3*92af6549SJohn Schmoller  *
4*92af6549SJohn Schmoller  * This program is free software; you can redistribute it and/or
5*92af6549SJohn Schmoller  * modify it under the terms of the GNU General Public License as
6*92af6549SJohn Schmoller  * published by the Free Software Foundation; either version 2 of
7*92af6549SJohn Schmoller  * the License, or (at your option) any later version.
8*92af6549SJohn Schmoller  */
9*92af6549SJohn Schmoller 
10*92af6549SJohn Schmoller #include <common.h>
11*92af6549SJohn Schmoller #include "fsl_8xxx_misc.h"
12*92af6549SJohn Schmoller 
13*92af6549SJohn Schmoller int checkboard(void)
14*92af6549SJohn Schmoller {
15*92af6549SJohn Schmoller 	char name[] = CONFIG_SYS_BOARD_NAME;
16*92af6549SJohn Schmoller 	char *s;
17*92af6549SJohn Schmoller 
18*92af6549SJohn Schmoller #ifdef CONFIG_SYS_FORM_CUSTOM
19*92af6549SJohn Schmoller 	s = "Custom";
20*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_6U_CPCI
21*92af6549SJohn Schmoller 	s = "6U CompactPCI";
22*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_ATCA_PMC
23*92af6549SJohn Schmoller 	s = "ATCA w/PMC";
24*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_ATCA_AMC
25*92af6549SJohn Schmoller 	s = "ATCA w/AMC";
26*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_VME
27*92af6549SJohn Schmoller 	s = "VME";
28*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_6U_VPX
29*92af6549SJohn Schmoller 	s = "6U VPX";
30*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PMC
31*92af6549SJohn Schmoller 	s = "PMC";
32*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PCI
33*92af6549SJohn Schmoller 	s = "PCI";
34*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_3U_CPCI
35*92af6549SJohn Schmoller 	s = "3U CompactPCI";
36*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_AMC
37*92af6549SJohn Schmoller 	s = "AdvancedMC";
38*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_XMC
39*92af6549SJohn Schmoller 	s = "XMC";
40*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PMC_XMC
41*92af6549SJohn Schmoller 	s = "PMC/XMC";
42*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_PCI_EXPRESS
43*92af6549SJohn Schmoller 	s = "PCI Express";
44*92af6549SJohn Schmoller #elif CONFIG_SYS_FORM_3U_VPX
45*92af6549SJohn Schmoller 	s = "3U VPX";
46*92af6549SJohn Schmoller #else
47*92af6549SJohn Schmoller #error "Form factor not defined"
48*92af6549SJohn Schmoller #endif
49*92af6549SJohn Schmoller 
50*92af6549SJohn Schmoller 	name[strlen(name) - 1] += get_board_derivative();
51*92af6549SJohn Schmoller 	printf("Board: X-ES %s %s SBC\n", name, s);
52*92af6549SJohn Schmoller 
53*92af6549SJohn Schmoller 	/* Display board specific information */
54*92af6549SJohn Schmoller 	puts("       ");
55*92af6549SJohn Schmoller 	if ((s = getenv("board_rev")))
56*92af6549SJohn Schmoller 		printf("Rev %s, ", s);
57*92af6549SJohn Schmoller 	if ((s = getenv("serial#")))
58*92af6549SJohn Schmoller 		printf("Serial# %s, ", s);
59*92af6549SJohn Schmoller 	if ((s = getenv("board_cfg")))
60*92af6549SJohn Schmoller 		printf("Cfg %s", s);
61*92af6549SJohn Schmoller 	puts("\n");
62*92af6549SJohn Schmoller 
63*92af6549SJohn Schmoller 	return 0;
64*92af6549SJohn Schmoller }
65