1 // SPDX-License-Identifier: GPL-2.0+
4 * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc
9 #include <gdsys_fpga.h>
12 UNITTYPE_MAIN_SERVER = 0,
13 UNITTYPE_MAIN_USER = 1,
14 UNITTYPE_VIDEO_SERVER = 2,
15 UNITTYPE_VIDEO_USER = 3,
20 UNITTYPEPCB_DP_165 = 1,
21 UNITTYPEPCB_DP_300 = 2,
27 COMPRESSION_TYPE_1 = 1,
28 COMPRESSION_TYPE_1_2 = 3,
29 COMPRESSION_TYPE_1_2_3 = 7,
51 CARRIER_SPEED_2_5G = 1,
54 bool ioep_fpga_has_osd(unsigned int fpga)
59 FPGA_GET_REG(0, fpga_features, &fpga_features);
60 feature_osd = fpga_features & (1<<11);
65 void ioep_fpga_print_info(unsigned int fpga)
71 unsigned unit_type_pcb_video;
72 unsigned feature_compression;
74 unsigned feature_audio;
75 unsigned feature_sysclock;
76 unsigned feature_ramconfig;
77 unsigned feature_carrier_speed;
78 unsigned feature_carriers;
79 unsigned feature_video_channels;
81 FPGA_GET_REG(fpga, versions, &versions);
82 FPGA_GET_REG(fpga, fpga_version, &fpga_version);
83 FPGA_GET_REG(fpga, fpga_features, &fpga_features);
85 unit_type = (versions & 0xf000) >> 12;
86 unit_type_pcb_video = (versions & 0x01c0) >> 6;
87 feature_compression = (fpga_features & 0xe000) >> 13;
88 feature_osd = fpga_features & (1<<11);
89 feature_audio = (fpga_features & 0x0600) >> 9;
90 feature_sysclock = (fpga_features & 0x0180) >> 7;
91 feature_ramconfig = (fpga_features & 0x0060) >> 5;
92 feature_carrier_speed = fpga_features & (1<<4);
93 feature_carriers = (fpga_features & 0x000c) >> 2;
94 feature_video_channels = fpga_features & 0x0003;
97 case UNITTYPE_MAIN_SERVER:
98 case UNITTYPE_MAIN_USER:
99 printf("Mainchannel");
102 case UNITTYPE_VIDEO_SERVER:
103 case UNITTYPE_VIDEO_USER:
104 printf("Videochannel");
108 printf("UnitType %d(not supported)", unit_type);
113 case UNITTYPE_MAIN_SERVER:
114 case UNITTYPE_VIDEO_SERVER:
116 if (versions & (1<<4))
120 case UNITTYPE_MAIN_USER:
121 case UNITTYPE_VIDEO_USER:
129 if (versions & (1<<5))
134 switch (unit_type_pcb_video) {
135 case UNITTYPEPCB_DVI:
139 case UNITTYPEPCB_DP_165:
140 printf(" DP 165MPix/s,");
143 case UNITTYPEPCB_DP_300:
144 printf(" DP 300MPix/s,");
147 case UNITTYPEPCB_HDMI:
152 printf(" FPGA V %d.%02d\n features:",
153 fpga_version / 100, fpga_version % 100);
156 switch (feature_compression) {
157 case COMPRESSION_NONE:
158 printf(" no compression");
161 case COMPRESSION_TYPE_1:
162 printf(" compression type1(delta)");
165 case COMPRESSION_TYPE_1_2:
166 printf(" compression type1(delta), type2(inline)");
169 case COMPRESSION_TYPE_1_2_3:
170 printf(" compression type1(delta), type2(inline), type3(intempo)");
174 printf(" compression %d(not supported)", feature_compression);
178 printf(", %sosd", feature_osd ? "" : "no ");
180 switch (feature_audio) {
182 printf(", no audio");
186 printf(", audio tx");
190 printf(", audio rx");
194 printf(", audio rx+tx");
198 printf(", audio %d(not supported)", feature_audio);
204 switch (feature_sysclock) {
206 printf("clock 147.456 MHz");
210 printf("clock %d(not supported)", feature_sysclock);
214 switch (feature_ramconfig) {
216 printf(", RAM 32 bit DDR2");
220 printf(", RAM 32 bit DDR3");
224 printf(", RAM 48 bit DDR3");
228 printf(", RAM %d(not supported)", feature_ramconfig);
232 printf(", %d carrier(s) %s", feature_carriers,
233 feature_carrier_speed ? "2.5Gbit/s" : "1Gbit/s");
235 printf(", %d video channel(s)\n", feature_video_channels);