Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2009 Extreme Engineering Solutions, Inc. |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include "fsl_8xxx_misc.h" |
| 8 | |
| 9 | int checkboard(void) |
| 10 | { |
| 11 | char name[] = CONFIG_SYS_BOARD_NAME; |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 12 | char buf[64]; |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 13 | char *s; |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 14 | int i; |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 15 | |
| 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 Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 53 | i = env_get_f("board_rev", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 54 | if (i > 0) |
| 55 | printf("Rev %s, ", buf); |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 56 | i = env_get_f("serial#", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 57 | if (i > 0) |
| 58 | printf("Serial# %s, ", buf); |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 59 | i = env_get_f("board_cfg", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 60 | if (i > 0) |
| 61 | printf("Cfg %s", buf); |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 62 | puts("\n"); |
| 63 | |
| 64 | return 0; |
| 65 | } |