blob: 3475caaadb946de3b3e5b4a1d199a2dde70432c1 [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
Wu Fengguang020abdb2010-04-19 13:13:06 +0800318static void do_self_tests(void)
319{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400320 if (BIT(1, 0) != 1)
321 exit(1);
322 if (BIT(0x80000000, 31) != 1)
323 exit(2);
324 if (BITS(0xc0000000, 31, 30) != 3)
325 exit(3);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800326}
327
328/*
329 * EagleLake registers
330 */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800331#define AUD_CONFIG 0x62000
332#define AUD_DEBUG 0x62010
333#define AUD_VID_DID 0x62020
334#define AUD_RID 0x62024
335#define AUD_SUBN_CNT 0x62028
336#define AUD_FUNC_GRP 0x62040
337#define AUD_SUBN_CNT2 0x62044
338#define AUD_GRP_CAP 0x62048
339#define AUD_PWRST 0x6204c
340#define AUD_SUPPWR 0x62050
341#define AUD_SID 0x62054
342#define AUD_OUT_CWCAP 0x62070
343#define AUD_OUT_PCMSIZE 0x62074
344#define AUD_OUT_STR 0x62078
345#define AUD_OUT_DIG_CNVT 0x6207c
346#define AUD_OUT_CH_STR 0x62080
347#define AUD_OUT_STR_DESC 0x62084
348#define AUD_PINW_CAP 0x620a0
349#define AUD_PIN_CAP 0x620a4
350#define AUD_PINW_CONNLNG 0x620a8
351#define AUD_PINW_CONNLST 0x620ac
352#define AUD_PINW_CNTR 0x620b0
353#define AUD_PINW_UNSOLRESP 0x620b8
354#define AUD_CNTL_ST 0x620b4
355#define AUD_PINW_CONFIG 0x620bc
356#define AUD_HDMIW_STATUS 0x620d4
357#define AUD_HDMIW_HDMIEDID 0x6210c
358#define AUD_HDMIW_INFOFR 0x62118
359#define AUD_CONV_CHCNT 0x62120
360#define AUD_CTS_ENABLE 0x62128
361
362#define VIDEO_DIP_CTL 0x61170
363#define VIDEO_DIP_ENABLE (1<<31)
364#define VIDEO_DIP_ENABLE_AVI (1<<21)
365#define VIDEO_DIP_ENABLE_VENDOR (1<<22)
366#define VIDEO_DIP_ENABLE_SPD (1<<24)
367#define VIDEO_DIP_BUF_AVI (0<<19)
368#define VIDEO_DIP_BUF_VENDOR (1<<19)
369#define VIDEO_DIP_BUF_SPD (3<<19)
370#define VIDEO_DIP_TRANS_ONCE (0<<16)
371#define VIDEO_DIP_TRANS_1 (1<<16)
372#define VIDEO_DIP_TRANS_2 (2<<16)
373
374#define AUDIO_HOTPLUG_EN (1<<24)
375
376
Wu Fengguang020abdb2010-04-19 13:13:06 +0800377static void dump_eaglelake(void)
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800378{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400379 uint32_t dword;
380 int i;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800381
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400382 /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800383
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400384 dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
385 dump_reg(SDVOB, "Digital Display Port B Control Register");
386 dump_reg(SDVOC, "Digital Display Port C Control Register");
387 dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800388
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400389 dump_reg(AUD_CONFIG, "Audio Configuration");
390 dump_reg(AUD_DEBUG, "Audio Debug");
391 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
392 dump_reg(AUD_RID, "Audio Revision ID");
393 dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
394 dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
395 dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
396 dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
397 dump_reg(AUD_PWRST, "Audio Power State");
398 dump_reg(AUD_SUPPWR, "Audio Supported Power States");
399 dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
400 dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
401 dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
402 dump_reg(AUD_OUT_STR, "Audio Stream Formats");
403 dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
404 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
405 dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
406 dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
407 dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
408 dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
409 dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
410 dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
411 dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
412 dump_reg(AUD_CNTL_ST, "Audio Control State Register");
413 dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
414 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
415 dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
416 dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
417 dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
418 dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800419
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400420 printf("\nDetails:\n\n");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800421
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400422 dword = INREG(AUD_VID_DID);
423 printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
424 printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800425
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400426 dword = INREG(AUD_RID);
427 printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
428 printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
429 printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
430 printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800431
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400432 dword = INREG(SDVOB);
433 printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
434 printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
435 printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
436 printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
437 printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800438
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400439 dword = INREG(SDVOC);
440 printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
441 printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
442 printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
443 printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
444 printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800445
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400446 dword = INREG(PORT_HOTPLUG_EN);
447 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)),
448 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)),
449 printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
450 printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
451 printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
452 printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
453 printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
454 printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)),
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800455
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400456 dword = INREG(VIDEO_DIP_CTL);
457 printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
458 printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
459 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
460 printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
461 printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
462 printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
463 printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
464 printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
465 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
466 printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
467 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
468 printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
469 printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800470
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400471 dword = INREG(AUD_CONFIG);
472 printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
473 OPNAME(pixel_clock, BITS(dword, 19, 16)));
474 printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
475 printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
476 printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800477
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400478 dword = INREG(AUD_DEBUG);
479 printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800480
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400481 dword = INREG(AUD_SUBN_CNT);
482 printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16));
483 printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800484
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400485 dword = INREG(AUD_SUBN_CNT2);
486 printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16));
487 printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800488
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400489 dword = INREG(AUD_FUNC_GRP);
490 printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
491 printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800492
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400493 dword = INREG(AUD_GRP_CAP);
494 printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
495 printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
496 printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800497
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400498 dword = INREG(AUD_PWRST);
499 printf("AUD_PWRST device power state\t\t%s\n",
500 power_state[BITS(dword, 5, 4)]);
501 printf("AUD_PWRST device power state setting\t%s\n",
502 power_state[BITS(dword, 1, 0)]);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800503
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400504 dword = INREG(AUD_SUPPWR);
505 printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
506 printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
507 printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
508 printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800509
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400510 dword = INREG(AUD_OUT_CWCAP);
511 printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
512 printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
513 printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
514 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
515 printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
516 printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
517 printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
518 printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
519 printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
520 printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
521 printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
522 printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
523 printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
524 printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800525
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400526 dword = INREG(AUD_OUT_DIG_CNVT);
527 printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8));
528 printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
529 printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
530 printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
531 printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
532 printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
533 printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
534 printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
535 printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800536
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400537 dword = INREG(AUD_OUT_CH_STR);
538 printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
539 printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800540
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400541 dword = INREG(AUD_OUT_STR_DESC);
542 printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1);
543 printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n",
544 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800545
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400546 dword = INREG(AUD_PINW_CAP);
547 printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
548 printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
549 printf("AUD_PINW_CAP channel count\t\t%lu\n",
550 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
551 printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
552 printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
553 printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
554 printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
555 printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
556 printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
557 printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
558 printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
559 printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
560 printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
561 printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800562
563
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400564 dword = INREG(AUD_PIN_CAP);
565 printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
566 printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
567 printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
568 printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800569
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400570 dword = INREG(AUD_PINW_CNTR);
571 printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
572 printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
573 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
574 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
575 printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
576 BITS(dword, 2, 0),
577 OPNAME(stream_type, BITS(dword, 2, 0)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800578
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400579 dword = INREG(AUD_PINW_UNSOLRESP);
580 printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800581
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400582 dword = INREG(AUD_CNTL_ST);
583 printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
584 printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
585 printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
586 printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
587 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
588 printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
589 BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
590 printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
591 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
592 printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
593 printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
594 printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
595 printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
596 printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
597 printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800598
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400599 dword = INREG(AUD_HDMIW_STATUS);
600 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
601 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
602 printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
603 printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800604
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400605 dword = INREG(AUD_CONV_CHCNT);
606 printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
607 printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800608
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400609 printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
610 for (i = 0; i < 8; i++) {
611 OUTREG(AUD_CONV_CHCNT, i);
612 dword = INREG(AUD_CONV_CHCNT);
613 printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4));
614 }
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800615
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400616 printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t");
617 dword = INREG(AUD_CNTL_ST);
618 dword &= ~BITMASK(8, 5);
619 OUTREG(AUD_CNTL_ST, dword);
620 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
621 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID)));
622 printf("\n");
Wu Fengguangf32aecb2011-11-12 11:12:50 +0800623
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400624 printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t");
625 dword = INREG(AUD_CNTL_ST);
626 dword &= ~BITMASK(20, 18);
627 dword &= ~BITMASK(3, 0);
628 OUTREG(AUD_CNTL_ST, dword);
629 for (i = 0; i < 8; i++)
630 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR)));
631 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800632}
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800633
Wu Fengguang020abdb2010-04-19 13:13:06 +0800634#undef AUD_RID
635#undef AUD_VID_DID
636#undef AUD_PWRST
637#undef AUD_OUT_CH_STR
638#undef AUD_HDMIW_STATUS
639
640/*
641 * IronLake registers
642 */
643#define AUD_CONFIG_A 0xE2000
644#define AUD_CONFIG_B 0xE2100
645#define AUD_CTS_ENABLE_A 0xE2028
646#define AUD_CTS_ENABLE_B 0xE2128
647#define AUD_MISC_CTRL_A 0xE2010
648#define AUD_MISC_CTRL_B 0xE2110
649#define AUD_VID_DID 0xE2020
650#define AUD_RID 0xE2024
651#define AUD_PWRST 0xE204C
652#define AUD_PORT_EN_HD_CFG 0xE207C
653#define AUD_OUT_DIG_CNVT_A 0xE2080
654#define AUD_OUT_DIG_CNVT_B 0xE2180
655#define AUD_OUT_CH_STR 0xE2088
656#define AUD_OUT_STR_DESC_A 0xE2084
657#define AUD_OUT_STR_DESC_B 0xE2184
658#define AUD_PINW_CONNLNG_LIST 0xE20A8
659#define AUD_PINW_CONNLNG_SEL 0xE20AC
660#define AUD_CNTL_ST_A 0xE20B4
661#define AUD_CNTL_ST_B 0xE21B4
662#define AUD_CNTL_ST2 0xE20C0
663#define AUD_HDMIW_STATUS 0xE20D4
664#define AUD_HDMIW_HDMIEDID_A 0xE2050
665#define AUD_HDMIW_HDMIEDID_B 0xE2150
666#define AUD_HDMIW_INFOFR_A 0xE2054
667#define AUD_HDMIW_INFOFR_B 0xE2154
668
669static void dump_ironlake(void)
670{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400671 uint32_t dword;
672 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800673
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400674 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
675 dump_reg(HDMIC, "HDMI Port C Control");
676 dump_reg(HDMID, "HDMI Port D Control");
677 dump_reg(PCH_DP_B, "DisplayPort B Control Register");
678 dump_reg(PCH_DP_C, "DisplayPort C Control Register");
679 dump_reg(PCH_DP_D, "DisplayPort D Control Register");
680 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
681 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
682 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
683 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
684 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
685 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
686 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
687 dump_reg(AUD_RID, "Audio Revision ID");
688 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
689 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
690 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
691 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
692 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
693 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
694 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
695 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
696 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
697 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
698 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
699 dump_reg(AUD_CNTL_ST2, "Audio Control State 2");
700 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
701 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
702 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
703 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
704 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800705
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400706 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800707
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400708 dword = INREG(AUD_VID_DID);
709 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
710 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800711
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400712 dword = INREG(AUD_RID);
713 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
714 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
715 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
716 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800717
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400718 dword = INREG(HDMIB);
719 printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
720 printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
721 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
722 printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23));
723 printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2));
724 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
725 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
726 printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
727 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800728
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400729 dword = INREG(HDMIC);
730 printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
731 printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
732 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
733 printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2));
734 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
735 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
736 printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
737 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800738
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400739 dword = INREG(HDMID);
740 printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
741 printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
742 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
743 printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2));
744 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
745 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
746 printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
747 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800748
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400749 dword = INREG(PCH_DP_B);
750 printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
751 printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
752 printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
753 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
754 printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
755 printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
756 printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800757
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400758 dword = INREG(PCH_DP_C);
759 printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
760 printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
761 printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
762 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
763 printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
764 printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
765 printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800766
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400767 dword = INREG(PCH_DP_D);
768 printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
769 printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
770 printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
771 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
772 printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
773 printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
774 printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800775
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400776 dword = INREG(AUD_CONFIG_A);
777 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
778 n_index_value[BIT(dword, 29)]);
779 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
780 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
781 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
782 printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
783 OPNAME(pixel_clock, BITS(dword, 19, 16)));
784 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
785 dword = INREG(AUD_CONFIG_B);
786 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
787 n_index_value[BIT(dword, 29)]);
788 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
789 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
790 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
791 printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
792 OPNAME(pixel_clock, BITS(dword, 19, 16)));
793 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800794
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400795 dword = INREG(AUD_CTS_ENABLE_A);
796 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
797 printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
798 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
799 dword = INREG(AUD_CTS_ENABLE_B);
800 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
801 printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
802 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800803
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400804 dword = INREG(AUD_MISC_CTRL_A);
805 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
806 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
807 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
808 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
809 dword = INREG(AUD_MISC_CTRL_B);
810 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
811 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
812 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
813 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800814
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400815 dword = INREG(AUD_PWRST);
816 printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]);
817 printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]);
818 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
819 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
820 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
821 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
822 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
823 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
824 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
825 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
826 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
827 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800828
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400829 dword = INREG(AUD_PORT_EN_HD_CFG);
830 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
831 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
832 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
833 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
834 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12));
835 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13));
836 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14));
837 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16));
838 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17));
839 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 +0800840
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400841 dword = INREG(AUD_OUT_DIG_CNVT_A);
842 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
843 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
844 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
845 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
846 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
847 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
848 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
849 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
850 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
851 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 +0800852
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400853 dword = INREG(AUD_OUT_DIG_CNVT_B);
854 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
855 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
856 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
857 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
858 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
859 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
860 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
861 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
862 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
863 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 +0800864
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400865 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
866 for (i = 0; i < 8; i++) {
867 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
868 dword = INREG(AUD_OUT_CH_STR);
869 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
870 1 + BITS(dword, 3, 0),
871 1 + BITS(dword, 7, 4),
872 1 + BITS(dword, 15, 12),
873 1 + BITS(dword, 23, 20));
874 }
Wu Fengguang020abdb2010-04-19 13:13:06 +0800875
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400876 dword = INREG(AUD_OUT_STR_DESC_A);
877 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
878 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
879 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
880 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
881 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 +0800882
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400883 dword = INREG(AUD_OUT_STR_DESC_B);
884 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
885 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
886 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
887 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
888 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 +0800889
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400890 dword = INREG(AUD_PINW_CONNLNG_SEL);
891 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0));
892 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8));
893 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800894
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400895 dword = INREG(AUD_CNTL_ST_A);
896 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
897 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
898 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
899 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
900 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
901 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
902 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
903 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
904 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
905 printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800906
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400907 dword = INREG(AUD_CNTL_ST_B);
908 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
909 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
910 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
911 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
912 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
913 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
914 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
915 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
916 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
917 printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800918
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400919 dword = INREG(AUD_CNTL_ST2);
920 printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1));
921 printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
922 printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5));
923 printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
924 printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9));
925 printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800926
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400927 dword = INREG(AUD_HDMIW_STATUS);
928 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
929 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
930 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
931 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
932 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
933 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800934
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400935 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
936 dword = INREG(AUD_CNTL_ST_A);
937 dword &= ~BITMASK(9, 5);
938 OUTREG(AUD_CNTL_ST_A, dword);
939 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
940 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
941 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800942
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400943 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
944 dword = INREG(AUD_CNTL_ST_B);
945 dword &= ~BITMASK(9, 5);
946 OUTREG(AUD_CNTL_ST_B, dword);
947 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
948 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
949 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800950
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400951 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
952 dword = INREG(AUD_CNTL_ST_A);
953 dword &= ~BITMASK(20, 18);
954 dword &= ~BITMASK(3, 0);
955 OUTREG(AUD_CNTL_ST_A, dword);
956 for (i = 0; i < 8; i++)
957 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
958 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800959
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400960 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
961 dword = INREG(AUD_CNTL_ST_B);
962 dword &= ~BITMASK(20, 18);
963 dword &= ~BITMASK(3, 0);
964 OUTREG(AUD_CNTL_ST_B, dword);
965 for (i = 0; i < 8; i++)
966 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
967 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800968
969}
970
971
972#undef AUD_CONFIG_A
973#undef AUD_MISC_CTRL_A
974#undef AUD_VID_DID
975#undef AUD_RID
976#undef AUD_CTS_ENABLE_A
977#undef AUD_PWRST
978#undef AUD_HDMIW_HDMIEDID_A
979#undef AUD_HDMIW_INFOFR_A
980#undef AUD_PORT_EN_HD_CFG
981#undef AUD_OUT_DIG_CNVT_A
982#undef AUD_OUT_STR_DESC_A
983#undef AUD_OUT_CH_STR
984#undef AUD_PINW_CONNLNG_LIST
985#undef AUD_CNTL_ST_A
986#undef AUD_HDMIW_STATUS
987#undef AUD_CONFIG_B
988#undef AUD_MISC_CTRL_B
989#undef AUD_CTS_ENABLE_B
990#undef AUD_HDMIW_HDMIEDID_B
991#undef AUD_HDMIW_INFOFR_B
992#undef AUD_OUT_DIG_CNVT_B
993#undef AUD_OUT_STR_DESC_B
994#undef AUD_CNTL_ST_B
995
996/*
997 * CougarPoint registers
998 */
Wu Fengguang97d20312011-11-12 11:12:45 +0800999#define DP_CTL_B 0xE4100
Wu Fengguang020abdb2010-04-19 13:13:06 +08001000#define DP_CTL_C 0xE4200
1001#define DP_AUX_CTL_C 0xE4210
1002#define DP_AUX_TST_C 0xE4228
1003#define SPORT_DDI_CRC_C 0xE4250
1004#define SPORT_DDI_CRC_R 0xE4264
1005#define DP_CTL_D 0xE4300
1006#define DP_AUX_CTL_D 0xE4310
1007#define DP_AUX_TST_D 0xE4328
1008#define SPORT_DDI_CRC_CTL_D 0xE4350
1009#define AUD_CONFIG_A 0xE5000
1010#define AUD_MISC_CTRL_A 0xE5010
1011#define AUD_VID_DID 0xE5020
1012#define AUD_RID 0xE5024
1013#define AUD_CTS_ENABLE_A 0xE5028
1014#define AUD_PWRST 0xE504C
1015#define AUD_HDMIW_HDMIEDID_A 0xE5050
1016#define AUD_HDMIW_INFOFR_A 0xE5054
1017#define AUD_PORT_EN_HD_CFG 0xE507C
1018#define AUD_OUT_DIG_CNVT_A 0xE5080
1019#define AUD_OUT_STR_DESC_A 0xE5084
1020#define AUD_OUT_CH_STR 0xE5088
1021#define AUD_PINW_CONNLNG_LIST 0xE50A8
1022#define AUD_PINW_CONNLNG_SELA 0xE50AC
1023#define AUD_CNTL_ST_A 0xE50B4
1024#define AUD_CNTRL_ST2 0xE50C0
1025#define AUD_CNTRL_ST3 0xE50C4
1026#define AUD_HDMIW_STATUS 0xE50D4
1027#define AUD_CONFIG_B 0xE5100
1028#define AUD_MISC_CTRL_B 0xE5110
1029#define AUD_CTS_ENABLE_B 0xE5128
1030#define AUD_HDMIW_HDMIEDID_B 0xE5150
1031#define AUD_HDMIW_INFOFR_B 0xE5154
1032#define AUD_OUT_DIG_CNVT_B 0xE5180
1033#define AUD_OUT_STR_DESC_B 0xE5184
1034#define AUD_CNTL_ST_B 0xE51B4
1035#define AUD_CONFIG_C 0xE5200
1036#define AUD_MISC_CTRL_C 0xE5210
1037#define AUD_CTS_ENABLE_C 0xE5228
1038#define AUD_HDMIW_HDMIEDID_C 0xE5250
1039#define AUD_HDMIW_INFOFR_C 0xE5254
1040#define AUD_OUT_DIG_CNVT_C 0xE5280
1041#define AUD_OUT_STR_DESC_C 0xE5284
1042#define AUD_CNTL_ST_C 0xE52B4
1043#define AUD_CONFIG_D 0xE5300
1044#define AUD_MISC_CTRL_D 0xE5310
1045#define AUD_CTS_ENABLE_D 0xE5328
1046#define AUD_HDMIW_HDMIEDID_D 0xE5350
1047#define AUD_HDMIW_INFOFR_D 0xE5354
1048#define AUD_OUT_DIG_CNVT_D 0xE5380
1049#define AUD_OUT_STR_DESC_D 0xE5384
1050#define AUD_CNTL_ST_D 0xE53B4
1051
Wu Fengguange321f132011-11-12 11:12:52 +08001052#define VIDEO_DIP_CTL_A 0xE0200
1053#define VIDEO_DIP_CTL_B 0xE1200
1054#define VIDEO_DIP_CTL_C 0xE2200
1055#define VIDEO_DIP_CTL_D 0xE3200
1056
Wu Fengguang020abdb2010-04-19 13:13:06 +08001057
1058static void dump_cpt(void)
1059{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001060 uint32_t dword;
1061 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +08001062
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001063 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
1064 dump_reg(HDMIC, "HDMI Port C Control");
1065 dump_reg(HDMID, "HDMI Port D Control");
1066 dump_reg(DP_CTL_B, "DisplayPort B Control");
1067 dump_reg(DP_CTL_C, "DisplayPort C Control");
1068 dump_reg(DP_CTL_D, "DisplayPort D Control");
1069 dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control");
1070 dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control");
1071 dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control");
1072 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
1073 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
1074 dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C");
1075 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
1076 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
1077 dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C");
1078 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
1079 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
1080 dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C");
1081 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
1082 dump_reg(AUD_RID, "Audio Revision ID");
1083 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
1084 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
1085 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
1086 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
1087 dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C");
1088 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
1089 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
1090 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
1091 dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C");
1092 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
1093 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
1094 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
1095 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
1096 dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C");
1097 dump_reg(AUD_CNTRL_ST2, "Audio Control State 2");
1098 dump_reg(AUD_CNTRL_ST3, "Audio Control State 3");
1099 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
1100 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
1101 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
1102 dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C");
1103 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
1104 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
1105 dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001106
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001107 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001108
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001109 dword = INREG(VIDEO_DIP_CTL_A);
1110 printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1111 printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1112 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1113 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1114 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1115 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1116 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1117 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1118 printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1119 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1120 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1121 printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001122
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001123 dword = INREG(VIDEO_DIP_CTL_B);
1124 printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1125 printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1126 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1127 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1128 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1129 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1130 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1131 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1132 printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1133 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1134 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1135 printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001136
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001137 dword = INREG(VIDEO_DIP_CTL_C);
1138 printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1139 printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1140 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1141 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1142 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1143 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1144 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1145 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1146 printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1147 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1148 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1149 printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001150
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001151 dword = INREG(AUD_VID_DID);
1152 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
1153 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001154
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001155 dword = INREG(AUD_RID);
1156 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1157 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1158 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1159 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001160
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001161 dword = INREG(HDMIB);
1162 printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1163 printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1164 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1165 printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1166 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1167 printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1168 printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1169 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1170 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1171 printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1172 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001173
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001174 dword = INREG(HDMIC);
1175 printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1176 printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1177 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1178 printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1179 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1180 printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1181 printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1182 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1183 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1184 printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1185 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001186
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001187 dword = INREG(HDMID);
1188 printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1189 printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1190 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1191 printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1192 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1193 printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1194 printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1195 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1196 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1197 printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1198 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001199
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001200 dword = INREG(DP_CTL_B);
1201 printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1202 printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1203 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1204 printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1205 printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1206 printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001207
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001208 dword = INREG(DP_CTL_C);
1209 printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1210 printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1211 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1212 printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1213 printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1214 printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001215
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001216 dword = INREG(DP_CTL_D);
1217 printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1218 printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1219 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1220 printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1221 printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1222 printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001223
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001224 dword = INREG(AUD_CONFIG_A);
1225 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1226 n_index_value[BIT(dword, 29)]);
1227 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1228 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1229 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1230 printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1231 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1232 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1233 dword = INREG(AUD_CONFIG_B);
1234 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1235 n_index_value[BIT(dword, 29)]);
1236 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1237 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1238 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1239 printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1240 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1241 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1242 dword = INREG(AUD_CONFIG_C);
1243 printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1244 n_index_value[BIT(dword, 29)]);
1245 printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1246 printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1247 printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1248 printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1249 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1250 printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001251
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001252 dword = INREG(AUD_CTS_ENABLE_A);
1253 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1254 printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1255 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1256 dword = INREG(AUD_CTS_ENABLE_B);
1257 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1258 printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1259 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1260 dword = INREG(AUD_CTS_ENABLE_C);
1261 printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1262 printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1263 printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001264
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001265 dword = INREG(AUD_MISC_CTRL_A);
1266 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1267 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1268 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1269 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1270 dword = INREG(AUD_MISC_CTRL_B);
1271 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1272 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1273 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1274 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1275 dword = INREG(AUD_MISC_CTRL_C);
1276 printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1277 printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1278 printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1279 printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001280
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001281 dword = INREG(AUD_PWRST);
1282 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1283 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1284 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1285 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1286 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1287 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1288 printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]);
1289 printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]);
1290 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1291 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1292 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1293 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1294 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1295 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001296
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001297 dword = INREG(AUD_PORT_EN_HD_CFG);
1298 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
1299 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
1300 printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2));
1301 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1302 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1303 printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1304 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1305 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1306 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1307 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1308 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1309 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 +08001310
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001311 dword = INREG(AUD_OUT_DIG_CNVT_A);
1312 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
1313 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1314 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1315 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
1316 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1317 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1318 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
1319 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1320 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1321 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 +08001322
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001323 dword = INREG(AUD_OUT_DIG_CNVT_B);
1324 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
1325 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1326 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1327 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
1328 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1329 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1330 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
1331 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1332 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1333 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 +08001334
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001335 dword = INREG(AUD_OUT_DIG_CNVT_C);
1336 printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1));
1337 printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1338 printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1339 printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4));
1340 printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1341 printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1342 printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7));
1343 printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1344 printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1345 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 +08001346
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001347 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
1348 for (i = 0; i < 8; i++) {
1349 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
1350 dword = INREG(AUD_OUT_CH_STR);
1351 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1352 1 + BITS(dword, 3, 0),
1353 1 + BITS(dword, 7, 4),
1354 1 + BITS(dword, 15, 12),
1355 1 + BITS(dword, 23, 20));
1356 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08001357
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001358 dword = INREG(AUD_OUT_STR_DESC_A);
1359 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1360 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1361 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
1362 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1363 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 +08001364
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001365 dword = INREG(AUD_OUT_STR_DESC_B);
1366 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1367 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1368 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
1369 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1370 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 +08001371
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001372 dword = INREG(AUD_OUT_STR_DESC_C);
1373 printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1374 printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1375 printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n",
1376 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1377 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 +08001378
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001379 dword = INREG(AUD_PINW_CONNLNG_SEL);
1380 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0));
1381 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8));
1382 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001383
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001384 dword = INREG(AUD_CNTL_ST_A);
1385 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1386 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1387 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1388 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1389 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1390 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
1391 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1392 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1393 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 +08001394
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001395 dword = INREG(AUD_CNTL_ST_B);
1396 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1397 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1398 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1399 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1400 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1401 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
1402 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1403 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1404 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 +08001405
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001406 dword = INREG(AUD_CNTL_ST_C);
1407 printf("AUD_CNTL_ST_C 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_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1410 printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1411 printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1412 printf("AUD_CNTL_ST_C 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_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1415 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 +08001416
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001417 dword = INREG(AUD_CNTRL_ST2);
1418 printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1));
1419 printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
1420 printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5));
1421 printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1422 printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9));
1423 printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001424
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001425 dword = INREG(AUD_CNTRL_ST3);
1426 printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3));
1427 printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n",
1428 BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]);
1429 printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7));
1430 printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n",
1431 BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]);
1432 printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11));
1433 printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n",
1434 BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001435
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001436 dword = INREG(AUD_HDMIW_STATUS);
1437 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1438 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1439 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1440 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1441 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1442 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1443 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1444 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001445
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001446 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1447 dword = INREG(AUD_CNTL_ST_A);
1448 dword &= ~BITMASK(9, 5);
1449 OUTREG(AUD_CNTL_ST_A, dword);
1450 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1451 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1452 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001453
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001454 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1455 dword = INREG(AUD_CNTL_ST_B);
1456 dword &= ~BITMASK(9, 5);
1457 OUTREG(AUD_CNTL_ST_B, dword);
1458 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1459 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1460 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001461
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001462 printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t");
1463 dword = INREG(AUD_CNTL_ST_C);
1464 dword &= ~BITMASK(9, 5);
1465 OUTREG(AUD_CNTL_ST_C, dword);
1466 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1467 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C)));
1468 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001469
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001470 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1471 dword = INREG(AUD_CNTL_ST_A);
1472 dword &= ~BITMASK(20, 18);
1473 dword &= ~BITMASK(3, 0);
1474 OUTREG(AUD_CNTL_ST_A, dword);
1475 for (i = 0; i < 8; i++)
1476 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1477 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001478
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001479 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1480 dword = INREG(AUD_CNTL_ST_B);
1481 dword &= ~BITMASK(20, 18);
1482 dword &= ~BITMASK(3, 0);
1483 OUTREG(AUD_CNTL_ST_B, dword);
1484 for (i = 0; i < 8; i++)
1485 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1486 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001487
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001488 printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t");
1489 dword = INREG(AUD_CNTL_ST_C);
1490 dword &= ~BITMASK(20, 18);
1491 dword &= ~BITMASK(3, 0);
1492 OUTREG(AUD_CNTL_ST_C, dword);
1493 for (i = 0; i < 8; i++)
1494 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C)));
1495 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001496
1497}
1498
Wang Xingchaoc4077222012-08-15 16:13:38 +08001499#undef AUD_CONFIG_A
1500#undef AUD_MISC_CTRL_A
1501#undef AUD_VID_DID
1502#undef AUD_RID
1503#undef AUD_CTS_ENABLE_A
1504#undef AUD_PWRST
1505#undef AUD_HDMIW_HDMIEDID_A
1506#undef AUD_HDMIW_INFOFR_A
1507#undef AUD_PORT_EN_HD_CFG
1508#undef AUD_OUT_DIG_CNVT_A
1509#undef AUD_OUT_STR_DESC_A
1510#undef AUD_OUT_CH_STR
1511#undef AUD_PINW_CONNLNG_LIST
Mengdong Lindeba8682013-09-09 15:38:40 -04001512#undef AUD_PINW_CONNLNG_SEL
Wang Xingchaoc4077222012-08-15 16:13:38 +08001513#undef AUD_CNTL_ST_A
1514#undef AUD_HDMIW_STATUS
1515#undef AUD_CONFIG_B
1516#undef AUD_MISC_CTRL_B
1517#undef AUD_CTS_ENABLE_B
1518#undef AUD_HDMIW_HDMIEDID_B
1519#undef AUD_HDMIW_INFOFR_B
1520#undef AUD_OUT_DIG_CNVT_B
1521#undef AUD_OUT_STR_DESC_B
1522#undef AUD_CNTL_ST_B
1523#undef AUD_CONFIG_C
1524#undef AUD_MISC_CTRL_C
1525#undef AUD_CTS_ENABLE_C
1526#undef AUD_HDMIW_HDMIEDID_C
1527#undef AUD_HDMIW_INFOFR_C
1528#undef AUD_OUT_DIG_CNVT_C
1529#undef AUD_OUT_STR_DESC_C
1530
1531#undef VIDEO_DIP_CTL_A
1532#undef VIDEO_DIP_CTL_B
1533#undef VIDEO_DIP_CTL_C
1534#undef VIDEO_DIP_CTL_D
1535#undef VIDEO_DIP_DATA
1536
1537/*
1538 * Haswell registers
1539 */
1540
1541/* DisplayPort Transport Control */
1542#define DP_TP_CTL_A 0x64040
1543#define DP_TP_CTL_B 0x64140
1544#define DP_TP_CTL_C 0x64240
1545#define DP_TP_CTL_D 0x64340
1546#define DP_TP_CTL_E 0x64440
1547
1548/* DisplayPort Transport Status */
1549#define DP_TP_ST_A 0x64044
1550#define DP_TP_ST_B 0x64144
1551#define DP_TP_ST_C 0x64244
1552#define DP_TP_ST_D 0x64344
1553#define DP_TP_ST_E 0x64444
1554
Wang Xingchaoc4077222012-08-15 16:13:38 +08001555/* DDI Buffer Control */
1556#define DDI_BUF_CTL_A 0x64000
1557#define DDI_BUF_CTL_B 0x64100
1558#define DDI_BUF_CTL_C 0x64200
1559#define DDI_BUF_CTL_D 0x64300
1560#define DDI_BUF_CTL_E 0x64400
1561
1562/* DDI Buffer Translation */
1563#define DDI_BUF_TRANS_A 0x64e00
1564#define DDI_BUF_TRANS_B 0x64e60
1565#define DDI_BUF_TRANS_C 0x64ec0
1566#define DDI_BUF_TRANS_D 0x64f20
1567#define DDI_BUF_TRANS_E 0x64f80
1568
1569/* DDI Aux Channel */
1570#define DDI_AUX_CHANNEL_CTRL 0x64010
1571#define DDI_AUX_DATA 0x64014
1572#define DDI_AUX_TST 0x64028
1573
1574/* DDI CRC Control */
1575#define DDI_CRC_CTL_A 0x64050
1576#define DDI_CRC_CTL_B 0x64150
1577#define DDI_CRC_CTL_C 0x64250
1578#define DDI_CRC_CTL_D 0x64350
1579#define DDI_CRC_CTL_E 0x64450
1580
1581/* Pipe DDI Function Control */
1582#define PIPE_DDI_FUNC_CTL_A 0x60400
1583#define PIPE_DDI_FUNC_CTL_B 0x61400
1584#define PIPE_DDI_FUNC_CTL_C 0x62400
1585#define PIPE_DDI_FUNC_CTL_EDP 0x6F400
1586
1587/* Pipe Configuration */
1588#define PIPE_CONF_A 0x70008
1589#define PIPE_CONF_B 0x71008
1590#define PIPE_CONF_C 0x72008
1591#define PIPE_CONF_EDP 0x7F008
1592
1593/* Audio registers */
Mengdong Lindeba8682013-09-09 15:38:40 -04001594#define AUD_TCA_CONFIG 0x65000
1595#define AUD_TCB_CONFIG 0x65100
1596#define AUD_TCC_CONFIG 0x65200
1597#define AUD_C1_MISC_CTRL 0x65010
1598#define AUD_C2_MISC_CTRL 0x65110
1599#define AUD_C3_MISC_CTRL 0x65210
1600#define AUD_VID_DID 0x65020
1601#define AUD_RID 0x65024
1602#define AUD_TCA_M_CTS_ENABLE 0x65028
1603#define AUD_TCB_M_CTS_ENABLE 0x65128
1604#define AUD_TCC_M_CTS_ENABLE 0x65228
1605#define AUD_PWRST 0x6504C
1606#define AUD_TCA_EDID_DATA 0x65050
1607#define AUD_TCB_EDID_DATA 0x65150
1608#define AUD_TCC_EDID_DATA 0x65250
1609#define AUD_TCA_INFOFR 0x65054
1610#define AUD_TCB_INFOFR 0x65154
1611#define AUD_TCC_INFOFR 0x65254
1612#define AUD_PIPE_CONV_CFG 0x6507C
1613#define AUD_C1_DIG_CNVT 0x65080
1614#define AUD_C2_DIG_CNVT 0x65180
1615#define AUD_C3_DIG_CNVT 0x65280
1616#define AUD_C1_STR_DESC 0x65084
1617#define AUD_C2_STR_DESC 0x65184
1618#define AUD_C3_STR_DESC 0x65284
1619#define AUD_OUT_CHAN_MAP 0x65088
1620#define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8
1621#define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8
1622#define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8
Wang Xingchaoc4077222012-08-15 16:13:38 +08001623#define AUD_PIPE_CONN_SEL_CTRL 0x650AC
Mengdong Lindeba8682013-09-09 15:38:40 -04001624#define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4
1625#define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4
1626#define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4
1627#define AUD_PIN_ELD_CP_VLD 0x650C0
1628#define AUD_HDMI_FIFO_STATUS 0x650D4
Wang Xingchaoc4077222012-08-15 16:13:38 +08001629
Mengdong Lin85357202013-08-13 00:21:57 -04001630/* Audio debug registers */
1631#define AUD_ICOI 0x65f00
1632#define AUD_IRII 0x65f04
1633#define AUD_ICS 0x65f08
Mengdong Linf075c3c2013-08-13 00:22:14 -04001634#define AUD_CHICKENBIT_REG 0x65f10
Mengdong Lin85357202013-08-13 00:21:57 -04001635
Wang Xingchaoc4077222012-08-15 16:13:38 +08001636/* Video DIP Control */
1637#define VIDEO_DIP_CTL_A 0x60200
1638#define VIDEO_DIP_CTL_B 0x61200
1639#define VIDEO_DIP_CTL_C 0x62200
1640#define VIDEO_DIP_CTL_D 0x63200
1641
1642#define VIDEO_DIP_DATA 0x60220
1643#define VIDEO_DIP_ECC 0x60240
1644
1645#define AUD_DP_DIP_STATUS 0x65f20
1646
Mengdong Lindeba8682013-09-09 15:38:40 -04001647#define MAX_PREFIX_SIZE 128
1648
1649#undef TRANSCODER_A
1650#undef TRANSCODER_B
1651#undef TRANSCODER_C
1652enum {
1653 TRANSCODER_A = 0,
1654 TRANSCODER_B,
1655 TRANSCODER_C,
1656};
1657
1658enum {
1659 PIPE_A = 0,
1660 PIPE_B,
1661 PIPE_C,
1662};
1663
1664enum {
1665 PORT_A = 0,
1666 PORT_B,
1667 PORT_C,
1668 PORT_D,
1669 PORT_E,
1670};
1671
1672enum {
1673 CONVERTER_1 = 0,
1674 CONVERTER_2,
1675 CONVERTER_3,
1676};
1677
1678static void dump_ddi_buf_ctl(int port)
1679{
1680 uint32_t dword;
1681
1682 dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100);
1683 printf("DDI %c Buffer control\n", 'A' + port - PORT_A);
1684 printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1),
1685 OPNAME(dp_port_width, BITS(dword, 3, 1)));
1686 printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31));
1687}
1688
1689static void dump_ddi_func_ctl(int pipe)
1690{
1691 uint32_t dword;
1692
1693 dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000);
1694 printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A);
1695 printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20),
1696 OPNAME(bits_per_color, BITS(dword, 22, 20)));
1697 printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24),
1698 OPNAME(ddi_mode, BITS(dword, 26, 24)));
1699 printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28),
1700 OPNAME(trans_to_port_sel, BITS(dword, 30, 28)));
1701 printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31));
1702}
1703
1704static void dump_aud_transcoder_config(int transcoder)
1705{
1706 uint32_t dword;
1707 char prefix[MAX_PREFIX_SIZE];
1708
1709 dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100);
1710 sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A);
1711
1712 printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1713 printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4));
1714 printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16),
1715 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1716 printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20));
1717 printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28));
1718 printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29),
1719 OPNAME(n_index_value, BIT(dword, 29)));
1720}
1721
1722static void dump_aud_misc_control(int converter)
1723{
1724 uint32_t dword;
1725 char prefix[MAX_PREFIX_SIZE];
1726
1727 dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100);
1728 sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1);
1729
1730 printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1731 printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2));
1732 printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4));
1733 printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8));
1734}
1735
1736static void dump_aud_vendor_device_id(void)
1737{
1738 uint32_t dword;
1739
1740 dword = INREG(AUD_VID_DID);
1741 printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0));
1742 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16));
1743}
1744
1745static void dump_aud_revision_id(void)
1746{
1747 uint32_t dword;
1748
1749 dword = INREG(AUD_RID);
1750 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
1751 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1752 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1753 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1754}
1755
1756static void dump_aud_m_cts_enable(int transcoder)
1757{
1758 uint32_t dword;
1759 char prefix[MAX_PREFIX_SIZE];
1760
1761 dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100);
1762 sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A);
1763
1764 printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0));
1765 printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20));
1766 printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M");
1767}
1768
1769static void dump_aud_power_state(void)
1770{
1771 uint32_t dword;
1772
1773 dword = INREG(AUD_PWRST);
1774 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1775 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1776 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1777 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1778 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
1779 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1780 printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1781 printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1782 printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1783 printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1784 printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]);
1785 printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]);
1786 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1787 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1788}
1789
1790static void dump_aud_edid_data(int transcoder)
1791{
1792 uint32_t dword;
1793 int i;
1794 int offset = (transcoder - TRANSCODER_A) * 0x100;
1795
1796 printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A);
1797 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1798 dword &= ~BITMASK(9, 5);
1799 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1800 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1801 printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset)));
1802 printf("\n");
1803}
1804
1805static void dump_aud_infoframe(int transcoder)
1806{
1807 uint32_t dword;
1808 int i;
1809 int offset = (transcoder - TRANSCODER_A) * 0x100;
1810
1811 printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A);
1812 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1813 dword &= ~BITMASK(20, 18);
1814 dword &= ~BITMASK(3, 0);
1815 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1816 for (i = 0; i < 8; i++)
1817 printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset)));
1818 printf("\n");
1819}
1820
1821static void dump_aud_pipe_conv_cfg(void)
1822{
1823 uint32_t dword;
1824
1825 dword = INREG(AUD_PIPE_CONV_CFG);
1826 printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0));
1827 printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1));
1828 printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2));
1829 printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1830 printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1831 printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1832 printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1833 printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1834 printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1835 printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1836 printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1837 printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
1838}
1839
1840static void dump_aud_dig_cnvt(int converter)
1841{
1842 uint32_t dword;
1843 char prefix[MAX_PREFIX_SIZE];
1844
1845 dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100);
1846 sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1);
1847
1848 printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1849 printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2));
1850 printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1851 printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4));
1852 printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5));
1853 printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6));
1854 printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7));
1855 printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8));
1856 printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16));
1857 printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20));
1858}
1859
1860static void dump_aud_str_desc(int converter)
1861{
1862 uint32_t dword;
1863 char prefix[MAX_PREFIX_SIZE];
1864 uint32_t rate;
1865
1866 dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100);
1867 sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1);
1868
1869 printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0));
1870 printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4),
1871 OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1872
1873 printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8),
1874 OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8)));
1875 printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11),
1876 OPNAME(sample_base_rate_mult, BITS(dword, 13, 11)));
1877 printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14),
1878 OPNAME(sample_base_rate, BIT(dword, 14)));
1879 rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1)
1880 /(BITS(dword, 10, 8) + 1);
1881 printf("=> Sample Rate %d Hz\n", rate);
1882
1883 printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1);
1884}
1885
1886static void dump_aud_out_chan_map(void)
1887{
1888 uint32_t dword;
1889 int i;
1890
1891 printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n");
1892 for (i = 0; i < 8; i++) {
1893 OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16));
1894 dword = INREG(AUD_OUT_CHAN_MAP);
1895 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1896 1 + BITS(dword, 3, 0),
1897 1 + BITS(dword, 7, 4),
1898 1 + BITS(dword, 15, 12),
1899 1 + BITS(dword, 23, 20));
1900 }
1901}
1902
1903static void dump_aud_connect_list_entry_length(int transcoder)
1904{
1905 uint32_t dword;
1906 char prefix[MAX_PREFIX_SIZE];
1907
1908 dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100);
1909 sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A);
1910
1911 printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0));
1912 printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7),
1913 OPNAME(connect_list_form, BIT(dword, 7)));
1914 printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8));
1915}
1916
1917static void dump_aud_connect_select_ctrl(void)
1918{
1919 uint32_t dword;
1920
1921 dword = INREG(AUD_PIPE_CONN_SEL_CTRL);
1922 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0));
1923 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8));
1924 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16));
1925}
1926
1927static void dump_aud_dip_eld_ctrl_st(int transcoder)
1928{
1929 uint32_t dword;
1930 int offset = (transcoder - TRANSCODER_A) * 0x100;
1931
1932 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1933 printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A);
1934
1935 printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4));
1936 printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10));
1937 printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16),
1938 dip_trans[BITS(dword, 17, 16)]);
1939 printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18),
1940 dip_index[BITS(dword, 20, 18)]);
1941 printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21),
1942 dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]);
1943 printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29),
1944 dip_port[BITS(dword, 30, 29)]);
1945 printf("\n");
1946}
1947
1948static void dump_aud_eld_cp_vld(void)
1949{
1950 uint32_t dword;
1951
1952 dword = INREG(AUD_PIN_ELD_CP_VLD);
1953 printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0));
1954 printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1));
1955 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2));
1956 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3));
1957 printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4));
1958 printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5));
1959 printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6));
1960 printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7));
1961 printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8));
1962 printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9));
1963 printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10));
1964 printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11));
1965}
1966
1967static void dump_hdmi_fifo_status(void)
1968{
1969 uint32_t dword;
1970
1971 dword = INREG(AUD_HDMI_FIFO_STATUS);
1972 printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
1973 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1974 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1975 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1976 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1977 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1978 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1979}
Wang Xingchaoc4077222012-08-15 16:13:38 +08001980
Mengdong Linf075c3c2013-08-13 00:22:14 -04001981static void parse_bdw_audio_chicken_bit_reg(uint32_t dword)
1982{
1983 printf("\t");
1984 printf("%s\n\t", OPNAME(vanilla_dp12_en, BIT(dword, 31)));
1985 printf("%s\n\t", OPNAME(vanilla_3_widgets_en, BIT(dword, 30)));
1986 printf("%s\n\t", OPNAME(block_audio, BIT(dword, 10)));
1987 printf("%s\n\t", OPNAME(dis_eld_valid_pulse_trans, BIT(dword, 9)));
1988 printf("%s\n\t", OPNAME(dis_pd_pulse_trans, BIT(dword, 8)));
1989 printf("%s\n\t", OPNAME(dis_ts_delta_err, BIT(dword, 7)));
1990 printf("%s\n\t", OPNAME(dis_ts_fix_dp_hbr, BIT(dword, 6)));
1991 printf("%s\n\t", OPNAME(pattern_gen_8_ch_en, BIT(dword, 5)));
1992 printf("%s\n\t", OPNAME(pattern_gen_2_ch_en, BIT(dword, 4)));
1993 printf("%s\n\t", OPNAME(fabric_32_44_dis, BIT(dword, 3)));
1994 printf("%s\n\t", OPNAME(epss_dis, BIT(dword, 2)));
1995 printf("%s\n\t", OPNAME(ts_test_mode, BIT(dword, 1)));
1996 printf("%s\n", OPNAME(en_mmio_program, BIT(dword, 0)));
1997}
1998
Mengdong Lin69cc00b2013-07-17 13:29:17 -04001999/* Dump audio registers for Haswell and its successors (eg. Broadwell).
2000 * Their register layout are same in the north display engine.
2001 */
2002static void dump_hsw_plus(void)
Wang Xingchaoc4077222012-08-15 16:13:38 +08002003{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002004 uint32_t dword;
Wang Xingchaoc4077222012-08-15 16:13:38 +08002005
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002006 /* HSW DDI Buffer */
2007 dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A");
2008 dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B");
2009 dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C");
2010 dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D");
2011 dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002012
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002013 /* HSW Pipe Function */
2014 dump_reg(PIPE_CONF_A, "PIPE Configuration A");
2015 dump_reg(PIPE_CONF_B, "PIPE Configuration B");
2016 dump_reg(PIPE_CONF_C, "PIPE Configuration C");
2017 dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002018
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002019 dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A");
2020 dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B");
2021 dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C");
2022 dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002023
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002024 /* HSW Display port */
2025 dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control");
2026 dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control");
2027 dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control");
2028 dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control");
2029 dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002030
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002031 dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status");
2032 dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status");
2033 dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status");
2034 dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status");
2035 dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002036
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002037 /* HSW North Display Audio */
Mengdong Lindeba8682013-09-09 15:38:40 -04002038 dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A");
2039 dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B");
2040 dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C");
2041 dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control");
2042 dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control");
2043 dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002044 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
Mengdong Lindeba8682013-09-09 15:38:40 -04002045 dump_reg(AUD_RID, "Audio Revision ID");
2046 dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A");
2047 dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B");
2048 dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002049 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
Mengdong Lindeba8682013-09-09 15:38:40 -04002050 dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A");
2051 dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B");
2052 dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C");
2053 dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A");
2054 dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B");
2055 dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C");
2056 dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs");
2057 dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1");
2058 dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2");
2059 dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3");
2060 dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1");
2061 dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2");
2062 dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002063 dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping");
Mengdong Lindeba8682013-09-09 15:38:40 -04002064 dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A");
2065 dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B");
2066 dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002067 dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control");
Mengdong Lindeba8682013-09-09 15:38:40 -04002068 dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A");
2069 dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B");
2070 dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C");
2071 dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status");
2072 dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002073
Mengdong Lin85357202013-08-13 00:21:57 -04002074 /* Audio debug registers */
2075 dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface");
2076 dump_reg(AUD_IRII, "Audio Immediate Response Input Interface");
2077 dump_reg(AUD_ICS, "Audio Immediate Command Status");
Mengdong Linf075c3c2013-08-13 00:22:14 -04002078 dump_reg(AUD_CHICKENBIT_REG, "Audio Chicken Bit Register");
Mengdong Lin85357202013-08-13 00:21:57 -04002079
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002080 printf("\nDetails:\n\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08002081
Mengdong Lindeba8682013-09-09 15:38:40 -04002082 dump_ddi_buf_ctl(PORT_A);
2083 dump_ddi_buf_ctl(PORT_B);
2084 dump_ddi_buf_ctl(PORT_C);
2085 dump_ddi_buf_ctl(PORT_D);
2086 dump_ddi_buf_ctl(PORT_E);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002087
Mengdong Lindeba8682013-09-09 15:38:40 -04002088 dump_ddi_func_ctl(PIPE_A);
2089 dump_ddi_func_ctl(PIPE_B);
2090 dump_ddi_func_ctl(PIPE_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002091
Mengdong Lindeba8682013-09-09 15:38:40 -04002092 /* audio configuration - details */
2093 dump_aud_transcoder_config(TRANSCODER_A);
2094 dump_aud_transcoder_config(TRANSCODER_B);
2095 dump_aud_transcoder_config(TRANSCODER_C);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002096
Mengdong Lindeba8682013-09-09 15:38:40 -04002097 dump_aud_misc_control(CONVERTER_1);
2098 dump_aud_misc_control(CONVERTER_2);
2099 dump_aud_misc_control(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002100
Mengdong Lindeba8682013-09-09 15:38:40 -04002101 dump_aud_vendor_device_id();
2102 dump_aud_revision_id();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002103
Mengdong Lindeba8682013-09-09 15:38:40 -04002104 dump_aud_m_cts_enable(TRANSCODER_A);
2105 dump_aud_m_cts_enable(TRANSCODER_B);
2106 dump_aud_m_cts_enable(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002107
Mengdong Lindeba8682013-09-09 15:38:40 -04002108 dump_aud_power_state();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002109
Mengdong Lindeba8682013-09-09 15:38:40 -04002110 dump_aud_edid_data(TRANSCODER_A);
2111 dump_aud_edid_data(TRANSCODER_B);
2112 dump_aud_edid_data(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002113
Mengdong Lindeba8682013-09-09 15:38:40 -04002114 dump_aud_infoframe(TRANSCODER_A);
2115 dump_aud_infoframe(TRANSCODER_B);
2116 dump_aud_infoframe(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002117
Mengdong Lindeba8682013-09-09 15:38:40 -04002118 dump_aud_pipe_conv_cfg();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002119
Mengdong Lindeba8682013-09-09 15:38:40 -04002120 dump_aud_dig_cnvt(CONVERTER_1);
2121 dump_aud_dig_cnvt(CONVERTER_2);
2122 dump_aud_dig_cnvt(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002123
Mengdong Lindeba8682013-09-09 15:38:40 -04002124 dump_aud_str_desc(CONVERTER_1);
2125 dump_aud_str_desc(CONVERTER_2);
2126 dump_aud_str_desc(CONVERTER_3);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002127
Mengdong Lindeba8682013-09-09 15:38:40 -04002128 dump_aud_out_chan_map();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002129
Mengdong Lindeba8682013-09-09 15:38:40 -04002130 dump_aud_connect_list_entry_length(TRANSCODER_A);
2131 dump_aud_connect_list_entry_length(TRANSCODER_B);
2132 dump_aud_connect_list_entry_length(TRANSCODER_C);
2133 dump_aud_connect_select_ctrl();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002134
Mengdong Lindeba8682013-09-09 15:38:40 -04002135 dump_aud_dip_eld_ctrl_st(TRANSCODER_A);
2136 dump_aud_dip_eld_ctrl_st(TRANSCODER_B);
2137 dump_aud_dip_eld_ctrl_st(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002138
Mengdong Lindeba8682013-09-09 15:38:40 -04002139 dump_aud_eld_cp_vld();
2140 dump_hdmi_fifo_status();
Mengdong Lin85357202013-08-13 00:21:57 -04002141
2142 printf("\nDetails:\n\n");
2143
2144 printf("IRV [%1lx] %s\t", BIT(dword, 1),
2145 OPNAME(immed_result_valid, BIT(dword, 1)));
2146 printf("ICB [%1lx] %s\n", BIT(dword, 1),
2147 OPNAME(immed_cmd_busy, BIT(dword, 0)));
Mengdong Linf075c3c2013-08-13 00:22:14 -04002148
2149 dword = INREG(AUD_CHICKENBIT_REG);
2150 printf("AUD_CHICKENBIT_REG Audio Chicken Bits: %08x\n", dword);
2151 if (IS_BROADWELL(devid))
2152 parse_bdw_audio_chicken_bit_reg(dword);
2153
Wang Xingchaoc4077222012-08-15 16:13:38 +08002154}
2155
Wu Fengguang020abdb2010-04-19 13:13:06 +08002156int main(int argc, char **argv)
2157{
2158 struct pci_device *pci_dev;
2159
2160 pci_dev = intel_get_pci_device();
2161 devid = pci_dev->device_id; /* XXX not true when mapping! */
2162
2163 do_self_tests();
2164
2165 if (argc == 2)
2166 intel_map_file(argv[1]);
2167 else
2168 intel_get_mmio(pci_dev);
2169
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002170 if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
2171 printf("%s audio registers:\n\n",
2172 IS_BROADWELL(devid) ? "Broadwell" : "Haswell");
2173 dump_hsw_plus();
2174 } else if (IS_GEN6(devid) || IS_GEN7(devid)
2175 || getenv("HAS_PCH_SPLIT")) {
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002176 printf("%s audio registers:\n\n",
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002177 IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002178 intel_check_pch();
2179 dump_cpt();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002180 } else if (IS_GEN5(devid)) {
2181 printf("Ironlake audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002182 dump_ironlake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002183 } else if (IS_G4X(devid)) {
2184 printf("G45 audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002185 dump_eaglelake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002186 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08002187
2188 return 0;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08002189}