blob: fd37ebd61a4b5efb164268ad717c3a8f654d232b [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
Wu Fengguang020abdb2010-04-19 13:13:06 +0800253static void do_self_tests(void)
254{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400255 if (BIT(1, 0) != 1)
256 exit(1);
257 if (BIT(0x80000000, 31) != 1)
258 exit(2);
259 if (BITS(0xc0000000, 31, 30) != 3)
260 exit(3);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800261}
262
263/*
264 * EagleLake registers
265 */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800266#define AUD_CONFIG 0x62000
267#define AUD_DEBUG 0x62010
268#define AUD_VID_DID 0x62020
269#define AUD_RID 0x62024
270#define AUD_SUBN_CNT 0x62028
271#define AUD_FUNC_GRP 0x62040
272#define AUD_SUBN_CNT2 0x62044
273#define AUD_GRP_CAP 0x62048
274#define AUD_PWRST 0x6204c
275#define AUD_SUPPWR 0x62050
276#define AUD_SID 0x62054
277#define AUD_OUT_CWCAP 0x62070
278#define AUD_OUT_PCMSIZE 0x62074
279#define AUD_OUT_STR 0x62078
280#define AUD_OUT_DIG_CNVT 0x6207c
281#define AUD_OUT_CH_STR 0x62080
282#define AUD_OUT_STR_DESC 0x62084
283#define AUD_PINW_CAP 0x620a0
284#define AUD_PIN_CAP 0x620a4
285#define AUD_PINW_CONNLNG 0x620a8
286#define AUD_PINW_CONNLST 0x620ac
287#define AUD_PINW_CNTR 0x620b0
288#define AUD_PINW_UNSOLRESP 0x620b8
289#define AUD_CNTL_ST 0x620b4
290#define AUD_PINW_CONFIG 0x620bc
291#define AUD_HDMIW_STATUS 0x620d4
292#define AUD_HDMIW_HDMIEDID 0x6210c
293#define AUD_HDMIW_INFOFR 0x62118
294#define AUD_CONV_CHCNT 0x62120
295#define AUD_CTS_ENABLE 0x62128
296
297#define VIDEO_DIP_CTL 0x61170
298#define VIDEO_DIP_ENABLE (1<<31)
299#define VIDEO_DIP_ENABLE_AVI (1<<21)
300#define VIDEO_DIP_ENABLE_VENDOR (1<<22)
301#define VIDEO_DIP_ENABLE_SPD (1<<24)
302#define VIDEO_DIP_BUF_AVI (0<<19)
303#define VIDEO_DIP_BUF_VENDOR (1<<19)
304#define VIDEO_DIP_BUF_SPD (3<<19)
305#define VIDEO_DIP_TRANS_ONCE (0<<16)
306#define VIDEO_DIP_TRANS_1 (1<<16)
307#define VIDEO_DIP_TRANS_2 (2<<16)
308
309#define AUDIO_HOTPLUG_EN (1<<24)
310
311
Wu Fengguang020abdb2010-04-19 13:13:06 +0800312static void dump_eaglelake(void)
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800313{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400314 uint32_t dword;
315 int i;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800316
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400317 /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800318
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400319 dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
320 dump_reg(SDVOB, "Digital Display Port B Control Register");
321 dump_reg(SDVOC, "Digital Display Port C Control Register");
322 dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800323
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400324 dump_reg(AUD_CONFIG, "Audio Configuration");
325 dump_reg(AUD_DEBUG, "Audio Debug");
326 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
327 dump_reg(AUD_RID, "Audio Revision ID");
328 dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
329 dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
330 dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
331 dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
332 dump_reg(AUD_PWRST, "Audio Power State");
333 dump_reg(AUD_SUPPWR, "Audio Supported Power States");
334 dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
335 dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
336 dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
337 dump_reg(AUD_OUT_STR, "Audio Stream Formats");
338 dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
339 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
340 dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
341 dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
342 dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
343 dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
344 dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
345 dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
346 dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
347 dump_reg(AUD_CNTL_ST, "Audio Control State Register");
348 dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
349 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
350 dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
351 dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
352 dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
353 dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800354
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400355 printf("\nDetails:\n\n");
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800356
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400357 dword = INREG(AUD_VID_DID);
358 printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
359 printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800360
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400361 dword = INREG(AUD_RID);
362 printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
363 printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
364 printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
365 printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800366
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400367 dword = INREG(SDVOB);
368 printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
369 printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
370 printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
371 printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
372 printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800373
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400374 dword = INREG(SDVOC);
375 printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
376 printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
377 printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
378 printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
379 printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800380
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400381 dword = INREG(PORT_HOTPLUG_EN);
382 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)),
383 printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)),
384 printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
385 printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
386 printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
387 printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
388 printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
389 printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)),
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800390
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400391 dword = INREG(VIDEO_DIP_CTL);
392 printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
393 printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
394 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
395 printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
396 printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
397 printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
398 printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
399 printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
400 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
401 printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
402 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
403 printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
404 printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800405
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400406 dword = INREG(AUD_CONFIG);
407 printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
408 OPNAME(pixel_clock, BITS(dword, 19, 16)));
409 printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
410 printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
411 printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800412
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400413 dword = INREG(AUD_DEBUG);
414 printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800415
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400416 dword = INREG(AUD_SUBN_CNT);
417 printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16));
418 printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800419
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400420 dword = INREG(AUD_SUBN_CNT2);
421 printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16));
422 printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800423
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400424 dword = INREG(AUD_FUNC_GRP);
425 printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
426 printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800427
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400428 dword = INREG(AUD_GRP_CAP);
429 printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
430 printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
431 printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800432
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400433 dword = INREG(AUD_PWRST);
434 printf("AUD_PWRST device power state\t\t%s\n",
435 power_state[BITS(dword, 5, 4)]);
436 printf("AUD_PWRST device power state setting\t%s\n",
437 power_state[BITS(dword, 1, 0)]);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800438
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400439 dword = INREG(AUD_SUPPWR);
440 printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
441 printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
442 printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
443 printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800444
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400445 dword = INREG(AUD_OUT_CWCAP);
446 printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
447 printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
448 printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
449 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
450 printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
451 printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
452 printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
453 printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
454 printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
455 printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
456 printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
457 printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
458 printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
459 printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800460
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400461 dword = INREG(AUD_OUT_DIG_CNVT);
462 printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8));
463 printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
464 printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
465 printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
466 printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
467 printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
468 printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
469 printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
470 printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800471
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400472 dword = INREG(AUD_OUT_CH_STR);
473 printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
474 printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800475
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400476 dword = INREG(AUD_OUT_STR_DESC);
477 printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1);
478 printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n",
479 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800480
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400481 dword = INREG(AUD_PINW_CAP);
482 printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
483 printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
484 printf("AUD_PINW_CAP channel count\t\t%lu\n",
485 BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
486 printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
487 printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
488 printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
489 printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
490 printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
491 printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
492 printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
493 printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
494 printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
495 printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
496 printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800497
498
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400499 dword = INREG(AUD_PIN_CAP);
500 printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
501 printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
502 printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
503 printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800504
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400505 dword = INREG(AUD_PINW_CNTR);
506 printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
507 printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
508 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
509 printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
510 printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
511 BITS(dword, 2, 0),
512 OPNAME(stream_type, BITS(dword, 2, 0)));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800513
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400514 dword = INREG(AUD_PINW_UNSOLRESP);
515 printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800516
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400517 dword = INREG(AUD_CNTL_ST);
518 printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
519 printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
520 printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
521 printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
522 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
523 printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
524 BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
525 printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
526 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
527 printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
528 printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
529 printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
530 printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
531 printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
532 printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800533
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400534 dword = INREG(AUD_HDMIW_STATUS);
535 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
536 printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
537 printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
538 printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800539
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400540 dword = INREG(AUD_CONV_CHCNT);
541 printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
542 printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1);
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800543
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400544 printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
545 for (i = 0; i < 8; i++) {
546 OUTREG(AUD_CONV_CHCNT, i);
547 dword = INREG(AUD_CONV_CHCNT);
548 printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4));
549 }
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800550
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400551 printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t");
552 dword = INREG(AUD_CNTL_ST);
553 dword &= ~BITMASK(8, 5);
554 OUTREG(AUD_CNTL_ST, dword);
555 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
556 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID)));
557 printf("\n");
Wu Fengguangf32aecb2011-11-12 11:12:50 +0800558
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400559 printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t");
560 dword = INREG(AUD_CNTL_ST);
561 dword &= ~BITMASK(20, 18);
562 dword &= ~BITMASK(3, 0);
563 OUTREG(AUD_CNTL_ST, dword);
564 for (i = 0; i < 8; i++)
565 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR)));
566 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800567}
Wu Fengguang9e9c9f22009-11-06 11:06:22 +0800568
Wu Fengguang020abdb2010-04-19 13:13:06 +0800569#undef AUD_RID
570#undef AUD_VID_DID
571#undef AUD_PWRST
572#undef AUD_OUT_CH_STR
573#undef AUD_HDMIW_STATUS
574
575/*
576 * IronLake registers
577 */
578#define AUD_CONFIG_A 0xE2000
579#define AUD_CONFIG_B 0xE2100
580#define AUD_CTS_ENABLE_A 0xE2028
581#define AUD_CTS_ENABLE_B 0xE2128
582#define AUD_MISC_CTRL_A 0xE2010
583#define AUD_MISC_CTRL_B 0xE2110
584#define AUD_VID_DID 0xE2020
585#define AUD_RID 0xE2024
586#define AUD_PWRST 0xE204C
587#define AUD_PORT_EN_HD_CFG 0xE207C
588#define AUD_OUT_DIG_CNVT_A 0xE2080
589#define AUD_OUT_DIG_CNVT_B 0xE2180
590#define AUD_OUT_CH_STR 0xE2088
591#define AUD_OUT_STR_DESC_A 0xE2084
592#define AUD_OUT_STR_DESC_B 0xE2184
593#define AUD_PINW_CONNLNG_LIST 0xE20A8
594#define AUD_PINW_CONNLNG_SEL 0xE20AC
595#define AUD_CNTL_ST_A 0xE20B4
596#define AUD_CNTL_ST_B 0xE21B4
597#define AUD_CNTL_ST2 0xE20C0
598#define AUD_HDMIW_STATUS 0xE20D4
599#define AUD_HDMIW_HDMIEDID_A 0xE2050
600#define AUD_HDMIW_HDMIEDID_B 0xE2150
601#define AUD_HDMIW_INFOFR_A 0xE2054
602#define AUD_HDMIW_INFOFR_B 0xE2154
603
604static void dump_ironlake(void)
605{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400606 uint32_t dword;
607 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800608
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400609 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
610 dump_reg(HDMIC, "HDMI Port C Control");
611 dump_reg(HDMID, "HDMI Port D Control");
612 dump_reg(PCH_DP_B, "DisplayPort B Control Register");
613 dump_reg(PCH_DP_C, "DisplayPort C Control Register");
614 dump_reg(PCH_DP_D, "DisplayPort D Control Register");
615 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
616 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
617 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
618 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
619 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
620 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
621 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
622 dump_reg(AUD_RID, "Audio Revision ID");
623 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
624 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
625 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
626 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
627 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
628 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
629 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
630 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
631 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
632 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
633 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
634 dump_reg(AUD_CNTL_ST2, "Audio Control State 2");
635 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
636 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
637 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
638 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
639 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800640
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400641 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800642
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400643 dword = INREG(AUD_VID_DID);
644 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
645 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800646
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400647 dword = INREG(AUD_RID);
648 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
649 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
650 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
651 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800652
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400653 dword = INREG(HDMIB);
654 printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
655 printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
656 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
657 printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23));
658 printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2));
659 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
660 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
661 printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
662 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800663
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400664 dword = INREG(HDMIC);
665 printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
666 printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
667 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
668 printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2));
669 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
670 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
671 printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
672 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800673
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400674 dword = INREG(HDMID);
675 printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
676 printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
677 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
678 printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2));
679 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
680 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
681 printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
682 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800683
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400684 dword = INREG(PCH_DP_B);
685 printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
686 printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
687 printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
688 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
689 printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
690 printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
691 printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800692
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400693 dword = INREG(PCH_DP_C);
694 printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
695 printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
696 printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
697 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
698 printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
699 printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
700 printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800701
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400702 dword = INREG(PCH_DP_D);
703 printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
704 printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A");
705 printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
706 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
707 printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
708 printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
709 printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguangb5ca6b42011-11-12 11:12:48 +0800710
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400711 dword = INREG(AUD_CONFIG_A);
712 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
713 n_index_value[BIT(dword, 29)]);
714 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
715 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
716 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
717 printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
718 OPNAME(pixel_clock, BITS(dword, 19, 16)));
719 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
720 dword = INREG(AUD_CONFIG_B);
721 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
722 n_index_value[BIT(dword, 29)]);
723 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
724 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
725 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
726 printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
727 OPNAME(pixel_clock, BITS(dword, 19, 16)));
728 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800729
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400730 dword = INREG(AUD_CTS_ENABLE_A);
731 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
732 printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
733 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
734 dword = INREG(AUD_CTS_ENABLE_B);
735 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
736 printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
737 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800738
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400739 dword = INREG(AUD_MISC_CTRL_A);
740 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
741 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
742 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
743 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
744 dword = INREG(AUD_MISC_CTRL_B);
745 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
746 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
747 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
748 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800749
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400750 dword = INREG(AUD_PWRST);
751 printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]);
752 printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]);
753 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
754 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
755 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
756 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
757 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
758 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
759 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
760 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
761 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
762 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +0800763
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400764 dword = INREG(AUD_PORT_EN_HD_CFG);
765 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
766 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
767 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
768 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
769 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12));
770 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13));
771 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14));
772 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16));
773 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17));
774 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 +0800775
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400776 dword = INREG(AUD_OUT_DIG_CNVT_A);
777 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
778 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
779 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
780 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
781 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
782 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
783 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
784 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
785 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
786 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 +0800787
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400788 dword = INREG(AUD_OUT_DIG_CNVT_B);
789 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
790 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
791 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
792 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
793 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
794 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
795 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
796 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
797 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
798 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 +0800799
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400800 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
801 for (i = 0; i < 8; i++) {
802 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
803 dword = INREG(AUD_OUT_CH_STR);
804 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
805 1 + BITS(dword, 3, 0),
806 1 + BITS(dword, 7, 4),
807 1 + BITS(dword, 15, 12),
808 1 + BITS(dword, 23, 20));
809 }
Wu Fengguang020abdb2010-04-19 13:13:06 +0800810
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400811 dword = INREG(AUD_OUT_STR_DESC_A);
812 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
813 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
814 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
815 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
816 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 +0800817
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400818 dword = INREG(AUD_OUT_STR_DESC_B);
819 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
820 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
821 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
822 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
823 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 +0800824
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400825 dword = INREG(AUD_PINW_CONNLNG_SEL);
826 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0));
827 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8));
828 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800829
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400830 dword = INREG(AUD_CNTL_ST_A);
831 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
832 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
833 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
834 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
835 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
836 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
837 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
838 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
839 printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
840 printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800841
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400842 dword = INREG(AUD_CNTL_ST_B);
843 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
844 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
845 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
846 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
847 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
848 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
849 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
850 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
851 printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10));
852 printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800853
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400854 dword = INREG(AUD_CNTL_ST2);
855 printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1));
856 printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
857 printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5));
858 printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
859 printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9));
860 printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800861
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400862 dword = INREG(AUD_HDMIW_STATUS);
863 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
864 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
865 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
866 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
867 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
868 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29));
Wu Fengguang020abdb2010-04-19 13:13:06 +0800869
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400870 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
871 dword = INREG(AUD_CNTL_ST_A);
872 dword &= ~BITMASK(9, 5);
873 OUTREG(AUD_CNTL_ST_A, dword);
874 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
875 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
876 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800877
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400878 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
879 dword = INREG(AUD_CNTL_ST_B);
880 dword &= ~BITMASK(9, 5);
881 OUTREG(AUD_CNTL_ST_B, dword);
882 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
883 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
884 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800885
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400886 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
887 dword = INREG(AUD_CNTL_ST_A);
888 dword &= ~BITMASK(20, 18);
889 dword &= ~BITMASK(3, 0);
890 OUTREG(AUD_CNTL_ST_A, dword);
891 for (i = 0; i < 8; i++)
892 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
893 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800894
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400895 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
896 dword = INREG(AUD_CNTL_ST_B);
897 dword &= ~BITMASK(20, 18);
898 dword &= ~BITMASK(3, 0);
899 OUTREG(AUD_CNTL_ST_B, dword);
900 for (i = 0; i < 8; i++)
901 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
902 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +0800903
904}
905
906
907#undef AUD_CONFIG_A
908#undef AUD_MISC_CTRL_A
909#undef AUD_VID_DID
910#undef AUD_RID
911#undef AUD_CTS_ENABLE_A
912#undef AUD_PWRST
913#undef AUD_HDMIW_HDMIEDID_A
914#undef AUD_HDMIW_INFOFR_A
915#undef AUD_PORT_EN_HD_CFG
916#undef AUD_OUT_DIG_CNVT_A
917#undef AUD_OUT_STR_DESC_A
918#undef AUD_OUT_CH_STR
919#undef AUD_PINW_CONNLNG_LIST
920#undef AUD_CNTL_ST_A
921#undef AUD_HDMIW_STATUS
922#undef AUD_CONFIG_B
923#undef AUD_MISC_CTRL_B
924#undef AUD_CTS_ENABLE_B
925#undef AUD_HDMIW_HDMIEDID_B
926#undef AUD_HDMIW_INFOFR_B
927#undef AUD_OUT_DIG_CNVT_B
928#undef AUD_OUT_STR_DESC_B
929#undef AUD_CNTL_ST_B
930
931/*
932 * CougarPoint registers
933 */
Wu Fengguang97d20312011-11-12 11:12:45 +0800934#define DP_CTL_B 0xE4100
Wu Fengguang020abdb2010-04-19 13:13:06 +0800935#define DP_CTL_C 0xE4200
936#define DP_AUX_CTL_C 0xE4210
937#define DP_AUX_TST_C 0xE4228
938#define SPORT_DDI_CRC_C 0xE4250
939#define SPORT_DDI_CRC_R 0xE4264
940#define DP_CTL_D 0xE4300
941#define DP_AUX_CTL_D 0xE4310
942#define DP_AUX_TST_D 0xE4328
943#define SPORT_DDI_CRC_CTL_D 0xE4350
944#define AUD_CONFIG_A 0xE5000
945#define AUD_MISC_CTRL_A 0xE5010
946#define AUD_VID_DID 0xE5020
947#define AUD_RID 0xE5024
948#define AUD_CTS_ENABLE_A 0xE5028
949#define AUD_PWRST 0xE504C
950#define AUD_HDMIW_HDMIEDID_A 0xE5050
951#define AUD_HDMIW_INFOFR_A 0xE5054
952#define AUD_PORT_EN_HD_CFG 0xE507C
953#define AUD_OUT_DIG_CNVT_A 0xE5080
954#define AUD_OUT_STR_DESC_A 0xE5084
955#define AUD_OUT_CH_STR 0xE5088
956#define AUD_PINW_CONNLNG_LIST 0xE50A8
957#define AUD_PINW_CONNLNG_SELA 0xE50AC
958#define AUD_CNTL_ST_A 0xE50B4
959#define AUD_CNTRL_ST2 0xE50C0
960#define AUD_CNTRL_ST3 0xE50C4
961#define AUD_HDMIW_STATUS 0xE50D4
962#define AUD_CONFIG_B 0xE5100
963#define AUD_MISC_CTRL_B 0xE5110
964#define AUD_CTS_ENABLE_B 0xE5128
965#define AUD_HDMIW_HDMIEDID_B 0xE5150
966#define AUD_HDMIW_INFOFR_B 0xE5154
967#define AUD_OUT_DIG_CNVT_B 0xE5180
968#define AUD_OUT_STR_DESC_B 0xE5184
969#define AUD_CNTL_ST_B 0xE51B4
970#define AUD_CONFIG_C 0xE5200
971#define AUD_MISC_CTRL_C 0xE5210
972#define AUD_CTS_ENABLE_C 0xE5228
973#define AUD_HDMIW_HDMIEDID_C 0xE5250
974#define AUD_HDMIW_INFOFR_C 0xE5254
975#define AUD_OUT_DIG_CNVT_C 0xE5280
976#define AUD_OUT_STR_DESC_C 0xE5284
977#define AUD_CNTL_ST_C 0xE52B4
978#define AUD_CONFIG_D 0xE5300
979#define AUD_MISC_CTRL_D 0xE5310
980#define AUD_CTS_ENABLE_D 0xE5328
981#define AUD_HDMIW_HDMIEDID_D 0xE5350
982#define AUD_HDMIW_INFOFR_D 0xE5354
983#define AUD_OUT_DIG_CNVT_D 0xE5380
984#define AUD_OUT_STR_DESC_D 0xE5384
985#define AUD_CNTL_ST_D 0xE53B4
986
Wu Fengguange321f132011-11-12 11:12:52 +0800987#define VIDEO_DIP_CTL_A 0xE0200
988#define VIDEO_DIP_CTL_B 0xE1200
989#define VIDEO_DIP_CTL_C 0xE2200
990#define VIDEO_DIP_CTL_D 0xE3200
991
Wu Fengguang020abdb2010-04-19 13:13:06 +0800992
993static void dump_cpt(void)
994{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400995 uint32_t dword;
996 int i;
Wu Fengguang020abdb2010-04-19 13:13:06 +0800997
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -0400998 dump_reg(HDMIB, "sDVO/HDMI Port B Control");
999 dump_reg(HDMIC, "HDMI Port C Control");
1000 dump_reg(HDMID, "HDMI Port D Control");
1001 dump_reg(DP_CTL_B, "DisplayPort B Control");
1002 dump_reg(DP_CTL_C, "DisplayPort C Control");
1003 dump_reg(DP_CTL_D, "DisplayPort D Control");
1004 dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control");
1005 dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control");
1006 dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control");
1007 dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A");
1008 dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B");
1009 dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C");
1010 dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A");
1011 dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B");
1012 dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C");
1013 dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A");
1014 dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B");
1015 dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C");
1016 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
1017 dump_reg(AUD_RID, "Audio Revision ID");
1018 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
1019 dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config");
1020 dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A");
1021 dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B");
1022 dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C");
1023 dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
1024 dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A");
1025 dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B");
1026 dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C");
1027 dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List");
1028 dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select");
1029 dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A");
1030 dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B");
1031 dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C");
1032 dump_reg(AUD_CNTRL_ST2, "Audio Control State 2");
1033 dump_reg(AUD_CNTRL_ST3, "Audio Control State 3");
1034 dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
1035 dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A");
1036 dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B");
1037 dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C");
1038 dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A");
1039 dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B");
1040 dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001041
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001042 printf("\nDetails:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001043
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001044 dword = INREG(VIDEO_DIP_CTL_A);
1045 printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1046 printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1047 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1048 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1049 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1050 printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1051 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1052 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1053 printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1054 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1055 printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1056 printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001057
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001058 dword = INREG(VIDEO_DIP_CTL_B);
1059 printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1060 printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1061 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1062 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1063 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1064 printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1065 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1066 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1067 printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1068 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1069 printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1070 printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001071
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001072 dword = INREG(VIDEO_DIP_CTL_C);
1073 printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)),
1074 printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)),
1075 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21));
1076 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22));
1077 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23));
1078 printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24));
1079 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n",
1080 BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
1081 printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n",
1082 BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
1083 printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8));
1084 printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0));
Wu Fengguange321f132011-11-12 11:12:52 +08001085
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001086 dword = INREG(AUD_VID_DID);
1087 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16);
1088 printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001089
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001090 dword = INREG(AUD_RID);
1091 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1092 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1093 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1094 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001095
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001096 dword = INREG(HDMIB);
1097 printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1098 printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1099 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1100 printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1101 printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1102 printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1103 printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1104 printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1105 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1106 printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1107 printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001108
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001109 dword = INREG(HDMIC);
1110 printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1111 printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1112 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1113 printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1114 printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1115 printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1116 printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1117 printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1118 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1119 printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1120 printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001121
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001122 dword = INREG(HDMID);
1123 printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
1124 printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n",
1125 BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]);
1126 printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7));
1127 printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5));
1128 printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23));
1129 printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1130 printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n",
1131 BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]);
1132 printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI");
1133 printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001134
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001135 dword = INREG(DP_CTL_B);
1136 printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1137 printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1138 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1139 printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1140 printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1141 printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001142
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001143 dword = INREG(DP_CTL_C);
1144 printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1145 printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1146 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1147 printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1148 printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1149 printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001150
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001151 dword = INREG(DP_CTL_D);
1152 printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31));
1153 printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n",
1154 BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]);
1155 printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2));
1156 printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5));
1157 printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001158
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001159 dword = INREG(AUD_CONFIG_A);
1160 printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1161 n_index_value[BIT(dword, 29)]);
1162 printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1163 printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1164 printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1165 printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1166 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1167 printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1168 dword = INREG(AUD_CONFIG_B);
1169 printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1170 n_index_value[BIT(dword, 29)]);
1171 printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1172 printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1173 printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1174 printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1175 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1176 printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
1177 dword = INREG(AUD_CONFIG_C);
1178 printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29),
1179 n_index_value[BIT(dword, 29)]);
1180 printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28));
1181 printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20));
1182 printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4));
1183 printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
1184 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1185 printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001186
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001187 dword = INREG(AUD_CTS_ENABLE_A);
1188 printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1189 printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1190 printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1191 dword = INREG(AUD_CTS_ENABLE_B);
1192 printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1193 printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1194 printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
1195 dword = INREG(AUD_CTS_ENABLE_C);
1196 printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20));
1197 printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M");
1198 printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001199
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001200 dword = INREG(AUD_MISC_CTRL_A);
1201 printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1202 printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1203 printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1204 printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1205 dword = INREG(AUD_MISC_CTRL_B);
1206 printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1207 printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1208 printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1209 printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
1210 dword = INREG(AUD_MISC_CTRL_C);
1211 printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2));
1212 printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8));
1213 printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4));
1214 printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001215
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001216 dword = INREG(AUD_PWRST);
1217 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1218 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1219 printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1220 printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1221 printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1222 printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1223 printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]);
1224 printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]);
1225 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1226 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1227 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1228 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1229 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1230 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001231
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001232 dword = INREG(AUD_PORT_EN_HD_CFG);
1233 printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0));
1234 printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1));
1235 printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2));
1236 printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1237 printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1238 printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1239 printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1240 printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1241 printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1242 printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1243 printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1244 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 +08001245
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001246 dword = INREG(AUD_OUT_DIG_CNVT_A);
1247 printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1));
1248 printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1249 printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1250 printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4));
1251 printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1252 printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1253 printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7));
1254 printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1255 printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1256 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 +08001257
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001258 dword = INREG(AUD_OUT_DIG_CNVT_B);
1259 printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1));
1260 printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1261 printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1262 printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4));
1263 printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1264 printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1265 printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7));
1266 printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1267 printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1268 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 +08001269
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001270 dword = INREG(AUD_OUT_DIG_CNVT_C);
1271 printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1));
1272 printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2));
1273 printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3));
1274 printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4));
1275 printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5));
1276 printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6));
1277 printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7));
1278 printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8));
1279 printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16));
1280 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 +08001281
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001282 printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n");
1283 for (i = 0; i < 8; i++) {
1284 OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16));
1285 dword = INREG(AUD_OUT_CH_STR);
1286 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1287 1 + BITS(dword, 3, 0),
1288 1 + BITS(dword, 7, 4),
1289 1 + BITS(dword, 15, 12),
1290 1 + BITS(dword, 23, 20));
1291 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08001292
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001293 dword = INREG(AUD_OUT_STR_DESC_A);
1294 printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1295 printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1296 printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n",
1297 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1298 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 +08001299
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001300 dword = INREG(AUD_OUT_STR_DESC_B);
1301 printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1302 printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1303 printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n",
1304 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1305 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 +08001306
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001307 dword = INREG(AUD_OUT_STR_DESC_C);
1308 printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27));
1309 printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1);
1310 printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n",
1311 BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1312 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 +08001313
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001314 dword = INREG(AUD_PINW_CONNLNG_SEL);
1315 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0));
1316 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8));
1317 printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001318
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001319 dword = INREG(AUD_CNTL_ST_A);
1320 printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1321 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1322 printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1323 printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1324 printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1325 printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n",
1326 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1327 printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1328 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 +08001329
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001330 dword = INREG(AUD_CNTL_ST_B);
1331 printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1332 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1333 printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1334 printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1335 printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1336 printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n",
1337 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1338 printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1339 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 +08001340
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001341 dword = INREG(AUD_CNTL_ST_C);
1342 printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n",
1343 BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
1344 printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21));
1345 printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22));
1346 printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23));
1347 printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n",
1348 BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
1349 printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4));
1350 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 +08001351
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001352 dword = INREG(AUD_CNTRL_ST2);
1353 printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1));
1354 printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0));
1355 printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5));
1356 printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4));
1357 printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9));
1358 printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001359
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001360 dword = INREG(AUD_CNTRL_ST3);
1361 printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3));
1362 printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n",
1363 BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]);
1364 printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7));
1365 printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n",
1366 BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]);
1367 printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11));
1368 printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n",
1369 BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]);
Wu Fengguang020abdb2010-04-19 13:13:06 +08001370
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001371 dword = INREG(AUD_HDMIW_STATUS);
1372 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1373 printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1374 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1375 printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1376 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1377 printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1378 printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25));
1379 printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
Wu Fengguang020abdb2010-04-19 13:13:06 +08001380
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001381 printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t");
1382 dword = INREG(AUD_CNTL_ST_A);
1383 dword &= ~BITMASK(9, 5);
1384 OUTREG(AUD_CNTL_ST_A, dword);
1385 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1386 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A)));
1387 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001388
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001389 printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t");
1390 dword = INREG(AUD_CNTL_ST_B);
1391 dword &= ~BITMASK(9, 5);
1392 OUTREG(AUD_CNTL_ST_B, dword);
1393 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1394 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B)));
1395 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001396
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001397 printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t");
1398 dword = INREG(AUD_CNTL_ST_C);
1399 dword &= ~BITMASK(9, 5);
1400 OUTREG(AUD_CNTL_ST_C, dword);
1401 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1402 printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C)));
1403 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001404
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001405 printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t");
1406 dword = INREG(AUD_CNTL_ST_A);
1407 dword &= ~BITMASK(20, 18);
1408 dword &= ~BITMASK(3, 0);
1409 OUTREG(AUD_CNTL_ST_A, dword);
1410 for (i = 0; i < 8; i++)
1411 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A)));
1412 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001413
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001414 printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t");
1415 dword = INREG(AUD_CNTL_ST_B);
1416 dword &= ~BITMASK(20, 18);
1417 dword &= ~BITMASK(3, 0);
1418 OUTREG(AUD_CNTL_ST_B, dword);
1419 for (i = 0; i < 8; i++)
1420 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B)));
1421 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001422
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001423 printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t");
1424 dword = INREG(AUD_CNTL_ST_C);
1425 dword &= ~BITMASK(20, 18);
1426 dword &= ~BITMASK(3, 0);
1427 OUTREG(AUD_CNTL_ST_C, dword);
1428 for (i = 0; i < 8; i++)
1429 printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C)));
1430 printf("\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08001431
1432}
1433
Wang Xingchaoc4077222012-08-15 16:13:38 +08001434#undef AUD_CONFIG_A
1435#undef AUD_MISC_CTRL_A
1436#undef AUD_VID_DID
1437#undef AUD_RID
1438#undef AUD_CTS_ENABLE_A
1439#undef AUD_PWRST
1440#undef AUD_HDMIW_HDMIEDID_A
1441#undef AUD_HDMIW_INFOFR_A
1442#undef AUD_PORT_EN_HD_CFG
1443#undef AUD_OUT_DIG_CNVT_A
1444#undef AUD_OUT_STR_DESC_A
1445#undef AUD_OUT_CH_STR
1446#undef AUD_PINW_CONNLNG_LIST
Mengdong Lindeba8682013-09-09 15:38:40 -04001447#undef AUD_PINW_CONNLNG_SEL
Wang Xingchaoc4077222012-08-15 16:13:38 +08001448#undef AUD_CNTL_ST_A
1449#undef AUD_HDMIW_STATUS
1450#undef AUD_CONFIG_B
1451#undef AUD_MISC_CTRL_B
1452#undef AUD_CTS_ENABLE_B
1453#undef AUD_HDMIW_HDMIEDID_B
1454#undef AUD_HDMIW_INFOFR_B
1455#undef AUD_OUT_DIG_CNVT_B
1456#undef AUD_OUT_STR_DESC_B
1457#undef AUD_CNTL_ST_B
1458#undef AUD_CONFIG_C
1459#undef AUD_MISC_CTRL_C
1460#undef AUD_CTS_ENABLE_C
1461#undef AUD_HDMIW_HDMIEDID_C
1462#undef AUD_HDMIW_INFOFR_C
1463#undef AUD_OUT_DIG_CNVT_C
1464#undef AUD_OUT_STR_DESC_C
1465
1466#undef VIDEO_DIP_CTL_A
1467#undef VIDEO_DIP_CTL_B
1468#undef VIDEO_DIP_CTL_C
1469#undef VIDEO_DIP_CTL_D
1470#undef VIDEO_DIP_DATA
1471
1472/*
1473 * Haswell registers
1474 */
1475
1476/* DisplayPort Transport Control */
1477#define DP_TP_CTL_A 0x64040
1478#define DP_TP_CTL_B 0x64140
1479#define DP_TP_CTL_C 0x64240
1480#define DP_TP_CTL_D 0x64340
1481#define DP_TP_CTL_E 0x64440
1482
1483/* DisplayPort Transport Status */
1484#define DP_TP_ST_A 0x64044
1485#define DP_TP_ST_B 0x64144
1486#define DP_TP_ST_C 0x64244
1487#define DP_TP_ST_D 0x64344
1488#define DP_TP_ST_E 0x64444
1489
Wang Xingchaoc4077222012-08-15 16:13:38 +08001490/* DDI Buffer Control */
1491#define DDI_BUF_CTL_A 0x64000
1492#define DDI_BUF_CTL_B 0x64100
1493#define DDI_BUF_CTL_C 0x64200
1494#define DDI_BUF_CTL_D 0x64300
1495#define DDI_BUF_CTL_E 0x64400
1496
1497/* DDI Buffer Translation */
1498#define DDI_BUF_TRANS_A 0x64e00
1499#define DDI_BUF_TRANS_B 0x64e60
1500#define DDI_BUF_TRANS_C 0x64ec0
1501#define DDI_BUF_TRANS_D 0x64f20
1502#define DDI_BUF_TRANS_E 0x64f80
1503
1504/* DDI Aux Channel */
1505#define DDI_AUX_CHANNEL_CTRL 0x64010
1506#define DDI_AUX_DATA 0x64014
1507#define DDI_AUX_TST 0x64028
1508
1509/* DDI CRC Control */
1510#define DDI_CRC_CTL_A 0x64050
1511#define DDI_CRC_CTL_B 0x64150
1512#define DDI_CRC_CTL_C 0x64250
1513#define DDI_CRC_CTL_D 0x64350
1514#define DDI_CRC_CTL_E 0x64450
1515
1516/* Pipe DDI Function Control */
1517#define PIPE_DDI_FUNC_CTL_A 0x60400
1518#define PIPE_DDI_FUNC_CTL_B 0x61400
1519#define PIPE_DDI_FUNC_CTL_C 0x62400
1520#define PIPE_DDI_FUNC_CTL_EDP 0x6F400
1521
1522/* Pipe Configuration */
1523#define PIPE_CONF_A 0x70008
1524#define PIPE_CONF_B 0x71008
1525#define PIPE_CONF_C 0x72008
1526#define PIPE_CONF_EDP 0x7F008
1527
1528/* Audio registers */
Mengdong Lindeba8682013-09-09 15:38:40 -04001529#define AUD_TCA_CONFIG 0x65000
1530#define AUD_TCB_CONFIG 0x65100
1531#define AUD_TCC_CONFIG 0x65200
1532#define AUD_C1_MISC_CTRL 0x65010
1533#define AUD_C2_MISC_CTRL 0x65110
1534#define AUD_C3_MISC_CTRL 0x65210
1535#define AUD_VID_DID 0x65020
1536#define AUD_RID 0x65024
1537#define AUD_TCA_M_CTS_ENABLE 0x65028
1538#define AUD_TCB_M_CTS_ENABLE 0x65128
1539#define AUD_TCC_M_CTS_ENABLE 0x65228
1540#define AUD_PWRST 0x6504C
1541#define AUD_TCA_EDID_DATA 0x65050
1542#define AUD_TCB_EDID_DATA 0x65150
1543#define AUD_TCC_EDID_DATA 0x65250
1544#define AUD_TCA_INFOFR 0x65054
1545#define AUD_TCB_INFOFR 0x65154
1546#define AUD_TCC_INFOFR 0x65254
1547#define AUD_PIPE_CONV_CFG 0x6507C
1548#define AUD_C1_DIG_CNVT 0x65080
1549#define AUD_C2_DIG_CNVT 0x65180
1550#define AUD_C3_DIG_CNVT 0x65280
1551#define AUD_C1_STR_DESC 0x65084
1552#define AUD_C2_STR_DESC 0x65184
1553#define AUD_C3_STR_DESC 0x65284
1554#define AUD_OUT_CHAN_MAP 0x65088
1555#define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8
1556#define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8
1557#define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8
Wang Xingchaoc4077222012-08-15 16:13:38 +08001558#define AUD_PIPE_CONN_SEL_CTRL 0x650AC
Mengdong Lindeba8682013-09-09 15:38:40 -04001559#define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4
1560#define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4
1561#define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4
1562#define AUD_PIN_ELD_CP_VLD 0x650C0
1563#define AUD_HDMI_FIFO_STATUS 0x650D4
Wang Xingchaoc4077222012-08-15 16:13:38 +08001564
Mengdong Lin85357202013-08-13 00:21:57 -04001565/* Audio debug registers */
1566#define AUD_ICOI 0x65f00
1567#define AUD_IRII 0x65f04
1568#define AUD_ICS 0x65f08
1569
Wang Xingchaoc4077222012-08-15 16:13:38 +08001570/* Video DIP Control */
1571#define VIDEO_DIP_CTL_A 0x60200
1572#define VIDEO_DIP_CTL_B 0x61200
1573#define VIDEO_DIP_CTL_C 0x62200
1574#define VIDEO_DIP_CTL_D 0x63200
1575
1576#define VIDEO_DIP_DATA 0x60220
1577#define VIDEO_DIP_ECC 0x60240
1578
1579#define AUD_DP_DIP_STATUS 0x65f20
1580
Mengdong Lindeba8682013-09-09 15:38:40 -04001581#define MAX_PREFIX_SIZE 128
1582
1583#undef TRANSCODER_A
1584#undef TRANSCODER_B
1585#undef TRANSCODER_C
1586enum {
1587 TRANSCODER_A = 0,
1588 TRANSCODER_B,
1589 TRANSCODER_C,
1590};
1591
1592enum {
1593 PIPE_A = 0,
1594 PIPE_B,
1595 PIPE_C,
1596};
1597
1598enum {
1599 PORT_A = 0,
1600 PORT_B,
1601 PORT_C,
1602 PORT_D,
1603 PORT_E,
1604};
1605
1606enum {
1607 CONVERTER_1 = 0,
1608 CONVERTER_2,
1609 CONVERTER_3,
1610};
1611
1612static void dump_ddi_buf_ctl(int port)
1613{
1614 uint32_t dword;
1615
1616 dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100);
1617 printf("DDI %c Buffer control\n", 'A' + port - PORT_A);
1618 printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1),
1619 OPNAME(dp_port_width, BITS(dword, 3, 1)));
1620 printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31));
1621}
1622
1623static void dump_ddi_func_ctl(int pipe)
1624{
1625 uint32_t dword;
1626
1627 dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000);
1628 printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A);
1629 printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20),
1630 OPNAME(bits_per_color, BITS(dword, 22, 20)));
1631 printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24),
1632 OPNAME(ddi_mode, BITS(dword, 26, 24)));
1633 printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28),
1634 OPNAME(trans_to_port_sel, BITS(dword, 30, 28)));
1635 printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31));
1636}
1637
1638static void dump_aud_transcoder_config(int transcoder)
1639{
1640 uint32_t dword;
1641 char prefix[MAX_PREFIX_SIZE];
1642
1643 dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100);
1644 sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A);
1645
1646 printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1647 printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4));
1648 printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16),
1649 OPNAME(pixel_clock, BITS(dword, 19, 16)));
1650 printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20));
1651 printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28));
1652 printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29),
1653 OPNAME(n_index_value, BIT(dword, 29)));
1654}
1655
1656static void dump_aud_misc_control(int converter)
1657{
1658 uint32_t dword;
1659 char prefix[MAX_PREFIX_SIZE];
1660
1661 dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100);
1662 sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1);
1663
1664 printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1665 printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2));
1666 printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4));
1667 printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8));
1668}
1669
1670static void dump_aud_vendor_device_id(void)
1671{
1672 uint32_t dword;
1673
1674 dword = INREG(AUD_VID_DID);
1675 printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0));
1676 printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16));
1677}
1678
1679static void dump_aud_revision_id(void)
1680{
1681 uint32_t dword;
1682
1683 dword = INREG(AUD_RID);
1684 printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0));
1685 printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8));
1686 printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16));
1687 printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20));
1688}
1689
1690static void dump_aud_m_cts_enable(int transcoder)
1691{
1692 uint32_t dword;
1693 char prefix[MAX_PREFIX_SIZE];
1694
1695 dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100);
1696 sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A);
1697
1698 printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0));
1699 printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20));
1700 printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M");
1701}
1702
1703static void dump_aud_power_state(void)
1704{
1705 uint32_t dword;
1706
1707 dword = INREG(AUD_PWRST);
1708 printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]);
1709 printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]);
1710 printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]);
1711 printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]);
1712 printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]);
1713 printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]);
1714 printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]);
1715 printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]);
1716 printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]);
1717 printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]);
1718 printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]);
1719 printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]);
1720 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]);
1721 printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]);
1722}
1723
1724static void dump_aud_edid_data(int transcoder)
1725{
1726 uint32_t dword;
1727 int i;
1728 int offset = (transcoder - TRANSCODER_A) * 0x100;
1729
1730 printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A);
1731 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1732 dword &= ~BITMASK(9, 5);
1733 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1734 for (i = 0; i < BITS(dword, 14, 10) / 4; i++)
1735 printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset)));
1736 printf("\n");
1737}
1738
1739static void dump_aud_infoframe(int transcoder)
1740{
1741 uint32_t dword;
1742 int i;
1743 int offset = (transcoder - TRANSCODER_A) * 0x100;
1744
1745 printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A);
1746 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1747 dword &= ~BITMASK(20, 18);
1748 dword &= ~BITMASK(3, 0);
1749 OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword);
1750 for (i = 0; i < 8; i++)
1751 printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset)));
1752 printf("\n");
1753}
1754
1755static void dump_aud_pipe_conv_cfg(void)
1756{
1757 uint32_t dword;
1758
1759 dword = INREG(AUD_PIPE_CONV_CFG);
1760 printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0));
1761 printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1));
1762 printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2));
1763 printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4));
1764 printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8));
1765 printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12));
1766 printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16));
1767 printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17));
1768 printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18));
1769 printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20));
1770 printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21));
1771 printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22));
1772}
1773
1774static void dump_aud_dig_cnvt(int converter)
1775{
1776 uint32_t dword;
1777 char prefix[MAX_PREFIX_SIZE];
1778
1779 dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100);
1780 sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1);
1781
1782 printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1));
1783 printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2));
1784 printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3));
1785 printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4));
1786 printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5));
1787 printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6));
1788 printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7));
1789 printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8));
1790 printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16));
1791 printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20));
1792}
1793
1794static void dump_aud_str_desc(int converter)
1795{
1796 uint32_t dword;
1797 char prefix[MAX_PREFIX_SIZE];
1798 uint32_t rate;
1799
1800 dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100);
1801 sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1);
1802
1803 printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0));
1804 printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4),
1805 OPNAME(bits_per_sample, BITS(dword, 6, 4)));
1806
1807 printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8),
1808 OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8)));
1809 printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11),
1810 OPNAME(sample_base_rate_mult, BITS(dword, 13, 11)));
1811 printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14),
1812 OPNAME(sample_base_rate, BIT(dword, 14)));
1813 rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1)
1814 /(BITS(dword, 10, 8) + 1);
1815 printf("=> Sample Rate %d Hz\n", rate);
1816
1817 printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1);
1818}
1819
1820static void dump_aud_out_chan_map(void)
1821{
1822 uint32_t dword;
1823 int i;
1824
1825 printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n");
1826 for (i = 0; i < 8; i++) {
1827 OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16));
1828 dword = INREG(AUD_OUT_CHAN_MAP);
1829 printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n",
1830 1 + BITS(dword, 3, 0),
1831 1 + BITS(dword, 7, 4),
1832 1 + BITS(dword, 15, 12),
1833 1 + BITS(dword, 23, 20));
1834 }
1835}
1836
1837static void dump_aud_connect_list_entry_length(int transcoder)
1838{
1839 uint32_t dword;
1840 char prefix[MAX_PREFIX_SIZE];
1841
1842 dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100);
1843 sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A);
1844
1845 printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0));
1846 printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7),
1847 OPNAME(connect_list_form, BIT(dword, 7)));
1848 printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8));
1849}
1850
1851static void dump_aud_connect_select_ctrl(void)
1852{
1853 uint32_t dword;
1854
1855 dword = INREG(AUD_PIPE_CONN_SEL_CTRL);
1856 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0));
1857 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8));
1858 printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16));
1859}
1860
1861static void dump_aud_dip_eld_ctrl_st(int transcoder)
1862{
1863 uint32_t dword;
1864 int offset = (transcoder - TRANSCODER_A) * 0x100;
1865
1866 dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset);
1867 printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A);
1868
1869 printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4));
1870 printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10));
1871 printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16),
1872 dip_trans[BITS(dword, 17, 16)]);
1873 printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18),
1874 dip_index[BITS(dword, 20, 18)]);
1875 printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21),
1876 dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]);
1877 printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29),
1878 dip_port[BITS(dword, 30, 29)]);
1879 printf("\n");
1880}
1881
1882static void dump_aud_eld_cp_vld(void)
1883{
1884 uint32_t dword;
1885
1886 dword = INREG(AUD_PIN_ELD_CP_VLD);
1887 printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0));
1888 printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1));
1889 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2));
1890 printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3));
1891 printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4));
1892 printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5));
1893 printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6));
1894 printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7));
1895 printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8));
1896 printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9));
1897 printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10));
1898 printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11));
1899}
1900
1901static void dump_hdmi_fifo_status(void)
1902{
1903 uint32_t dword;
1904
1905 dword = INREG(AUD_HDMI_FIFO_STATUS);
1906 printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24));
1907 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26));
1908 printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27));
1909 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28));
1910 printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29));
1911 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30));
1912 printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31));
1913}
Wang Xingchaoc4077222012-08-15 16:13:38 +08001914
Mengdong Lin69cc00b2013-07-17 13:29:17 -04001915/* Dump audio registers for Haswell and its successors (eg. Broadwell).
1916 * Their register layout are same in the north display engine.
1917 */
1918static void dump_hsw_plus(void)
Wang Xingchaoc4077222012-08-15 16:13:38 +08001919{
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001920 uint32_t dword;
Wang Xingchaoc4077222012-08-15 16:13:38 +08001921
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001922 /* HSW DDI Buffer */
1923 dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A");
1924 dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B");
1925 dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C");
1926 dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D");
1927 dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001928
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001929 /* HSW Pipe Function */
1930 dump_reg(PIPE_CONF_A, "PIPE Configuration A");
1931 dump_reg(PIPE_CONF_B, "PIPE Configuration B");
1932 dump_reg(PIPE_CONF_C, "PIPE Configuration C");
1933 dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001934
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001935 dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A");
1936 dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B");
1937 dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C");
1938 dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001939
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001940 /* HSW Display port */
1941 dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control");
1942 dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control");
1943 dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control");
1944 dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control");
1945 dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001946
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001947 dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status");
1948 dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status");
1949 dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status");
1950 dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status");
1951 dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001952
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001953 /* HSW North Display Audio */
Mengdong Lindeba8682013-09-09 15:38:40 -04001954 dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A");
1955 dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B");
1956 dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C");
1957 dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control");
1958 dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control");
1959 dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001960 dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
Mengdong Lindeba8682013-09-09 15:38:40 -04001961 dump_reg(AUD_RID, "Audio Revision ID");
1962 dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A");
1963 dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B");
1964 dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001965 dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)");
Mengdong Lindeba8682013-09-09 15:38:40 -04001966 dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A");
1967 dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B");
1968 dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C");
1969 dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A");
1970 dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B");
1971 dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C");
1972 dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs");
1973 dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1");
1974 dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2");
1975 dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3");
1976 dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1");
1977 dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2");
1978 dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001979 dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping");
Mengdong Lindeba8682013-09-09 15:38:40 -04001980 dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A");
1981 dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B");
1982 dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C");
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001983 dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control");
Mengdong Lindeba8682013-09-09 15:38:40 -04001984 dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A");
1985 dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B");
1986 dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C");
1987 dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status");
1988 dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001989
Mengdong Lin85357202013-08-13 00:21:57 -04001990 /* Audio debug registers */
1991 dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface");
1992 dump_reg(AUD_IRII, "Audio Immediate Response Input Interface");
1993 dump_reg(AUD_ICS, "Audio Immediate Command Status");
1994
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04001995 printf("\nDetails:\n\n");
Wang Xingchaoc4077222012-08-15 16:13:38 +08001996
Mengdong Lindeba8682013-09-09 15:38:40 -04001997 dump_ddi_buf_ctl(PORT_A);
1998 dump_ddi_buf_ctl(PORT_B);
1999 dump_ddi_buf_ctl(PORT_C);
2000 dump_ddi_buf_ctl(PORT_D);
2001 dump_ddi_buf_ctl(PORT_E);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002002
Mengdong Lindeba8682013-09-09 15:38:40 -04002003 dump_ddi_func_ctl(PIPE_A);
2004 dump_ddi_func_ctl(PIPE_B);
2005 dump_ddi_func_ctl(PIPE_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002006
Mengdong Lindeba8682013-09-09 15:38:40 -04002007 /* audio configuration - details */
2008 dump_aud_transcoder_config(TRANSCODER_A);
2009 dump_aud_transcoder_config(TRANSCODER_B);
2010 dump_aud_transcoder_config(TRANSCODER_C);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002011
Mengdong Lindeba8682013-09-09 15:38:40 -04002012 dump_aud_misc_control(CONVERTER_1);
2013 dump_aud_misc_control(CONVERTER_2);
2014 dump_aud_misc_control(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002015
Mengdong Lindeba8682013-09-09 15:38:40 -04002016 dump_aud_vendor_device_id();
2017 dump_aud_revision_id();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002018
Mengdong Lindeba8682013-09-09 15:38:40 -04002019 dump_aud_m_cts_enable(TRANSCODER_A);
2020 dump_aud_m_cts_enable(TRANSCODER_B);
2021 dump_aud_m_cts_enable(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002022
Mengdong Lindeba8682013-09-09 15:38:40 -04002023 dump_aud_power_state();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002024
Mengdong Lindeba8682013-09-09 15:38:40 -04002025 dump_aud_edid_data(TRANSCODER_A);
2026 dump_aud_edid_data(TRANSCODER_B);
2027 dump_aud_edid_data(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002028
Mengdong Lindeba8682013-09-09 15:38:40 -04002029 dump_aud_infoframe(TRANSCODER_A);
2030 dump_aud_infoframe(TRANSCODER_B);
2031 dump_aud_infoframe(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002032
Mengdong Lindeba8682013-09-09 15:38:40 -04002033 dump_aud_pipe_conv_cfg();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002034
Mengdong Lindeba8682013-09-09 15:38:40 -04002035 dump_aud_dig_cnvt(CONVERTER_1);
2036 dump_aud_dig_cnvt(CONVERTER_2);
2037 dump_aud_dig_cnvt(CONVERTER_3);
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002038
Mengdong Lindeba8682013-09-09 15:38:40 -04002039 dump_aud_str_desc(CONVERTER_1);
2040 dump_aud_str_desc(CONVERTER_2);
2041 dump_aud_str_desc(CONVERTER_3);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002042
Mengdong Lindeba8682013-09-09 15:38:40 -04002043 dump_aud_out_chan_map();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002044
Mengdong Lindeba8682013-09-09 15:38:40 -04002045 dump_aud_connect_list_entry_length(TRANSCODER_A);
2046 dump_aud_connect_list_entry_length(TRANSCODER_B);
2047 dump_aud_connect_list_entry_length(TRANSCODER_C);
2048 dump_aud_connect_select_ctrl();
Wang Xingchaoc4077222012-08-15 16:13:38 +08002049
Mengdong Lindeba8682013-09-09 15:38:40 -04002050 dump_aud_dip_eld_ctrl_st(TRANSCODER_A);
2051 dump_aud_dip_eld_ctrl_st(TRANSCODER_B);
2052 dump_aud_dip_eld_ctrl_st(TRANSCODER_C);
Wang Xingchaoc4077222012-08-15 16:13:38 +08002053
Mengdong Lindeba8682013-09-09 15:38:40 -04002054 dump_aud_eld_cp_vld();
2055 dump_hdmi_fifo_status();
Mengdong Lin85357202013-08-13 00:21:57 -04002056
2057 printf("\nDetails:\n\n");
2058
2059 printf("IRV [%1lx] %s\t", BIT(dword, 1),
2060 OPNAME(immed_result_valid, BIT(dword, 1)));
2061 printf("ICB [%1lx] %s\n", BIT(dword, 1),
2062 OPNAME(immed_cmd_busy, BIT(dword, 0)));
Wang Xingchaoc4077222012-08-15 16:13:38 +08002063}
2064
Wu Fengguang020abdb2010-04-19 13:13:06 +08002065int main(int argc, char **argv)
2066{
2067 struct pci_device *pci_dev;
2068
2069 pci_dev = intel_get_pci_device();
2070 devid = pci_dev->device_id; /* XXX not true when mapping! */
2071
2072 do_self_tests();
2073
2074 if (argc == 2)
2075 intel_map_file(argv[1]);
2076 else
2077 intel_get_mmio(pci_dev);
2078
Mengdong Lin69cc00b2013-07-17 13:29:17 -04002079 if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
2080 printf("%s audio registers:\n\n",
2081 IS_BROADWELL(devid) ? "Broadwell" : "Haswell");
2082 dump_hsw_plus();
2083 } else if (IS_GEN6(devid) || IS_GEN7(devid)
2084 || getenv("HAS_PCH_SPLIT")) {
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002085 printf("%s audio registers:\n\n",
Mengdong Lin3c7dc5c2013-09-09 15:38:32 -04002086 IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002087 intel_check_pch();
2088 dump_cpt();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002089 } else if (IS_GEN5(devid)) {
2090 printf("Ironlake audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002091 dump_ironlake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002092 } else if (IS_G4X(devid)) {
2093 printf("G45 audio registers:\n\n");
Wu Fengguang020abdb2010-04-19 13:13:06 +08002094 dump_eaglelake();
Wu Fengguang6fcb5cd2011-11-12 11:12:49 +08002095 }
Wu Fengguang020abdb2010-04-19 13:13:06 +08002096
2097 return 0;
Wu Fengguang9e9c9f22009-11-06 11:06:22 +08002098}