3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/processor.h>
28 #include <asm/ppc4xx-gpio.h>
30 #include <gdsys_fpga.h>
32 #include "../common/osd.h"
35 UNITTYPE_VIDEO_USER = 0,
36 UNITTYPE_MAIN_USER = 1,
37 UNITTYPE_VIDEO_SERVER = 2,
38 UNITTYPE_MAIN_SERVER = 3,
63 static void print_fpga_info(unsigned dev)
65 ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(dev);
66 u16 versions = in_le16(&fpga->versions);
67 u16 fpga_version = in_le16(&fpga->fpga_version);
68 u16 fpga_features = in_le16(&fpga->fpga_features);
70 unsigned hardware_version;
71 unsigned feature_compression;
72 unsigned feature_rs232;
73 unsigned feature_audio;
74 unsigned feature_sysclock;
75 unsigned feature_ramconfig;
76 unsigned feature_carrier_speed;
77 unsigned feature_carriers;
78 unsigned feature_video_channels;
79 int fpga_state = get_fpga_state(dev);
81 printf("FPGA%d: ", dev);
83 hardware_version = versions & 0x000f;
86 && !((hardware_version == HWVER_101)
87 && (fpga_state == FPGA_STATE_DONE_FAILED))) {
88 puts("not available\n");
89 print_fpga_state(dev);
93 unit_type = (versions >> 4) & 0x000f;
94 hardware_version = versions & 0x000f;
95 feature_compression = (fpga_features >> 13) & 0x0003;
96 feature_rs232 = fpga_features & (1<<11);
97 feature_audio = (fpga_features >> 9) & 0x0003;
98 feature_sysclock = (fpga_features >> 7) & 0x0003;
99 feature_ramconfig = (fpga_features >> 5) & 0x0003;
100 feature_carrier_speed = fpga_features & (1<<4);
101 feature_carriers = (fpga_features >> 2) & 0x0003;
102 feature_video_channels = fpga_features & 0x0003;
105 case UNITTYPE_VIDEO_USER:
106 printf("Videochannel Userside");
109 case UNITTYPE_MAIN_USER:
110 printf("Mainchannel Userside");
113 case UNITTYPE_VIDEO_SERVER:
114 printf("Videochannel Serverside");
117 case UNITTYPE_MAIN_SERVER:
118 printf("Mainchannel Serverside");
122 printf("UnitType %d(not supported)", unit_type);
126 switch (hardware_version) {
128 printf(" HW-Ver 1.01\n");
132 printf(" HW-Ver 1.10\n");
136 printf(" HW-Ver %d(not supported)\n",
141 printf(" FPGA V %d.%02d, features:",
142 fpga_version / 100, fpga_version % 100);
144 printf(" %sRS232", feature_rs232 ? "" : "no ");
146 switch (feature_audio) {
148 printf(", no audio");
152 printf(", audio tx");
156 printf(", audio rx");
160 printf(", audio rx+tx");
164 printf(", audio %d(not supported)", feature_audio);
168 switch (feature_sysclock) {
170 printf(", clock 156.25 MHz");
174 printf(", clock %d(not supported)", feature_sysclock);
180 switch (feature_ramconfig) {
186 printf("RAM 32 bit DDR2");
190 printf("RAM 64 bit DDR2");
194 printf("RAM %d(not supported)", feature_ramconfig);
198 printf(", %d carrier(s) %s", feature_carriers,
199 feature_carrier_speed ? "10 Gbit/s" : "of unknown speed");
201 printf(", %d video channel(s)\n", feature_video_channels);
205 * Check Board Identity:
210 char *s = getenv("serial#");
214 printf("DLVision 10G");
223 for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k)
229 int last_stage_init(void)
233 for (k = 0; k < CONFIG_SYS_OSD_SCREENS; ++k)
234 if (!get_fpga_state(k)
235 || (get_fpga_state(k) == FPGA_STATE_DONE_FAILED))