blob: ffd82889304e84c0106ed2d302518f763734ad8b [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
Mengdong Lin1803f1e2014-02-28 16:18:11 -050043#define IS_HASWELL_PLUS(devid) (IS_HASWELL(devid) || IS_BROADWELL(devid))
44
Wu Fengguang020abdb2010-04-19 13:13:06 +080045#define BITSTO(n) (n >= sizeof(long) * 8 ? ~0 : (1UL << (n)) - 1)
46#define BITMASK(high, low) (BITSTO(high+1) & ~BITSTO(low))
47#define BITS(reg, high, low) (((reg) & (BITMASK(high, low))) >> (low))
48#define BIT(reg, n) BITS(reg, n, n)
49
50#define min_t(type, x, y) ({ \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040051 type __min1 = (x); \
52 type __min2 = (y); \
53 __min1 < __min2 ? __min1 : __min2; })
Wu Fengguang020abdb2010-04-19 13:13:06 +080054
55#define OPNAME(names, index) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040056 names[min_t(unsigned int, index, ARRAY_SIZE(names) - 1)]
Wu Fengguang020abdb2010-04-19 13:13:06 +080057
Mengdong Lin92d31972014-03-03 11:04:39 -050058#define set_aud_reg_base(base) (aud_reg_base = (base))
59
60#define set_reg_base(base, audio_offset) \
61 do { \
62 disp_reg_base = (base); \
63 set_aud_reg_base((base) + (audio_offset)); \
64 } while (0)
65
Wu Fengguang020abdb2010-04-19 13:13:06 +080066#define dump_reg(reg, desc) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040067 do { \
68 dword = INREG(reg); \
69 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
70 } while (0)
Wu Fengguang020abdb2010-04-19 13:13:06 +080071
Mengdong Lin92d31972014-03-03 11:04:39 -050072#define dump_disp_reg(reg, desc) \
73 do { \
74 dword = INREG(disp_reg_base + reg); \
75 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
76 } while (0)
77
78#define dump_aud_reg(reg, desc) \
79 do { \
80 dword = INREG(aud_reg_base + reg); \
81 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
82 } while (0)
83
84#define read_aud_reg(reg) INREG(aud_reg_base + (reg))
Wu Fengguang020abdb2010-04-19 13:13:06 +080085
Mengdong Lindeba8682013-09-09 15:38:40 -040086static const char * const pixel_clock[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080087 [0] = "25.2 / 1.001 MHz",
88 [1] = "25.2 MHz",
89 [2] = "27 MHz",
90 [3] = "27 * 1.001 MHz",
91 [4] = "54 MHz",
92 [5] = "54 * 1.001 MHz",
93 [6] = "74.25 / 1.001 MHz",
94 [7] = "74.25 MHz",
95 [8] = "148.5 / 1.001 MHz",
96 [9] = "148.5 MHz",
97 [10] = "Reserved",
98};
99
Mengdong Lindeba8682013-09-09 15:38:40 -0400100static const char * const power_state[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800101 [0] = "D0",
102 [1] = "D1",
103 [2] = "D2",
104 [3] = "D3",
105};
106
Mengdong Lindeba8682013-09-09 15:38:40 -0400107static const char * const stream_type[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800108 [0] = "default samples",
109 [1] = "one bit stream",
110 [2] = "DST stream",
111 [3] = "MLP stream",
112 [4] = "Reserved",
113};
114
Mengdong Lindeba8682013-09-09 15:38:40 -0400115static const char * const dip_port[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800116 [0] = "Reserved",
117 [1] = "Digital Port B",
118 [2] = "Digital Port C",
119 [3] = "Digital Port D",
120};
121
Mengdong Lindeba8682013-09-09 15:38:40 -0400122static const char * const dip_type[] = {
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400123 [0] = "Audio DIP Disabled",
124 [1] = "Audio DIP Enabled",
Wang Xingchaoc4077222012-08-15 16:13:38 +0800125};
126
Mengdong Lindeba8682013-09-09 15:38:40 -0400127static const char * const dip_gen1_state[] = {
128 [0] = "Generic 1 (ACP) DIP Disabled",
129 [1] = "Generic 1 (ACP) DIP Enabled",
130};
131
132static const char * const dip_gen2_state[] = {
133 [0] = "Generic 2 DIP Disabled",
134 [1] = "Generic 2 DIP Enabled",
135};
136
137static const char * const dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800138 [0] = "Audio DIP",
139 [1] = "ACP DIP",
140 [2] = "ISRC1 DIP",
141 [3] = "ISRC2 DIP",
142 [4] = "Reserved",
143};
144
Mengdong Lindeba8682013-09-09 15:38:40 -0400145static const char * const dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800146 [0] = "disabled",
147 [1] = "reserved",
148 [2] = "send once",
149 [3] = "best effort",
150};
151
Mengdong Lindeba8682013-09-09 15:38:40 -0400152static const char * const video_dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800153 [0] = "AVI DIP",
154 [1] = "Vendor-specific DIP",
Wu Fengguangf3f84bb2011-11-12 11:12:55 +0800155 [2] = "Gamut Metadata DIP",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800156 [3] = "Source Product Description DIP",
157};
158
Mengdong Lindeba8682013-09-09 15:38:40 -0400159static const char * const video_dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800160 [0] = "send once",
161 [1] = "send every vsync",
162 [2] = "send at least every other vsync",
163 [3] = "reserved",
164};
165
Mengdong Lindeba8682013-09-09 15:38:40 -0400166static const char * const trans_to_port_sel[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800167 [0] = "no port",
168 [1] = "Digital Port B",
Wang Xingchaof9a24812012-08-15 16:13:37 +0800169 [2] = "Digital Port C",
170 [3] = "Digital Port D",
171 [4] = "reserved",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800172 [5] = "reserved",
173 [6] = "reserved",
174 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800175};
176
Mengdong Lindeba8682013-09-09 15:38:40 -0400177static const char * const ddi_mode[] = {
Wang Xingchaoc4077222012-08-15 16:13:38 +0800178 [0] = "HDMI mode",
179 [1] = "DVI mode",
180 [2] = "DP SST mode",
181 [3] = "DP MST mode",
182 [4] = "DP FDI mode",
183 [5] = "reserved",
184 [6] = "reserved",
185 [7] = "reserved",
186};
187
Mengdong Lindeba8682013-09-09 15:38:40 -0400188static const char * const bits_per_color[] = {
189 [0] = "8 bpc",
190 [1] = "10 bpc",
191 [2] = "6 bpc",
192 [3] = "12 bpc",
193 [4] = "reserved",
194 [5] = "reserved",
195 [6] = "reserved",
196 [7] = "reserved",
197};
198
199static const char * const transcoder_select[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800200 [0] = "Transcoder A",
201 [1] = "Transcoder B",
202 [2] = "Transcoder C",
203 [3] = "reserved",
204};
205
Mengdong Lindeba8682013-09-09 15:38:40 -0400206static const char * const dp_port_width[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800207 [0] = "x1 mode",
208 [1] = "x2 mode",
Wu Fengguangcf4c12f2011-11-12 11:12:46 +0800209 [2] = "reserved",
210 [3] = "x4 mode",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800211 [4] = "reserved",
212 [5] = "reserved",
213 [6] = "reserved",
214 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800215};
216
Mengdong Lindeba8682013-09-09 15:38:40 -0400217static const char * const sample_base_rate[] = {
218 [0] = "48 kHz",
219 [1] = "44.1 kHz",
220};
221
222static const char * const sample_base_rate_mult[] = {
223 [0] = "x1 (48 kHz, 44.1 kHz or less)",
224 [1] = "x2 (96 kHz, 88.2 kHz, 32 kHz)",
225 [2] = "x3 (144 kHz)",
226 [3] = "x4 (192 kHz, 176.4 kHz)",
227 [4] = "Reserved",
228};
229
230static const char * const sample_base_rate_divisor[] = {
231 [0] = "Divided by 1 (48 kHz, 44.1 kHz)",
232 [1] = "Divided by 2 (24 kHz, 22.05 kHz)",
233 [2] = "Divided by 3 (16 kHz, 32 kHz)",
234 [3] = "Divided by 4 (11.025 kHz)",
235 [4] = "Divided by 5 (9.6 kHz)",
236 [5] = "Divided by 6 (8 kHz)",
237 [6] = "Divided by 7",
238 [7] = "Divided by 8 (6 kHz)",
239};
240
241static const char * const connect_list_form[] = {
242 [0] = "Short Form",
243 [1] = "Long Form",
244};
245
246
247static const char * const bits_per_sample[] = {
Wu Fengguang12861a92011-11-12 11:12:47 +0800248 [0] = "reserved",
249 [1] = "16 bits",
250 [2] = "24 bits",
251 [3] = "32 bits",
252 [4] = "20 bits",
253 [5] = "reserved",
254};
255
Mengdong Lindeba8682013-09-09 15:38:40 -0400256static const char * const sdvo_hdmi_encoding[] = {
Wu Fengguangee949582011-11-12 11:12:53 +0800257 [0] = "SDVO",
258 [1] = "reserved",
259 [2] = "TMDS",
260 [3] = "reserved",
261};
Wu Fengguang12861a92011-11-12 11:12:47 +0800262
Mengdong Lindeba8682013-09-09 15:38:40 -0400263static const char * const n_index_value[] = {
Wu Fengguange64abe52012-01-17 07:19:24 +0800264 [0] = "HDMI",
265 [1] = "DisplayPort",
266};
267
Mengdong Lin85357202013-08-13 00:21:57 -0400268static const char * const immed_result_valid[] = {
269 [0] = "No immediate response is available",
270 [1] = "Immediate response is available",
271};
272
273static const char * const immed_cmd_busy[] = {
274 [0] = "Can accept an immediate command",
275 [1] = "Immediate command is available",
276};
277
Mengdong Linf075c3c2013-08-13 00:22:14 -0400278static const char * const vanilla_dp12_en[] = {
279 [0] = "DP 1.2 features are disabled",
280 [1] = "DP 1.2 features are enabled",
281};
282
283static const char * const vanilla_3_widgets_en[] = {
284 [0] = "2nd & 3rd pin/convertor widgets are disabled",
285 [1] = "All three pin/convertor widgets are enabled",
286};
287
288static const char * const block_audio[] = {
289 [0] = "Allow audio data to reach the port",
290 [1] = "Block audio data from reaching the port",
291};
292
293static const char * const dis_eld_valid_pulse_trans[] = {
294 [0] = "Enable ELD valid pulse transition when unsol is disabled",
295 [1] = "Disable ELD valid pulse transition when unsol is disabled",
296};
297
298static const char * const dis_pd_pulse_trans[] = {
299 [0] = "Enable Presense Detect pulse transition when unsol is disabled",
300 [1] = "Disable Presense Detect pulse transition when unsol is disabled",
301};
302
303static const char * const dis_ts_delta_err[] = {
304 [0] = "Enable timestamp delta error for 32/44 KHz",
305 [1] = "Disable timestamp delta error for 32/44 KHz",
306};
307
308static const char * const dis_ts_fix_dp_hbr[] = {
309 [0] = "Enable timestamp fix for DP HBR",
310 [1] = "Disable timestamp fix for DP HBR",
311};
312
313static const char * const pattern_gen_8_ch_en[] = {
314 [0] = "Disable 8-channel pattern generator",
315 [1] = "Enable 8-channel pattern generator",
316};
317
318static const char * const pattern_gen_2_ch_en[] = {
319 [0] = "Disable 2-channel pattern generator",
320 [1] = "Enable 2-channel pattern generator",
321};
322
323static const char * const fabric_32_44_dis[] = {
324 [0] = "Allow sample fabrication for 32/44 KHz",
325 [1] = "Disable sample fabrication for 32/44 KHz",
326};
327
328static const char * const epss_dis[] = {
329 [0] = "Allow audio EPSS",
330 [1] = "Disable audio EPSS",
331};
332
333static const char * const ts_test_mode[] = {
334 [0] = "Default time stamp mode",
335 [1] = "Audio time stamp test mode for audio only feature",
336};
337
338static const char * const en_mmio_program[] = {
339 [0] = "Programming by HD-Audio Azalia",
340 [1] = "Programming by MMIO debug registers",
341};
342
Mengdong Lin97e5cf62013-08-13 00:22:24 -0400343static const char * const audio_dp_dip_status[] = {
344 [0] = "audfc dp fifo full",
345 [1] = "audfc dp fifo empty",
346 [2] = "audfc dp fifo overrun",
347 [3] = "audfc dip fifo full",
348 [4] = "audfc dp fifo empty cd",
349 [5] = "audfb dp fifo full",
350 [6] = "audfb dp fifo empty",
351 [7] = "audfb dp fifo overrun",
352 [8] = "audfb dip fifo full",
353 [9] = "audfb dp fifo empty cd",
354 [10] = "audfa dp fifo full",
355 [11] = "audfa dp fifo empty",
356 [12] = "audfa dp fifo overrun",
357 [13] = "audfa dip fifo full",
358 [14] = "audfa dp fifo empty cd",
359 [15] = "Pipe c audio overflow",
360 [16] = "Pipe b audio overflow",
361 [17] = "Pipe a audio overflow",
362 [31] = 0,
363};
364
Mengdong Lined386662014-02-28 13:25:27 -0500365#undef TRANSCODER_A
366#undef TRANSCODER_B
367#undef TRANSCODER_C
368
369enum {
370 TRANSCODER_A = 0,
371 TRANSCODER_B,
372 TRANSCODER_C,
373};
374
375enum {
376 PIPE_A = 0,
377 PIPE_B,
378 PIPE_C,
379};
380
381enum {
382 PORT_A = 0,
383 PORT_B,
384 PORT_C,
385 PORT_D,
386 PORT_E,
387};
388
389enum {
390 CONVERTER_1 = 0,
391 CONVERTER_2,
392 CONVERTER_3,
393};
394
Wu Fengguang020abdb2010-04-19 13:13:06 +0800395static void do_self_tests(void)
396{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400397 if (BIT(1, 0) != 1)
398 exit(1);
399 if (BIT(0x80000000, 31) != 1)
400 exit(2);
401 if (BITS(0xc0000000, 31, 30) != 3)
402 exit(3);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800403}
404
405/*
406 * EagleLake registers
407 */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800408#define AUD_CONFIG 0x62000
409#define AUD_DEBUG 0x62010
410#define AUD_VID_DID 0x62020
411#define AUD_RID 0x62024
412#define AUD_SUBN_CNT 0x62028
413#define AUD_FUNC_GRP 0x62040
414#define AUD_SUBN_CNT2 0x62044
415#define AUD_GRP_CAP 0x62048
416#define AUD_PWRST 0x6204c
417#define AUD_SUPPWR 0x62050
418#define AUD_SID 0x62054
419#define AUD_OUT_CWCAP 0x62070
420#define AUD_OUT_PCMSIZE 0x62074
421#define AUD_OUT_STR 0x62078
422#define AUD_OUT_DIG_CNVT 0x6207c
423#define AUD_OUT_CH_STR 0x62080
424#define AUD_OUT_STR_DESC 0x62084
425#define AUD_PINW_CAP 0x620a0
426#define AUD_PIN_CAP 0x620a4
427#define AUD_PINW_CONNLNG 0x620a8
428#define AUD_PINW_CONNLST 0x620ac
429#define AUD_PINW_CNTR 0x620b0
430#define AUD_PINW_UNSOLRESP 0x620b8
431#define AUD_CNTL_ST 0x620b4
432#define AUD_PINW_CONFIG 0x620bc
433#define AUD_HDMIW_STATUS 0x620d4
434#define AUD_HDMIW_HDMIEDID 0x6210c
435#define AUD_HDMIW_INFOFR 0x62118
436#define AUD_CONV_CHCNT 0x62120
437#define AUD_CTS_ENABLE 0x62128
438
439#define VIDEO_DIP_CTL 0x61170
440#define VIDEO_DIP_ENABLE (1<<31)
441#define VIDEO_DIP_ENABLE_AVI (1<<21)
442#define VIDEO_DIP_ENABLE_VENDOR (1<<22)
443#define VIDEO_DIP_ENABLE_SPD (1<<24)
444#define VIDEO_DIP_BUF_AVI (0<<19)
445#define VIDEO_DIP_BUF_VENDOR (1<<19)
446#define VIDEO_DIP_BUF_SPD (3<<19)
447#define VIDEO_DIP_TRANS_ONCE (0<<16)
448#define VIDEO_DIP_TRANS_1 (1<<16)
449#define VIDEO_DIP_TRANS_2 (2<<16)
450
451#define AUDIO_HOTPLUG_EN (1<<24)
452
453
Wu Fengguang020abdb2010-04-19 13:13:06 +0800454static void dump_eaglelake(void)
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800455{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400456 uint32_t dword;
457 int i;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800458
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400459 /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800460
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400461 dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
462 dump_reg(SDVOB, "Digital Display Port B Control Register");
463 dump_reg(SDVOC, "Digital Display Port C Control Register");
464 dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800465
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400466 dump_reg(AUD_CONFIG, "Audio Configuration");
467 dump_reg(AUD_DEBUG, "Audio Debug");
468 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
469 dump_reg(AUD_RID, "Audio Revision ID");
470 dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
471 dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
472 dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
473 dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
474 dump_reg(AUD_PWRST, "Audio Power State");
475 dump_reg(AUD_SUPPWR, "Audio Supported Power States");
476 dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
477 dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
478 dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
479 dump_reg(AUD_OUT_STR, "Audio Stream Formats");
480 dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
481 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
482 dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
483 dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
484 dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
485 dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
486 dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
487 dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
488 dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
489 dump_reg(AUD_CNTL_ST, "Audio Control State Register");
490 dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
491 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
492 dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
493 dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
494 dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
495 dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800496
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400497 printf("\nDetails:\n\n");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800498
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400499 dword = INREG(AUD_VID_DID);
500 printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
501 printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800502
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400503 dword = INREG(AUD_RID);
504 printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
505 printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
506 printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
507 printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800508
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400509 dword = INREG(SDVOB);
510 printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
511 printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
512 printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
513 printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
514 printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800515
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400516 dword = INREG(SDVOC);
517 printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
518 printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
519 printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
520 printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
521 printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800522
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400523 dword = INREG(PORT_HOTPLUG_EN);
524 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)),
525 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)),
526 printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
527 printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
528 printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
529 printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
530 printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
531 printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)),
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800532
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400533 dword = INREG(VIDEO_DIP_CTL);
534 printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
535 printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
536 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
537 printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
538 printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
539 printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
540 printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
541 printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
542 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
543 printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
544 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
545 printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
546 printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800547
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400548 dword = INREG(AUD_CONFIG);
549 printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
550 OPNAME(pixel_clock, BITS(dword, 19, 16)));
551 printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
552 printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
553 printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800554
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400555 dword = INREG(AUD_DEBUG);
556 printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800557
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400558 dword = INREG(AUD_SUBN_CNT);
559 printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16));
560 printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800561
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400562 dword = INREG(AUD_SUBN_CNT2);
563 printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16));
564 printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800565
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400566 dword = INREG(AUD_FUNC_GRP);
567 printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
568 printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800569
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400570 dword = INREG(AUD_GRP_CAP);
571 printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
572 printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
573 printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800574
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400575 dword = INREG(AUD_PWRST);
576 printf("AUD_PWRST device power state\t\t%s\n",
577 power_state[BITS(dword, 5, 4)]);
578 printf("AUD_PWRST device power state setting\t%s\n",
579 power_state[BITS(dword, 1, 0)]);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800580
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400581 dword = INREG(AUD_SUPPWR);
582 printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
583 printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
584 printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
585 printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800586
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400587 dword = INREG(AUD_OUT_CWCAP);
588 printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
589 printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
590 printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
591 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
592 printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
593 printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
594 printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
595 printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
596 printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
597 printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
598 printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
599 printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
600 printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
601 printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800602
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400603 dword = INREG(AUD_OUT_DIG_CNVT);
604 printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8));
605 printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
606 printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
607 printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
608 printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
609 printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
610 printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
611 printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
612 printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800613
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400614 dword = INREG(AUD_OUT_CH_STR);
615 printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
616 printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800617
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400618 dword = INREG(AUD_OUT_STR_DESC);
619 printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1);
620 printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n",
621 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800622
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400623 dword = INREG(AUD_PINW_CAP);
624 printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
625 printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
626 printf("AUD_PINW_CAP channel count\t\t%lu\n",
627 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
628 printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
629 printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
630 printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
631 printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
632 printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
633 printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
634 printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
635 printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
636 printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
637 printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
638 printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800639
640
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400641 dword = INREG(AUD_PIN_CAP);
642 printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
643 printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
644 printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
645 printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800646
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400647 dword = INREG(AUD_PINW_CNTR);
648 printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
649 printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
650 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
651 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
652 printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
653 BITS(dword, 2, 0),
654 OPNAME(stream_type, BITS(dword, 2, 0)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800655
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400656 dword = INREG(AUD_PINW_UNSOLRESP);
657 printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800658
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400659 dword = INREG(AUD_CNTL_ST);
660 printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
661 printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
662 printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
663 printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
664 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
665 printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
666 BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
667 printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
668 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
669 printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
670 printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
671 printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
672 printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
673 printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
674 printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800675
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400676 dword = INREG(AUD_HDMIW_STATUS);
677 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
678 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
679 printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
680 printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800681
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400682 dword = INREG(AUD_CONV_CHCNT);
683 printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
684 printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800685
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400686 printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
687 for (i = 0; i < 8; i++) {
688 OUTREG(AUD_CONV_CHCNT, i);
689 dword = INREG(AUD_CONV_CHCNT);
690 printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4));
691 }
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800692
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400693 printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t");
694 dword = INREG(AUD_CNTL_ST);
695 dword &= ~BITMASK(8, 5);
696 OUTREG(AUD_CNTL_ST, dword);
697 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
698 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID)));
699 printf("\n");
Wu Fengguangf32aecb2011-11-12 11:12:50 +0800700
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400701 printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t");
702 dword = INREG(AUD_CNTL_ST);
703 dword &= ~BITMASK(20, 18);
704 dword &= ~BITMASK(3, 0);
705 OUTREG(AUD_CNTL_ST, dword);
706 for (i = 0; i < 8; i++)
707 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR)));
708 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800709}
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800710
Wu Fengguang020abdb2010-04-19 13:13:06 +0800711#undef AUD_RID
712#undef AUD_VID_DID
713#undef AUD_PWRST
714#undef AUD_OUT_CH_STR
715#undef AUD_HDMIW_STATUS
716
717/*
718 * IronLake registers
719 */
720#define AUD_CONFIG_A 0xE2000
721#define AUD_CONFIG_B 0xE2100
722#define AUD_CTS_ENABLE_A 0xE2028
723#define AUD_CTS_ENABLE_B 0xE2128
724#define AUD_MISC_CTRL_A 0xE2010
725#define AUD_MISC_CTRL_B 0xE2110
726#define AUD_VID_DID 0xE2020
727#define AUD_RID 0xE2024
728#define AUD_PWRST 0xE204C
729#define AUD_PORT_EN_HD_CFG 0xE207C
730#define AUD_OUT_DIG_CNVT_A 0xE2080
731#define AUD_OUT_DIG_CNVT_B 0xE2180
732#define AUD_OUT_CH_STR 0xE2088
733#define AUD_OUT_STR_DESC_A 0xE2084
734#define AUD_OUT_STR_DESC_B 0xE2184
735#define AUD_PINW_CONNLNG_LIST 0xE20A8
736#define AUD_PINW_CONNLNG_SEL 0xE20AC
737#define AUD_CNTL_ST_A 0xE20B4
738#define AUD_CNTL_ST_B 0xE21B4
739#define AUD_CNTL_ST2 0xE20C0
740#define AUD_HDMIW_STATUS 0xE20D4
741#define AUD_HDMIW_HDMIEDID_A 0xE2050
742#define AUD_HDMIW_HDMIEDID_B 0xE2150
743#define AUD_HDMIW_INFOFR_A 0xE2054
744#define AUD_HDMIW_INFOFR_B 0xE2154
745
746static void dump_ironlake(void)
747{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400748 uint32_t dword;
749 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800750
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400751 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
752 dump_reg(HDMIC, "HDMI Port C Control");
753 dump_reg(HDMID, "HDMI Port D Control");
754 dump_reg(PCH_DP_B, "DisplayPort B Control Register");
755 dump_reg(PCH_DP_C, "DisplayPort C Control Register");
756 dump_reg(PCH_DP_D, "DisplayPort D Control Register");
757 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
758 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
759 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
760 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
761 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
762 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
763 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
764 dump_reg(AUD_RID, "Audio Revision ID");
765 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
766 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
767 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
768 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
769 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
770 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
771 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
772 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
773 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
774 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
775 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
776 dump_reg(AUD_CNTL_ST2, "Audio Control State 2");
777 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
778 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
779 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
780 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
781 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800782
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400783 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800784
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400785 dword = INREG(AUD_VID_DID);
786 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
787 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800788
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400789 dword = INREG(AUD_RID);
790 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
791 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
792 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
793 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800794
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400795 dword = INREG(HDMIB);
796 printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
797 printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
798 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
799 printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23));
800 printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2));
801 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
802 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
803 printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
804 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800805
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400806 dword = INREG(HDMIC);
807 printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
808 printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
809 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
810 printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2));
811 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
812 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
813 printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
814 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800815
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400816 dword = INREG(HDMID);
817 printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
818 printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
819 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
820 printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2));
821 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
822 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
823 printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
824 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800825
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400826 dword = INREG(PCH_DP_B);
827 printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
828 printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
829 printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
830 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
831 printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
832 printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
833 printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800834
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400835 dword = INREG(PCH_DP_C);
836 printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
837 printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
838 printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
839 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
840 printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
841 printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
842 printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800843
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400844 dword = INREG(PCH_DP_D);
845 printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
846 printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
847 printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
848 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
849 printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
850 printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
851 printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800852
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400853 dword = INREG(AUD_CONFIG_A);
854 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
855 n_index_value[BIT(dword, 29)]);
856 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
857 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
858 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
859 printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
860 OPNAME(pixel_clock, BITS(dword, 19, 16)));
861 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
862 dword = INREG(AUD_CONFIG_B);
863 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
864 n_index_value[BIT(dword, 29)]);
865 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
866 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
867 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
868 printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
869 OPNAME(pixel_clock, BITS(dword, 19, 16)));
870 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800871
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400872 dword = INREG(AUD_CTS_ENABLE_A);
873 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
874 printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
875 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
876 dword = INREG(AUD_CTS_ENABLE_B);
877 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
878 printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
879 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800880
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400881 dword = INREG(AUD_MISC_CTRL_A);
882 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
883 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
884 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
885 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
886 dword = INREG(AUD_MISC_CTRL_B);
887 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
888 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
889 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
890 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800891
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400892 dword = INREG(AUD_PWRST);
893 printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]);
894 printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]);
895 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
896 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
897 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
898 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
899 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
900 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
901 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
902 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
903 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
904 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800905
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400906 dword = INREG(AUD_PORT_EN_HD_CFG);
907 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
908 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
909 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
910 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
911 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12));
912 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13));
913 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14));
914 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16));
915 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17));
916 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 +0800917
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400918 dword = INREG(AUD_OUT_DIG_CNVT_A);
919 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
920 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
921 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
922 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
923 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
924 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
925 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
926 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
927 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
928 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 +0800929
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400930 dword = INREG(AUD_OUT_DIG_CNVT_B);
931 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
932 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
933 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
934 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
935 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
936 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
937 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
938 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
939 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
940 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 +0800941
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400942 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
943 for (i = 0; i < 8; i++) {
944 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
945 dword = INREG(AUD_OUT_CH_STR);
946 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
947 1 + BITS(dword, 3, 0),
948 1 + BITS(dword, 7, 4),
949 1 + BITS(dword, 15, 12),
950 1 + BITS(dword, 23, 20));
951 }
Wu Fengguang020abdb2010-04-19 13:13:06 +0800952
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400953 dword = INREG(AUD_OUT_STR_DESC_A);
954 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
955 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
956 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
957 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
958 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 +0800959
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400960 dword = INREG(AUD_OUT_STR_DESC_B);
961 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
962 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
963 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
964 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
965 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 +0800966
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400967 dword = INREG(AUD_PINW_CONNLNG_SEL);
968 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0));
969 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8));
970 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800971
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400972 dword = INREG(AUD_CNTL_ST_A);
973 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
974 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
975 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
976 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
977 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
978 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
979 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
980 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
981 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
982 printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800983
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400984 dword = INREG(AUD_CNTL_ST_B);
985 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
986 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
987 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
988 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
989 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
990 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
991 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
992 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
993 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
994 printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800995
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400996 dword = INREG(AUD_CNTL_ST2);
997 printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1));
998 printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
999 printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5));
1000 printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1001 printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9));
1002 printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001003
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001004 dword = INREG(AUD_HDMIW_STATUS);
1005 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1006 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1007 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1008 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1009 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1010 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001011
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001012 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1013 dword = INREG(AUD_CNTL_ST_A);
1014 dword &= ~BITMASK(9, 5);
1015 OUTREG(AUD_CNTL_ST_A, dword);
1016 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1017 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1018 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001019
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001020 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1021 dword = INREG(AUD_CNTL_ST_B);
1022 dword &= ~BITMASK(9, 5);
1023 OUTREG(AUD_CNTL_ST_B, dword);
1024 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1025 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1026 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001027
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001028 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1029 dword = INREG(AUD_CNTL_ST_A);
1030 dword &= ~BITMASK(20, 18);
1031 dword &= ~BITMASK(3, 0);
1032 OUTREG(AUD_CNTL_ST_A, dword);
1033 for (i = 0; i < 8; i++)
1034 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1035 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001036
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001037 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1038 dword = INREG(AUD_CNTL_ST_B);
1039 dword &= ~BITMASK(20, 18);
1040 dword &= ~BITMASK(3, 0);
1041 OUTREG(AUD_CNTL_ST_B, dword);
1042 for (i = 0; i < 8; i++)
1043 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1044 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001045
1046}
1047
1048
1049#undef AUD_CONFIG_A
1050#undef AUD_MISC_CTRL_A
1051#undef AUD_VID_DID
1052#undef AUD_RID
1053#undef AUD_CTS_ENABLE_A
1054#undef AUD_PWRST
1055#undef AUD_HDMIW_HDMIEDID_A
1056#undef AUD_HDMIW_INFOFR_A
1057#undef AUD_PORT_EN_HD_CFG
1058#undef AUD_OUT_DIG_CNVT_A
1059#undef AUD_OUT_STR_DESC_A
1060#undef AUD_OUT_CH_STR
1061#undef AUD_PINW_CONNLNG_LIST
1062#undef AUD_CNTL_ST_A
1063#undef AUD_HDMIW_STATUS
1064#undef AUD_CONFIG_B
1065#undef AUD_MISC_CTRL_B
1066#undef AUD_CTS_ENABLE_B
1067#undef AUD_HDMIW_HDMIEDID_B
1068#undef AUD_HDMIW_INFOFR_B
1069#undef AUD_OUT_DIG_CNVT_B
1070#undef AUD_OUT_STR_DESC_B
1071#undef AUD_CNTL_ST_B
1072
1073/*
1074 * CougarPoint registers
1075 */
Wu Fengguang97d20312011-11-12 11:12:45 +08001076#define DP_CTL_B 0xE4100
Wu Fengguang020abdb2010-04-19 13:13:06 +08001077#define DP_CTL_C 0xE4200
1078#define DP_AUX_CTL_C 0xE4210
1079#define DP_AUX_TST_C 0xE4228
1080#define SPORT_DDI_CRC_C 0xE4250
1081#define SPORT_DDI_CRC_R 0xE4264
1082#define DP_CTL_D 0xE4300
1083#define DP_AUX_CTL_D 0xE4310
1084#define DP_AUX_TST_D 0xE4328
1085#define SPORT_DDI_CRC_CTL_D 0xE4350
1086#define AUD_CONFIG_A 0xE5000
1087#define AUD_MISC_CTRL_A 0xE5010
1088#define AUD_VID_DID 0xE5020
1089#define AUD_RID 0xE5024
1090#define AUD_CTS_ENABLE_A 0xE5028
1091#define AUD_PWRST 0xE504C
1092#define AUD_HDMIW_HDMIEDID_A 0xE5050
1093#define AUD_HDMIW_INFOFR_A 0xE5054
1094#define AUD_PORT_EN_HD_CFG 0xE507C
1095#define AUD_OUT_DIG_CNVT_A 0xE5080
1096#define AUD_OUT_STR_DESC_A 0xE5084
1097#define AUD_OUT_CH_STR 0xE5088
1098#define AUD_PINW_CONNLNG_LIST 0xE50A8
1099#define AUD_PINW_CONNLNG_SELA 0xE50AC
1100#define AUD_CNTL_ST_A 0xE50B4
1101#define AUD_CNTRL_ST2 0xE50C0
1102#define AUD_CNTRL_ST3 0xE50C4
1103#define AUD_HDMIW_STATUS 0xE50D4
1104#define AUD_CONFIG_B 0xE5100
1105#define AUD_MISC_CTRL_B 0xE5110
1106#define AUD_CTS_ENABLE_B 0xE5128
1107#define AUD_HDMIW_HDMIEDID_B 0xE5150
1108#define AUD_HDMIW_INFOFR_B 0xE5154
1109#define AUD_OUT_DIG_CNVT_B 0xE5180
1110#define AUD_OUT_STR_DESC_B 0xE5184
1111#define AUD_CNTL_ST_B 0xE51B4
1112#define AUD_CONFIG_C 0xE5200
1113#define AUD_MISC_CTRL_C 0xE5210
1114#define AUD_CTS_ENABLE_C 0xE5228
1115#define AUD_HDMIW_HDMIEDID_C 0xE5250
1116#define AUD_HDMIW_INFOFR_C 0xE5254
1117#define AUD_OUT_DIG_CNVT_C 0xE5280
1118#define AUD_OUT_STR_DESC_C 0xE5284
1119#define AUD_CNTL_ST_C 0xE52B4
1120#define AUD_CONFIG_D 0xE5300
1121#define AUD_MISC_CTRL_D 0xE5310
1122#define AUD_CTS_ENABLE_D 0xE5328
1123#define AUD_HDMIW_HDMIEDID_D 0xE5350
1124#define AUD_HDMIW_INFOFR_D 0xE5354
1125#define AUD_OUT_DIG_CNVT_D 0xE5380
1126#define AUD_OUT_STR_DESC_D 0xE5384
1127#define AUD_CNTL_ST_D 0xE53B4
1128
Wu Fengguange321f132011-11-12 11:12:52 +08001129#define VIDEO_DIP_CTL_A 0xE0200
1130#define VIDEO_DIP_CTL_B 0xE1200
1131#define VIDEO_DIP_CTL_C 0xE2200
1132#define VIDEO_DIP_CTL_D 0xE3200
1133
Wu Fengguang020abdb2010-04-19 13:13:06 +08001134
1135static void dump_cpt(void)
1136{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001137 uint32_t dword;
1138 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +08001139
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001140 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
1141 dump_reg(HDMIC, "HDMI Port C Control");
1142 dump_reg(HDMID, "HDMI Port D Control");
1143 dump_reg(DP_CTL_B, "DisplayPort B Control");
1144 dump_reg(DP_CTL_C, "DisplayPort C Control");
1145 dump_reg(DP_CTL_D, "DisplayPort D Control");
1146 dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control");
1147 dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control");
1148 dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control");
1149 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
1150 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
1151 dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C");
1152 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
1153 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
1154 dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C");
1155 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
1156 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
1157 dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C");
1158 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
1159 dump_reg(AUD_RID, "Audio Revision ID");
1160 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
1161 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
1162 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
1163 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
1164 dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C");
1165 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
1166 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
1167 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
1168 dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C");
1169 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
1170 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
1171 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
1172 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
1173 dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C");
1174 dump_reg(AUD_CNTRL_ST2, "Audio Control State 2");
1175 dump_reg(AUD_CNTRL_ST3, "Audio Control State 3");
1176 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
1177 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
1178 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
1179 dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C");
1180 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
1181 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
1182 dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001183
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001184 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001185
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001186 dword = INREG(VIDEO_DIP_CTL_A);
1187 printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1188 printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1189 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1190 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1191 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1192 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1193 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1194 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1195 printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1196 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1197 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1198 printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001199
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001200 dword = INREG(VIDEO_DIP_CTL_B);
1201 printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1202 printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1203 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1204 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1205 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1206 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1207 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1208 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1209 printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1210 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1211 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1212 printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001213
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001214 dword = INREG(VIDEO_DIP_CTL_C);
1215 printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1216 printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1217 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1218 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1219 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1220 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1221 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1222 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1223 printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1224 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1225 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1226 printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001227
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001228 dword = INREG(AUD_VID_DID);
1229 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
1230 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001231
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001232 dword = INREG(AUD_RID);
1233 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1234 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1235 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1236 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001237
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001238 dword = INREG(HDMIB);
1239 printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1240 printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1241 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1242 printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1243 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1244 printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1245 printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1246 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1247 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1248 printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1249 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001250
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001251 dword = INREG(HDMIC);
1252 printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1253 printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1254 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1255 printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1256 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1257 printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1258 printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1259 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1260 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1261 printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1262 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001263
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001264 dword = INREG(HDMID);
1265 printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1266 printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1267 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1268 printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1269 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1270 printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1271 printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1272 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1273 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1274 printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1275 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001276
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001277 dword = INREG(DP_CTL_B);
1278 printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1279 printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1280 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1281 printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1282 printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1283 printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001284
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001285 dword = INREG(DP_CTL_C);
1286 printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1287 printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1288 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1289 printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1290 printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1291 printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001292
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001293 dword = INREG(DP_CTL_D);
1294 printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1295 printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1296 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1297 printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1298 printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1299 printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001300
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001301 dword = INREG(AUD_CONFIG_A);
1302 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1303 n_index_value[BIT(dword, 29)]);
1304 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1305 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1306 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1307 printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1308 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1309 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1310 dword = INREG(AUD_CONFIG_B);
1311 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1312 n_index_value[BIT(dword, 29)]);
1313 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1314 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1315 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1316 printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1317 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1318 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1319 dword = INREG(AUD_CONFIG_C);
1320 printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1321 n_index_value[BIT(dword, 29)]);
1322 printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1323 printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1324 printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1325 printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1326 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1327 printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001328
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001329 dword = INREG(AUD_CTS_ENABLE_A);
1330 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1331 printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1332 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1333 dword = INREG(AUD_CTS_ENABLE_B);
1334 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1335 printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1336 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1337 dword = INREG(AUD_CTS_ENABLE_C);
1338 printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1339 printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1340 printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001341
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001342 dword = INREG(AUD_MISC_CTRL_A);
1343 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1344 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1345 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1346 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1347 dword = INREG(AUD_MISC_CTRL_B);
1348 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1349 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1350 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1351 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1352 dword = INREG(AUD_MISC_CTRL_C);
1353 printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1354 printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1355 printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1356 printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001357
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001358 dword = INREG(AUD_PWRST);
1359 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1360 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1361 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1362 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1363 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1364 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1365 printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]);
1366 printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]);
1367 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1368 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1369 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1370 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1371 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1372 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001373
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001374 dword = INREG(AUD_PORT_EN_HD_CFG);
1375 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
1376 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
1377 printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2));
1378 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1379 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1380 printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1381 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1382 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1383 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1384 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1385 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1386 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 +08001387
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001388 dword = INREG(AUD_OUT_DIG_CNVT_A);
1389 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
1390 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1391 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1392 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
1393 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1394 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1395 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
1396 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1397 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1398 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 +08001399
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001400 dword = INREG(AUD_OUT_DIG_CNVT_B);
1401 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
1402 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1403 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1404 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
1405 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1406 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1407 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
1408 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1409 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1410 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 +08001411
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001412 dword = INREG(AUD_OUT_DIG_CNVT_C);
1413 printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1));
1414 printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1415 printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1416 printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4));
1417 printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1418 printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1419 printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7));
1420 printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1421 printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1422 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 +08001423
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001424 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
1425 for (i = 0; i < 8; i++) {
1426 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
1427 dword = INREG(AUD_OUT_CH_STR);
1428 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1429 1 + BITS(dword, 3, 0),
1430 1 + BITS(dword, 7, 4),
1431 1 + BITS(dword, 15, 12),
1432 1 + BITS(dword, 23, 20));
1433 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08001434
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001435 dword = INREG(AUD_OUT_STR_DESC_A);
1436 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1437 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1438 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
1439 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1440 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 +08001441
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001442 dword = INREG(AUD_OUT_STR_DESC_B);
1443 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1444 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1445 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
1446 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1447 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 +08001448
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001449 dword = INREG(AUD_OUT_STR_DESC_C);
1450 printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1451 printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1452 printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n",
1453 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1454 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 +08001455
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001456 dword = INREG(AUD_PINW_CONNLNG_SEL);
1457 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0));
1458 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8));
1459 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001460
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001461 dword = INREG(AUD_CNTL_ST_A);
1462 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1463 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1464 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1465 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1466 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1467 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
1468 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1469 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1470 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 +08001471
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001472 dword = INREG(AUD_CNTL_ST_B);
1473 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1474 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1475 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1476 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1477 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1478 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
1479 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1480 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1481 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 +08001482
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001483 dword = INREG(AUD_CNTL_ST_C);
1484 printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1485 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1486 printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1487 printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1488 printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1489 printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n",
1490 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1491 printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1492 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 +08001493
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001494 dword = INREG(AUD_CNTRL_ST2);
1495 printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1));
1496 printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
1497 printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5));
1498 printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1499 printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9));
1500 printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001501
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001502 dword = INREG(AUD_CNTRL_ST3);
1503 printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3));
1504 printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n",
1505 BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]);
1506 printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7));
1507 printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n",
1508 BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]);
1509 printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11));
1510 printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n",
1511 BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001512
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001513 dword = INREG(AUD_HDMIW_STATUS);
1514 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1515 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1516 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1517 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1518 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1519 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1520 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1521 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001522
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001523 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1524 dword = INREG(AUD_CNTL_ST_A);
1525 dword &= ~BITMASK(9, 5);
1526 OUTREG(AUD_CNTL_ST_A, dword);
1527 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1528 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1529 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001530
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001531 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1532 dword = INREG(AUD_CNTL_ST_B);
1533 dword &= ~BITMASK(9, 5);
1534 OUTREG(AUD_CNTL_ST_B, dword);
1535 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1536 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1537 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001538
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001539 printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t");
1540 dword = INREG(AUD_CNTL_ST_C);
1541 dword &= ~BITMASK(9, 5);
1542 OUTREG(AUD_CNTL_ST_C, dword);
1543 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1544 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C)));
1545 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001546
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001547 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1548 dword = INREG(AUD_CNTL_ST_A);
1549 dword &= ~BITMASK(20, 18);
1550 dword &= ~BITMASK(3, 0);
1551 OUTREG(AUD_CNTL_ST_A, dword);
1552 for (i = 0; i < 8; i++)
1553 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1554 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001555
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001556 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1557 dword = INREG(AUD_CNTL_ST_B);
1558 dword &= ~BITMASK(20, 18);
1559 dword &= ~BITMASK(3, 0);
1560 OUTREG(AUD_CNTL_ST_B, dword);
1561 for (i = 0; i < 8; i++)
1562 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1563 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001564
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001565 printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t");
1566 dword = INREG(AUD_CNTL_ST_C);
1567 dword &= ~BITMASK(20, 18);
1568 dword &= ~BITMASK(3, 0);
1569 OUTREG(AUD_CNTL_ST_C, dword);
1570 for (i = 0; i < 8; i++)
1571 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C)));
1572 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001573
1574}
1575
Wang Xingchaoc4077222012-08-15 16:13:38 +08001576#undef AUD_CONFIG_A
1577#undef AUD_MISC_CTRL_A
1578#undef AUD_VID_DID
1579#undef AUD_RID
1580#undef AUD_CTS_ENABLE_A
1581#undef AUD_PWRST
1582#undef AUD_HDMIW_HDMIEDID_A
1583#undef AUD_HDMIW_INFOFR_A
1584#undef AUD_PORT_EN_HD_CFG
1585#undef AUD_OUT_DIG_CNVT_A
1586#undef AUD_OUT_STR_DESC_A
1587#undef AUD_OUT_CH_STR
1588#undef AUD_PINW_CONNLNG_LIST
Mengdong Lindeba8682013-09-09 15:38:40 -04001589#undef AUD_PINW_CONNLNG_SEL
Wang Xingchaoc4077222012-08-15 16:13:38 +08001590#undef AUD_CNTL_ST_A
1591#undef AUD_HDMIW_STATUS
1592#undef AUD_CONFIG_B
1593#undef AUD_MISC_CTRL_B
1594#undef AUD_CTS_ENABLE_B
1595#undef AUD_HDMIW_HDMIEDID_B
1596#undef AUD_HDMIW_INFOFR_B
1597#undef AUD_OUT_DIG_CNVT_B
1598#undef AUD_OUT_STR_DESC_B
1599#undef AUD_CNTL_ST_B
1600#undef AUD_CONFIG_C
1601#undef AUD_MISC_CTRL_C
1602#undef AUD_CTS_ENABLE_C
1603#undef AUD_HDMIW_HDMIEDID_C
1604#undef AUD_HDMIW_INFOFR_C
1605#undef AUD_OUT_DIG_CNVT_C
1606#undef AUD_OUT_STR_DESC_C
1607
1608#undef VIDEO_DIP_CTL_A
1609#undef VIDEO_DIP_CTL_B
1610#undef VIDEO_DIP_CTL_C
1611#undef VIDEO_DIP_CTL_D
1612#undef VIDEO_DIP_DATA
1613
1614/*
1615 * Haswell registers
1616 */
1617
1618/* DisplayPort Transport Control */
1619#define DP_TP_CTL_A 0x64040
1620#define DP_TP_CTL_B 0x64140
1621#define DP_TP_CTL_C 0x64240
1622#define DP_TP_CTL_D 0x64340
1623#define DP_TP_CTL_E 0x64440
1624
1625/* DisplayPort Transport Status */
1626#define DP_TP_ST_A 0x64044
1627#define DP_TP_ST_B 0x64144
1628#define DP_TP_ST_C 0x64244
1629#define DP_TP_ST_D 0x64344
1630#define DP_TP_ST_E 0x64444
1631
Wang Xingchaoc4077222012-08-15 16:13:38 +08001632/* DDI Buffer Control */
1633#define DDI_BUF_CTL_A 0x64000
1634#define DDI_BUF_CTL_B 0x64100
1635#define DDI_BUF_CTL_C 0x64200
1636#define DDI_BUF_CTL_D 0x64300
1637#define DDI_BUF_CTL_E 0x64400
1638
1639/* DDI Buffer Translation */
1640#define DDI_BUF_TRANS_A 0x64e00
1641#define DDI_BUF_TRANS_B 0x64e60
1642#define DDI_BUF_TRANS_C 0x64ec0
1643#define DDI_BUF_TRANS_D 0x64f20
1644#define DDI_BUF_TRANS_E 0x64f80
1645
1646/* DDI Aux Channel */
1647#define DDI_AUX_CHANNEL_CTRL 0x64010
1648#define DDI_AUX_DATA 0x64014
1649#define DDI_AUX_TST 0x64028
1650
1651/* DDI CRC Control */
1652#define DDI_CRC_CTL_A 0x64050
1653#define DDI_CRC_CTL_B 0x64150
1654#define DDI_CRC_CTL_C 0x64250
1655#define DDI_CRC_CTL_D 0x64350
1656#define DDI_CRC_CTL_E 0x64450
1657
1658/* Pipe DDI Function Control */
1659#define PIPE_DDI_FUNC_CTL_A 0x60400
1660#define PIPE_DDI_FUNC_CTL_B 0x61400
1661#define PIPE_DDI_FUNC_CTL_C 0x62400
1662#define PIPE_DDI_FUNC_CTL_EDP 0x6F400
1663
1664/* Pipe Configuration */
1665#define PIPE_CONF_A 0x70008
1666#define PIPE_CONF_B 0x71008
1667#define PIPE_CONF_C 0x72008
1668#define PIPE_CONF_EDP 0x7F008
1669
1670/* Audio registers */
Mengdong Lindeba8682013-09-09 15:38:40 -04001671#define AUD_TCA_CONFIG 0x65000
1672#define AUD_TCB_CONFIG 0x65100
1673#define AUD_TCC_CONFIG 0x65200
1674#define AUD_C1_MISC_CTRL 0x65010
1675#define AUD_C2_MISC_CTRL 0x65110
1676#define AUD_C3_MISC_CTRL 0x65210
1677#define AUD_VID_DID 0x65020
1678#define AUD_RID 0x65024
1679#define AUD_TCA_M_CTS_ENABLE 0x65028
1680#define AUD_TCB_M_CTS_ENABLE 0x65128
1681#define AUD_TCC_M_CTS_ENABLE 0x65228
1682#define AUD_PWRST 0x6504C
1683#define AUD_TCA_EDID_DATA 0x65050
1684#define AUD_TCB_EDID_DATA 0x65150
1685#define AUD_TCC_EDID_DATA 0x65250
1686#define AUD_TCA_INFOFR 0x65054
1687#define AUD_TCB_INFOFR 0x65154
1688#define AUD_TCC_INFOFR 0x65254
1689#define AUD_PIPE_CONV_CFG 0x6507C
1690#define AUD_C1_DIG_CNVT 0x65080
1691#define AUD_C2_DIG_CNVT 0x65180
1692#define AUD_C3_DIG_CNVT 0x65280
1693#define AUD_C1_STR_DESC 0x65084
1694#define AUD_C2_STR_DESC 0x65184
1695#define AUD_C3_STR_DESC 0x65284
1696#define AUD_OUT_CHAN_MAP 0x65088
1697#define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8
1698#define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8
1699#define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8
Wang Xingchaoc4077222012-08-15 16:13:38 +08001700#define AUD_PIPE_CONN_SEL_CTRL 0x650AC
Mengdong Lindeba8682013-09-09 15:38:40 -04001701#define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4
1702#define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4
1703#define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4
1704#define AUD_PIN_ELD_CP_VLD 0x650C0
1705#define AUD_HDMI_FIFO_STATUS 0x650D4
Wang Xingchaoc4077222012-08-15 16:13:38 +08001706
Mengdong Lin85357202013-08-13 00:21:57 -04001707/* Audio debug registers */
1708#define AUD_ICOI 0x65f00
1709#define AUD_IRII 0x65f04
1710#define AUD_ICS 0x65f08
Mengdong Linf075c3c2013-08-13 00:22:14 -04001711#define AUD_CHICKENBIT_REG 0x65f10
Mengdong Lin97e5cf62013-08-13 00:22:24 -04001712#define AUD_DP_DIP_STATUS 0x65f20
Mengdong Line35126d2013-08-13 00:22:33 -04001713#define AUD_TCA_M_CTS 0x65f44
1714#define AUD_TCB_M_CTS 0x65f54
1715#define AUD_TCC_M_CTS 0x65f64
Mengdong Lin85357202013-08-13 00:21:57 -04001716
Wang Xingchaoc4077222012-08-15 16:13:38 +08001717/* Video DIP Control */
1718#define VIDEO_DIP_CTL_A 0x60200
1719#define VIDEO_DIP_CTL_B 0x61200
1720#define VIDEO_DIP_CTL_C 0x62200
1721#define VIDEO_DIP_CTL_D 0x63200
1722
1723#define VIDEO_DIP_DATA 0x60220
1724#define VIDEO_DIP_ECC 0x60240
1725
1726#define AUD_DP_DIP_STATUS 0x65f20
1727
Mengdong Lindeba8682013-09-09 15:38:40 -04001728#define MAX_PREFIX_SIZE 128
1729
Mengdong Lindeba8682013-09-09 15:38:40 -04001730static void dump_ddi_buf_ctl(int port)
1731{
1732 uint32_t dword;
1733
1734 dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100);
1735 printf("DDI %c Buffer control\n", 'A' + port - PORT_A);
1736 printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1),
1737 OPNAME(dp_port_width, BITS(dword, 3, 1)));
1738 printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31));
1739}
1740
1741static void dump_ddi_func_ctl(int pipe)
1742{
1743 uint32_t dword;
1744
1745 dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000);
1746 printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A);
1747 printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20),
1748 OPNAME(bits_per_color, BITS(dword, 22, 20)));
1749 printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24),
1750 OPNAME(ddi_mode, BITS(dword, 26, 24)));
1751 printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28),
1752 OPNAME(trans_to_port_sel, BITS(dword, 30, 28)));
1753 printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31));
1754}
1755
1756static void dump_aud_transcoder_config(int transcoder)
1757{
1758 uint32_t dword;
1759 char prefix[MAX_PREFIX_SIZE];
1760
1761 dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100);
1762 sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A);
1763
1764 printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1765 printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4));
1766 printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16),
1767 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1768 printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20));
1769 printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28));
1770 printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29),
1771 OPNAME(n_index_value, BIT(dword, 29)));
1772}
1773
1774static void dump_aud_misc_control(int converter)
1775{
1776 uint32_t dword;
1777 char prefix[MAX_PREFIX_SIZE];
1778
1779 dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100);
1780 sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1);
1781
1782 printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1783 printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2));
1784 printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4));
1785 printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8));
1786}
1787
1788static void dump_aud_vendor_device_id(void)
1789{
1790 uint32_t dword;
1791
1792 dword = INREG(AUD_VID_DID);
1793 printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0));
1794 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16));
1795}
1796
1797static void dump_aud_revision_id(void)
1798{
1799 uint32_t dword;
1800
1801 dword = INREG(AUD_RID);
1802 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
1803 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1804 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1805 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1806}
1807
1808static void dump_aud_m_cts_enable(int transcoder)
1809{
1810 uint32_t dword;
1811 char prefix[MAX_PREFIX_SIZE];
1812
1813 dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100);
1814 sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A);
1815
1816 printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0));
1817 printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20));
1818 printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M");
1819}
1820
1821static void dump_aud_power_state(void)
1822{
1823 uint32_t dword;
1824
1825 dword = INREG(AUD_PWRST);
1826 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1827 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1828 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1829 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1830 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
1831 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1832 printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1833 printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1834 printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1835 printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1836 printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]);
1837 printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]);
1838 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1839 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1840}
1841
1842static void dump_aud_edid_data(int transcoder)
1843{
1844 uint32_t dword;
1845 int i;
1846 int offset = (transcoder - TRANSCODER_A) * 0x100;
1847
1848 printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A);
1849 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1850 dword &= ~BITMASK(9, 5);
1851 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1852 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1853 printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset)));
1854 printf("\n");
1855}
1856
1857static void dump_aud_infoframe(int transcoder)
1858{
1859 uint32_t dword;
1860 int i;
1861 int offset = (transcoder - TRANSCODER_A) * 0x100;
1862
1863 printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A);
1864 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1865 dword &= ~BITMASK(20, 18);
1866 dword &= ~BITMASK(3, 0);
1867 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1868 for (i = 0; i < 8; i++)
1869 printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset)));
1870 printf("\n");
1871}
1872
1873static void dump_aud_pipe_conv_cfg(void)
1874{
1875 uint32_t dword;
1876
1877 dword = INREG(AUD_PIPE_CONV_CFG);
1878 printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0));
1879 printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1));
1880 printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2));
1881 printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1882 printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1883 printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1884 printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1885 printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1886 printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1887 printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1888 printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1889 printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
1890}
1891
1892static void dump_aud_dig_cnvt(int converter)
1893{
1894 uint32_t dword;
1895 char prefix[MAX_PREFIX_SIZE];
1896
1897 dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100);
1898 sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1);
1899
1900 printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1901 printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2));
1902 printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1903 printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4));
1904 printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5));
1905 printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6));
1906 printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7));
1907 printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8));
1908 printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16));
1909 printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20));
1910}
1911
1912static void dump_aud_str_desc(int converter)
1913{
1914 uint32_t dword;
1915 char prefix[MAX_PREFIX_SIZE];
1916 uint32_t rate;
1917
1918 dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100);
1919 sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1);
1920
1921 printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0));
1922 printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4),
1923 OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1924
1925 printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8),
1926 OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8)));
1927 printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11),
1928 OPNAME(sample_base_rate_mult, BITS(dword, 13, 11)));
1929 printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14),
1930 OPNAME(sample_base_rate, BIT(dword, 14)));
1931 rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1)
1932 /(BITS(dword, 10, 8) + 1);
1933 printf("=> Sample Rate %d Hz\n", rate);
1934
1935 printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1);
1936}
1937
1938static void dump_aud_out_chan_map(void)
1939{
1940 uint32_t dword;
1941 int i;
1942
1943 printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n");
1944 for (i = 0; i < 8; i++) {
1945 OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16));
1946 dword = INREG(AUD_OUT_CHAN_MAP);
1947 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1948 1 + BITS(dword, 3, 0),
1949 1 + BITS(dword, 7, 4),
1950 1 + BITS(dword, 15, 12),
1951 1 + BITS(dword, 23, 20));
1952 }
1953}
1954
1955static void dump_aud_connect_list_entry_length(int transcoder)
1956{
1957 uint32_t dword;
1958 char prefix[MAX_PREFIX_SIZE];
1959
1960 dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100);
1961 sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A);
1962
1963 printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0));
1964 printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7),
1965 OPNAME(connect_list_form, BIT(dword, 7)));
1966 printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8));
1967}
1968
1969static void dump_aud_connect_select_ctrl(void)
1970{
1971 uint32_t dword;
1972
1973 dword = INREG(AUD_PIPE_CONN_SEL_CTRL);
1974 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0));
1975 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8));
1976 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16));
1977}
1978
1979static void dump_aud_dip_eld_ctrl_st(int transcoder)
1980{
1981 uint32_t dword;
1982 int offset = (transcoder - TRANSCODER_A) * 0x100;
1983
1984 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1985 printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A);
1986
1987 printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4));
1988 printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10));
1989 printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16),
1990 dip_trans[BITS(dword, 17, 16)]);
1991 printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18),
1992 dip_index[BITS(dword, 20, 18)]);
1993 printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21),
1994 dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]);
1995 printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29),
1996 dip_port[BITS(dword, 30, 29)]);
1997 printf("\n");
1998}
1999
2000static void dump_aud_eld_cp_vld(void)
2001{
2002 uint32_t dword;
2003
2004 dword = INREG(AUD_PIN_ELD_CP_VLD);
2005 printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0));
2006 printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1));
2007 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2));
2008 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3));
2009 printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4));
2010 printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5));
2011 printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6));
2012 printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7));
2013 printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8));
2014 printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9));
2015 printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10));
2016 printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11));
2017}
2018
2019static void dump_hdmi_fifo_status(void)
2020{
2021 uint32_t dword;
2022
2023 dword = INREG(AUD_HDMI_FIFO_STATUS);
2024 printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
2025 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
2026 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
2027 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
2028 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
2029 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
2030 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
2031}
Wang Xingchaoc4077222012-08-15 16:13:38 +08002032
Mengdong Linf075c3c2013-08-13 00:22:14 -04002033static void parse_bdw_audio_chicken_bit_reg(uint32_t dword)
2034{
2035 printf("\t");
2036 printf("%s\n\t", OPNAME(vanilla_dp12_en, BIT(dword, 31)));
2037 printf("%s\n\t", OPNAME(vanilla_3_widgets_en, BIT(dword, 30)));
2038 printf("%s\n\t", OPNAME(block_audio, BIT(dword, 10)));
2039 printf("%s\n\t", OPNAME(dis_eld_valid_pulse_trans, BIT(dword, 9)));
2040 printf("%s\n\t", OPNAME(dis_pd_pulse_trans, BIT(dword, 8)));
2041 printf("%s\n\t", OPNAME(dis_ts_delta_err, BIT(dword, 7)));
2042 printf("%s\n\t", OPNAME(dis_ts_fix_dp_hbr, BIT(dword, 6)));
2043 printf("%s\n\t", OPNAME(pattern_gen_8_ch_en, BIT(dword, 5)));
2044 printf("%s\n\t", OPNAME(pattern_gen_2_ch_en, BIT(dword, 4)));
2045 printf("%s\n\t", OPNAME(fabric_32_44_dis, BIT(dword, 3)));
2046 printf("%s\n\t", OPNAME(epss_dis, BIT(dword, 2)));
2047 printf("%s\n\t", OPNAME(ts_test_mode, BIT(dword, 1)));
2048 printf("%s\n", OPNAME(en_mmio_program, BIT(dword, 0)));
2049}
2050
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002051/* Dump audio registers for Haswell and its successors (eg. Broadwell).
2052 * Their register layout are same in the north display engine.
2053 */
2054static void dump_hsw_plus(void)
Wang Xingchaoc4077222012-08-15 16:13:38 +08002055{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002056 uint32_t dword;
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002057 int i;
Wang Xingchaoc4077222012-08-15 16:13:38 +08002058
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002059 /* HSW DDI Buffer */
2060 dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A");
2061 dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B");
2062 dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C");
2063 dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D");
2064 dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002065
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002066 /* HSW Pipe Function */
2067 dump_reg(PIPE_CONF_A, "PIPE Configuration A");
2068 dump_reg(PIPE_CONF_B, "PIPE Configuration B");
2069 dump_reg(PIPE_CONF_C, "PIPE Configuration C");
2070 dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002071
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002072 dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A");
2073 dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B");
2074 dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C");
2075 dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002076
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002077 /* HSW Display port */
2078 dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control");
2079 dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control");
2080 dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control");
2081 dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control");
2082 dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002083
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002084 dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status");
2085 dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status");
2086 dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status");
2087 dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status");
2088 dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002089
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002090 /* HSW North Display Audio */
Mengdong Lindeba8682013-09-09 15:38:40 -04002091 dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A");
2092 dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B");
2093 dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C");
2094 dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control");
2095 dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control");
2096 dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002097 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
Mengdong Lindeba8682013-09-09 15:38:40 -04002098 dump_reg(AUD_RID, "Audio Revision ID");
2099 dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A");
2100 dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B");
2101 dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002102 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
Mengdong Lindeba8682013-09-09 15:38:40 -04002103 dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A");
2104 dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B");
2105 dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C");
2106 dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A");
2107 dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B");
2108 dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C");
2109 dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs");
2110 dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1");
2111 dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2");
2112 dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3");
2113 dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1");
2114 dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2");
2115 dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002116 dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping");
Mengdong Lindeba8682013-09-09 15:38:40 -04002117 dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A");
2118 dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B");
2119 dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002120 dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control");
Mengdong Lindeba8682013-09-09 15:38:40 -04002121 dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A");
2122 dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B");
2123 dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C");
2124 dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status");
2125 dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002126
Mengdong Lin85357202013-08-13 00:21:57 -04002127 /* Audio debug registers */
2128 dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface");
2129 dump_reg(AUD_IRII, "Audio Immediate Response Input Interface");
2130 dump_reg(AUD_ICS, "Audio Immediate Command Status");
Mengdong Linf075c3c2013-08-13 00:22:14 -04002131 dump_reg(AUD_CHICKENBIT_REG, "Audio Chicken Bit Register");
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002132 dump_reg(AUD_DP_DIP_STATUS, "Audio DP and DIP FIFO Debug Status");
Mengdong Line35126d2013-08-13 00:22:33 -04002133 dump_reg(AUD_TCA_M_CTS, "Audio M CTS Read Back Transcoder A");
2134 dump_reg(AUD_TCB_M_CTS, "Audio M CTS Read Back Transcoder B");
2135 dump_reg(AUD_TCC_M_CTS, "Audio M CTS Read Back Transcoder C");
Mengdong Lin85357202013-08-13 00:21:57 -04002136
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002137 printf("\nDetails:\n\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002138
Mengdong Lindeba8682013-09-09 15:38:40 -04002139 dump_ddi_buf_ctl(PORT_A);
2140 dump_ddi_buf_ctl(PORT_B);
2141 dump_ddi_buf_ctl(PORT_C);
2142 dump_ddi_buf_ctl(PORT_D);
2143 dump_ddi_buf_ctl(PORT_E);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002144
Mengdong Lindeba8682013-09-09 15:38:40 -04002145 dump_ddi_func_ctl(PIPE_A);
2146 dump_ddi_func_ctl(PIPE_B);
2147 dump_ddi_func_ctl(PIPE_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002148
Mengdong Lindeba8682013-09-09 15:38:40 -04002149 /* audio configuration - details */
2150 dump_aud_transcoder_config(TRANSCODER_A);
2151 dump_aud_transcoder_config(TRANSCODER_B);
2152 dump_aud_transcoder_config(TRANSCODER_C);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002153
Mengdong Lindeba8682013-09-09 15:38:40 -04002154 dump_aud_misc_control(CONVERTER_1);
2155 dump_aud_misc_control(CONVERTER_2);
2156 dump_aud_misc_control(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002157
Mengdong Lindeba8682013-09-09 15:38:40 -04002158 dump_aud_vendor_device_id();
2159 dump_aud_revision_id();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002160
Mengdong Lindeba8682013-09-09 15:38:40 -04002161 dump_aud_m_cts_enable(TRANSCODER_A);
2162 dump_aud_m_cts_enable(TRANSCODER_B);
2163 dump_aud_m_cts_enable(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002164
Mengdong Lindeba8682013-09-09 15:38:40 -04002165 dump_aud_power_state();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002166
Mengdong Lindeba8682013-09-09 15:38:40 -04002167 dump_aud_edid_data(TRANSCODER_A);
2168 dump_aud_edid_data(TRANSCODER_B);
2169 dump_aud_edid_data(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002170
Mengdong Lindeba8682013-09-09 15:38:40 -04002171 dump_aud_infoframe(TRANSCODER_A);
2172 dump_aud_infoframe(TRANSCODER_B);
2173 dump_aud_infoframe(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002174
Mengdong Lindeba8682013-09-09 15:38:40 -04002175 dump_aud_pipe_conv_cfg();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002176
Mengdong Lindeba8682013-09-09 15:38:40 -04002177 dump_aud_dig_cnvt(CONVERTER_1);
2178 dump_aud_dig_cnvt(CONVERTER_2);
2179 dump_aud_dig_cnvt(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002180
Mengdong Lindeba8682013-09-09 15:38:40 -04002181 dump_aud_str_desc(CONVERTER_1);
2182 dump_aud_str_desc(CONVERTER_2);
2183 dump_aud_str_desc(CONVERTER_3);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002184
Mengdong Lindeba8682013-09-09 15:38:40 -04002185 dump_aud_out_chan_map();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002186
Mengdong Lindeba8682013-09-09 15:38:40 -04002187 dump_aud_connect_list_entry_length(TRANSCODER_A);
2188 dump_aud_connect_list_entry_length(TRANSCODER_B);
2189 dump_aud_connect_list_entry_length(TRANSCODER_C);
2190 dump_aud_connect_select_ctrl();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002191
Mengdong Lindeba8682013-09-09 15:38:40 -04002192 dump_aud_dip_eld_ctrl_st(TRANSCODER_A);
2193 dump_aud_dip_eld_ctrl_st(TRANSCODER_B);
2194 dump_aud_dip_eld_ctrl_st(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002195
Mengdong Lindeba8682013-09-09 15:38:40 -04002196 dump_aud_eld_cp_vld();
2197 dump_hdmi_fifo_status();
Mengdong Lin85357202013-08-13 00:21:57 -04002198
2199 printf("\nDetails:\n\n");
2200
2201 printf("IRV [%1lx] %s\t", BIT(dword, 1),
2202 OPNAME(immed_result_valid, BIT(dword, 1)));
2203 printf("ICB [%1lx] %s\n", BIT(dword, 1),
2204 OPNAME(immed_cmd_busy, BIT(dword, 0)));
Mengdong Linf075c3c2013-08-13 00:22:14 -04002205
2206 dword = INREG(AUD_CHICKENBIT_REG);
2207 printf("AUD_CHICKENBIT_REG Audio Chicken Bits: %08x\n", dword);
2208 if (IS_BROADWELL(devid))
2209 parse_bdw_audio_chicken_bit_reg(dword);
2210
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002211 dword = INREG(AUD_DP_DIP_STATUS);
2212 printf("AUD_DP_DIP_STATUS Audio DP & DIP FIFO Status: %08x\n\t", dword);
2213 for (i = 31; i >= 0; i--)
2214 if (BIT(dword, i))
2215 printf("%s\n\t", audio_dp_dip_status[i]);
2216 printf("\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002217}
2218
Wu Fengguang020abdb2010-04-19 13:13:06 +08002219int main(int argc, char **argv)
2220{
2221 struct pci_device *pci_dev;
2222
2223 pci_dev = intel_get_pci_device();
2224 devid = pci_dev->device_id; /* XXX not true when mapping! */
2225
2226 do_self_tests();
2227
2228 if (argc == 2)
2229 intel_map_file(argv[1]);
2230 else
2231 intel_get_mmio(pci_dev);
2232
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002233 if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
2234 printf("%s audio registers:\n\n",
2235 IS_BROADWELL(devid) ? "Broadwell" : "Haswell");
2236 dump_hsw_plus();
2237 } else if (IS_GEN6(devid) || IS_GEN7(devid)
2238 || getenv("HAS_PCH_SPLIT")) {
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002239 printf("%s audio registers:\n\n",
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002240 IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002241 intel_check_pch();
2242 dump_cpt();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002243 } else if (IS_GEN5(devid)) {
2244 printf("Ironlake audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002245 dump_ironlake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002246 } else if (IS_G4X(devid)) {
2247 printf("G45 audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002248 dump_eaglelake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002249 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08002250
2251 return 0;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08002252}