blob: faa577e240bf191a71e63b8ba1b2b6bbed2d6f80 [file] [log] [blame]
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08001/*
2 * Copyright © 2009 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Authors:
24 * Zhenyu Wang <zhenyu.z.wang@intel.com>
25 * Wu Fengguang <fengguang.wu@intel.com>
26 *
27 */
28
Wu Fengguang020abdb2010-04-19 13:13:06 +080029#define _GNU_SOURCE
Wu Fengguang9e9c9f22009-11-06 11:06:22 +080030#include <unistd.h>
Wu Fengguang020abdb2010-04-19 13:13:06 +080031#include <stdlib.h>
32#include <stdio.h>
33#include <string.h>
34#include <err.h>
Wu Fengguang9e9c9f22009-11-06 11:06:22 +080035#include <arpa/inet.h>
36#include "intel_gpu_tools.h"
37
Wu Fengguang020abdb2010-04-19 13:13:06 +080038static uint32_t devid;
39
Mengdong Lin92d31972014-03-03 11:04:39 -050040static int aud_reg_base = 0; /* base address of audio registers */
41static int disp_reg_base = 0; /* base address of display registers */
Wu Fengguang020abdb2010-04-19 13:13:06 +080042
43#define BITSTO(n) (n >= sizeof(long) * 8 ? ~0 : (1UL << (n)) - 1)
44#define BITMASK(high, low) (BITSTO(high+1) & ~BITSTO(low))
45#define BITS(reg, high, low) (((reg) & (BITMASK(high, low))) >> (low))
46#define BIT(reg, n) BITS(reg, n, n)
47
48#define min_t(type, x, y) ({ \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040049 type __min1 = (x); \
50 type __min2 = (y); \
51 __min1 < __min2 ? __min1 : __min2; })
Wu Fengguang020abdb2010-04-19 13:13:06 +080052
53#define OPNAME(names, index) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040054 names[min_t(unsigned int, index, ARRAY_SIZE(names) - 1)]
Wu Fengguang020abdb2010-04-19 13:13:06 +080055
Mengdong Lin92d31972014-03-03 11:04:39 -050056#define set_aud_reg_base(base) (aud_reg_base = (base))
57
58#define set_reg_base(base, audio_offset) \
59 do { \
60 disp_reg_base = (base); \
61 set_aud_reg_base((base) + (audio_offset)); \
62 } while (0)
63
Wu Fengguang020abdb2010-04-19 13:13:06 +080064#define dump_reg(reg, desc) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040065 do { \
66 dword = INREG(reg); \
67 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
68 } while (0)
Wu Fengguang020abdb2010-04-19 13:13:06 +080069
Mengdong Lin92d31972014-03-03 11:04:39 -050070#define dump_disp_reg(reg, desc) \
71 do { \
72 dword = INREG(disp_reg_base + reg); \
73 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
74 } while (0)
75
76#define dump_aud_reg(reg, desc) \
77 do { \
78 dword = INREG(aud_reg_base + reg); \
79 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
80 } while (0)
81
82#define read_aud_reg(reg) INREG(aud_reg_base + (reg))
Wu Fengguang020abdb2010-04-19 13:13:06 +080083
Mengdong Lindeba8682013-09-09 15:38:40 -040084static const char * const pixel_clock[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080085 [0] = "25.2 / 1.001 MHz",
86 [1] = "25.2 MHz",
87 [2] = "27 MHz",
88 [3] = "27 * 1.001 MHz",
89 [4] = "54 MHz",
90 [5] = "54 * 1.001 MHz",
91 [6] = "74.25 / 1.001 MHz",
92 [7] = "74.25 MHz",
93 [8] = "148.5 / 1.001 MHz",
94 [9] = "148.5 MHz",
95 [10] = "Reserved",
96};
97
Mengdong Lindeba8682013-09-09 15:38:40 -040098static const char * const power_state[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080099 [0] = "D0",
100 [1] = "D1",
101 [2] = "D2",
102 [3] = "D3",
103};
104
Mengdong Lindeba8682013-09-09 15:38:40 -0400105static const char * const stream_type[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800106 [0] = "default samples",
107 [1] = "one bit stream",
108 [2] = "DST stream",
109 [3] = "MLP stream",
110 [4] = "Reserved",
111};
112
Mengdong Lindeba8682013-09-09 15:38:40 -0400113static const char * const dip_port[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800114 [0] = "Reserved",
115 [1] = "Digital Port B",
116 [2] = "Digital Port C",
117 [3] = "Digital Port D",
118};
119
Mengdong Lindeba8682013-09-09 15:38:40 -0400120static const char * const dip_type[] = {
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400121 [0] = "Audio DIP Disabled",
122 [1] = "Audio DIP Enabled",
Wang Xingchaoc4077222012-08-15 16:13:38 +0800123};
124
Mengdong Lindeba8682013-09-09 15:38:40 -0400125static const char * const dip_gen1_state[] = {
126 [0] = "Generic 1 (ACP) DIP Disabled",
127 [1] = "Generic 1 (ACP) DIP Enabled",
128};
129
130static const char * const dip_gen2_state[] = {
131 [0] = "Generic 2 DIP Disabled",
132 [1] = "Generic 2 DIP Enabled",
133};
134
135static const char * const dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800136 [0] = "Audio DIP",
137 [1] = "ACP DIP",
138 [2] = "ISRC1 DIP",
139 [3] = "ISRC2 DIP",
140 [4] = "Reserved",
141};
142
Mengdong Lindeba8682013-09-09 15:38:40 -0400143static const char * const dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800144 [0] = "disabled",
145 [1] = "reserved",
146 [2] = "send once",
147 [3] = "best effort",
148};
149
Mengdong Lindeba8682013-09-09 15:38:40 -0400150static const char * const video_dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800151 [0] = "AVI DIP",
152 [1] = "Vendor-specific DIP",
Wu Fengguangf3f84bb2011-11-12 11:12:55 +0800153 [2] = "Gamut Metadata DIP",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800154 [3] = "Source Product Description DIP",
155};
156
Mengdong Lindeba8682013-09-09 15:38:40 -0400157static const char * const video_dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800158 [0] = "send once",
159 [1] = "send every vsync",
160 [2] = "send at least every other vsync",
161 [3] = "reserved",
162};
163
Mengdong Lindeba8682013-09-09 15:38:40 -0400164static const char * const trans_to_port_sel[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800165 [0] = "no port",
166 [1] = "Digital Port B",
Wang Xingchaof9a24812012-08-15 16:13:37 +0800167 [2] = "Digital Port C",
168 [3] = "Digital Port D",
169 [4] = "reserved",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800170 [5] = "reserved",
171 [6] = "reserved",
172 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800173};
174
Mengdong Lindeba8682013-09-09 15:38:40 -0400175static const char * const ddi_mode[] = {
Wang Xingchaoc4077222012-08-15 16:13:38 +0800176 [0] = "HDMI mode",
177 [1] = "DVI mode",
178 [2] = "DP SST mode",
179 [3] = "DP MST mode",
180 [4] = "DP FDI mode",
181 [5] = "reserved",
182 [6] = "reserved",
183 [7] = "reserved",
184};
185
Mengdong Lindeba8682013-09-09 15:38:40 -0400186static const char * const bits_per_color[] = {
187 [0] = "8 bpc",
188 [1] = "10 bpc",
189 [2] = "6 bpc",
190 [3] = "12 bpc",
191 [4] = "reserved",
192 [5] = "reserved",
193 [6] = "reserved",
194 [7] = "reserved",
195};
196
197static const char * const transcoder_select[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800198 [0] = "Transcoder A",
199 [1] = "Transcoder B",
200 [2] = "Transcoder C",
201 [3] = "reserved",
202};
203
Mengdong Lindeba8682013-09-09 15:38:40 -0400204static const char * const dp_port_width[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800205 [0] = "x1 mode",
206 [1] = "x2 mode",
Wu Fengguangcf4c12f2011-11-12 11:12:46 +0800207 [2] = "reserved",
208 [3] = "x4 mode",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800209 [4] = "reserved",
210 [5] = "reserved",
211 [6] = "reserved",
212 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800213};
214
Mengdong Lindeba8682013-09-09 15:38:40 -0400215static const char * const sample_base_rate[] = {
216 [0] = "48 kHz",
217 [1] = "44.1 kHz",
218};
219
220static const char * const sample_base_rate_mult[] = {
221 [0] = "x1 (48 kHz, 44.1 kHz or less)",
222 [1] = "x2 (96 kHz, 88.2 kHz, 32 kHz)",
223 [2] = "x3 (144 kHz)",
224 [3] = "x4 (192 kHz, 176.4 kHz)",
225 [4] = "Reserved",
226};
227
228static const char * const sample_base_rate_divisor[] = {
229 [0] = "Divided by 1 (48 kHz, 44.1 kHz)",
230 [1] = "Divided by 2 (24 kHz, 22.05 kHz)",
231 [2] = "Divided by 3 (16 kHz, 32 kHz)",
232 [3] = "Divided by 4 (11.025 kHz)",
233 [4] = "Divided by 5 (9.6 kHz)",
234 [5] = "Divided by 6 (8 kHz)",
235 [6] = "Divided by 7",
236 [7] = "Divided by 8 (6 kHz)",
237};
238
239static const char * const connect_list_form[] = {
240 [0] = "Short Form",
241 [1] = "Long Form",
242};
243
244
245static const char * const bits_per_sample[] = {
Wu Fengguang12861a92011-11-12 11:12:47 +0800246 [0] = "reserved",
247 [1] = "16 bits",
248 [2] = "24 bits",
249 [3] = "32 bits",
250 [4] = "20 bits",
251 [5] = "reserved",
252};
253
Mengdong Lindeba8682013-09-09 15:38:40 -0400254static const char * const sdvo_hdmi_encoding[] = {
Wu Fengguangee949582011-11-12 11:12:53 +0800255 [0] = "SDVO",
256 [1] = "reserved",
257 [2] = "TMDS",
258 [3] = "reserved",
259};
Wu Fengguang12861a92011-11-12 11:12:47 +0800260
Mengdong Lindeba8682013-09-09 15:38:40 -0400261static const char * const n_index_value[] = {
Wu Fengguange64abe52012-01-17 07:19:24 +0800262 [0] = "HDMI",
263 [1] = "DisplayPort",
264};
265
Mengdong Lin85357202013-08-13 00:21:57 -0400266static const char * const immed_result_valid[] = {
267 [0] = "No immediate response is available",
268 [1] = "Immediate response is available",
269};
270
271static const char * const immed_cmd_busy[] = {
272 [0] = "Can accept an immediate command",
273 [1] = "Immediate command is available",
274};
275
Mengdong Linf075c3c2013-08-13 00:22:14 -0400276static const char * const vanilla_dp12_en[] = {
277 [0] = "DP 1.2 features are disabled",
278 [1] = "DP 1.2 features are enabled",
279};
280
281static const char * const vanilla_3_widgets_en[] = {
282 [0] = "2nd & 3rd pin/convertor widgets are disabled",
283 [1] = "All three pin/convertor widgets are enabled",
284};
285
286static const char * const block_audio[] = {
287 [0] = "Allow audio data to reach the port",
288 [1] = "Block audio data from reaching the port",
289};
290
291static const char * const dis_eld_valid_pulse_trans[] = {
292 [0] = "Enable ELD valid pulse transition when unsol is disabled",
293 [1] = "Disable ELD valid pulse transition when unsol is disabled",
294};
295
296static const char * const dis_pd_pulse_trans[] = {
297 [0] = "Enable Presense Detect pulse transition when unsol is disabled",
298 [1] = "Disable Presense Detect pulse transition when unsol is disabled",
299};
300
301static const char * const dis_ts_delta_err[] = {
302 [0] = "Enable timestamp delta error for 32/44 KHz",
303 [1] = "Disable timestamp delta error for 32/44 KHz",
304};
305
306static const char * const dis_ts_fix_dp_hbr[] = {
307 [0] = "Enable timestamp fix for DP HBR",
308 [1] = "Disable timestamp fix for DP HBR",
309};
310
311static const char * const pattern_gen_8_ch_en[] = {
312 [0] = "Disable 8-channel pattern generator",
313 [1] = "Enable 8-channel pattern generator",
314};
315
316static const char * const pattern_gen_2_ch_en[] = {
317 [0] = "Disable 2-channel pattern generator",
318 [1] = "Enable 2-channel pattern generator",
319};
320
321static const char * const fabric_32_44_dis[] = {
322 [0] = "Allow sample fabrication for 32/44 KHz",
323 [1] = "Disable sample fabrication for 32/44 KHz",
324};
325
326static const char * const epss_dis[] = {
327 [0] = "Allow audio EPSS",
328 [1] = "Disable audio EPSS",
329};
330
331static const char * const ts_test_mode[] = {
332 [0] = "Default time stamp mode",
333 [1] = "Audio time stamp test mode for audio only feature",
334};
335
336static const char * const en_mmio_program[] = {
337 [0] = "Programming by HD-Audio Azalia",
338 [1] = "Programming by MMIO debug registers",
339};
340
Mengdong Lin97e5cf62013-08-13 00:22:24 -0400341static const char * const audio_dp_dip_status[] = {
342 [0] = "audfc dp fifo full",
343 [1] = "audfc dp fifo empty",
344 [2] = "audfc dp fifo overrun",
345 [3] = "audfc dip fifo full",
346 [4] = "audfc dp fifo empty cd",
347 [5] = "audfb dp fifo full",
348 [6] = "audfb dp fifo empty",
349 [7] = "audfb dp fifo overrun",
350 [8] = "audfb dip fifo full",
351 [9] = "audfb dp fifo empty cd",
352 [10] = "audfa dp fifo full",
353 [11] = "audfa dp fifo empty",
354 [12] = "audfa dp fifo overrun",
355 [13] = "audfa dip fifo full",
356 [14] = "audfa dp fifo empty cd",
357 [15] = "Pipe c audio overflow",
358 [16] = "Pipe b audio overflow",
359 [17] = "Pipe a audio overflow",
360 [31] = 0,
361};
362
Mengdong Lined386662014-02-28 13:25:27 -0500363#undef TRANSCODER_A
364#undef TRANSCODER_B
365#undef TRANSCODER_C
366
367enum {
368 TRANSCODER_A = 0,
369 TRANSCODER_B,
370 TRANSCODER_C,
371};
372
373enum {
374 PIPE_A = 0,
375 PIPE_B,
376 PIPE_C,
377};
378
379enum {
380 PORT_A = 0,
381 PORT_B,
382 PORT_C,
383 PORT_D,
384 PORT_E,
385};
386
387enum {
388 CONVERTER_1 = 0,
389 CONVERTER_2,
390 CONVERTER_3,
391};
392
Wu Fengguang020abdb2010-04-19 13:13:06 +0800393static void do_self_tests(void)
394{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400395 if (BIT(1, 0) != 1)
396 exit(1);
397 if (BIT(0x80000000, 31) != 1)
398 exit(2);
399 if (BITS(0xc0000000, 31, 30) != 3)
400 exit(3);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800401}
402
403/*
404 * EagleLake registers
405 */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800406#define AUD_CONFIG 0x62000
407#define AUD_DEBUG 0x62010
408#define AUD_VID_DID 0x62020
409#define AUD_RID 0x62024
410#define AUD_SUBN_CNT 0x62028
411#define AUD_FUNC_GRP 0x62040
412#define AUD_SUBN_CNT2 0x62044
413#define AUD_GRP_CAP 0x62048
414#define AUD_PWRST 0x6204c
415#define AUD_SUPPWR 0x62050
416#define AUD_SID 0x62054
417#define AUD_OUT_CWCAP 0x62070
418#define AUD_OUT_PCMSIZE 0x62074
419#define AUD_OUT_STR 0x62078
420#define AUD_OUT_DIG_CNVT 0x6207c
421#define AUD_OUT_CH_STR 0x62080
422#define AUD_OUT_STR_DESC 0x62084
423#define AUD_PINW_CAP 0x620a0
424#define AUD_PIN_CAP 0x620a4
425#define AUD_PINW_CONNLNG 0x620a8
426#define AUD_PINW_CONNLST 0x620ac
427#define AUD_PINW_CNTR 0x620b0
428#define AUD_PINW_UNSOLRESP 0x620b8
429#define AUD_CNTL_ST 0x620b4
430#define AUD_PINW_CONFIG 0x620bc
431#define AUD_HDMIW_STATUS 0x620d4
432#define AUD_HDMIW_HDMIEDID 0x6210c
433#define AUD_HDMIW_INFOFR 0x62118
434#define AUD_CONV_CHCNT 0x62120
435#define AUD_CTS_ENABLE 0x62128
436
437#define VIDEO_DIP_CTL 0x61170
438#define VIDEO_DIP_ENABLE (1<<31)
439#define VIDEO_DIP_ENABLE_AVI (1<<21)
440#define VIDEO_DIP_ENABLE_VENDOR (1<<22)
441#define VIDEO_DIP_ENABLE_SPD (1<<24)
442#define VIDEO_DIP_BUF_AVI (0<<19)
443#define VIDEO_DIP_BUF_VENDOR (1<<19)
444#define VIDEO_DIP_BUF_SPD (3<<19)
445#define VIDEO_DIP_TRANS_ONCE (0<<16)
446#define VIDEO_DIP_TRANS_1 (1<<16)
447#define VIDEO_DIP_TRANS_2 (2<<16)
448
449#define AUDIO_HOTPLUG_EN (1<<24)
450
451
Wu Fengguang020abdb2010-04-19 13:13:06 +0800452static void dump_eaglelake(void)
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800453{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400454 uint32_t dword;
455 int i;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800456
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400457 /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800458
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400459 dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
460 dump_reg(SDVOB, "Digital Display Port B Control Register");
461 dump_reg(SDVOC, "Digital Display Port C Control Register");
462 dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800463
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400464 dump_reg(AUD_CONFIG, "Audio Configuration");
465 dump_reg(AUD_DEBUG, "Audio Debug");
466 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
467 dump_reg(AUD_RID, "Audio Revision ID");
468 dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
469 dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
470 dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
471 dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
472 dump_reg(AUD_PWRST, "Audio Power State");
473 dump_reg(AUD_SUPPWR, "Audio Supported Power States");
474 dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
475 dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
476 dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
477 dump_reg(AUD_OUT_STR, "Audio Stream Formats");
478 dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
479 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
480 dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
481 dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
482 dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
483 dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
484 dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
485 dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
486 dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
487 dump_reg(AUD_CNTL_ST, "Audio Control State Register");
488 dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
489 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
490 dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
491 dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
492 dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
493 dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800494
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400495 printf("\nDetails:\n\n");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800496
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400497 dword = INREG(AUD_VID_DID);
498 printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
499 printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800500
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400501 dword = INREG(AUD_RID);
502 printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
503 printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
504 printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
505 printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800506
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400507 dword = INREG(SDVOB);
508 printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
509 printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
510 printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
511 printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
512 printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800513
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400514 dword = INREG(SDVOC);
515 printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
516 printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
517 printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
518 printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
519 printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800520
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400521 dword = INREG(PORT_HOTPLUG_EN);
522 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)),
523 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)),
524 printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
525 printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
526 printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
527 printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
528 printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
529 printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)),
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800530
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400531 dword = INREG(VIDEO_DIP_CTL);
532 printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
533 printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
534 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
535 printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
536 printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
537 printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
538 printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
539 printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
540 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
541 printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
542 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
543 printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
544 printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800545
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400546 dword = INREG(AUD_CONFIG);
547 printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
548 OPNAME(pixel_clock, BITS(dword, 19, 16)));
549 printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
550 printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
551 printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800552
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400553 dword = INREG(AUD_DEBUG);
554 printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800555
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400556 dword = INREG(AUD_SUBN_CNT);
557 printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16));
558 printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800559
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400560 dword = INREG(AUD_SUBN_CNT2);
561 printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16));
562 printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800563
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400564 dword = INREG(AUD_FUNC_GRP);
565 printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
566 printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800567
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400568 dword = INREG(AUD_GRP_CAP);
569 printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
570 printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
571 printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800572
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400573 dword = INREG(AUD_PWRST);
574 printf("AUD_PWRST device power state\t\t%s\n",
575 power_state[BITS(dword, 5, 4)]);
576 printf("AUD_PWRST device power state setting\t%s\n",
577 power_state[BITS(dword, 1, 0)]);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800578
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400579 dword = INREG(AUD_SUPPWR);
580 printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
581 printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
582 printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
583 printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800584
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400585 dword = INREG(AUD_OUT_CWCAP);
586 printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
587 printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
588 printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
589 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
590 printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
591 printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
592 printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
593 printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
594 printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
595 printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
596 printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
597 printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
598 printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
599 printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800600
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400601 dword = INREG(AUD_OUT_DIG_CNVT);
602 printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8));
603 printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
604 printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
605 printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
606 printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
607 printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
608 printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
609 printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
610 printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800611
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400612 dword = INREG(AUD_OUT_CH_STR);
613 printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
614 printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800615
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400616 dword = INREG(AUD_OUT_STR_DESC);
617 printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1);
618 printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n",
619 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800620
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400621 dword = INREG(AUD_PINW_CAP);
622 printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
623 printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
624 printf("AUD_PINW_CAP channel count\t\t%lu\n",
625 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
626 printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
627 printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
628 printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
629 printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
630 printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
631 printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
632 printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
633 printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
634 printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
635 printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
636 printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800637
638
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400639 dword = INREG(AUD_PIN_CAP);
640 printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
641 printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
642 printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
643 printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800644
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400645 dword = INREG(AUD_PINW_CNTR);
646 printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
647 printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
648 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
649 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
650 printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
651 BITS(dword, 2, 0),
652 OPNAME(stream_type, BITS(dword, 2, 0)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800653
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400654 dword = INREG(AUD_PINW_UNSOLRESP);
655 printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800656
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400657 dword = INREG(AUD_CNTL_ST);
658 printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
659 printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
660 printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
661 printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
662 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
663 printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
664 BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
665 printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
666 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
667 printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
668 printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
669 printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
670 printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
671 printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
672 printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800673
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400674 dword = INREG(AUD_HDMIW_STATUS);
675 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
676 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
677 printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
678 printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800679
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400680 dword = INREG(AUD_CONV_CHCNT);
681 printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
682 printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800683
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400684 printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
685 for (i = 0; i < 8; i++) {
686 OUTREG(AUD_CONV_CHCNT, i);
687 dword = INREG(AUD_CONV_CHCNT);
688 printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4));
689 }
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800690
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400691 printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t");
692 dword = INREG(AUD_CNTL_ST);
693 dword &= ~BITMASK(8, 5);
694 OUTREG(AUD_CNTL_ST, dword);
695 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
696 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID)));
697 printf("\n");
Wu Fengguangf32aecb2011-11-12 11:12:50 +0800698
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400699 printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t");
700 dword = INREG(AUD_CNTL_ST);
701 dword &= ~BITMASK(20, 18);
702 dword &= ~BITMASK(3, 0);
703 OUTREG(AUD_CNTL_ST, dword);
704 for (i = 0; i < 8; i++)
705 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR)));
706 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800707}
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800708
Wu Fengguang020abdb2010-04-19 13:13:06 +0800709#undef AUD_RID
710#undef AUD_VID_DID
711#undef AUD_PWRST
712#undef AUD_OUT_CH_STR
713#undef AUD_HDMIW_STATUS
714
715/*
716 * IronLake registers
717 */
718#define AUD_CONFIG_A 0xE2000
719#define AUD_CONFIG_B 0xE2100
720#define AUD_CTS_ENABLE_A 0xE2028
721#define AUD_CTS_ENABLE_B 0xE2128
722#define AUD_MISC_CTRL_A 0xE2010
723#define AUD_MISC_CTRL_B 0xE2110
724#define AUD_VID_DID 0xE2020
725#define AUD_RID 0xE2024
726#define AUD_PWRST 0xE204C
727#define AUD_PORT_EN_HD_CFG 0xE207C
728#define AUD_OUT_DIG_CNVT_A 0xE2080
729#define AUD_OUT_DIG_CNVT_B 0xE2180
730#define AUD_OUT_CH_STR 0xE2088
731#define AUD_OUT_STR_DESC_A 0xE2084
732#define AUD_OUT_STR_DESC_B 0xE2184
733#define AUD_PINW_CONNLNG_LIST 0xE20A8
734#define AUD_PINW_CONNLNG_SEL 0xE20AC
735#define AUD_CNTL_ST_A 0xE20B4
736#define AUD_CNTL_ST_B 0xE21B4
737#define AUD_CNTL_ST2 0xE20C0
738#define AUD_HDMIW_STATUS 0xE20D4
739#define AUD_HDMIW_HDMIEDID_A 0xE2050
740#define AUD_HDMIW_HDMIEDID_B 0xE2150
741#define AUD_HDMIW_INFOFR_A 0xE2054
742#define AUD_HDMIW_INFOFR_B 0xE2154
743
744static void dump_ironlake(void)
745{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400746 uint32_t dword;
747 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800748
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400749 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
750 dump_reg(HDMIC, "HDMI Port C Control");
751 dump_reg(HDMID, "HDMI Port D Control");
752 dump_reg(PCH_DP_B, "DisplayPort B Control Register");
753 dump_reg(PCH_DP_C, "DisplayPort C Control Register");
754 dump_reg(PCH_DP_D, "DisplayPort D Control Register");
755 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
756 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
757 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
758 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
759 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
760 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
761 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
762 dump_reg(AUD_RID, "Audio Revision ID");
763 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
764 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
765 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
766 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
767 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
768 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
769 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
770 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
771 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
772 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
773 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
774 dump_reg(AUD_CNTL_ST2, "Audio Control State 2");
775 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
776 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
777 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
778 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
779 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800780
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400781 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800782
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400783 dword = INREG(AUD_VID_DID);
784 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
785 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800786
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400787 dword = INREG(AUD_RID);
788 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
789 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
790 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
791 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800792
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400793 dword = INREG(HDMIB);
794 printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
795 printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
796 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
797 printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23));
798 printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2));
799 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
800 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
801 printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
802 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800803
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400804 dword = INREG(HDMIC);
805 printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
806 printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
807 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
808 printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2));
809 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
810 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
811 printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
812 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800813
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400814 dword = INREG(HDMID);
815 printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
816 printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
817 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
818 printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2));
819 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
820 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
821 printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
822 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800823
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400824 dword = INREG(PCH_DP_B);
825 printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
826 printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
827 printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
828 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
829 printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
830 printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
831 printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800832
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400833 dword = INREG(PCH_DP_C);
834 printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
835 printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
836 printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
837 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
838 printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
839 printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
840 printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800841
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400842 dword = INREG(PCH_DP_D);
843 printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
844 printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
845 printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
846 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
847 printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
848 printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
849 printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800850
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400851 dword = INREG(AUD_CONFIG_A);
852 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
853 n_index_value[BIT(dword, 29)]);
854 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
855 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
856 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
857 printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
858 OPNAME(pixel_clock, BITS(dword, 19, 16)));
859 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
860 dword = INREG(AUD_CONFIG_B);
861 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
862 n_index_value[BIT(dword, 29)]);
863 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
864 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
865 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
866 printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
867 OPNAME(pixel_clock, BITS(dword, 19, 16)));
868 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800869
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400870 dword = INREG(AUD_CTS_ENABLE_A);
871 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
872 printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
873 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
874 dword = INREG(AUD_CTS_ENABLE_B);
875 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
876 printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
877 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800878
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400879 dword = INREG(AUD_MISC_CTRL_A);
880 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
881 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
882 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
883 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
884 dword = INREG(AUD_MISC_CTRL_B);
885 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
886 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
887 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
888 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800889
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400890 dword = INREG(AUD_PWRST);
891 printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]);
892 printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]);
893 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
894 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
895 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
896 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
897 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
898 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
899 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
900 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
901 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
902 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800903
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400904 dword = INREG(AUD_PORT_EN_HD_CFG);
905 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
906 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
907 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
908 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
909 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12));
910 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13));
911 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14));
912 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16));
913 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17));
914 printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 18));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800915
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400916 dword = INREG(AUD_OUT_DIG_CNVT_A);
917 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
918 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
919 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
920 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
921 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
922 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
923 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
924 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
925 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
926 printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800927
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400928 dword = INREG(AUD_OUT_DIG_CNVT_B);
929 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
930 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
931 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
932 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
933 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
934 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
935 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
936 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
937 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
938 printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800939
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400940 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
941 for (i = 0; i < 8; i++) {
942 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
943 dword = INREG(AUD_OUT_CH_STR);
944 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
945 1 + BITS(dword, 3, 0),
946 1 + BITS(dword, 7, 4),
947 1 + BITS(dword, 15, 12),
948 1 + BITS(dword, 23, 20));
949 }
Wu Fengguang020abdb2010-04-19 13:13:06 +0800950
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400951 dword = INREG(AUD_OUT_STR_DESC_A);
952 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
953 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
954 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
955 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
956 printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800957
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400958 dword = INREG(AUD_OUT_STR_DESC_B);
959 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
960 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
961 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
962 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
963 printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800964
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400965 dword = INREG(AUD_PINW_CONNLNG_SEL);
966 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0));
967 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8));
968 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800969
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400970 dword = INREG(AUD_CNTL_ST_A);
971 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
972 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
973 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
974 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
975 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
976 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
977 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
978 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
979 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
980 printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800981
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400982 dword = INREG(AUD_CNTL_ST_B);
983 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
984 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
985 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
986 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
987 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
988 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
989 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
990 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
991 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
992 printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800993
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400994 dword = INREG(AUD_CNTL_ST2);
995 printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1));
996 printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
997 printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5));
998 printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
999 printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9));
1000 printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001001
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001002 dword = INREG(AUD_HDMIW_STATUS);
1003 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1004 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1005 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1006 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1007 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1008 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001009
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001010 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1011 dword = INREG(AUD_CNTL_ST_A);
1012 dword &= ~BITMASK(9, 5);
1013 OUTREG(AUD_CNTL_ST_A, dword);
1014 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1015 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1016 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001017
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001018 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1019 dword = INREG(AUD_CNTL_ST_B);
1020 dword &= ~BITMASK(9, 5);
1021 OUTREG(AUD_CNTL_ST_B, dword);
1022 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1023 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1024 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001025
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001026 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1027 dword = INREG(AUD_CNTL_ST_A);
1028 dword &= ~BITMASK(20, 18);
1029 dword &= ~BITMASK(3, 0);
1030 OUTREG(AUD_CNTL_ST_A, dword);
1031 for (i = 0; i < 8; i++)
1032 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1033 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001034
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001035 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1036 dword = INREG(AUD_CNTL_ST_B);
1037 dword &= ~BITMASK(20, 18);
1038 dword &= ~BITMASK(3, 0);
1039 OUTREG(AUD_CNTL_ST_B, dword);
1040 for (i = 0; i < 8; i++)
1041 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1042 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001043
1044}
1045
1046
1047#undef AUD_CONFIG_A
1048#undef AUD_MISC_CTRL_A
1049#undef AUD_VID_DID
1050#undef AUD_RID
1051#undef AUD_CTS_ENABLE_A
1052#undef AUD_PWRST
1053#undef AUD_HDMIW_HDMIEDID_A
1054#undef AUD_HDMIW_INFOFR_A
1055#undef AUD_PORT_EN_HD_CFG
1056#undef AUD_OUT_DIG_CNVT_A
1057#undef AUD_OUT_STR_DESC_A
1058#undef AUD_OUT_CH_STR
1059#undef AUD_PINW_CONNLNG_LIST
1060#undef AUD_CNTL_ST_A
1061#undef AUD_HDMIW_STATUS
1062#undef AUD_CONFIG_B
1063#undef AUD_MISC_CTRL_B
1064#undef AUD_CTS_ENABLE_B
1065#undef AUD_HDMIW_HDMIEDID_B
1066#undef AUD_HDMIW_INFOFR_B
1067#undef AUD_OUT_DIG_CNVT_B
1068#undef AUD_OUT_STR_DESC_B
1069#undef AUD_CNTL_ST_B
1070
1071/*
1072 * CougarPoint registers
1073 */
Wu Fengguang97d20312011-11-12 11:12:45 +08001074#define DP_CTL_B 0xE4100
Wu Fengguang020abdb2010-04-19 13:13:06 +08001075#define DP_CTL_C 0xE4200
1076#define DP_AUX_CTL_C 0xE4210
1077#define DP_AUX_TST_C 0xE4228
1078#define SPORT_DDI_CRC_C 0xE4250
1079#define SPORT_DDI_CRC_R 0xE4264
1080#define DP_CTL_D 0xE4300
1081#define DP_AUX_CTL_D 0xE4310
1082#define DP_AUX_TST_D 0xE4328
1083#define SPORT_DDI_CRC_CTL_D 0xE4350
1084#define AUD_CONFIG_A 0xE5000
1085#define AUD_MISC_CTRL_A 0xE5010
1086#define AUD_VID_DID 0xE5020
1087#define AUD_RID 0xE5024
1088#define AUD_CTS_ENABLE_A 0xE5028
1089#define AUD_PWRST 0xE504C
1090#define AUD_HDMIW_HDMIEDID_A 0xE5050
1091#define AUD_HDMIW_INFOFR_A 0xE5054
1092#define AUD_PORT_EN_HD_CFG 0xE507C
1093#define AUD_OUT_DIG_CNVT_A 0xE5080
1094#define AUD_OUT_STR_DESC_A 0xE5084
1095#define AUD_OUT_CH_STR 0xE5088
1096#define AUD_PINW_CONNLNG_LIST 0xE50A8
1097#define AUD_PINW_CONNLNG_SELA 0xE50AC
1098#define AUD_CNTL_ST_A 0xE50B4
1099#define AUD_CNTRL_ST2 0xE50C0
1100#define AUD_CNTRL_ST3 0xE50C4
1101#define AUD_HDMIW_STATUS 0xE50D4
1102#define AUD_CONFIG_B 0xE5100
1103#define AUD_MISC_CTRL_B 0xE5110
1104#define AUD_CTS_ENABLE_B 0xE5128
1105#define AUD_HDMIW_HDMIEDID_B 0xE5150
1106#define AUD_HDMIW_INFOFR_B 0xE5154
1107#define AUD_OUT_DIG_CNVT_B 0xE5180
1108#define AUD_OUT_STR_DESC_B 0xE5184
1109#define AUD_CNTL_ST_B 0xE51B4
1110#define AUD_CONFIG_C 0xE5200
1111#define AUD_MISC_CTRL_C 0xE5210
1112#define AUD_CTS_ENABLE_C 0xE5228
1113#define AUD_HDMIW_HDMIEDID_C 0xE5250
1114#define AUD_HDMIW_INFOFR_C 0xE5254
1115#define AUD_OUT_DIG_CNVT_C 0xE5280
1116#define AUD_OUT_STR_DESC_C 0xE5284
1117#define AUD_CNTL_ST_C 0xE52B4
1118#define AUD_CONFIG_D 0xE5300
1119#define AUD_MISC_CTRL_D 0xE5310
1120#define AUD_CTS_ENABLE_D 0xE5328
1121#define AUD_HDMIW_HDMIEDID_D 0xE5350
1122#define AUD_HDMIW_INFOFR_D 0xE5354
1123#define AUD_OUT_DIG_CNVT_D 0xE5380
1124#define AUD_OUT_STR_DESC_D 0xE5384
1125#define AUD_CNTL_ST_D 0xE53B4
1126
Wu Fengguange321f132011-11-12 11:12:52 +08001127#define VIDEO_DIP_CTL_A 0xE0200
1128#define VIDEO_DIP_CTL_B 0xE1200
1129#define VIDEO_DIP_CTL_C 0xE2200
1130#define VIDEO_DIP_CTL_D 0xE3200
1131
Wu Fengguang020abdb2010-04-19 13:13:06 +08001132
1133static void dump_cpt(void)
1134{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001135 uint32_t dword;
1136 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +08001137
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001138 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
1139 dump_reg(HDMIC, "HDMI Port C Control");
1140 dump_reg(HDMID, "HDMI Port D Control");
1141 dump_reg(DP_CTL_B, "DisplayPort B Control");
1142 dump_reg(DP_CTL_C, "DisplayPort C Control");
1143 dump_reg(DP_CTL_D, "DisplayPort D Control");
1144 dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control");
1145 dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control");
1146 dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control");
1147 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
1148 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
1149 dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C");
1150 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
1151 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
1152 dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C");
1153 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
1154 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
1155 dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C");
1156 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
1157 dump_reg(AUD_RID, "Audio Revision ID");
1158 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
1159 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
1160 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
1161 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
1162 dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C");
1163 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
1164 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
1165 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
1166 dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C");
1167 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
1168 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
1169 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
1170 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
1171 dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C");
1172 dump_reg(AUD_CNTRL_ST2, "Audio Control State 2");
1173 dump_reg(AUD_CNTRL_ST3, "Audio Control State 3");
1174 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
1175 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
1176 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
1177 dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C");
1178 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
1179 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
1180 dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001181
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001182 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001183
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001184 dword = INREG(VIDEO_DIP_CTL_A);
1185 printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1186 printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1187 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1188 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1189 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1190 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1191 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1192 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1193 printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1194 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1195 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1196 printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001197
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001198 dword = INREG(VIDEO_DIP_CTL_B);
1199 printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1200 printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1201 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1202 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1203 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1204 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1205 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1206 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1207 printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1208 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1209 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1210 printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001211
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001212 dword = INREG(VIDEO_DIP_CTL_C);
1213 printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1214 printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1215 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1216 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1217 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1218 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1219 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1220 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1221 printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1222 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1223 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1224 printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001225
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001226 dword = INREG(AUD_VID_DID);
1227 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
1228 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001229
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001230 dword = INREG(AUD_RID);
1231 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1232 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1233 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1234 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001235
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001236 dword = INREG(HDMIB);
1237 printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1238 printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1239 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1240 printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1241 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1242 printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1243 printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1244 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1245 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1246 printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1247 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001248
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001249 dword = INREG(HDMIC);
1250 printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1251 printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1252 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1253 printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1254 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1255 printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1256 printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1257 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1258 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1259 printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1260 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001261
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001262 dword = INREG(HDMID);
1263 printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1264 printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1265 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1266 printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1267 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1268 printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1269 printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1270 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1271 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1272 printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1273 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001274
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001275 dword = INREG(DP_CTL_B);
1276 printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1277 printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1278 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1279 printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1280 printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1281 printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001282
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001283 dword = INREG(DP_CTL_C);
1284 printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1285 printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1286 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1287 printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1288 printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1289 printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001290
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001291 dword = INREG(DP_CTL_D);
1292 printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1293 printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1294 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1295 printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1296 printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1297 printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001298
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001299 dword = INREG(AUD_CONFIG_A);
1300 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1301 n_index_value[BIT(dword, 29)]);
1302 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1303 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1304 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1305 printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1306 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1307 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1308 dword = INREG(AUD_CONFIG_B);
1309 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1310 n_index_value[BIT(dword, 29)]);
1311 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1312 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1313 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1314 printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1315 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1316 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1317 dword = INREG(AUD_CONFIG_C);
1318 printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1319 n_index_value[BIT(dword, 29)]);
1320 printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1321 printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1322 printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1323 printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1324 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1325 printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001326
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001327 dword = INREG(AUD_CTS_ENABLE_A);
1328 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1329 printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1330 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1331 dword = INREG(AUD_CTS_ENABLE_B);
1332 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1333 printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1334 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1335 dword = INREG(AUD_CTS_ENABLE_C);
1336 printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1337 printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1338 printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001339
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001340 dword = INREG(AUD_MISC_CTRL_A);
1341 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1342 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1343 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1344 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1345 dword = INREG(AUD_MISC_CTRL_B);
1346 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1347 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1348 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1349 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1350 dword = INREG(AUD_MISC_CTRL_C);
1351 printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1352 printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1353 printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1354 printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001355
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001356 dword = INREG(AUD_PWRST);
1357 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1358 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1359 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1360 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1361 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1362 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1363 printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]);
1364 printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]);
1365 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1366 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1367 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1368 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1369 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1370 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001371
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001372 dword = INREG(AUD_PORT_EN_HD_CFG);
1373 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
1374 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
1375 printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2));
1376 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1377 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1378 printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1379 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1380 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1381 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1382 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1383 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1384 printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001385
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001386 dword = INREG(AUD_OUT_DIG_CNVT_A);
1387 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
1388 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1389 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1390 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
1391 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1392 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1393 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
1394 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1395 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1396 printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001397
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001398 dword = INREG(AUD_OUT_DIG_CNVT_B);
1399 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
1400 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1401 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1402 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
1403 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1404 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1405 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
1406 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1407 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1408 printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001409
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001410 dword = INREG(AUD_OUT_DIG_CNVT_C);
1411 printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1));
1412 printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1413 printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1414 printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4));
1415 printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1416 printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1417 printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7));
1418 printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1419 printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1420 printf("AUD_OUT_DIG_CNVT_C Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001421
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001422 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
1423 for (i = 0; i < 8; i++) {
1424 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
1425 dword = INREG(AUD_OUT_CH_STR);
1426 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1427 1 + BITS(dword, 3, 0),
1428 1 + BITS(dword, 7, 4),
1429 1 + BITS(dword, 15, 12),
1430 1 + BITS(dword, 23, 20));
1431 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08001432
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001433 dword = INREG(AUD_OUT_STR_DESC_A);
1434 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1435 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1436 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
1437 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1438 printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001439
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001440 dword = INREG(AUD_OUT_STR_DESC_B);
1441 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1442 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1443 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
1444 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1445 printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001446
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001447 dword = INREG(AUD_OUT_STR_DESC_C);
1448 printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1449 printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1450 printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n",
1451 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1452 printf("AUD_OUT_STR_DESC_C Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001453
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001454 dword = INREG(AUD_PINW_CONNLNG_SEL);
1455 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0));
1456 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8));
1457 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001458
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001459 dword = INREG(AUD_CNTL_ST_A);
1460 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1461 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1462 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1463 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1464 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1465 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
1466 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1467 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1468 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001469
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001470 dword = INREG(AUD_CNTL_ST_B);
1471 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1472 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1473 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1474 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1475 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1476 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
1477 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1478 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1479 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001480
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001481 dword = INREG(AUD_CNTL_ST_C);
1482 printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1483 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1484 printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1485 printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1486 printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1487 printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n",
1488 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1489 printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1490 printf("AUD_CNTL_ST_C ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001491
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001492 dword = INREG(AUD_CNTRL_ST2);
1493 printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1));
1494 printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
1495 printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5));
1496 printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1497 printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9));
1498 printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001499
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001500 dword = INREG(AUD_CNTRL_ST3);
1501 printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3));
1502 printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n",
1503 BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]);
1504 printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7));
1505 printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n",
1506 BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]);
1507 printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11));
1508 printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n",
1509 BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001510
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001511 dword = INREG(AUD_HDMIW_STATUS);
1512 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1513 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1514 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1515 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1516 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1517 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1518 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1519 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001520
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001521 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1522 dword = INREG(AUD_CNTL_ST_A);
1523 dword &= ~BITMASK(9, 5);
1524 OUTREG(AUD_CNTL_ST_A, dword);
1525 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1526 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1527 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001528
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001529 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1530 dword = INREG(AUD_CNTL_ST_B);
1531 dword &= ~BITMASK(9, 5);
1532 OUTREG(AUD_CNTL_ST_B, dword);
1533 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1534 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1535 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001536
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001537 printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t");
1538 dword = INREG(AUD_CNTL_ST_C);
1539 dword &= ~BITMASK(9, 5);
1540 OUTREG(AUD_CNTL_ST_C, dword);
1541 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1542 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C)));
1543 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001544
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001545 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1546 dword = INREG(AUD_CNTL_ST_A);
1547 dword &= ~BITMASK(20, 18);
1548 dword &= ~BITMASK(3, 0);
1549 OUTREG(AUD_CNTL_ST_A, dword);
1550 for (i = 0; i < 8; i++)
1551 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1552 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001553
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001554 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1555 dword = INREG(AUD_CNTL_ST_B);
1556 dword &= ~BITMASK(20, 18);
1557 dword &= ~BITMASK(3, 0);
1558 OUTREG(AUD_CNTL_ST_B, dword);
1559 for (i = 0; i < 8; i++)
1560 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1561 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001562
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001563 printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t");
1564 dword = INREG(AUD_CNTL_ST_C);
1565 dword &= ~BITMASK(20, 18);
1566 dword &= ~BITMASK(3, 0);
1567 OUTREG(AUD_CNTL_ST_C, dword);
1568 for (i = 0; i < 8; i++)
1569 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C)));
1570 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001571
1572}
1573
Wang Xingchaoc4077222012-08-15 16:13:38 +08001574#undef AUD_CONFIG_A
1575#undef AUD_MISC_CTRL_A
1576#undef AUD_VID_DID
1577#undef AUD_RID
1578#undef AUD_CTS_ENABLE_A
1579#undef AUD_PWRST
1580#undef AUD_HDMIW_HDMIEDID_A
1581#undef AUD_HDMIW_INFOFR_A
1582#undef AUD_PORT_EN_HD_CFG
1583#undef AUD_OUT_DIG_CNVT_A
1584#undef AUD_OUT_STR_DESC_A
1585#undef AUD_OUT_CH_STR
1586#undef AUD_PINW_CONNLNG_LIST
Mengdong Lindeba8682013-09-09 15:38:40 -04001587#undef AUD_PINW_CONNLNG_SEL
Wang Xingchaoc4077222012-08-15 16:13:38 +08001588#undef AUD_CNTL_ST_A
1589#undef AUD_HDMIW_STATUS
1590#undef AUD_CONFIG_B
1591#undef AUD_MISC_CTRL_B
1592#undef AUD_CTS_ENABLE_B
1593#undef AUD_HDMIW_HDMIEDID_B
1594#undef AUD_HDMIW_INFOFR_B
1595#undef AUD_OUT_DIG_CNVT_B
1596#undef AUD_OUT_STR_DESC_B
1597#undef AUD_CNTL_ST_B
1598#undef AUD_CONFIG_C
1599#undef AUD_MISC_CTRL_C
1600#undef AUD_CTS_ENABLE_C
1601#undef AUD_HDMIW_HDMIEDID_C
1602#undef AUD_HDMIW_INFOFR_C
1603#undef AUD_OUT_DIG_CNVT_C
1604#undef AUD_OUT_STR_DESC_C
1605
1606#undef VIDEO_DIP_CTL_A
1607#undef VIDEO_DIP_CTL_B
1608#undef VIDEO_DIP_CTL_C
1609#undef VIDEO_DIP_CTL_D
1610#undef VIDEO_DIP_DATA
1611
1612/*
1613 * Haswell registers
1614 */
1615
1616/* DisplayPort Transport Control */
1617#define DP_TP_CTL_A 0x64040
1618#define DP_TP_CTL_B 0x64140
1619#define DP_TP_CTL_C 0x64240
1620#define DP_TP_CTL_D 0x64340
1621#define DP_TP_CTL_E 0x64440
1622
1623/* DisplayPort Transport Status */
1624#define DP_TP_ST_A 0x64044
1625#define DP_TP_ST_B 0x64144
1626#define DP_TP_ST_C 0x64244
1627#define DP_TP_ST_D 0x64344
1628#define DP_TP_ST_E 0x64444
1629
Wang Xingchaoc4077222012-08-15 16:13:38 +08001630/* DDI Buffer Control */
1631#define DDI_BUF_CTL_A 0x64000
1632#define DDI_BUF_CTL_B 0x64100
1633#define DDI_BUF_CTL_C 0x64200
1634#define DDI_BUF_CTL_D 0x64300
1635#define DDI_BUF_CTL_E 0x64400
1636
1637/* DDI Buffer Translation */
1638#define DDI_BUF_TRANS_A 0x64e00
1639#define DDI_BUF_TRANS_B 0x64e60
1640#define DDI_BUF_TRANS_C 0x64ec0
1641#define DDI_BUF_TRANS_D 0x64f20
1642#define DDI_BUF_TRANS_E 0x64f80
1643
1644/* DDI Aux Channel */
1645#define DDI_AUX_CHANNEL_CTRL 0x64010
1646#define DDI_AUX_DATA 0x64014
1647#define DDI_AUX_TST 0x64028
1648
1649/* DDI CRC Control */
1650#define DDI_CRC_CTL_A 0x64050
1651#define DDI_CRC_CTL_B 0x64150
1652#define DDI_CRC_CTL_C 0x64250
1653#define DDI_CRC_CTL_D 0x64350
1654#define DDI_CRC_CTL_E 0x64450
1655
1656/* Pipe DDI Function Control */
1657#define PIPE_DDI_FUNC_CTL_A 0x60400
1658#define PIPE_DDI_FUNC_CTL_B 0x61400
1659#define PIPE_DDI_FUNC_CTL_C 0x62400
1660#define PIPE_DDI_FUNC_CTL_EDP 0x6F400
1661
1662/* Pipe Configuration */
1663#define PIPE_CONF_A 0x70008
1664#define PIPE_CONF_B 0x71008
1665#define PIPE_CONF_C 0x72008
1666#define PIPE_CONF_EDP 0x7F008
1667
1668/* Audio registers */
Mengdong Lindeba8682013-09-09 15:38:40 -04001669#define AUD_TCA_CONFIG 0x65000
1670#define AUD_TCB_CONFIG 0x65100
1671#define AUD_TCC_CONFIG 0x65200
1672#define AUD_C1_MISC_CTRL 0x65010
1673#define AUD_C2_MISC_CTRL 0x65110
1674#define AUD_C3_MISC_CTRL 0x65210
1675#define AUD_VID_DID 0x65020
1676#define AUD_RID 0x65024
1677#define AUD_TCA_M_CTS_ENABLE 0x65028
1678#define AUD_TCB_M_CTS_ENABLE 0x65128
1679#define AUD_TCC_M_CTS_ENABLE 0x65228
1680#define AUD_PWRST 0x6504C
1681#define AUD_TCA_EDID_DATA 0x65050
1682#define AUD_TCB_EDID_DATA 0x65150
1683#define AUD_TCC_EDID_DATA 0x65250
1684#define AUD_TCA_INFOFR 0x65054
1685#define AUD_TCB_INFOFR 0x65154
1686#define AUD_TCC_INFOFR 0x65254
1687#define AUD_PIPE_CONV_CFG 0x6507C
1688#define AUD_C1_DIG_CNVT 0x65080
1689#define AUD_C2_DIG_CNVT 0x65180
1690#define AUD_C3_DIG_CNVT 0x65280
1691#define AUD_C1_STR_DESC 0x65084
1692#define AUD_C2_STR_DESC 0x65184
1693#define AUD_C3_STR_DESC 0x65284
1694#define AUD_OUT_CHAN_MAP 0x65088
1695#define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8
1696#define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8
1697#define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8
Wang Xingchaoc4077222012-08-15 16:13:38 +08001698#define AUD_PIPE_CONN_SEL_CTRL 0x650AC
Mengdong Lindeba8682013-09-09 15:38:40 -04001699#define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4
1700#define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4
1701#define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4
1702#define AUD_PIN_ELD_CP_VLD 0x650C0
1703#define AUD_HDMI_FIFO_STATUS 0x650D4
Wang Xingchaoc4077222012-08-15 16:13:38 +08001704
Mengdong Lin85357202013-08-13 00:21:57 -04001705/* Audio debug registers */
1706#define AUD_ICOI 0x65f00
1707#define AUD_IRII 0x65f04
1708#define AUD_ICS 0x65f08
Mengdong Linf075c3c2013-08-13 00:22:14 -04001709#define AUD_CHICKENBIT_REG 0x65f10
Mengdong Lin97e5cf62013-08-13 00:22:24 -04001710#define AUD_DP_DIP_STATUS 0x65f20
Mengdong Line35126d2013-08-13 00:22:33 -04001711#define AUD_TCA_M_CTS 0x65f44
1712#define AUD_TCB_M_CTS 0x65f54
1713#define AUD_TCC_M_CTS 0x65f64
Mengdong Lin85357202013-08-13 00:21:57 -04001714
Wang Xingchaoc4077222012-08-15 16:13:38 +08001715/* Video DIP Control */
1716#define VIDEO_DIP_CTL_A 0x60200
1717#define VIDEO_DIP_CTL_B 0x61200
1718#define VIDEO_DIP_CTL_C 0x62200
1719#define VIDEO_DIP_CTL_D 0x63200
1720
1721#define VIDEO_DIP_DATA 0x60220
1722#define VIDEO_DIP_ECC 0x60240
1723
1724#define AUD_DP_DIP_STATUS 0x65f20
1725
Mengdong Lindeba8682013-09-09 15:38:40 -04001726#define MAX_PREFIX_SIZE 128
1727
Mengdong Lindeba8682013-09-09 15:38:40 -04001728static void dump_ddi_buf_ctl(int port)
1729{
1730 uint32_t dword;
1731
1732 dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100);
1733 printf("DDI %c Buffer control\n", 'A' + port - PORT_A);
1734 printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1),
1735 OPNAME(dp_port_width, BITS(dword, 3, 1)));
1736 printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31));
1737}
1738
1739static void dump_ddi_func_ctl(int pipe)
1740{
1741 uint32_t dword;
1742
1743 dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000);
1744 printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A);
1745 printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20),
1746 OPNAME(bits_per_color, BITS(dword, 22, 20)));
1747 printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24),
1748 OPNAME(ddi_mode, BITS(dword, 26, 24)));
1749 printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28),
1750 OPNAME(trans_to_port_sel, BITS(dword, 30, 28)));
1751 printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31));
1752}
1753
1754static void dump_aud_transcoder_config(int transcoder)
1755{
1756 uint32_t dword;
1757 char prefix[MAX_PREFIX_SIZE];
1758
1759 dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100);
1760 sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A);
1761
1762 printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1763 printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4));
1764 printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16),
1765 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1766 printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20));
1767 printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28));
1768 printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29),
1769 OPNAME(n_index_value, BIT(dword, 29)));
1770}
1771
1772static void dump_aud_misc_control(int converter)
1773{
1774 uint32_t dword;
1775 char prefix[MAX_PREFIX_SIZE];
1776
1777 dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100);
1778 sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1);
1779
1780 printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1781 printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2));
1782 printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4));
1783 printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8));
1784}
1785
1786static void dump_aud_vendor_device_id(void)
1787{
1788 uint32_t dword;
1789
1790 dword = INREG(AUD_VID_DID);
1791 printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0));
1792 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16));
1793}
1794
1795static void dump_aud_revision_id(void)
1796{
1797 uint32_t dword;
1798
1799 dword = INREG(AUD_RID);
1800 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
1801 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1802 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1803 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1804}
1805
1806static void dump_aud_m_cts_enable(int transcoder)
1807{
1808 uint32_t dword;
1809 char prefix[MAX_PREFIX_SIZE];
1810
1811 dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100);
1812 sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A);
1813
1814 printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0));
1815 printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20));
1816 printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M");
1817}
1818
1819static void dump_aud_power_state(void)
1820{
1821 uint32_t dword;
1822
1823 dword = INREG(AUD_PWRST);
1824 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1825 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1826 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1827 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1828 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
1829 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1830 printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1831 printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1832 printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1833 printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1834 printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]);
1835 printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]);
1836 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1837 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1838}
1839
1840static void dump_aud_edid_data(int transcoder)
1841{
1842 uint32_t dword;
1843 int i;
1844 int offset = (transcoder - TRANSCODER_A) * 0x100;
1845
1846 printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A);
1847 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1848 dword &= ~BITMASK(9, 5);
1849 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1850 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1851 printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset)));
1852 printf("\n");
1853}
1854
1855static void dump_aud_infoframe(int transcoder)
1856{
1857 uint32_t dword;
1858 int i;
1859 int offset = (transcoder - TRANSCODER_A) * 0x100;
1860
1861 printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A);
1862 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1863 dword &= ~BITMASK(20, 18);
1864 dword &= ~BITMASK(3, 0);
1865 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1866 for (i = 0; i < 8; i++)
1867 printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset)));
1868 printf("\n");
1869}
1870
1871static void dump_aud_pipe_conv_cfg(void)
1872{
1873 uint32_t dword;
1874
1875 dword = INREG(AUD_PIPE_CONV_CFG);
1876 printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0));
1877 printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1));
1878 printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2));
1879 printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1880 printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1881 printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1882 printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1883 printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1884 printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1885 printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1886 printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1887 printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
1888}
1889
1890static void dump_aud_dig_cnvt(int converter)
1891{
1892 uint32_t dword;
1893 char prefix[MAX_PREFIX_SIZE];
1894
1895 dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100);
1896 sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1);
1897
1898 printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1899 printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2));
1900 printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1901 printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4));
1902 printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5));
1903 printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6));
1904 printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7));
1905 printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8));
1906 printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16));
1907 printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20));
1908}
1909
1910static void dump_aud_str_desc(int converter)
1911{
1912 uint32_t dword;
1913 char prefix[MAX_PREFIX_SIZE];
1914 uint32_t rate;
1915
1916 dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100);
1917 sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1);
1918
1919 printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0));
1920 printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4),
1921 OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1922
1923 printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8),
1924 OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8)));
1925 printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11),
1926 OPNAME(sample_base_rate_mult, BITS(dword, 13, 11)));
1927 printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14),
1928 OPNAME(sample_base_rate, BIT(dword, 14)));
1929 rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1)
1930 /(BITS(dword, 10, 8) + 1);
1931 printf("=> Sample Rate %d Hz\n", rate);
1932
1933 printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1);
1934}
1935
1936static void dump_aud_out_chan_map(void)
1937{
1938 uint32_t dword;
1939 int i;
1940
1941 printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n");
1942 for (i = 0; i < 8; i++) {
1943 OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16));
1944 dword = INREG(AUD_OUT_CHAN_MAP);
1945 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1946 1 + BITS(dword, 3, 0),
1947 1 + BITS(dword, 7, 4),
1948 1 + BITS(dword, 15, 12),
1949 1 + BITS(dword, 23, 20));
1950 }
1951}
1952
1953static void dump_aud_connect_list_entry_length(int transcoder)
1954{
1955 uint32_t dword;
1956 char prefix[MAX_PREFIX_SIZE];
1957
1958 dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100);
1959 sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A);
1960
1961 printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0));
1962 printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7),
1963 OPNAME(connect_list_form, BIT(dword, 7)));
1964 printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8));
1965}
1966
1967static void dump_aud_connect_select_ctrl(void)
1968{
1969 uint32_t dword;
1970
1971 dword = INREG(AUD_PIPE_CONN_SEL_CTRL);
1972 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0));
1973 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8));
1974 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16));
1975}
1976
1977static void dump_aud_dip_eld_ctrl_st(int transcoder)
1978{
1979 uint32_t dword;
1980 int offset = (transcoder - TRANSCODER_A) * 0x100;
1981
1982 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1983 printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A);
1984
1985 printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4));
1986 printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10));
1987 printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16),
1988 dip_trans[BITS(dword, 17, 16)]);
1989 printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18),
1990 dip_index[BITS(dword, 20, 18)]);
1991 printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21),
1992 dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]);
1993 printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29),
1994 dip_port[BITS(dword, 30, 29)]);
1995 printf("\n");
1996}
1997
1998static void dump_aud_eld_cp_vld(void)
1999{
2000 uint32_t dword;
2001
2002 dword = INREG(AUD_PIN_ELD_CP_VLD);
2003 printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0));
2004 printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1));
2005 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2));
2006 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3));
2007 printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4));
2008 printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5));
2009 printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6));
2010 printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7));
2011 printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8));
2012 printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9));
2013 printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10));
2014 printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11));
2015}
2016
2017static void dump_hdmi_fifo_status(void)
2018{
2019 uint32_t dword;
2020
2021 dword = INREG(AUD_HDMI_FIFO_STATUS);
2022 printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
2023 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
2024 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
2025 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
2026 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
2027 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
2028 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
2029}
Wang Xingchaoc4077222012-08-15 16:13:38 +08002030
Mengdong Linf075c3c2013-08-13 00:22:14 -04002031static void parse_bdw_audio_chicken_bit_reg(uint32_t dword)
2032{
2033 printf("\t");
2034 printf("%s\n\t", OPNAME(vanilla_dp12_en, BIT(dword, 31)));
2035 printf("%s\n\t", OPNAME(vanilla_3_widgets_en, BIT(dword, 30)));
2036 printf("%s\n\t", OPNAME(block_audio, BIT(dword, 10)));
2037 printf("%s\n\t", OPNAME(dis_eld_valid_pulse_trans, BIT(dword, 9)));
2038 printf("%s\n\t", OPNAME(dis_pd_pulse_trans, BIT(dword, 8)));
2039 printf("%s\n\t", OPNAME(dis_ts_delta_err, BIT(dword, 7)));
2040 printf("%s\n\t", OPNAME(dis_ts_fix_dp_hbr, BIT(dword, 6)));
2041 printf("%s\n\t", OPNAME(pattern_gen_8_ch_en, BIT(dword, 5)));
2042 printf("%s\n\t", OPNAME(pattern_gen_2_ch_en, BIT(dword, 4)));
2043 printf("%s\n\t", OPNAME(fabric_32_44_dis, BIT(dword, 3)));
2044 printf("%s\n\t", OPNAME(epss_dis, BIT(dword, 2)));
2045 printf("%s\n\t", OPNAME(ts_test_mode, BIT(dword, 1)));
2046 printf("%s\n", OPNAME(en_mmio_program, BIT(dword, 0)));
2047}
2048
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002049/* Dump audio registers for Haswell and its successors (eg. Broadwell).
2050 * Their register layout are same in the north display engine.
2051 */
2052static void dump_hsw_plus(void)
Wang Xingchaoc4077222012-08-15 16:13:38 +08002053{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002054 uint32_t dword;
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002055 int i;
Wang Xingchaoc4077222012-08-15 16:13:38 +08002056
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002057 /* HSW DDI Buffer */
2058 dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A");
2059 dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B");
2060 dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C");
2061 dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D");
2062 dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002063
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002064 /* HSW Pipe Function */
2065 dump_reg(PIPE_CONF_A, "PIPE Configuration A");
2066 dump_reg(PIPE_CONF_B, "PIPE Configuration B");
2067 dump_reg(PIPE_CONF_C, "PIPE Configuration C");
2068 dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002069
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002070 dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A");
2071 dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B");
2072 dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C");
2073 dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002074
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002075 /* HSW Display port */
2076 dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control");
2077 dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control");
2078 dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control");
2079 dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control");
2080 dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002081
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002082 dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status");
2083 dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status");
2084 dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status");
2085 dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status");
2086 dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002087
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002088 /* HSW North Display Audio */
Mengdong Lindeba8682013-09-09 15:38:40 -04002089 dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A");
2090 dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B");
2091 dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C");
2092 dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control");
2093 dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control");
2094 dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002095 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
Mengdong Lindeba8682013-09-09 15:38:40 -04002096 dump_reg(AUD_RID, "Audio Revision ID");
2097 dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A");
2098 dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B");
2099 dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002100 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
Mengdong Lindeba8682013-09-09 15:38:40 -04002101 dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A");
2102 dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B");
2103 dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C");
2104 dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A");
2105 dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B");
2106 dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C");
2107 dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs");
2108 dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1");
2109 dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2");
2110 dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3");
2111 dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1");
2112 dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2");
2113 dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002114 dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping");
Mengdong Lindeba8682013-09-09 15:38:40 -04002115 dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A");
2116 dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B");
2117 dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002118 dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control");
Mengdong Lindeba8682013-09-09 15:38:40 -04002119 dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A");
2120 dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B");
2121 dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C");
2122 dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status");
2123 dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002124
Mengdong Lin85357202013-08-13 00:21:57 -04002125 /* Audio debug registers */
2126 dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface");
2127 dump_reg(AUD_IRII, "Audio Immediate Response Input Interface");
2128 dump_reg(AUD_ICS, "Audio Immediate Command Status");
Mengdong Linf075c3c2013-08-13 00:22:14 -04002129 dump_reg(AUD_CHICKENBIT_REG, "Audio Chicken Bit Register");
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002130 dump_reg(AUD_DP_DIP_STATUS, "Audio DP and DIP FIFO Debug Status");
Mengdong Line35126d2013-08-13 00:22:33 -04002131 dump_reg(AUD_TCA_M_CTS, "Audio M CTS Read Back Transcoder A");
2132 dump_reg(AUD_TCB_M_CTS, "Audio M CTS Read Back Transcoder B");
2133 dump_reg(AUD_TCC_M_CTS, "Audio M CTS Read Back Transcoder C");
Mengdong Lin85357202013-08-13 00:21:57 -04002134
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002135 printf("\nDetails:\n\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002136
Mengdong Lindeba8682013-09-09 15:38:40 -04002137 dump_ddi_buf_ctl(PORT_A);
2138 dump_ddi_buf_ctl(PORT_B);
2139 dump_ddi_buf_ctl(PORT_C);
2140 dump_ddi_buf_ctl(PORT_D);
2141 dump_ddi_buf_ctl(PORT_E);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002142
Mengdong Lindeba8682013-09-09 15:38:40 -04002143 dump_ddi_func_ctl(PIPE_A);
2144 dump_ddi_func_ctl(PIPE_B);
2145 dump_ddi_func_ctl(PIPE_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002146
Mengdong Lindeba8682013-09-09 15:38:40 -04002147 /* audio configuration - details */
2148 dump_aud_transcoder_config(TRANSCODER_A);
2149 dump_aud_transcoder_config(TRANSCODER_B);
2150 dump_aud_transcoder_config(TRANSCODER_C);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002151
Mengdong Lindeba8682013-09-09 15:38:40 -04002152 dump_aud_misc_control(CONVERTER_1);
2153 dump_aud_misc_control(CONVERTER_2);
2154 dump_aud_misc_control(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002155
Mengdong Lindeba8682013-09-09 15:38:40 -04002156 dump_aud_vendor_device_id();
2157 dump_aud_revision_id();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002158
Mengdong Lindeba8682013-09-09 15:38:40 -04002159 dump_aud_m_cts_enable(TRANSCODER_A);
2160 dump_aud_m_cts_enable(TRANSCODER_B);
2161 dump_aud_m_cts_enable(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002162
Mengdong Lindeba8682013-09-09 15:38:40 -04002163 dump_aud_power_state();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002164
Mengdong Lindeba8682013-09-09 15:38:40 -04002165 dump_aud_edid_data(TRANSCODER_A);
2166 dump_aud_edid_data(TRANSCODER_B);
2167 dump_aud_edid_data(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002168
Mengdong Lindeba8682013-09-09 15:38:40 -04002169 dump_aud_infoframe(TRANSCODER_A);
2170 dump_aud_infoframe(TRANSCODER_B);
2171 dump_aud_infoframe(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002172
Mengdong Lindeba8682013-09-09 15:38:40 -04002173 dump_aud_pipe_conv_cfg();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002174
Mengdong Lindeba8682013-09-09 15:38:40 -04002175 dump_aud_dig_cnvt(CONVERTER_1);
2176 dump_aud_dig_cnvt(CONVERTER_2);
2177 dump_aud_dig_cnvt(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002178
Mengdong Lindeba8682013-09-09 15:38:40 -04002179 dump_aud_str_desc(CONVERTER_1);
2180 dump_aud_str_desc(CONVERTER_2);
2181 dump_aud_str_desc(CONVERTER_3);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002182
Mengdong Lindeba8682013-09-09 15:38:40 -04002183 dump_aud_out_chan_map();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002184
Mengdong Lindeba8682013-09-09 15:38:40 -04002185 dump_aud_connect_list_entry_length(TRANSCODER_A);
2186 dump_aud_connect_list_entry_length(TRANSCODER_B);
2187 dump_aud_connect_list_entry_length(TRANSCODER_C);
2188 dump_aud_connect_select_ctrl();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002189
Mengdong Lindeba8682013-09-09 15:38:40 -04002190 dump_aud_dip_eld_ctrl_st(TRANSCODER_A);
2191 dump_aud_dip_eld_ctrl_st(TRANSCODER_B);
2192 dump_aud_dip_eld_ctrl_st(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002193
Mengdong Lindeba8682013-09-09 15:38:40 -04002194 dump_aud_eld_cp_vld();
2195 dump_hdmi_fifo_status();
Mengdong Lin85357202013-08-13 00:21:57 -04002196
2197 printf("\nDetails:\n\n");
2198
2199 printf("IRV [%1lx] %s\t", BIT(dword, 1),
2200 OPNAME(immed_result_valid, BIT(dword, 1)));
2201 printf("ICB [%1lx] %s\n", BIT(dword, 1),
2202 OPNAME(immed_cmd_busy, BIT(dword, 0)));
Mengdong Linf075c3c2013-08-13 00:22:14 -04002203
2204 dword = INREG(AUD_CHICKENBIT_REG);
2205 printf("AUD_CHICKENBIT_REG Audio Chicken Bits: %08x\n", dword);
2206 if (IS_BROADWELL(devid))
2207 parse_bdw_audio_chicken_bit_reg(dword);
2208
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002209 dword = INREG(AUD_DP_DIP_STATUS);
2210 printf("AUD_DP_DIP_STATUS Audio DP & DIP FIFO Status: %08x\n\t", dword);
2211 for (i = 31; i >= 0; i--)
2212 if (BIT(dword, i))
2213 printf("%s\n\t", audio_dp_dip_status[i]);
2214 printf("\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002215}
2216
Wu Fengguang020abdb2010-04-19 13:13:06 +08002217int main(int argc, char **argv)
2218{
2219 struct pci_device *pci_dev;
2220
2221 pci_dev = intel_get_pci_device();
2222 devid = pci_dev->device_id; /* XXX not true when mapping! */
2223
2224 do_self_tests();
2225
2226 if (argc == 2)
2227 intel_map_file(argv[1]);
2228 else
2229 intel_get_mmio(pci_dev);
2230
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002231 if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
2232 printf("%s audio registers:\n\n",
2233 IS_BROADWELL(devid) ? "Broadwell" : "Haswell");
2234 dump_hsw_plus();
2235 } else if (IS_GEN6(devid) || IS_GEN7(devid)
2236 || getenv("HAS_PCH_SPLIT")) {
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002237 printf("%s audio registers:\n\n",
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002238 IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002239 intel_check_pch();
2240 dump_cpt();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002241 } else if (IS_GEN5(devid)) {
2242 printf("Ironlake audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002243 dump_ironlake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002244 } else if (IS_G4X(devid)) {
2245 printf("G45 audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002246 dump_eaglelake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002247 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08002248
2249 return 0;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08002250}