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