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> |
Simon Glass | db22961 | 2019-08-01 09:46:42 -0600 | [diff] [blame] | 7 | #include <env.h> |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 8 | #include "fsl_8xxx_misc.h" |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 10 | |
| 11 | int checkboard(void) |
| 12 | { |
| 13 | char name[] = CONFIG_SYS_BOARD_NAME; |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 14 | char buf[64]; |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 15 | char *s; |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 16 | int i; |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 17 | |
| 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 Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 55 | i = env_get_f("board_rev", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 56 | if (i > 0) |
| 57 | printf("Rev %s, ", buf); |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 58 | i = env_get_f("serial#", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 59 | if (i > 0) |
| 60 | printf("Serial# %s, ", buf); |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 61 | i = env_get_f("board_cfg", buf, sizeof(buf)); |
Wolfgang Denk | 5c1cfee | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 62 | if (i > 0) |
| 63 | printf("Cfg %s", buf); |
John Schmoller | d9c2dd5 | 2010-10-22 00:20:24 -0500 | [diff] [blame] | 64 | puts("\n"); |
| 65 | |
| 66 | return 0; |
| 67 | } |