blob: 619734cd5ac63343dffd1b49cfbba97650ff3662 [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
40
41#define BITSTO(n) (n >= sizeof(long) * 8 ? ~0 : (1UL << (n)) - 1)
42#define BITMASK(high, low) (BITSTO(high+1) & ~BITSTO(low))
43#define BITS(reg, high, low) (((reg) & (BITMASK(high, low))) >> (low))
44#define BIT(reg, n) BITS(reg, n, n)
45
46#define min_t(type, x, y) ({ \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040047 type __min1 = (x); \
48 type __min2 = (y); \
49 __min1 < __min2 ? __min1 : __min2; })
Wu Fengguang020abdb2010-04-19 13:13:06 +080050
51#define OPNAME(names, index) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040052 names[min_t(unsigned int, index, ARRAY_SIZE(names) - 1)]
Wu Fengguang020abdb2010-04-19 13:13:06 +080053
54#define dump_reg(reg, desc) \
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040055 do { \
56 dword = INREG(reg); \
57 printf("%-21s 0x%08x %s\n", # reg, dword, desc); \
58 } while (0)
Wu Fengguang020abdb2010-04-19 13:13:06 +080059
60
Mengdong Lindeba8682013-09-09 15:38:40 -040061static const char * const pixel_clock[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080062 [0] = "25.2 / 1.001 MHz",
63 [1] = "25.2 MHz",
64 [2] = "27 MHz",
65 [3] = "27 * 1.001 MHz",
66 [4] = "54 MHz",
67 [5] = "54 * 1.001 MHz",
68 [6] = "74.25 / 1.001 MHz",
69 [7] = "74.25 MHz",
70 [8] = "148.5 / 1.001 MHz",
71 [9] = "148.5 MHz",
72 [10] = "Reserved",
73};
74
Mengdong Lindeba8682013-09-09 15:38:40 -040075static const char * const power_state[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080076 [0] = "D0",
77 [1] = "D1",
78 [2] = "D2",
79 [3] = "D3",
80};
81
Mengdong Lindeba8682013-09-09 15:38:40 -040082static const char * const stream_type[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080083 [0] = "default samples",
84 [1] = "one bit stream",
85 [2] = "DST stream",
86 [3] = "MLP stream",
87 [4] = "Reserved",
88};
89
Mengdong Lindeba8682013-09-09 15:38:40 -040090static const char * const dip_port[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +080091 [0] = "Reserved",
92 [1] = "Digital Port B",
93 [2] = "Digital Port C",
94 [3] = "Digital Port D",
95};
96
Mengdong Lindeba8682013-09-09 15:38:40 -040097static const char * const dip_type[] = {
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -040098 [0] = "Audio DIP Disabled",
99 [1] = "Audio DIP Enabled",
Wang Xingchaoc4077222012-08-15 16:13:38 +0800100};
101
Mengdong Lindeba8682013-09-09 15:38:40 -0400102static const char * const dip_gen1_state[] = {
103 [0] = "Generic 1 (ACP) DIP Disabled",
104 [1] = "Generic 1 (ACP) DIP Enabled",
105};
106
107static const char * const dip_gen2_state[] = {
108 [0] = "Generic 2 DIP Disabled",
109 [1] = "Generic 2 DIP Enabled",
110};
111
112static const char * const dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800113 [0] = "Audio DIP",
114 [1] = "ACP DIP",
115 [2] = "ISRC1 DIP",
116 [3] = "ISRC2 DIP",
117 [4] = "Reserved",
118};
119
Mengdong Lindeba8682013-09-09 15:38:40 -0400120static const char * const dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800121 [0] = "disabled",
122 [1] = "reserved",
123 [2] = "send once",
124 [3] = "best effort",
125};
126
Mengdong Lindeba8682013-09-09 15:38:40 -0400127static const char * const video_dip_index[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800128 [0] = "AVI DIP",
129 [1] = "Vendor-specific DIP",
Wu Fengguangf3f84bb2011-11-12 11:12:55 +0800130 [2] = "Gamut Metadata DIP",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800131 [3] = "Source Product Description DIP",
132};
133
Mengdong Lindeba8682013-09-09 15:38:40 -0400134static const char * const video_dip_trans[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800135 [0] = "send once",
136 [1] = "send every vsync",
137 [2] = "send at least every other vsync",
138 [3] = "reserved",
139};
140
Mengdong Lindeba8682013-09-09 15:38:40 -0400141static const char * const trans_to_port_sel[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800142 [0] = "no port",
143 [1] = "Digital Port B",
Wang Xingchaof9a24812012-08-15 16:13:37 +0800144 [2] = "Digital Port C",
145 [3] = "Digital Port D",
146 [4] = "reserved",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800147 [5] = "reserved",
148 [6] = "reserved",
149 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800150};
151
Mengdong Lindeba8682013-09-09 15:38:40 -0400152static const char * const ddi_mode[] = {
Wang Xingchaoc4077222012-08-15 16:13:38 +0800153 [0] = "HDMI mode",
154 [1] = "DVI mode",
155 [2] = "DP SST mode",
156 [3] = "DP MST mode",
157 [4] = "DP FDI mode",
158 [5] = "reserved",
159 [6] = "reserved",
160 [7] = "reserved",
161};
162
Mengdong Lindeba8682013-09-09 15:38:40 -0400163static const char * const bits_per_color[] = {
164 [0] = "8 bpc",
165 [1] = "10 bpc",
166 [2] = "6 bpc",
167 [3] = "12 bpc",
168 [4] = "reserved",
169 [5] = "reserved",
170 [6] = "reserved",
171 [7] = "reserved",
172};
173
174static const char * const transcoder_select[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800175 [0] = "Transcoder A",
176 [1] = "Transcoder B",
177 [2] = "Transcoder C",
178 [3] = "reserved",
179};
180
Mengdong Lindeba8682013-09-09 15:38:40 -0400181static const char * const dp_port_width[] = {
Wu Fengguang020abdb2010-04-19 13:13:06 +0800182 [0] = "x1 mode",
183 [1] = "x2 mode",
Wu Fengguangcf4c12f2011-11-12 11:12:46 +0800184 [2] = "reserved",
185 [3] = "x4 mode",
Alan Coopersmithc4610062012-01-06 14:37:19 -0800186 [4] = "reserved",
187 [5] = "reserved",
188 [6] = "reserved",
189 [7] = "reserved",
Wu Fengguang020abdb2010-04-19 13:13:06 +0800190};
191
Mengdong Lindeba8682013-09-09 15:38:40 -0400192static const char * const sample_base_rate[] = {
193 [0] = "48 kHz",
194 [1] = "44.1 kHz",
195};
196
197static const char * const sample_base_rate_mult[] = {
198 [0] = "x1 (48 kHz, 44.1 kHz or less)",
199 [1] = "x2 (96 kHz, 88.2 kHz, 32 kHz)",
200 [2] = "x3 (144 kHz)",
201 [3] = "x4 (192 kHz, 176.4 kHz)",
202 [4] = "Reserved",
203};
204
205static const char * const sample_base_rate_divisor[] = {
206 [0] = "Divided by 1 (48 kHz, 44.1 kHz)",
207 [1] = "Divided by 2 (24 kHz, 22.05 kHz)",
208 [2] = "Divided by 3 (16 kHz, 32 kHz)",
209 [3] = "Divided by 4 (11.025 kHz)",
210 [4] = "Divided by 5 (9.6 kHz)",
211 [5] = "Divided by 6 (8 kHz)",
212 [6] = "Divided by 7",
213 [7] = "Divided by 8 (6 kHz)",
214};
215
216static const char * const connect_list_form[] = {
217 [0] = "Short Form",
218 [1] = "Long Form",
219};
220
221
222static const char * const bits_per_sample[] = {
Wu Fengguang12861a92011-11-12 11:12:47 +0800223 [0] = "reserved",
224 [1] = "16 bits",
225 [2] = "24 bits",
226 [3] = "32 bits",
227 [4] = "20 bits",
228 [5] = "reserved",
229};
230
Mengdong Lindeba8682013-09-09 15:38:40 -0400231static const char * const sdvo_hdmi_encoding[] = {
Wu Fengguangee949582011-11-12 11:12:53 +0800232 [0] = "SDVO",
233 [1] = "reserved",
234 [2] = "TMDS",
235 [3] = "reserved",
236};
Wu Fengguang12861a92011-11-12 11:12:47 +0800237
Mengdong Lindeba8682013-09-09 15:38:40 -0400238static const char * const n_index_value[] = {
Wu Fengguange64abe52012-01-17 07:19:24 +0800239 [0] = "HDMI",
240 [1] = "DisplayPort",
241};
242
Mengdong Lin85357202013-08-13 00:21:57 -0400243static const char * const immed_result_valid[] = {
244 [0] = "No immediate response is available",
245 [1] = "Immediate response is available",
246};
247
248static const char * const immed_cmd_busy[] = {
249 [0] = "Can accept an immediate command",
250 [1] = "Immediate command is available",
251};
252
Mengdong Linf075c3c2013-08-13 00:22:14 -0400253static const char * const vanilla_dp12_en[] = {
254 [0] = "DP 1.2 features are disabled",
255 [1] = "DP 1.2 features are enabled",
256};
257
258static const char * const vanilla_3_widgets_en[] = {
259 [0] = "2nd & 3rd pin/convertor widgets are disabled",
260 [1] = "All three pin/convertor widgets are enabled",
261};
262
263static const char * const block_audio[] = {
264 [0] = "Allow audio data to reach the port",
265 [1] = "Block audio data from reaching the port",
266};
267
268static const char * const dis_eld_valid_pulse_trans[] = {
269 [0] = "Enable ELD valid pulse transition when unsol is disabled",
270 [1] = "Disable ELD valid pulse transition when unsol is disabled",
271};
272
273static const char * const dis_pd_pulse_trans[] = {
274 [0] = "Enable Presense Detect pulse transition when unsol is disabled",
275 [1] = "Disable Presense Detect pulse transition when unsol is disabled",
276};
277
278static const char * const dis_ts_delta_err[] = {
279 [0] = "Enable timestamp delta error for 32/44 KHz",
280 [1] = "Disable timestamp delta error for 32/44 KHz",
281};
282
283static const char * const dis_ts_fix_dp_hbr[] = {
284 [0] = "Enable timestamp fix for DP HBR",
285 [1] = "Disable timestamp fix for DP HBR",
286};
287
288static const char * const pattern_gen_8_ch_en[] = {
289 [0] = "Disable 8-channel pattern generator",
290 [1] = "Enable 8-channel pattern generator",
291};
292
293static const char * const pattern_gen_2_ch_en[] = {
294 [0] = "Disable 2-channel pattern generator",
295 [1] = "Enable 2-channel pattern generator",
296};
297
298static const char * const fabric_32_44_dis[] = {
299 [0] = "Allow sample fabrication for 32/44 KHz",
300 [1] = "Disable sample fabrication for 32/44 KHz",
301};
302
303static const char * const epss_dis[] = {
304 [0] = "Allow audio EPSS",
305 [1] = "Disable audio EPSS",
306};
307
308static const char * const ts_test_mode[] = {
309 [0] = "Default time stamp mode",
310 [1] = "Audio time stamp test mode for audio only feature",
311};
312
313static const char * const en_mmio_program[] = {
314 [0] = "Programming by HD-Audio Azalia",
315 [1] = "Programming by MMIO debug registers",
316};
317
Mengdong Lin97e5cf62013-08-13 00:22:24 -0400318static const char * const audio_dp_dip_status[] = {
319 [0] = "audfc dp fifo full",
320 [1] = "audfc dp fifo empty",
321 [2] = "audfc dp fifo overrun",
322 [3] = "audfc dip fifo full",
323 [4] = "audfc dp fifo empty cd",
324 [5] = "audfb dp fifo full",
325 [6] = "audfb dp fifo empty",
326 [7] = "audfb dp fifo overrun",
327 [8] = "audfb dip fifo full",
328 [9] = "audfb dp fifo empty cd",
329 [10] = "audfa dp fifo full",
330 [11] = "audfa dp fifo empty",
331 [12] = "audfa dp fifo overrun",
332 [13] = "audfa dip fifo full",
333 [14] = "audfa dp fifo empty cd",
334 [15] = "Pipe c audio overflow",
335 [16] = "Pipe b audio overflow",
336 [17] = "Pipe a audio overflow",
337 [31] = 0,
338};
339
Wu Fengguang020abdb2010-04-19 13:13:06 +0800340static void do_self_tests(void)
341{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400342 if (BIT(1, 0) != 1)
343 exit(1);
344 if (BIT(0x80000000, 31) != 1)
345 exit(2);
346 if (BITS(0xc0000000, 31, 30) != 3)
347 exit(3);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800348}
349
350/*
351 * EagleLake registers
352 */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800353#define AUD_CONFIG 0x62000
354#define AUD_DEBUG 0x62010
355#define AUD_VID_DID 0x62020
356#define AUD_RID 0x62024
357#define AUD_SUBN_CNT 0x62028
358#define AUD_FUNC_GRP 0x62040
359#define AUD_SUBN_CNT2 0x62044
360#define AUD_GRP_CAP 0x62048
361#define AUD_PWRST 0x6204c
362#define AUD_SUPPWR 0x62050
363#define AUD_SID 0x62054
364#define AUD_OUT_CWCAP 0x62070
365#define AUD_OUT_PCMSIZE 0x62074
366#define AUD_OUT_STR 0x62078
367#define AUD_OUT_DIG_CNVT 0x6207c
368#define AUD_OUT_CH_STR 0x62080
369#define AUD_OUT_STR_DESC 0x62084
370#define AUD_PINW_CAP 0x620a0
371#define AUD_PIN_CAP 0x620a4
372#define AUD_PINW_CONNLNG 0x620a8
373#define AUD_PINW_CONNLST 0x620ac
374#define AUD_PINW_CNTR 0x620b0
375#define AUD_PINW_UNSOLRESP 0x620b8
376#define AUD_CNTL_ST 0x620b4
377#define AUD_PINW_CONFIG 0x620bc
378#define AUD_HDMIW_STATUS 0x620d4
379#define AUD_HDMIW_HDMIEDID 0x6210c
380#define AUD_HDMIW_INFOFR 0x62118
381#define AUD_CONV_CHCNT 0x62120
382#define AUD_CTS_ENABLE 0x62128
383
384#define VIDEO_DIP_CTL 0x61170
385#define VIDEO_DIP_ENABLE (1<<31)
386#define VIDEO_DIP_ENABLE_AVI (1<<21)
387#define VIDEO_DIP_ENABLE_VENDOR (1<<22)
388#define VIDEO_DIP_ENABLE_SPD (1<<24)
389#define VIDEO_DIP_BUF_AVI (0<<19)
390#define VIDEO_DIP_BUF_VENDOR (1<<19)
391#define VIDEO_DIP_BUF_SPD (3<<19)
392#define VIDEO_DIP_TRANS_ONCE (0<<16)
393#define VIDEO_DIP_TRANS_1 (1<<16)
394#define VIDEO_DIP_TRANS_2 (2<<16)
395
396#define AUDIO_HOTPLUG_EN (1<<24)
397
398
Wu Fengguang020abdb2010-04-19 13:13:06 +0800399static void dump_eaglelake(void)
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800400{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400401 uint32_t dword;
402 int i;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800403
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400404 /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800405
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400406 dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
407 dump_reg(SDVOB, "Digital Display Port B Control Register");
408 dump_reg(SDVOC, "Digital Display Port C Control Register");
409 dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800410
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400411 dump_reg(AUD_CONFIG, "Audio Configuration");
412 dump_reg(AUD_DEBUG, "Audio Debug");
413 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
414 dump_reg(AUD_RID, "Audio Revision ID");
415 dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
416 dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
417 dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
418 dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
419 dump_reg(AUD_PWRST, "Audio Power State");
420 dump_reg(AUD_SUPPWR, "Audio Supported Power States");
421 dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
422 dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
423 dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
424 dump_reg(AUD_OUT_STR, "Audio Stream Formats");
425 dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
426 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
427 dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
428 dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
429 dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
430 dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
431 dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
432 dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
433 dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
434 dump_reg(AUD_CNTL_ST, "Audio Control State Register");
435 dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
436 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
437 dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
438 dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
439 dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
440 dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800441
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400442 printf("\nDetails:\n\n");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800443
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400444 dword = INREG(AUD_VID_DID);
445 printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
446 printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800447
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400448 dword = INREG(AUD_RID);
449 printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
450 printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
451 printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
452 printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800453
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400454 dword = INREG(SDVOB);
455 printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
456 printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
457 printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
458 printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
459 printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800460
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400461 dword = INREG(SDVOC);
462 printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
463 printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
464 printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
465 printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
466 printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800467
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400468 dword = INREG(PORT_HOTPLUG_EN);
469 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)),
470 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)),
471 printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
472 printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
473 printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
474 printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
475 printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
476 printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)),
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800477
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400478 dword = INREG(VIDEO_DIP_CTL);
479 printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
480 printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
481 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
482 printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
483 printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
484 printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
485 printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
486 printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
487 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
488 printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
489 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
490 printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
491 printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800492
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400493 dword = INREG(AUD_CONFIG);
494 printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
495 OPNAME(pixel_clock, BITS(dword, 19, 16)));
496 printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
497 printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
498 printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800499
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400500 dword = INREG(AUD_DEBUG);
501 printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800502
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400503 dword = INREG(AUD_SUBN_CNT);
504 printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16));
505 printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800506
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400507 dword = INREG(AUD_SUBN_CNT2);
508 printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16));
509 printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800510
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400511 dword = INREG(AUD_FUNC_GRP);
512 printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
513 printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800514
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400515 dword = INREG(AUD_GRP_CAP);
516 printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
517 printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
518 printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800519
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400520 dword = INREG(AUD_PWRST);
521 printf("AUD_PWRST device power state\t\t%s\n",
522 power_state[BITS(dword, 5, 4)]);
523 printf("AUD_PWRST device power state setting\t%s\n",
524 power_state[BITS(dword, 1, 0)]);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800525
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400526 dword = INREG(AUD_SUPPWR);
527 printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
528 printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
529 printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
530 printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800531
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400532 dword = INREG(AUD_OUT_CWCAP);
533 printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
534 printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
535 printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
536 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
537 printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
538 printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
539 printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
540 printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
541 printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
542 printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
543 printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
544 printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
545 printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
546 printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800547
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400548 dword = INREG(AUD_OUT_DIG_CNVT);
549 printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8));
550 printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
551 printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
552 printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
553 printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
554 printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
555 printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
556 printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
557 printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800558
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400559 dword = INREG(AUD_OUT_CH_STR);
560 printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
561 printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800562
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400563 dword = INREG(AUD_OUT_STR_DESC);
564 printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1);
565 printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n",
566 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800567
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400568 dword = INREG(AUD_PINW_CAP);
569 printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
570 printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
571 printf("AUD_PINW_CAP channel count\t\t%lu\n",
572 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
573 printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
574 printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
575 printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
576 printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
577 printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
578 printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
579 printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
580 printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
581 printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
582 printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
583 printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800584
585
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400586 dword = INREG(AUD_PIN_CAP);
587 printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
588 printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
589 printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
590 printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800591
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400592 dword = INREG(AUD_PINW_CNTR);
593 printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
594 printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
595 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
596 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
597 printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
598 BITS(dword, 2, 0),
599 OPNAME(stream_type, BITS(dword, 2, 0)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800600
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400601 dword = INREG(AUD_PINW_UNSOLRESP);
602 printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800603
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400604 dword = INREG(AUD_CNTL_ST);
605 printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
606 printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
607 printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
608 printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
609 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
610 printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
611 BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
612 printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
613 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
614 printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
615 printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
616 printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
617 printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
618 printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
619 printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800620
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400621 dword = INREG(AUD_HDMIW_STATUS);
622 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
623 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
624 printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
625 printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800626
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400627 dword = INREG(AUD_CONV_CHCNT);
628 printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
629 printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800630
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400631 printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
632 for (i = 0; i < 8; i++) {
633 OUTREG(AUD_CONV_CHCNT, i);
634 dword = INREG(AUD_CONV_CHCNT);
635 printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4));
636 }
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800637
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400638 printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t");
639 dword = INREG(AUD_CNTL_ST);
640 dword &= ~BITMASK(8, 5);
641 OUTREG(AUD_CNTL_ST, dword);
642 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
643 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID)));
644 printf("\n");
Wu Fengguangf32aecb2011-11-12 11:12:50 +0800645
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400646 printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t");
647 dword = INREG(AUD_CNTL_ST);
648 dword &= ~BITMASK(20, 18);
649 dword &= ~BITMASK(3, 0);
650 OUTREG(AUD_CNTL_ST, dword);
651 for (i = 0; i < 8; i++)
652 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR)));
653 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800654}
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800655
Wu Fengguang020abdb2010-04-19 13:13:06 +0800656#undef AUD_RID
657#undef AUD_VID_DID
658#undef AUD_PWRST
659#undef AUD_OUT_CH_STR
660#undef AUD_HDMIW_STATUS
661
662/*
663 * IronLake registers
664 */
665#define AUD_CONFIG_A 0xE2000
666#define AUD_CONFIG_B 0xE2100
667#define AUD_CTS_ENABLE_A 0xE2028
668#define AUD_CTS_ENABLE_B 0xE2128
669#define AUD_MISC_CTRL_A 0xE2010
670#define AUD_MISC_CTRL_B 0xE2110
671#define AUD_VID_DID 0xE2020
672#define AUD_RID 0xE2024
673#define AUD_PWRST 0xE204C
674#define AUD_PORT_EN_HD_CFG 0xE207C
675#define AUD_OUT_DIG_CNVT_A 0xE2080
676#define AUD_OUT_DIG_CNVT_B 0xE2180
677#define AUD_OUT_CH_STR 0xE2088
678#define AUD_OUT_STR_DESC_A 0xE2084
679#define AUD_OUT_STR_DESC_B 0xE2184
680#define AUD_PINW_CONNLNG_LIST 0xE20A8
681#define AUD_PINW_CONNLNG_SEL 0xE20AC
682#define AUD_CNTL_ST_A 0xE20B4
683#define AUD_CNTL_ST_B 0xE21B4
684#define AUD_CNTL_ST2 0xE20C0
685#define AUD_HDMIW_STATUS 0xE20D4
686#define AUD_HDMIW_HDMIEDID_A 0xE2050
687#define AUD_HDMIW_HDMIEDID_B 0xE2150
688#define AUD_HDMIW_INFOFR_A 0xE2054
689#define AUD_HDMIW_INFOFR_B 0xE2154
690
691static void dump_ironlake(void)
692{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400693 uint32_t dword;
694 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800695
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400696 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
697 dump_reg(HDMIC, "HDMI Port C Control");
698 dump_reg(HDMID, "HDMI Port D Control");
699 dump_reg(PCH_DP_B, "DisplayPort B Control Register");
700 dump_reg(PCH_DP_C, "DisplayPort C Control Register");
701 dump_reg(PCH_DP_D, "DisplayPort D Control Register");
702 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
703 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
704 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
705 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
706 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
707 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
708 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
709 dump_reg(AUD_RID, "Audio Revision ID");
710 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
711 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
712 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
713 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
714 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
715 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
716 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
717 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
718 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
719 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
720 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
721 dump_reg(AUD_CNTL_ST2, "Audio Control State 2");
722 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
723 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
724 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
725 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
726 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800727
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400728 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800729
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400730 dword = INREG(AUD_VID_DID);
731 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
732 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800733
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400734 dword = INREG(AUD_RID);
735 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
736 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
737 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
738 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800739
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400740 dword = INREG(HDMIB);
741 printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
742 printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
743 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
744 printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23));
745 printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2));
746 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
747 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
748 printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
749 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800750
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400751 dword = INREG(HDMIC);
752 printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
753 printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
754 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
755 printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2));
756 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
757 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
758 printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
759 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800760
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400761 dword = INREG(HDMID);
762 printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
763 printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
764 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
765 printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2));
766 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
767 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
768 printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
769 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800770
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400771 dword = INREG(PCH_DP_B);
772 printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
773 printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
774 printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
775 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
776 printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
777 printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
778 printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800779
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400780 dword = INREG(PCH_DP_C);
781 printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
782 printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
783 printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
784 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
785 printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
786 printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
787 printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800788
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400789 dword = INREG(PCH_DP_D);
790 printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
791 printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
792 printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
793 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
794 printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
795 printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
796 printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800797
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400798 dword = INREG(AUD_CONFIG_A);
799 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
800 n_index_value[BIT(dword, 29)]);
801 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
802 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
803 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
804 printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
805 OPNAME(pixel_clock, BITS(dword, 19, 16)));
806 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
807 dword = INREG(AUD_CONFIG_B);
808 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
809 n_index_value[BIT(dword, 29)]);
810 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
811 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
812 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
813 printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
814 OPNAME(pixel_clock, BITS(dword, 19, 16)));
815 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800816
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400817 dword = INREG(AUD_CTS_ENABLE_A);
818 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
819 printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
820 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
821 dword = INREG(AUD_CTS_ENABLE_B);
822 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
823 printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
824 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800825
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400826 dword = INREG(AUD_MISC_CTRL_A);
827 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
828 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
829 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
830 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
831 dword = INREG(AUD_MISC_CTRL_B);
832 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
833 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
834 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
835 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800836
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400837 dword = INREG(AUD_PWRST);
838 printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]);
839 printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]);
840 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
841 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
842 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
843 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
844 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
845 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
846 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
847 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
848 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
849 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800850
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400851 dword = INREG(AUD_PORT_EN_HD_CFG);
852 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
853 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
854 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
855 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
856 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12));
857 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13));
858 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14));
859 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16));
860 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17));
861 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 +0800862
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400863 dword = INREG(AUD_OUT_DIG_CNVT_A);
864 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
865 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
866 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
867 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
868 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
869 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
870 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
871 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
872 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
873 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 +0800874
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400875 dword = INREG(AUD_OUT_DIG_CNVT_B);
876 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
877 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
878 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
879 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
880 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
881 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
882 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
883 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
884 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
885 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 +0800886
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400887 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
888 for (i = 0; i < 8; i++) {
889 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
890 dword = INREG(AUD_OUT_CH_STR);
891 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
892 1 + BITS(dword, 3, 0),
893 1 + BITS(dword, 7, 4),
894 1 + BITS(dword, 15, 12),
895 1 + BITS(dword, 23, 20));
896 }
Wu Fengguang020abdb2010-04-19 13:13:06 +0800897
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400898 dword = INREG(AUD_OUT_STR_DESC_A);
899 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
900 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
901 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
902 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
903 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 +0800904
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400905 dword = INREG(AUD_OUT_STR_DESC_B);
906 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
907 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
908 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
909 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
910 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 +0800911
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400912 dword = INREG(AUD_PINW_CONNLNG_SEL);
913 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0));
914 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8));
915 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800916
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400917 dword = INREG(AUD_CNTL_ST_A);
918 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
919 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
920 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
921 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
922 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
923 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
924 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
925 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
926 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
927 printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800928
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400929 dword = INREG(AUD_CNTL_ST_B);
930 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
931 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
932 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
933 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
934 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
935 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
936 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
937 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
938 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
939 printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800940
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400941 dword = INREG(AUD_CNTL_ST2);
942 printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1));
943 printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
944 printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5));
945 printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
946 printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9));
947 printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800948
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400949 dword = INREG(AUD_HDMIW_STATUS);
950 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
951 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
952 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
953 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
954 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
955 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800956
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400957 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
958 dword = INREG(AUD_CNTL_ST_A);
959 dword &= ~BITMASK(9, 5);
960 OUTREG(AUD_CNTL_ST_A, dword);
961 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
962 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
963 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800964
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400965 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
966 dword = INREG(AUD_CNTL_ST_B);
967 dword &= ~BITMASK(9, 5);
968 OUTREG(AUD_CNTL_ST_B, dword);
969 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
970 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
971 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800972
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400973 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
974 dword = INREG(AUD_CNTL_ST_A);
975 dword &= ~BITMASK(20, 18);
976 dword &= ~BITMASK(3, 0);
977 OUTREG(AUD_CNTL_ST_A, dword);
978 for (i = 0; i < 8; i++)
979 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
980 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800981
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400982 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
983 dword = INREG(AUD_CNTL_ST_B);
984 dword &= ~BITMASK(20, 18);
985 dword &= ~BITMASK(3, 0);
986 OUTREG(AUD_CNTL_ST_B, dword);
987 for (i = 0; i < 8; i++)
988 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
989 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800990
991}
992
993
994#undef AUD_CONFIG_A
995#undef AUD_MISC_CTRL_A
996#undef AUD_VID_DID
997#undef AUD_RID
998#undef AUD_CTS_ENABLE_A
999#undef AUD_PWRST
1000#undef AUD_HDMIW_HDMIEDID_A
1001#undef AUD_HDMIW_INFOFR_A
1002#undef AUD_PORT_EN_HD_CFG
1003#undef AUD_OUT_DIG_CNVT_A
1004#undef AUD_OUT_STR_DESC_A
1005#undef AUD_OUT_CH_STR
1006#undef AUD_PINW_CONNLNG_LIST
1007#undef AUD_CNTL_ST_A
1008#undef AUD_HDMIW_STATUS
1009#undef AUD_CONFIG_B
1010#undef AUD_MISC_CTRL_B
1011#undef AUD_CTS_ENABLE_B
1012#undef AUD_HDMIW_HDMIEDID_B
1013#undef AUD_HDMIW_INFOFR_B
1014#undef AUD_OUT_DIG_CNVT_B
1015#undef AUD_OUT_STR_DESC_B
1016#undef AUD_CNTL_ST_B
1017
1018/*
1019 * CougarPoint registers
1020 */
Wu Fengguang97d20312011-11-12 11:12:45 +08001021#define DP_CTL_B 0xE4100
Wu Fengguang020abdb2010-04-19 13:13:06 +08001022#define DP_CTL_C 0xE4200
1023#define DP_AUX_CTL_C 0xE4210
1024#define DP_AUX_TST_C 0xE4228
1025#define SPORT_DDI_CRC_C 0xE4250
1026#define SPORT_DDI_CRC_R 0xE4264
1027#define DP_CTL_D 0xE4300
1028#define DP_AUX_CTL_D 0xE4310
1029#define DP_AUX_TST_D 0xE4328
1030#define SPORT_DDI_CRC_CTL_D 0xE4350
1031#define AUD_CONFIG_A 0xE5000
1032#define AUD_MISC_CTRL_A 0xE5010
1033#define AUD_VID_DID 0xE5020
1034#define AUD_RID 0xE5024
1035#define AUD_CTS_ENABLE_A 0xE5028
1036#define AUD_PWRST 0xE504C
1037#define AUD_HDMIW_HDMIEDID_A 0xE5050
1038#define AUD_HDMIW_INFOFR_A 0xE5054
1039#define AUD_PORT_EN_HD_CFG 0xE507C
1040#define AUD_OUT_DIG_CNVT_A 0xE5080
1041#define AUD_OUT_STR_DESC_A 0xE5084
1042#define AUD_OUT_CH_STR 0xE5088
1043#define AUD_PINW_CONNLNG_LIST 0xE50A8
1044#define AUD_PINW_CONNLNG_SELA 0xE50AC
1045#define AUD_CNTL_ST_A 0xE50B4
1046#define AUD_CNTRL_ST2 0xE50C0
1047#define AUD_CNTRL_ST3 0xE50C4
1048#define AUD_HDMIW_STATUS 0xE50D4
1049#define AUD_CONFIG_B 0xE5100
1050#define AUD_MISC_CTRL_B 0xE5110
1051#define AUD_CTS_ENABLE_B 0xE5128
1052#define AUD_HDMIW_HDMIEDID_B 0xE5150
1053#define AUD_HDMIW_INFOFR_B 0xE5154
1054#define AUD_OUT_DIG_CNVT_B 0xE5180
1055#define AUD_OUT_STR_DESC_B 0xE5184
1056#define AUD_CNTL_ST_B 0xE51B4
1057#define AUD_CONFIG_C 0xE5200
1058#define AUD_MISC_CTRL_C 0xE5210
1059#define AUD_CTS_ENABLE_C 0xE5228
1060#define AUD_HDMIW_HDMIEDID_C 0xE5250
1061#define AUD_HDMIW_INFOFR_C 0xE5254
1062#define AUD_OUT_DIG_CNVT_C 0xE5280
1063#define AUD_OUT_STR_DESC_C 0xE5284
1064#define AUD_CNTL_ST_C 0xE52B4
1065#define AUD_CONFIG_D 0xE5300
1066#define AUD_MISC_CTRL_D 0xE5310
1067#define AUD_CTS_ENABLE_D 0xE5328
1068#define AUD_HDMIW_HDMIEDID_D 0xE5350
1069#define AUD_HDMIW_INFOFR_D 0xE5354
1070#define AUD_OUT_DIG_CNVT_D 0xE5380
1071#define AUD_OUT_STR_DESC_D 0xE5384
1072#define AUD_CNTL_ST_D 0xE53B4
1073
Wu Fengguange321f132011-11-12 11:12:52 +08001074#define VIDEO_DIP_CTL_A 0xE0200
1075#define VIDEO_DIP_CTL_B 0xE1200
1076#define VIDEO_DIP_CTL_C 0xE2200
1077#define VIDEO_DIP_CTL_D 0xE3200
1078
Wu Fengguang020abdb2010-04-19 13:13:06 +08001079
1080static void dump_cpt(void)
1081{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001082 uint32_t dword;
1083 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +08001084
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001085 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
1086 dump_reg(HDMIC, "HDMI Port C Control");
1087 dump_reg(HDMID, "HDMI Port D Control");
1088 dump_reg(DP_CTL_B, "DisplayPort B Control");
1089 dump_reg(DP_CTL_C, "DisplayPort C Control");
1090 dump_reg(DP_CTL_D, "DisplayPort D Control");
1091 dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control");
1092 dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control");
1093 dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control");
1094 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
1095 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
1096 dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C");
1097 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
1098 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
1099 dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C");
1100 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
1101 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
1102 dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C");
1103 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
1104 dump_reg(AUD_RID, "Audio Revision ID");
1105 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
1106 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
1107 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
1108 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
1109 dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C");
1110 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
1111 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
1112 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
1113 dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C");
1114 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
1115 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
1116 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
1117 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
1118 dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C");
1119 dump_reg(AUD_CNTRL_ST2, "Audio Control State 2");
1120 dump_reg(AUD_CNTRL_ST3, "Audio Control State 3");
1121 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
1122 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
1123 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
1124 dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C");
1125 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
1126 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
1127 dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001128
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001129 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001130
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001131 dword = INREG(VIDEO_DIP_CTL_A);
1132 printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1133 printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1134 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1135 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1136 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1137 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1138 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1139 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1140 printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1141 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1142 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1143 printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001144
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001145 dword = INREG(VIDEO_DIP_CTL_B);
1146 printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1147 printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1148 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1149 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1150 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1151 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1152 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1153 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1154 printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1155 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1156 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1157 printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001158
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001159 dword = INREG(VIDEO_DIP_CTL_C);
1160 printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1161 printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1162 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1163 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1164 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1165 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1166 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1167 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1168 printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1169 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1170 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1171 printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001172
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001173 dword = INREG(AUD_VID_DID);
1174 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
1175 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001176
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001177 dword = INREG(AUD_RID);
1178 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1179 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1180 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1181 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001182
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001183 dword = INREG(HDMIB);
1184 printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1185 printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1186 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1187 printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1188 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1189 printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1190 printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1191 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1192 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1193 printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1194 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001195
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001196 dword = INREG(HDMIC);
1197 printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1198 printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1199 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1200 printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1201 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1202 printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1203 printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1204 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1205 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1206 printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1207 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001208
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001209 dword = INREG(HDMID);
1210 printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1211 printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1212 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1213 printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1214 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1215 printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1216 printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1217 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1218 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1219 printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1220 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001221
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001222 dword = INREG(DP_CTL_B);
1223 printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1224 printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1225 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1226 printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1227 printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1228 printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001229
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001230 dword = INREG(DP_CTL_C);
1231 printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1232 printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1233 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1234 printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1235 printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1236 printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001237
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001238 dword = INREG(DP_CTL_D);
1239 printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1240 printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1241 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1242 printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1243 printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1244 printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001245
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001246 dword = INREG(AUD_CONFIG_A);
1247 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1248 n_index_value[BIT(dword, 29)]);
1249 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1250 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1251 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1252 printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1253 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1254 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1255 dword = INREG(AUD_CONFIG_B);
1256 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1257 n_index_value[BIT(dword, 29)]);
1258 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1259 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1260 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1261 printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1262 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1263 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1264 dword = INREG(AUD_CONFIG_C);
1265 printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1266 n_index_value[BIT(dword, 29)]);
1267 printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1268 printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1269 printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1270 printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1271 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1272 printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001273
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001274 dword = INREG(AUD_CTS_ENABLE_A);
1275 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1276 printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1277 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1278 dword = INREG(AUD_CTS_ENABLE_B);
1279 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1280 printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1281 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1282 dword = INREG(AUD_CTS_ENABLE_C);
1283 printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1284 printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1285 printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001286
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001287 dword = INREG(AUD_MISC_CTRL_A);
1288 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1289 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1290 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1291 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1292 dword = INREG(AUD_MISC_CTRL_B);
1293 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1294 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1295 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1296 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1297 dword = INREG(AUD_MISC_CTRL_C);
1298 printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1299 printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1300 printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1301 printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001302
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001303 dword = INREG(AUD_PWRST);
1304 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1305 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1306 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1307 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1308 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1309 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1310 printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]);
1311 printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]);
1312 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1313 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1314 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1315 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1316 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1317 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001318
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001319 dword = INREG(AUD_PORT_EN_HD_CFG);
1320 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
1321 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
1322 printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2));
1323 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1324 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1325 printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1326 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1327 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1328 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1329 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1330 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1331 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 +08001332
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001333 dword = INREG(AUD_OUT_DIG_CNVT_A);
1334 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
1335 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1336 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1337 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
1338 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1339 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1340 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
1341 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1342 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1343 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 +08001344
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001345 dword = INREG(AUD_OUT_DIG_CNVT_B);
1346 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
1347 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1348 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1349 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
1350 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1351 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1352 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
1353 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1354 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1355 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 +08001356
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001357 dword = INREG(AUD_OUT_DIG_CNVT_C);
1358 printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1));
1359 printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1360 printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1361 printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4));
1362 printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1363 printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1364 printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7));
1365 printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1366 printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1367 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 +08001368
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001369 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
1370 for (i = 0; i < 8; i++) {
1371 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
1372 dword = INREG(AUD_OUT_CH_STR);
1373 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1374 1 + BITS(dword, 3, 0),
1375 1 + BITS(dword, 7, 4),
1376 1 + BITS(dword, 15, 12),
1377 1 + BITS(dword, 23, 20));
1378 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08001379
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001380 dword = INREG(AUD_OUT_STR_DESC_A);
1381 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1382 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1383 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
1384 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1385 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 +08001386
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001387 dword = INREG(AUD_OUT_STR_DESC_B);
1388 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1389 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1390 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
1391 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1392 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 +08001393
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001394 dword = INREG(AUD_OUT_STR_DESC_C);
1395 printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1396 printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1397 printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n",
1398 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1399 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 +08001400
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001401 dword = INREG(AUD_PINW_CONNLNG_SEL);
1402 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0));
1403 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8));
1404 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001405
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001406 dword = INREG(AUD_CNTL_ST_A);
1407 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1408 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1409 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1410 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1411 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1412 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
1413 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1414 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1415 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 +08001416
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001417 dword = INREG(AUD_CNTL_ST_B);
1418 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1419 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1420 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1421 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1422 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1423 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
1424 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1425 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1426 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 +08001427
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001428 dword = INREG(AUD_CNTL_ST_C);
1429 printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1430 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1431 printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1432 printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1433 printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1434 printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n",
1435 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1436 printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1437 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 +08001438
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001439 dword = INREG(AUD_CNTRL_ST2);
1440 printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1));
1441 printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
1442 printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5));
1443 printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1444 printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9));
1445 printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001446
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001447 dword = INREG(AUD_CNTRL_ST3);
1448 printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3));
1449 printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n",
1450 BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]);
1451 printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7));
1452 printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n",
1453 BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]);
1454 printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11));
1455 printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n",
1456 BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001457
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001458 dword = INREG(AUD_HDMIW_STATUS);
1459 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1460 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1461 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1462 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1463 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1464 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1465 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1466 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001467
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001468 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1469 dword = INREG(AUD_CNTL_ST_A);
1470 dword &= ~BITMASK(9, 5);
1471 OUTREG(AUD_CNTL_ST_A, dword);
1472 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1473 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1474 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001475
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001476 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1477 dword = INREG(AUD_CNTL_ST_B);
1478 dword &= ~BITMASK(9, 5);
1479 OUTREG(AUD_CNTL_ST_B, dword);
1480 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1481 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1482 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001483
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001484 printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t");
1485 dword = INREG(AUD_CNTL_ST_C);
1486 dword &= ~BITMASK(9, 5);
1487 OUTREG(AUD_CNTL_ST_C, dword);
1488 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1489 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C)));
1490 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001491
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001492 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1493 dword = INREG(AUD_CNTL_ST_A);
1494 dword &= ~BITMASK(20, 18);
1495 dword &= ~BITMASK(3, 0);
1496 OUTREG(AUD_CNTL_ST_A, dword);
1497 for (i = 0; i < 8; i++)
1498 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1499 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001500
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001501 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1502 dword = INREG(AUD_CNTL_ST_B);
1503 dword &= ~BITMASK(20, 18);
1504 dword &= ~BITMASK(3, 0);
1505 OUTREG(AUD_CNTL_ST_B, dword);
1506 for (i = 0; i < 8; i++)
1507 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1508 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001509
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001510 printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t");
1511 dword = INREG(AUD_CNTL_ST_C);
1512 dword &= ~BITMASK(20, 18);
1513 dword &= ~BITMASK(3, 0);
1514 OUTREG(AUD_CNTL_ST_C, dword);
1515 for (i = 0; i < 8; i++)
1516 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C)));
1517 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001518
1519}
1520
Wang Xingchaoc4077222012-08-15 16:13:38 +08001521#undef AUD_CONFIG_A
1522#undef AUD_MISC_CTRL_A
1523#undef AUD_VID_DID
1524#undef AUD_RID
1525#undef AUD_CTS_ENABLE_A
1526#undef AUD_PWRST
1527#undef AUD_HDMIW_HDMIEDID_A
1528#undef AUD_HDMIW_INFOFR_A
1529#undef AUD_PORT_EN_HD_CFG
1530#undef AUD_OUT_DIG_CNVT_A
1531#undef AUD_OUT_STR_DESC_A
1532#undef AUD_OUT_CH_STR
1533#undef AUD_PINW_CONNLNG_LIST
Mengdong Lindeba8682013-09-09 15:38:40 -04001534#undef AUD_PINW_CONNLNG_SEL
Wang Xingchaoc4077222012-08-15 16:13:38 +08001535#undef AUD_CNTL_ST_A
1536#undef AUD_HDMIW_STATUS
1537#undef AUD_CONFIG_B
1538#undef AUD_MISC_CTRL_B
1539#undef AUD_CTS_ENABLE_B
1540#undef AUD_HDMIW_HDMIEDID_B
1541#undef AUD_HDMIW_INFOFR_B
1542#undef AUD_OUT_DIG_CNVT_B
1543#undef AUD_OUT_STR_DESC_B
1544#undef AUD_CNTL_ST_B
1545#undef AUD_CONFIG_C
1546#undef AUD_MISC_CTRL_C
1547#undef AUD_CTS_ENABLE_C
1548#undef AUD_HDMIW_HDMIEDID_C
1549#undef AUD_HDMIW_INFOFR_C
1550#undef AUD_OUT_DIG_CNVT_C
1551#undef AUD_OUT_STR_DESC_C
1552
1553#undef VIDEO_DIP_CTL_A
1554#undef VIDEO_DIP_CTL_B
1555#undef VIDEO_DIP_CTL_C
1556#undef VIDEO_DIP_CTL_D
1557#undef VIDEO_DIP_DATA
1558
1559/*
1560 * Haswell registers
1561 */
1562
1563/* DisplayPort Transport Control */
1564#define DP_TP_CTL_A 0x64040
1565#define DP_TP_CTL_B 0x64140
1566#define DP_TP_CTL_C 0x64240
1567#define DP_TP_CTL_D 0x64340
1568#define DP_TP_CTL_E 0x64440
1569
1570/* DisplayPort Transport Status */
1571#define DP_TP_ST_A 0x64044
1572#define DP_TP_ST_B 0x64144
1573#define DP_TP_ST_C 0x64244
1574#define DP_TP_ST_D 0x64344
1575#define DP_TP_ST_E 0x64444
1576
Wang Xingchaoc4077222012-08-15 16:13:38 +08001577/* DDI Buffer Control */
1578#define DDI_BUF_CTL_A 0x64000
1579#define DDI_BUF_CTL_B 0x64100
1580#define DDI_BUF_CTL_C 0x64200
1581#define DDI_BUF_CTL_D 0x64300
1582#define DDI_BUF_CTL_E 0x64400
1583
1584/* DDI Buffer Translation */
1585#define DDI_BUF_TRANS_A 0x64e00
1586#define DDI_BUF_TRANS_B 0x64e60
1587#define DDI_BUF_TRANS_C 0x64ec0
1588#define DDI_BUF_TRANS_D 0x64f20
1589#define DDI_BUF_TRANS_E 0x64f80
1590
1591/* DDI Aux Channel */
1592#define DDI_AUX_CHANNEL_CTRL 0x64010
1593#define DDI_AUX_DATA 0x64014
1594#define DDI_AUX_TST 0x64028
1595
1596/* DDI CRC Control */
1597#define DDI_CRC_CTL_A 0x64050
1598#define DDI_CRC_CTL_B 0x64150
1599#define DDI_CRC_CTL_C 0x64250
1600#define DDI_CRC_CTL_D 0x64350
1601#define DDI_CRC_CTL_E 0x64450
1602
1603/* Pipe DDI Function Control */
1604#define PIPE_DDI_FUNC_CTL_A 0x60400
1605#define PIPE_DDI_FUNC_CTL_B 0x61400
1606#define PIPE_DDI_FUNC_CTL_C 0x62400
1607#define PIPE_DDI_FUNC_CTL_EDP 0x6F400
1608
1609/* Pipe Configuration */
1610#define PIPE_CONF_A 0x70008
1611#define PIPE_CONF_B 0x71008
1612#define PIPE_CONF_C 0x72008
1613#define PIPE_CONF_EDP 0x7F008
1614
1615/* Audio registers */
Mengdong Lindeba8682013-09-09 15:38:40 -04001616#define AUD_TCA_CONFIG 0x65000
1617#define AUD_TCB_CONFIG 0x65100
1618#define AUD_TCC_CONFIG 0x65200
1619#define AUD_C1_MISC_CTRL 0x65010
1620#define AUD_C2_MISC_CTRL 0x65110
1621#define AUD_C3_MISC_CTRL 0x65210
1622#define AUD_VID_DID 0x65020
1623#define AUD_RID 0x65024
1624#define AUD_TCA_M_CTS_ENABLE 0x65028
1625#define AUD_TCB_M_CTS_ENABLE 0x65128
1626#define AUD_TCC_M_CTS_ENABLE 0x65228
1627#define AUD_PWRST 0x6504C
1628#define AUD_TCA_EDID_DATA 0x65050
1629#define AUD_TCB_EDID_DATA 0x65150
1630#define AUD_TCC_EDID_DATA 0x65250
1631#define AUD_TCA_INFOFR 0x65054
1632#define AUD_TCB_INFOFR 0x65154
1633#define AUD_TCC_INFOFR 0x65254
1634#define AUD_PIPE_CONV_CFG 0x6507C
1635#define AUD_C1_DIG_CNVT 0x65080
1636#define AUD_C2_DIG_CNVT 0x65180
1637#define AUD_C3_DIG_CNVT 0x65280
1638#define AUD_C1_STR_DESC 0x65084
1639#define AUD_C2_STR_DESC 0x65184
1640#define AUD_C3_STR_DESC 0x65284
1641#define AUD_OUT_CHAN_MAP 0x65088
1642#define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8
1643#define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8
1644#define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8
Wang Xingchaoc4077222012-08-15 16:13:38 +08001645#define AUD_PIPE_CONN_SEL_CTRL 0x650AC
Mengdong Lindeba8682013-09-09 15:38:40 -04001646#define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4
1647#define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4
1648#define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4
1649#define AUD_PIN_ELD_CP_VLD 0x650C0
1650#define AUD_HDMI_FIFO_STATUS 0x650D4
Wang Xingchaoc4077222012-08-15 16:13:38 +08001651
Mengdong Lin85357202013-08-13 00:21:57 -04001652/* Audio debug registers */
1653#define AUD_ICOI 0x65f00
1654#define AUD_IRII 0x65f04
1655#define AUD_ICS 0x65f08
Mengdong Linf075c3c2013-08-13 00:22:14 -04001656#define AUD_CHICKENBIT_REG 0x65f10
Mengdong Lin97e5cf62013-08-13 00:22:24 -04001657#define AUD_DP_DIP_STATUS 0x65f20
Mengdong Lin85357202013-08-13 00:21:57 -04001658
Wang Xingchaoc4077222012-08-15 16:13:38 +08001659/* Video DIP Control */
1660#define VIDEO_DIP_CTL_A 0x60200
1661#define VIDEO_DIP_CTL_B 0x61200
1662#define VIDEO_DIP_CTL_C 0x62200
1663#define VIDEO_DIP_CTL_D 0x63200
1664
1665#define VIDEO_DIP_DATA 0x60220
1666#define VIDEO_DIP_ECC 0x60240
1667
1668#define AUD_DP_DIP_STATUS 0x65f20
1669
Mengdong Lindeba8682013-09-09 15:38:40 -04001670#define MAX_PREFIX_SIZE 128
1671
1672#undef TRANSCODER_A
1673#undef TRANSCODER_B
1674#undef TRANSCODER_C
1675enum {
1676 TRANSCODER_A = 0,
1677 TRANSCODER_B,
1678 TRANSCODER_C,
1679};
1680
1681enum {
1682 PIPE_A = 0,
1683 PIPE_B,
1684 PIPE_C,
1685};
1686
1687enum {
1688 PORT_A = 0,
1689 PORT_B,
1690 PORT_C,
1691 PORT_D,
1692 PORT_E,
1693};
1694
1695enum {
1696 CONVERTER_1 = 0,
1697 CONVERTER_2,
1698 CONVERTER_3,
1699};
1700
1701static void dump_ddi_buf_ctl(int port)
1702{
1703 uint32_t dword;
1704
1705 dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100);
1706 printf("DDI %c Buffer control\n", 'A' + port - PORT_A);
1707 printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1),
1708 OPNAME(dp_port_width, BITS(dword, 3, 1)));
1709 printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31));
1710}
1711
1712static void dump_ddi_func_ctl(int pipe)
1713{
1714 uint32_t dword;
1715
1716 dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000);
1717 printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A);
1718 printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20),
1719 OPNAME(bits_per_color, BITS(dword, 22, 20)));
1720 printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24),
1721 OPNAME(ddi_mode, BITS(dword, 26, 24)));
1722 printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28),
1723 OPNAME(trans_to_port_sel, BITS(dword, 30, 28)));
1724 printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31));
1725}
1726
1727static void dump_aud_transcoder_config(int transcoder)
1728{
1729 uint32_t dword;
1730 char prefix[MAX_PREFIX_SIZE];
1731
1732 dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100);
1733 sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A);
1734
1735 printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1736 printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4));
1737 printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16),
1738 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1739 printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20));
1740 printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28));
1741 printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29),
1742 OPNAME(n_index_value, BIT(dword, 29)));
1743}
1744
1745static void dump_aud_misc_control(int converter)
1746{
1747 uint32_t dword;
1748 char prefix[MAX_PREFIX_SIZE];
1749
1750 dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100);
1751 sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1);
1752
1753 printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1754 printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2));
1755 printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4));
1756 printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8));
1757}
1758
1759static void dump_aud_vendor_device_id(void)
1760{
1761 uint32_t dword;
1762
1763 dword = INREG(AUD_VID_DID);
1764 printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0));
1765 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16));
1766}
1767
1768static void dump_aud_revision_id(void)
1769{
1770 uint32_t dword;
1771
1772 dword = INREG(AUD_RID);
1773 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
1774 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1775 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1776 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1777}
1778
1779static void dump_aud_m_cts_enable(int transcoder)
1780{
1781 uint32_t dword;
1782 char prefix[MAX_PREFIX_SIZE];
1783
1784 dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100);
1785 sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A);
1786
1787 printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0));
1788 printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20));
1789 printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M");
1790}
1791
1792static void dump_aud_power_state(void)
1793{
1794 uint32_t dword;
1795
1796 dword = INREG(AUD_PWRST);
1797 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1798 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1799 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1800 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1801 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
1802 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1803 printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1804 printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1805 printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1806 printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1807 printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]);
1808 printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]);
1809 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1810 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1811}
1812
1813static void dump_aud_edid_data(int transcoder)
1814{
1815 uint32_t dword;
1816 int i;
1817 int offset = (transcoder - TRANSCODER_A) * 0x100;
1818
1819 printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A);
1820 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1821 dword &= ~BITMASK(9, 5);
1822 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1823 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1824 printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset)));
1825 printf("\n");
1826}
1827
1828static void dump_aud_infoframe(int transcoder)
1829{
1830 uint32_t dword;
1831 int i;
1832 int offset = (transcoder - TRANSCODER_A) * 0x100;
1833
1834 printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A);
1835 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1836 dword &= ~BITMASK(20, 18);
1837 dword &= ~BITMASK(3, 0);
1838 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1839 for (i = 0; i < 8; i++)
1840 printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset)));
1841 printf("\n");
1842}
1843
1844static void dump_aud_pipe_conv_cfg(void)
1845{
1846 uint32_t dword;
1847
1848 dword = INREG(AUD_PIPE_CONV_CFG);
1849 printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0));
1850 printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1));
1851 printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2));
1852 printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1853 printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1854 printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1855 printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1856 printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1857 printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1858 printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1859 printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1860 printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
1861}
1862
1863static void dump_aud_dig_cnvt(int converter)
1864{
1865 uint32_t dword;
1866 char prefix[MAX_PREFIX_SIZE];
1867
1868 dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100);
1869 sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1);
1870
1871 printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1872 printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2));
1873 printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1874 printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4));
1875 printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5));
1876 printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6));
1877 printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7));
1878 printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8));
1879 printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16));
1880 printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20));
1881}
1882
1883static void dump_aud_str_desc(int converter)
1884{
1885 uint32_t dword;
1886 char prefix[MAX_PREFIX_SIZE];
1887 uint32_t rate;
1888
1889 dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100);
1890 sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1);
1891
1892 printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0));
1893 printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4),
1894 OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1895
1896 printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8),
1897 OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8)));
1898 printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11),
1899 OPNAME(sample_base_rate_mult, BITS(dword, 13, 11)));
1900 printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14),
1901 OPNAME(sample_base_rate, BIT(dword, 14)));
1902 rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1)
1903 /(BITS(dword, 10, 8) + 1);
1904 printf("=> Sample Rate %d Hz\n", rate);
1905
1906 printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1);
1907}
1908
1909static void dump_aud_out_chan_map(void)
1910{
1911 uint32_t dword;
1912 int i;
1913
1914 printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n");
1915 for (i = 0; i < 8; i++) {
1916 OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16));
1917 dword = INREG(AUD_OUT_CHAN_MAP);
1918 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1919 1 + BITS(dword, 3, 0),
1920 1 + BITS(dword, 7, 4),
1921 1 + BITS(dword, 15, 12),
1922 1 + BITS(dword, 23, 20));
1923 }
1924}
1925
1926static void dump_aud_connect_list_entry_length(int transcoder)
1927{
1928 uint32_t dword;
1929 char prefix[MAX_PREFIX_SIZE];
1930
1931 dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100);
1932 sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A);
1933
1934 printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0));
1935 printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7),
1936 OPNAME(connect_list_form, BIT(dword, 7)));
1937 printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8));
1938}
1939
1940static void dump_aud_connect_select_ctrl(void)
1941{
1942 uint32_t dword;
1943
1944 dword = INREG(AUD_PIPE_CONN_SEL_CTRL);
1945 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0));
1946 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8));
1947 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16));
1948}
1949
1950static void dump_aud_dip_eld_ctrl_st(int transcoder)
1951{
1952 uint32_t dword;
1953 int offset = (transcoder - TRANSCODER_A) * 0x100;
1954
1955 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1956 printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A);
1957
1958 printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4));
1959 printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10));
1960 printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16),
1961 dip_trans[BITS(dword, 17, 16)]);
1962 printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18),
1963 dip_index[BITS(dword, 20, 18)]);
1964 printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21),
1965 dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]);
1966 printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29),
1967 dip_port[BITS(dword, 30, 29)]);
1968 printf("\n");
1969}
1970
1971static void dump_aud_eld_cp_vld(void)
1972{
1973 uint32_t dword;
1974
1975 dword = INREG(AUD_PIN_ELD_CP_VLD);
1976 printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0));
1977 printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1));
1978 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2));
1979 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3));
1980 printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4));
1981 printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5));
1982 printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6));
1983 printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7));
1984 printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8));
1985 printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9));
1986 printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10));
1987 printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11));
1988}
1989
1990static void dump_hdmi_fifo_status(void)
1991{
1992 uint32_t dword;
1993
1994 dword = INREG(AUD_HDMI_FIFO_STATUS);
1995 printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
1996 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1997 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1998 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1999 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
2000 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
2001 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
2002}
Wang Xingchaoc4077222012-08-15 16:13:38 +08002003
Mengdong Linf075c3c2013-08-13 00:22:14 -04002004static void parse_bdw_audio_chicken_bit_reg(uint32_t dword)
2005{
2006 printf("\t");
2007 printf("%s\n\t", OPNAME(vanilla_dp12_en, BIT(dword, 31)));
2008 printf("%s\n\t", OPNAME(vanilla_3_widgets_en, BIT(dword, 30)));
2009 printf("%s\n\t", OPNAME(block_audio, BIT(dword, 10)));
2010 printf("%s\n\t", OPNAME(dis_eld_valid_pulse_trans, BIT(dword, 9)));
2011 printf("%s\n\t", OPNAME(dis_pd_pulse_trans, BIT(dword, 8)));
2012 printf("%s\n\t", OPNAME(dis_ts_delta_err, BIT(dword, 7)));
2013 printf("%s\n\t", OPNAME(dis_ts_fix_dp_hbr, BIT(dword, 6)));
2014 printf("%s\n\t", OPNAME(pattern_gen_8_ch_en, BIT(dword, 5)));
2015 printf("%s\n\t", OPNAME(pattern_gen_2_ch_en, BIT(dword, 4)));
2016 printf("%s\n\t", OPNAME(fabric_32_44_dis, BIT(dword, 3)));
2017 printf("%s\n\t", OPNAME(epss_dis, BIT(dword, 2)));
2018 printf("%s\n\t", OPNAME(ts_test_mode, BIT(dword, 1)));
2019 printf("%s\n", OPNAME(en_mmio_program, BIT(dword, 0)));
2020}
2021
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002022/* Dump audio registers for Haswell and its successors (eg. Broadwell).
2023 * Their register layout are same in the north display engine.
2024 */
2025static void dump_hsw_plus(void)
Wang Xingchaoc4077222012-08-15 16:13:38 +08002026{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002027 uint32_t dword;
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002028 int i;
Wang Xingchaoc4077222012-08-15 16:13:38 +08002029
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002030 /* HSW DDI Buffer */
2031 dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A");
2032 dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B");
2033 dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C");
2034 dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D");
2035 dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002036
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002037 /* HSW Pipe Function */
2038 dump_reg(PIPE_CONF_A, "PIPE Configuration A");
2039 dump_reg(PIPE_CONF_B, "PIPE Configuration B");
2040 dump_reg(PIPE_CONF_C, "PIPE Configuration C");
2041 dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002042
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002043 dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A");
2044 dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B");
2045 dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C");
2046 dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002047
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002048 /* HSW Display port */
2049 dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control");
2050 dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control");
2051 dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control");
2052 dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control");
2053 dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002054
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002055 dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status");
2056 dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status");
2057 dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status");
2058 dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status");
2059 dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002060
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002061 /* HSW North Display Audio */
Mengdong Lindeba8682013-09-09 15:38:40 -04002062 dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A");
2063 dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B");
2064 dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C");
2065 dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control");
2066 dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control");
2067 dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002068 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
Mengdong Lindeba8682013-09-09 15:38:40 -04002069 dump_reg(AUD_RID, "Audio Revision ID");
2070 dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A");
2071 dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B");
2072 dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002073 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
Mengdong Lindeba8682013-09-09 15:38:40 -04002074 dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A");
2075 dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B");
2076 dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C");
2077 dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A");
2078 dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B");
2079 dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C");
2080 dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs");
2081 dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1");
2082 dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2");
2083 dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3");
2084 dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1");
2085 dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2");
2086 dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002087 dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping");
Mengdong Lindeba8682013-09-09 15:38:40 -04002088 dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A");
2089 dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B");
2090 dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002091 dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control");
Mengdong Lindeba8682013-09-09 15:38:40 -04002092 dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A");
2093 dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B");
2094 dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C");
2095 dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status");
2096 dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002097
Mengdong Lin85357202013-08-13 00:21:57 -04002098 /* Audio debug registers */
2099 dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface");
2100 dump_reg(AUD_IRII, "Audio Immediate Response Input Interface");
2101 dump_reg(AUD_ICS, "Audio Immediate Command Status");
Mengdong Linf075c3c2013-08-13 00:22:14 -04002102 dump_reg(AUD_CHICKENBIT_REG, "Audio Chicken Bit Register");
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002103 dump_reg(AUD_DP_DIP_STATUS, "Audio DP and DIP FIFO Debug Status");
Mengdong Lin85357202013-08-13 00:21:57 -04002104
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002105 printf("\nDetails:\n\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002106
Mengdong Lindeba8682013-09-09 15:38:40 -04002107 dump_ddi_buf_ctl(PORT_A);
2108 dump_ddi_buf_ctl(PORT_B);
2109 dump_ddi_buf_ctl(PORT_C);
2110 dump_ddi_buf_ctl(PORT_D);
2111 dump_ddi_buf_ctl(PORT_E);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002112
Mengdong Lindeba8682013-09-09 15:38:40 -04002113 dump_ddi_func_ctl(PIPE_A);
2114 dump_ddi_func_ctl(PIPE_B);
2115 dump_ddi_func_ctl(PIPE_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002116
Mengdong Lindeba8682013-09-09 15:38:40 -04002117 /* audio configuration - details */
2118 dump_aud_transcoder_config(TRANSCODER_A);
2119 dump_aud_transcoder_config(TRANSCODER_B);
2120 dump_aud_transcoder_config(TRANSCODER_C);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002121
Mengdong Lindeba8682013-09-09 15:38:40 -04002122 dump_aud_misc_control(CONVERTER_1);
2123 dump_aud_misc_control(CONVERTER_2);
2124 dump_aud_misc_control(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002125
Mengdong Lindeba8682013-09-09 15:38:40 -04002126 dump_aud_vendor_device_id();
2127 dump_aud_revision_id();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002128
Mengdong Lindeba8682013-09-09 15:38:40 -04002129 dump_aud_m_cts_enable(TRANSCODER_A);
2130 dump_aud_m_cts_enable(TRANSCODER_B);
2131 dump_aud_m_cts_enable(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002132
Mengdong Lindeba8682013-09-09 15:38:40 -04002133 dump_aud_power_state();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002134
Mengdong Lindeba8682013-09-09 15:38:40 -04002135 dump_aud_edid_data(TRANSCODER_A);
2136 dump_aud_edid_data(TRANSCODER_B);
2137 dump_aud_edid_data(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002138
Mengdong Lindeba8682013-09-09 15:38:40 -04002139 dump_aud_infoframe(TRANSCODER_A);
2140 dump_aud_infoframe(TRANSCODER_B);
2141 dump_aud_infoframe(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002142
Mengdong Lindeba8682013-09-09 15:38:40 -04002143 dump_aud_pipe_conv_cfg();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002144
Mengdong Lindeba8682013-09-09 15:38:40 -04002145 dump_aud_dig_cnvt(CONVERTER_1);
2146 dump_aud_dig_cnvt(CONVERTER_2);
2147 dump_aud_dig_cnvt(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002148
Mengdong Lindeba8682013-09-09 15:38:40 -04002149 dump_aud_str_desc(CONVERTER_1);
2150 dump_aud_str_desc(CONVERTER_2);
2151 dump_aud_str_desc(CONVERTER_3);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002152
Mengdong Lindeba8682013-09-09 15:38:40 -04002153 dump_aud_out_chan_map();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002154
Mengdong Lindeba8682013-09-09 15:38:40 -04002155 dump_aud_connect_list_entry_length(TRANSCODER_A);
2156 dump_aud_connect_list_entry_length(TRANSCODER_B);
2157 dump_aud_connect_list_entry_length(TRANSCODER_C);
2158 dump_aud_connect_select_ctrl();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002159
Mengdong Lindeba8682013-09-09 15:38:40 -04002160 dump_aud_dip_eld_ctrl_st(TRANSCODER_A);
2161 dump_aud_dip_eld_ctrl_st(TRANSCODER_B);
2162 dump_aud_dip_eld_ctrl_st(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002163
Mengdong Lindeba8682013-09-09 15:38:40 -04002164 dump_aud_eld_cp_vld();
2165 dump_hdmi_fifo_status();
Mengdong Lin85357202013-08-13 00:21:57 -04002166
2167 printf("\nDetails:\n\n");
2168
2169 printf("IRV [%1lx] %s\t", BIT(dword, 1),
2170 OPNAME(immed_result_valid, BIT(dword, 1)));
2171 printf("ICB [%1lx] %s\n", BIT(dword, 1),
2172 OPNAME(immed_cmd_busy, BIT(dword, 0)));
Mengdong Linf075c3c2013-08-13 00:22:14 -04002173
2174 dword = INREG(AUD_CHICKENBIT_REG);
2175 printf("AUD_CHICKENBIT_REG Audio Chicken Bits: %08x\n", dword);
2176 if (IS_BROADWELL(devid))
2177 parse_bdw_audio_chicken_bit_reg(dword);
2178
Mengdong Lin97e5cf62013-08-13 00:22:24 -04002179 dword = INREG(AUD_DP_DIP_STATUS);
2180 printf("AUD_DP_DIP_STATUS Audio DP & DIP FIFO Status: %08x\n\t", dword);
2181 for (i = 31; i >= 0; i--)
2182 if (BIT(dword, i))
2183 printf("%s\n\t", audio_dp_dip_status[i]);
2184 printf("\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002185}
2186
Wu Fengguang020abdb2010-04-19 13:13:06 +08002187int main(int argc, char **argv)
2188{
2189 struct pci_device *pci_dev;
2190
2191 pci_dev = intel_get_pci_device();
2192 devid = pci_dev->device_id; /* XXX not true when mapping! */
2193
2194 do_self_tests();
2195
2196 if (argc == 2)
2197 intel_map_file(argv[1]);
2198 else
2199 intel_get_mmio(pci_dev);
2200
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002201 if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
2202 printf("%s audio registers:\n\n",
2203 IS_BROADWELL(devid) ? "Broadwell" : "Haswell");
2204 dump_hsw_plus();
2205 } else if (IS_GEN6(devid) || IS_GEN7(devid)
2206 || getenv("HAS_PCH_SPLIT")) {
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002207 printf("%s audio registers:\n\n",
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002208 IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002209 intel_check_pch();
2210 dump_cpt();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002211 } else if (IS_GEN5(devid)) {
2212 printf("Ironlake audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002213 dump_ironlake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002214 } else if (IS_G4X(devid)) {
2215 printf("G45 audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002216 dump_eaglelake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002217 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08002218
2219 return 0;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08002220}