1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <common.h>
25#include <command.h>
26#include <asm/processor.h>
27#include <asm/io.h>
28
29#define HWTYPE_CCX16 1
30#define HWREV_300 3
31
32int board_early_init_f(void)
33{
34 mtdcr(UIC0SR, 0xFFFFFFFF);
35 mtdcr(UIC0ER, 0x00000000);
36 mtdcr(UIC0CR, 0x00000000);
37 mtdcr(UIC0PR, 0xFFFFFF80);
38 mtdcr(UIC0TR, 0x10000000);
39 mtdcr(UIC0VCR, 0x00000001);
40 mtdcr(UIC0SR, 0xFFFFFFFF);
41
42
43
44
45
46 mtebc(EBC0_CFG, 0xa8400000);
47
48 return 0;
49}
50
51
52
53
54int checkboard(void)
55{
56 char buf[64];
57 int i = getenv_f("serial#", buf, sizeof(buf));
58 u16 val = in_le16((void *)CONFIG_FPGA_BASE + 2);
59 u8 unit_type;
60 u8 hardware_cpu_ports;
61 u8 hardware_con_ports;
62 u8 hardware_version;
63
64 printf("Board: CATCenter Neo");
65
66 if (i > 0) {
67 puts(", serial# ");
68 puts(buf);
69 }
70 puts("\n ");
71
72 unit_type = (val & 0xf000) >> 12;
73 hardware_cpu_ports = ((val & 0x0f00) >> 8) * 8;
74 hardware_con_ports = ((val & 0x00f0) >> 4) * 2;
75 hardware_version = val & 0x000f;
76
77 switch (unit_type) {
78 case HWTYPE_CCX16:
79 printf("CCX16-FPGA (80 UARTs)");
80 break;
81
82 default:
83 printf("UnitType %d, unsupported", unit_type);
84 break;
85 }
86
87 printf(", %d cpu ports, %d console ports,",
88 hardware_cpu_ports, hardware_con_ports);
89
90 switch (hardware_version) {
91 case HWREV_300:
92 printf(" HW-Ver 3.00\n");
93 break;
94
95 default:
96 printf(" HW-Ver %d, unsupported\n",
97 hardware_version);
98 break;
99 }
100
101 return 0;
102}
103