Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 1 | /* |
| 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 Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 29 | #define _GNU_SOURCE |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 30 | #include <unistd.h> |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 31 | #include <stdlib.h> |
| 32 | #include <stdio.h> |
| 33 | #include <string.h> |
| 34 | #include <err.h> |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 35 | #include <arpa/inet.h> |
| 36 | #include "intel_gpu_tools.h" |
| 37 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 38 | static uint32_t devid; |
| 39 | |
Mengdong Lin | 92d3197 | 2014-03-03 11:04:39 -0500 | [diff] [blame] | 40 | static int aud_reg_base = 0; /* base address of audio registers */ |
| 41 | static int disp_reg_base = 0; /* base address of display registers */ |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 42 | |
Mengdong Lin | 1803f1e | 2014-02-28 16:18:11 -0500 | [diff] [blame] | 43 | #define IS_HASWELL_PLUS(devid) (IS_HASWELL(devid) || IS_BROADWELL(devid)) |
| 44 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 45 | #define BITSTO(n) (n >= sizeof(long) * 8 ? ~0 : (1UL << (n)) - 1) |
| 46 | #define BITMASK(high, low) (BITSTO(high+1) & ~BITSTO(low)) |
| 47 | #define BITS(reg, high, low) (((reg) & (BITMASK(high, low))) >> (low)) |
| 48 | #define BIT(reg, n) BITS(reg, n, n) |
| 49 | |
| 50 | #define min_t(type, x, y) ({ \ |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 51 | type __min1 = (x); \ |
| 52 | type __min2 = (y); \ |
| 53 | __min1 < __min2 ? __min1 : __min2; }) |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 54 | |
| 55 | #define OPNAME(names, index) \ |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 56 | names[min_t(unsigned int, index, ARRAY_SIZE(names) - 1)] |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 57 | |
Mengdong Lin | 92d3197 | 2014-03-03 11:04:39 -0500 | [diff] [blame] | 58 | #define set_aud_reg_base(base) (aud_reg_base = (base)) |
| 59 | |
| 60 | #define set_reg_base(base, audio_offset) \ |
| 61 | do { \ |
| 62 | disp_reg_base = (base); \ |
| 63 | set_aud_reg_base((base) + (audio_offset)); \ |
| 64 | } while (0) |
| 65 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 66 | #define dump_reg(reg, desc) \ |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 67 | do { \ |
| 68 | dword = INREG(reg); \ |
| 69 | printf("%-21s 0x%08x %s\n", # reg, dword, desc); \ |
| 70 | } while (0) |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 71 | |
Mengdong Lin | 92d3197 | 2014-03-03 11:04:39 -0500 | [diff] [blame] | 72 | #define dump_disp_reg(reg, desc) \ |
| 73 | do { \ |
| 74 | dword = INREG(disp_reg_base + reg); \ |
| 75 | printf("%-21s 0x%08x %s\n", # reg, dword, desc); \ |
| 76 | } while (0) |
| 77 | |
| 78 | #define dump_aud_reg(reg, desc) \ |
| 79 | do { \ |
| 80 | dword = INREG(aud_reg_base + reg); \ |
| 81 | printf("%-21s 0x%08x %s\n", # reg, dword, desc); \ |
| 82 | } while (0) |
| 83 | |
| 84 | #define read_aud_reg(reg) INREG(aud_reg_base + (reg)) |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 85 | |
Mengdong Lin | bae8a00 | 2014-03-03 13:23:50 -0500 | [diff] [blame^] | 86 | static int get_num_pipes(void) |
| 87 | { |
| 88 | int num_pipes; |
| 89 | |
| 90 | if (IS_VALLEYVIEW(devid)) |
| 91 | num_pipes = 2; /* Valleyview is Gen 7 but only has 2 pipes */ |
| 92 | else if (IS_G4X(devid) || IS_GEN5(devid)) |
| 93 | num_pipes = 2; |
| 94 | else |
| 95 | num_pipes = 3; |
| 96 | |
| 97 | return num_pipes; |
| 98 | } |
| 99 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 100 | static const char * const pixel_clock[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 101 | [0] = "25.2 / 1.001 MHz", |
| 102 | [1] = "25.2 MHz", |
| 103 | [2] = "27 MHz", |
| 104 | [3] = "27 * 1.001 MHz", |
| 105 | [4] = "54 MHz", |
| 106 | [5] = "54 * 1.001 MHz", |
| 107 | [6] = "74.25 / 1.001 MHz", |
| 108 | [7] = "74.25 MHz", |
| 109 | [8] = "148.5 / 1.001 MHz", |
| 110 | [9] = "148.5 MHz", |
| 111 | [10] = "Reserved", |
| 112 | }; |
| 113 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 114 | static const char * const power_state[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 115 | [0] = "D0", |
| 116 | [1] = "D1", |
| 117 | [2] = "D2", |
| 118 | [3] = "D3", |
| 119 | }; |
| 120 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 121 | static const char * const stream_type[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 122 | [0] = "default samples", |
| 123 | [1] = "one bit stream", |
| 124 | [2] = "DST stream", |
| 125 | [3] = "MLP stream", |
| 126 | [4] = "Reserved", |
| 127 | }; |
| 128 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 129 | static const char * const dip_port[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 130 | [0] = "Reserved", |
| 131 | [1] = "Digital Port B", |
| 132 | [2] = "Digital Port C", |
| 133 | [3] = "Digital Port D", |
| 134 | }; |
| 135 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 136 | static const char * const dip_type[] = { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 137 | [0] = "Audio DIP Disabled", |
| 138 | [1] = "Audio DIP Enabled", |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 139 | }; |
| 140 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 141 | static const char * const dip_gen1_state[] = { |
| 142 | [0] = "Generic 1 (ACP) DIP Disabled", |
| 143 | [1] = "Generic 1 (ACP) DIP Enabled", |
| 144 | }; |
| 145 | |
| 146 | static const char * const dip_gen2_state[] = { |
| 147 | [0] = "Generic 2 DIP Disabled", |
| 148 | [1] = "Generic 2 DIP Enabled", |
| 149 | }; |
| 150 | |
| 151 | static const char * const dip_index[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 152 | [0] = "Audio DIP", |
| 153 | [1] = "ACP DIP", |
| 154 | [2] = "ISRC1 DIP", |
| 155 | [3] = "ISRC2 DIP", |
| 156 | [4] = "Reserved", |
| 157 | }; |
| 158 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 159 | static const char * const dip_trans[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 160 | [0] = "disabled", |
| 161 | [1] = "reserved", |
| 162 | [2] = "send once", |
| 163 | [3] = "best effort", |
| 164 | }; |
| 165 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 166 | static const char * const video_dip_index[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 167 | [0] = "AVI DIP", |
| 168 | [1] = "Vendor-specific DIP", |
Wu Fengguang | f3f84bb | 2011-11-12 11:12:55 +0800 | [diff] [blame] | 169 | [2] = "Gamut Metadata DIP", |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 170 | [3] = "Source Product Description DIP", |
| 171 | }; |
| 172 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 173 | static const char * const video_dip_trans[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 174 | [0] = "send once", |
| 175 | [1] = "send every vsync", |
| 176 | [2] = "send at least every other vsync", |
| 177 | [3] = "reserved", |
| 178 | }; |
| 179 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 180 | static const char * const trans_to_port_sel[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 181 | [0] = "no port", |
| 182 | [1] = "Digital Port B", |
Wang Xingchao | f9a2481 | 2012-08-15 16:13:37 +0800 | [diff] [blame] | 183 | [2] = "Digital Port C", |
| 184 | [3] = "Digital Port D", |
| 185 | [4] = "reserved", |
Alan Coopersmith | c461006 | 2012-01-06 14:37:19 -0800 | [diff] [blame] | 186 | [5] = "reserved", |
| 187 | [6] = "reserved", |
| 188 | [7] = "reserved", |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 189 | }; |
| 190 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 191 | static const char * const ddi_mode[] = { |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 192 | [0] = "HDMI mode", |
| 193 | [1] = "DVI mode", |
| 194 | [2] = "DP SST mode", |
| 195 | [3] = "DP MST mode", |
| 196 | [4] = "DP FDI mode", |
| 197 | [5] = "reserved", |
| 198 | [6] = "reserved", |
| 199 | [7] = "reserved", |
| 200 | }; |
| 201 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 202 | static const char * const bits_per_color[] = { |
| 203 | [0] = "8 bpc", |
| 204 | [1] = "10 bpc", |
| 205 | [2] = "6 bpc", |
| 206 | [3] = "12 bpc", |
| 207 | [4] = "reserved", |
| 208 | [5] = "reserved", |
| 209 | [6] = "reserved", |
| 210 | [7] = "reserved", |
| 211 | }; |
| 212 | |
| 213 | static const char * const transcoder_select[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 214 | [0] = "Transcoder A", |
| 215 | [1] = "Transcoder B", |
| 216 | [2] = "Transcoder C", |
| 217 | [3] = "reserved", |
| 218 | }; |
| 219 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 220 | static const char * const dp_port_width[] = { |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 221 | [0] = "x1 mode", |
| 222 | [1] = "x2 mode", |
Wu Fengguang | cf4c12f | 2011-11-12 11:12:46 +0800 | [diff] [blame] | 223 | [2] = "reserved", |
| 224 | [3] = "x4 mode", |
Alan Coopersmith | c461006 | 2012-01-06 14:37:19 -0800 | [diff] [blame] | 225 | [4] = "reserved", |
| 226 | [5] = "reserved", |
| 227 | [6] = "reserved", |
| 228 | [7] = "reserved", |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 229 | }; |
| 230 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 231 | static const char * const sample_base_rate[] = { |
| 232 | [0] = "48 kHz", |
| 233 | [1] = "44.1 kHz", |
| 234 | }; |
| 235 | |
| 236 | static const char * const sample_base_rate_mult[] = { |
| 237 | [0] = "x1 (48 kHz, 44.1 kHz or less)", |
| 238 | [1] = "x2 (96 kHz, 88.2 kHz, 32 kHz)", |
| 239 | [2] = "x3 (144 kHz)", |
| 240 | [3] = "x4 (192 kHz, 176.4 kHz)", |
| 241 | [4] = "Reserved", |
| 242 | }; |
| 243 | |
| 244 | static const char * const sample_base_rate_divisor[] = { |
| 245 | [0] = "Divided by 1 (48 kHz, 44.1 kHz)", |
| 246 | [1] = "Divided by 2 (24 kHz, 22.05 kHz)", |
| 247 | [2] = "Divided by 3 (16 kHz, 32 kHz)", |
| 248 | [3] = "Divided by 4 (11.025 kHz)", |
| 249 | [4] = "Divided by 5 (9.6 kHz)", |
| 250 | [5] = "Divided by 6 (8 kHz)", |
| 251 | [6] = "Divided by 7", |
| 252 | [7] = "Divided by 8 (6 kHz)", |
| 253 | }; |
| 254 | |
| 255 | static const char * const connect_list_form[] = { |
| 256 | [0] = "Short Form", |
| 257 | [1] = "Long Form", |
| 258 | }; |
| 259 | |
| 260 | |
| 261 | static const char * const bits_per_sample[] = { |
Wu Fengguang | 12861a9 | 2011-11-12 11:12:47 +0800 | [diff] [blame] | 262 | [0] = "reserved", |
| 263 | [1] = "16 bits", |
| 264 | [2] = "24 bits", |
| 265 | [3] = "32 bits", |
| 266 | [4] = "20 bits", |
| 267 | [5] = "reserved", |
| 268 | }; |
| 269 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 270 | static const char * const sdvo_hdmi_encoding[] = { |
Wu Fengguang | ee94958 | 2011-11-12 11:12:53 +0800 | [diff] [blame] | 271 | [0] = "SDVO", |
| 272 | [1] = "reserved", |
| 273 | [2] = "TMDS", |
| 274 | [3] = "reserved", |
| 275 | }; |
Wu Fengguang | 12861a9 | 2011-11-12 11:12:47 +0800 | [diff] [blame] | 276 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 277 | static const char * const n_index_value[] = { |
Wu Fengguang | e64abe5 | 2012-01-17 07:19:24 +0800 | [diff] [blame] | 278 | [0] = "HDMI", |
| 279 | [1] = "DisplayPort", |
| 280 | }; |
| 281 | |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 282 | static const char * const immed_result_valid[] = { |
| 283 | [0] = "No immediate response is available", |
| 284 | [1] = "Immediate response is available", |
| 285 | }; |
| 286 | |
| 287 | static const char * const immed_cmd_busy[] = { |
| 288 | [0] = "Can accept an immediate command", |
| 289 | [1] = "Immediate command is available", |
| 290 | }; |
| 291 | |
Mengdong Lin | f075c3c | 2013-08-13 00:22:14 -0400 | [diff] [blame] | 292 | static const char * const vanilla_dp12_en[] = { |
| 293 | [0] = "DP 1.2 features are disabled", |
| 294 | [1] = "DP 1.2 features are enabled", |
| 295 | }; |
| 296 | |
| 297 | static const char * const vanilla_3_widgets_en[] = { |
| 298 | [0] = "2nd & 3rd pin/convertor widgets are disabled", |
| 299 | [1] = "All three pin/convertor widgets are enabled", |
| 300 | }; |
| 301 | |
| 302 | static const char * const block_audio[] = { |
| 303 | [0] = "Allow audio data to reach the port", |
| 304 | [1] = "Block audio data from reaching the port", |
| 305 | }; |
| 306 | |
| 307 | static const char * const dis_eld_valid_pulse_trans[] = { |
| 308 | [0] = "Enable ELD valid pulse transition when unsol is disabled", |
| 309 | [1] = "Disable ELD valid pulse transition when unsol is disabled", |
| 310 | }; |
| 311 | |
| 312 | static const char * const dis_pd_pulse_trans[] = { |
| 313 | [0] = "Enable Presense Detect pulse transition when unsol is disabled", |
| 314 | [1] = "Disable Presense Detect pulse transition when unsol is disabled", |
| 315 | }; |
| 316 | |
| 317 | static const char * const dis_ts_delta_err[] = { |
| 318 | [0] = "Enable timestamp delta error for 32/44 KHz", |
| 319 | [1] = "Disable timestamp delta error for 32/44 KHz", |
| 320 | }; |
| 321 | |
| 322 | static const char * const dis_ts_fix_dp_hbr[] = { |
| 323 | [0] = "Enable timestamp fix for DP HBR", |
| 324 | [1] = "Disable timestamp fix for DP HBR", |
| 325 | }; |
| 326 | |
| 327 | static const char * const pattern_gen_8_ch_en[] = { |
| 328 | [0] = "Disable 8-channel pattern generator", |
| 329 | [1] = "Enable 8-channel pattern generator", |
| 330 | }; |
| 331 | |
| 332 | static const char * const pattern_gen_2_ch_en[] = { |
| 333 | [0] = "Disable 2-channel pattern generator", |
| 334 | [1] = "Enable 2-channel pattern generator", |
| 335 | }; |
| 336 | |
| 337 | static const char * const fabric_32_44_dis[] = { |
| 338 | [0] = "Allow sample fabrication for 32/44 KHz", |
| 339 | [1] = "Disable sample fabrication for 32/44 KHz", |
| 340 | }; |
| 341 | |
| 342 | static const char * const epss_dis[] = { |
| 343 | [0] = "Allow audio EPSS", |
| 344 | [1] = "Disable audio EPSS", |
| 345 | }; |
| 346 | |
| 347 | static const char * const ts_test_mode[] = { |
| 348 | [0] = "Default time stamp mode", |
| 349 | [1] = "Audio time stamp test mode for audio only feature", |
| 350 | }; |
| 351 | |
| 352 | static const char * const en_mmio_program[] = { |
| 353 | [0] = "Programming by HD-Audio Azalia", |
| 354 | [1] = "Programming by MMIO debug registers", |
| 355 | }; |
| 356 | |
Mengdong Lin | 97e5cf6 | 2013-08-13 00:22:24 -0400 | [diff] [blame] | 357 | static const char * const audio_dp_dip_status[] = { |
| 358 | [0] = "audfc dp fifo full", |
| 359 | [1] = "audfc dp fifo empty", |
| 360 | [2] = "audfc dp fifo overrun", |
| 361 | [3] = "audfc dip fifo full", |
| 362 | [4] = "audfc dp fifo empty cd", |
| 363 | [5] = "audfb dp fifo full", |
| 364 | [6] = "audfb dp fifo empty", |
| 365 | [7] = "audfb dp fifo overrun", |
| 366 | [8] = "audfb dip fifo full", |
| 367 | [9] = "audfb dp fifo empty cd", |
| 368 | [10] = "audfa dp fifo full", |
| 369 | [11] = "audfa dp fifo empty", |
| 370 | [12] = "audfa dp fifo overrun", |
| 371 | [13] = "audfa dip fifo full", |
| 372 | [14] = "audfa dp fifo empty cd", |
| 373 | [15] = "Pipe c audio overflow", |
| 374 | [16] = "Pipe b audio overflow", |
| 375 | [17] = "Pipe a audio overflow", |
| 376 | [31] = 0, |
| 377 | }; |
| 378 | |
Mengdong Lin | ed38666 | 2014-02-28 13:25:27 -0500 | [diff] [blame] | 379 | #undef TRANSCODER_A |
| 380 | #undef TRANSCODER_B |
| 381 | #undef TRANSCODER_C |
| 382 | |
| 383 | enum { |
| 384 | TRANSCODER_A = 0, |
| 385 | TRANSCODER_B, |
| 386 | TRANSCODER_C, |
| 387 | }; |
| 388 | |
| 389 | enum { |
| 390 | PIPE_A = 0, |
| 391 | PIPE_B, |
| 392 | PIPE_C, |
| 393 | }; |
| 394 | |
| 395 | enum { |
| 396 | PORT_A = 0, |
| 397 | PORT_B, |
| 398 | PORT_C, |
| 399 | PORT_D, |
| 400 | PORT_E, |
| 401 | }; |
| 402 | |
| 403 | enum { |
| 404 | CONVERTER_1 = 0, |
| 405 | CONVERTER_2, |
| 406 | CONVERTER_3, |
| 407 | }; |
| 408 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 409 | static void do_self_tests(void) |
| 410 | { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 411 | if (BIT(1, 0) != 1) |
| 412 | exit(1); |
| 413 | if (BIT(0x80000000, 31) != 1) |
| 414 | exit(2); |
| 415 | if (BITS(0xc0000000, 31, 30) != 3) |
| 416 | exit(3); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | /* |
| 420 | * EagleLake registers |
| 421 | */ |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 422 | #define AUD_CONFIG 0x62000 |
| 423 | #define AUD_DEBUG 0x62010 |
| 424 | #define AUD_VID_DID 0x62020 |
| 425 | #define AUD_RID 0x62024 |
| 426 | #define AUD_SUBN_CNT 0x62028 |
| 427 | #define AUD_FUNC_GRP 0x62040 |
| 428 | #define AUD_SUBN_CNT2 0x62044 |
| 429 | #define AUD_GRP_CAP 0x62048 |
| 430 | #define AUD_PWRST 0x6204c |
| 431 | #define AUD_SUPPWR 0x62050 |
| 432 | #define AUD_SID 0x62054 |
| 433 | #define AUD_OUT_CWCAP 0x62070 |
| 434 | #define AUD_OUT_PCMSIZE 0x62074 |
| 435 | #define AUD_OUT_STR 0x62078 |
| 436 | #define AUD_OUT_DIG_CNVT 0x6207c |
| 437 | #define AUD_OUT_CH_STR 0x62080 |
| 438 | #define AUD_OUT_STR_DESC 0x62084 |
| 439 | #define AUD_PINW_CAP 0x620a0 |
| 440 | #define AUD_PIN_CAP 0x620a4 |
| 441 | #define AUD_PINW_CONNLNG 0x620a8 |
| 442 | #define AUD_PINW_CONNLST 0x620ac |
| 443 | #define AUD_PINW_CNTR 0x620b0 |
| 444 | #define AUD_PINW_UNSOLRESP 0x620b8 |
| 445 | #define AUD_CNTL_ST 0x620b4 |
| 446 | #define AUD_PINW_CONFIG 0x620bc |
| 447 | #define AUD_HDMIW_STATUS 0x620d4 |
| 448 | #define AUD_HDMIW_HDMIEDID 0x6210c |
| 449 | #define AUD_HDMIW_INFOFR 0x62118 |
| 450 | #define AUD_CONV_CHCNT 0x62120 |
| 451 | #define AUD_CTS_ENABLE 0x62128 |
| 452 | |
| 453 | #define VIDEO_DIP_CTL 0x61170 |
| 454 | #define VIDEO_DIP_ENABLE (1<<31) |
| 455 | #define VIDEO_DIP_ENABLE_AVI (1<<21) |
| 456 | #define VIDEO_DIP_ENABLE_VENDOR (1<<22) |
| 457 | #define VIDEO_DIP_ENABLE_SPD (1<<24) |
| 458 | #define VIDEO_DIP_BUF_AVI (0<<19) |
| 459 | #define VIDEO_DIP_BUF_VENDOR (1<<19) |
| 460 | #define VIDEO_DIP_BUF_SPD (3<<19) |
| 461 | #define VIDEO_DIP_TRANS_ONCE (0<<16) |
| 462 | #define VIDEO_DIP_TRANS_1 (1<<16) |
| 463 | #define VIDEO_DIP_TRANS_2 (2<<16) |
| 464 | |
| 465 | #define AUDIO_HOTPLUG_EN (1<<24) |
| 466 | |
| 467 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 468 | static void dump_eaglelake(void) |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 469 | { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 470 | uint32_t dword; |
| 471 | int i; |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 472 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 473 | /* printf("%-18s %8s %s\n\n", "register name", "raw value", "description"); */ |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 474 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 475 | dump_reg(VIDEO_DIP_CTL, "Video DIP Control"); |
| 476 | dump_reg(SDVOB, "Digital Display Port B Control Register"); |
| 477 | dump_reg(SDVOC, "Digital Display Port C Control Register"); |
| 478 | dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable"); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 479 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 480 | dump_reg(AUD_CONFIG, "Audio Configuration"); |
| 481 | dump_reg(AUD_DEBUG, "Audio Debug"); |
| 482 | dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); |
| 483 | dump_reg(AUD_RID, "Audio Revision ID"); |
| 484 | dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count"); |
| 485 | dump_reg(AUD_FUNC_GRP, "Audio Function Group Type"); |
| 486 | dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count"); |
| 487 | dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities"); |
| 488 | dump_reg(AUD_PWRST, "Audio Power State"); |
| 489 | dump_reg(AUD_SUPPWR, "Audio Supported Power States"); |
| 490 | dump_reg(AUD_SID, "Audio Root Node Subsystem ID"); |
| 491 | dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities"); |
| 492 | dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates"); |
| 493 | dump_reg(AUD_OUT_STR, "Audio Stream Formats"); |
| 494 | dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter"); |
| 495 | dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); |
| 496 | dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format"); |
| 497 | dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities"); |
| 498 | dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities"); |
| 499 | dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length"); |
| 500 | dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry"); |
| 501 | dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control"); |
| 502 | dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable"); |
| 503 | dump_reg(AUD_CNTL_ST, "Audio Control State Register"); |
| 504 | dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default"); |
| 505 | dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); |
| 506 | dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block"); |
| 507 | dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet"); |
| 508 | dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count"); |
| 509 | dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable"); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 510 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 511 | printf("\nDetails:\n\n"); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 512 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 513 | dword = INREG(AUD_VID_DID); |
| 514 | printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16); |
| 515 | printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 516 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 517 | dword = INREG(AUD_RID); |
| 518 | printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 519 | printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 520 | printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8)); |
| 521 | printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 522 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 523 | dword = INREG(SDVOB); |
| 524 | printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 525 | printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI)); |
| 526 | printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO)); |
| 527 | printf("SDVOB null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); |
| 528 | printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 529 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 530 | dword = INREG(SDVOC); |
| 531 | printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 532 | printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI)); |
| 533 | printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO)); |
| 534 | printf("SDVOC null packets\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); |
| 535 | printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 536 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 537 | dword = INREG(PORT_HOTPLUG_EN); |
| 538 | printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n", BIT(dword, 29)), |
| 539 | printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n", BIT(dword, 28)), |
| 540 | printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)), |
| 541 | printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)), |
| 542 | printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)), |
| 543 | printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)), |
| 544 | printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)), |
| 545 | printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)), |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 546 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 547 | dword = INREG(VIDEO_DIP_CTL); |
| 548 | printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)), |
| 549 | printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n", |
| 550 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 551 | printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28)); |
| 552 | printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21)); |
| 553 | printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22)); |
| 554 | printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24)); |
| 555 | printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n", |
| 556 | BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); |
| 557 | printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n", |
| 558 | BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); |
| 559 | printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8)); |
| 560 | printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 561 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 562 | dword = INREG(AUD_CONFIG); |
| 563 | printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 564 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 565 | printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2)); |
| 566 | printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1)); |
| 567 | printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 568 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 569 | dword = INREG(AUD_DEBUG); |
| 570 | printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 571 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 572 | dword = INREG(AUD_SUBN_CNT); |
| 573 | printf("AUD_SUBN_CNT starting node number\t0x%lx\n", BITS(dword, 23, 16)); |
| 574 | printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 575 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 576 | dword = INREG(AUD_SUBN_CNT2); |
| 577 | printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n", BITS(dword, 24, 16)); |
| 578 | printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 579 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 580 | dword = INREG(AUD_FUNC_GRP); |
| 581 | printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8)); |
| 582 | printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 583 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 584 | dword = INREG(AUD_GRP_CAP); |
| 585 | printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16)); |
| 586 | printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8)); |
| 587 | printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 588 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 589 | dword = INREG(AUD_PWRST); |
| 590 | printf("AUD_PWRST device power state\t\t%s\n", |
| 591 | power_state[BITS(dword, 5, 4)]); |
| 592 | printf("AUD_PWRST device power state setting\t%s\n", |
| 593 | power_state[BITS(dword, 1, 0)]); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 594 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 595 | dword = INREG(AUD_SUPPWR); |
| 596 | printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0)); |
| 597 | printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1)); |
| 598 | printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2)); |
| 599 | printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 600 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 601 | dword = INREG(AUD_OUT_CWCAP); |
| 602 | printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 603 | printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 604 | printf("AUD_OUT_CWCAP channel count\t\t%lu\n", |
| 605 | BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1); |
| 606 | printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11)); |
| 607 | printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10)); |
| 608 | printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9)); |
| 609 | printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8)); |
| 610 | printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7)); |
| 611 | printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5)); |
| 612 | printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4)); |
| 613 | printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3)); |
| 614 | printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2)); |
| 615 | printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 616 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 617 | dword = INREG(AUD_OUT_DIG_CNVT); |
| 618 | printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n", BITS(dword, 14, 8)); |
| 619 | printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7)); |
| 620 | printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6)); |
| 621 | printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5)); |
| 622 | printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4)); |
| 623 | printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3)); |
| 624 | printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2)); |
| 625 | printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1)); |
| 626 | printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 627 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 628 | dword = INREG(AUD_OUT_CH_STR); |
| 629 | printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4)); |
| 630 | printf("AUD_OUT_CH_STR lowest channel\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 631 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 632 | dword = INREG(AUD_OUT_STR_DESC); |
| 633 | printf("AUD_OUT_STR_DESC stream channels\t%lu\n", BITS(dword, 3, 0) + 1); |
| 634 | printf("AUD_OUT_STR_DESC Bits per Sample\t[%#lx] %s\n", |
| 635 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 636 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 637 | dword = INREG(AUD_PINW_CAP); |
| 638 | printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 639 | printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 640 | printf("AUD_PINW_CAP channel count\t\t%lu\n", |
| 641 | BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1); |
| 642 | printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12)); |
| 643 | printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11)); |
| 644 | printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10)); |
| 645 | printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9)); |
| 646 | printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8)); |
| 647 | printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7)); |
| 648 | printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5)); |
| 649 | printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4)); |
| 650 | printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3)); |
| 651 | printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2)); |
| 652 | printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 653 | |
| 654 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 655 | dword = INREG(AUD_PIN_CAP); |
| 656 | printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16)); |
| 657 | printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7)); |
| 658 | printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4)); |
| 659 | printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 660 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 661 | dword = INREG(AUD_PINW_CNTR); |
| 662 | printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8)); |
| 663 | printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6)); |
| 664 | printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8)); |
| 665 | printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8)); |
| 666 | printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n", |
| 667 | BITS(dword, 2, 0), |
| 668 | OPNAME(stream_type, BITS(dword, 2, 0))); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 669 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 670 | dword = INREG(AUD_PINW_UNSOLRESP); |
| 671 | printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 672 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 673 | dword = INREG(AUD_CNTL_ST); |
| 674 | printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21)); |
| 675 | printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22)); |
| 676 | printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23)); |
| 677 | printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n", |
| 678 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 679 | printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n", |
| 680 | BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18))); |
| 681 | printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n", |
| 682 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 683 | printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0)); |
| 684 | printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15)); |
| 685 | printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14)); |
| 686 | printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4)); |
| 687 | printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9)); |
| 688 | printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 689 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 690 | dword = INREG(AUD_HDMIW_STATUS); |
| 691 | printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31)); |
| 692 | printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30)); |
| 693 | printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29)); |
| 694 | printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28)); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 695 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 696 | dword = INREG(AUD_CONV_CHCNT); |
| 697 | printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14)); |
| 698 | printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n", BITS(dword, 11, 8) + 1); |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 699 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 700 | printf("AUD_CONV_CHCNT HDMI channel mapping:\n"); |
| 701 | for (i = 0; i < 8; i++) { |
| 702 | OUTREG(AUD_CONV_CHCNT, i); |
| 703 | dword = INREG(AUD_CONV_CHCNT); |
| 704 | printf("\t\t\t\t\t[0x%x] %u => %lu\n", dword, i, BITS(dword, 7, 4)); |
| 705 | } |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 706 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 707 | printf("AUD_HDMIW_HDMIEDID HDMI ELD:\n\t"); |
| 708 | dword = INREG(AUD_CNTL_ST); |
| 709 | dword &= ~BITMASK(8, 5); |
| 710 | OUTREG(AUD_CNTL_ST, dword); |
| 711 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 712 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID))); |
| 713 | printf("\n"); |
Wu Fengguang | f32aecb | 2011-11-12 11:12:50 +0800 | [diff] [blame] | 714 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 715 | printf("AUD_HDMIW_INFOFR HDMI audio Infoframe:\n\t"); |
| 716 | dword = INREG(AUD_CNTL_ST); |
| 717 | dword &= ~BITMASK(20, 18); |
| 718 | dword &= ~BITMASK(3, 0); |
| 719 | OUTREG(AUD_CNTL_ST, dword); |
| 720 | for (i = 0; i < 8; i++) |
| 721 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR))); |
| 722 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 723 | } |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 724 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 725 | #undef AUD_RID |
| 726 | #undef AUD_VID_DID |
| 727 | #undef AUD_PWRST |
| 728 | #undef AUD_OUT_CH_STR |
| 729 | #undef AUD_HDMIW_STATUS |
| 730 | |
| 731 | /* |
| 732 | * IronLake registers |
| 733 | */ |
| 734 | #define AUD_CONFIG_A 0xE2000 |
| 735 | #define AUD_CONFIG_B 0xE2100 |
| 736 | #define AUD_CTS_ENABLE_A 0xE2028 |
| 737 | #define AUD_CTS_ENABLE_B 0xE2128 |
| 738 | #define AUD_MISC_CTRL_A 0xE2010 |
| 739 | #define AUD_MISC_CTRL_B 0xE2110 |
| 740 | #define AUD_VID_DID 0xE2020 |
| 741 | #define AUD_RID 0xE2024 |
| 742 | #define AUD_PWRST 0xE204C |
| 743 | #define AUD_PORT_EN_HD_CFG 0xE207C |
| 744 | #define AUD_OUT_DIG_CNVT_A 0xE2080 |
| 745 | #define AUD_OUT_DIG_CNVT_B 0xE2180 |
| 746 | #define AUD_OUT_CH_STR 0xE2088 |
| 747 | #define AUD_OUT_STR_DESC_A 0xE2084 |
| 748 | #define AUD_OUT_STR_DESC_B 0xE2184 |
| 749 | #define AUD_PINW_CONNLNG_LIST 0xE20A8 |
| 750 | #define AUD_PINW_CONNLNG_SEL 0xE20AC |
| 751 | #define AUD_CNTL_ST_A 0xE20B4 |
| 752 | #define AUD_CNTL_ST_B 0xE21B4 |
| 753 | #define AUD_CNTL_ST2 0xE20C0 |
| 754 | #define AUD_HDMIW_STATUS 0xE20D4 |
| 755 | #define AUD_HDMIW_HDMIEDID_A 0xE2050 |
| 756 | #define AUD_HDMIW_HDMIEDID_B 0xE2150 |
| 757 | #define AUD_HDMIW_INFOFR_A 0xE2054 |
| 758 | #define AUD_HDMIW_INFOFR_B 0xE2154 |
| 759 | |
| 760 | static void dump_ironlake(void) |
| 761 | { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 762 | uint32_t dword; |
| 763 | int i; |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 764 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 765 | dump_reg(HDMIB, "sDVO/HDMI Port B Control"); |
| 766 | dump_reg(HDMIC, "HDMI Port C Control"); |
| 767 | dump_reg(HDMID, "HDMI Port D Control"); |
| 768 | dump_reg(PCH_DP_B, "DisplayPort B Control Register"); |
| 769 | dump_reg(PCH_DP_C, "DisplayPort C Control Register"); |
| 770 | dump_reg(PCH_DP_D, "DisplayPort D Control Register"); |
| 771 | dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); |
| 772 | dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); |
| 773 | dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A"); |
| 774 | dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B"); |
| 775 | dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A"); |
| 776 | dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B"); |
| 777 | dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); |
| 778 | dump_reg(AUD_RID, "Audio Revision ID"); |
| 779 | dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); |
| 780 | dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config"); |
| 781 | dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A"); |
| 782 | dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B"); |
| 783 | dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); |
| 784 | dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A"); |
| 785 | dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B"); |
| 786 | dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List"); |
| 787 | dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select"); |
| 788 | dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A"); |
| 789 | dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B"); |
| 790 | dump_reg(AUD_CNTL_ST2, "Audio Control State 2"); |
| 791 | dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); |
| 792 | dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A"); |
| 793 | dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B"); |
| 794 | dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A"); |
| 795 | dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 796 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 797 | printf("\nDetails:\n\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 798 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 799 | dword = INREG(AUD_VID_DID); |
| 800 | printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16); |
| 801 | printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 802 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 803 | dword = INREG(AUD_RID); |
| 804 | printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 805 | printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 806 | printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); |
| 807 | printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 808 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 809 | dword = INREG(HDMIB); |
| 810 | printf("HDMIB HDMIB_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 811 | printf("HDMIB Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 812 | printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 813 | printf("HDMIB SDVOB Hot Plug Interrupt Detect Enable\t\t%lu\n", BIT(dword, 23)); |
| 814 | printf("HDMIB Digital_Port_B_Detected\t\t\t\t%lu\n", BIT(dword, 2)); |
| 815 | printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 816 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 817 | printf("HDMIB Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); |
| 818 | printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 819 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 820 | dword = INREG(HDMIC); |
| 821 | printf("HDMIC HDMIC_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 822 | printf("HDMIC Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 823 | printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 824 | printf("HDMIC Digital_Port_C_Detected\t\t\t\t%lu\n", BIT(dword, 2)); |
| 825 | printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 826 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 827 | printf("HDMIC Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); |
| 828 | printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 829 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 830 | dword = INREG(HDMID); |
| 831 | printf("HDMID HDMID_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 832 | printf("HDMID Transcoder_Select\t\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 833 | printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 834 | printf("HDMID Digital_Port_D_Detected\t\t\t\t%lu\n", BIT(dword, 2)); |
| 835 | printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 836 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 837 | printf("HDMID Null_packets_enabled_during_Vsync\t\t\t%u\n", !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC)); |
| 838 | printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 839 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 840 | dword = INREG(PCH_DP_B); |
| 841 | printf("PCH_DP_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 842 | printf("PCH_DP_B Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 843 | printf("PCH_DP_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 844 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 845 | printf("PCH_DP_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 846 | printf("PCH_DP_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 847 | printf("PCH_DP_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | b5ca6b4 | 2011-11-12 11:12:48 +0800 | [diff] [blame] | 848 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 849 | dword = INREG(PCH_DP_C); |
| 850 | printf("PCH_DP_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 851 | printf("PCH_DP_C Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 852 | printf("PCH_DP_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 853 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 854 | printf("PCH_DP_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 855 | printf("PCH_DP_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 856 | printf("PCH_DP_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | b5ca6b4 | 2011-11-12 11:12:48 +0800 | [diff] [blame] | 857 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 858 | dword = INREG(PCH_DP_D); |
| 859 | printf("PCH_DP_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 860 | printf("PCH_DP_D Transcoder_Select\t\t\t\t%s\n", BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); |
| 861 | printf("PCH_DP_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 862 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 863 | printf("PCH_DP_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 864 | printf("PCH_DP_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 865 | printf("PCH_DP_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | b5ca6b4 | 2011-11-12 11:12:48 +0800 | [diff] [blame] | 866 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 867 | dword = INREG(AUD_CONFIG_A); |
| 868 | printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), |
| 869 | n_index_value[BIT(dword, 29)]); |
| 870 | printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); |
| 871 | printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); |
| 872 | printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); |
| 873 | printf("AUD_CONFIG_A Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 874 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 875 | printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); |
| 876 | dword = INREG(AUD_CONFIG_B); |
| 877 | printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), |
| 878 | n_index_value[BIT(dword, 29)]); |
| 879 | printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); |
| 880 | printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); |
| 881 | printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); |
| 882 | printf("AUD_CONFIG_B Pixel_Clock\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 883 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 884 | printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 885 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 886 | dword = INREG(AUD_CTS_ENABLE_A); |
| 887 | printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); |
| 888 | printf("AUD_CTS_ENABLE_A CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); |
| 889 | printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); |
| 890 | dword = INREG(AUD_CTS_ENABLE_B); |
| 891 | printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); |
| 892 | printf("AUD_CTS_ENABLE_B CTS/M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); |
| 893 | printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 894 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 895 | dword = INREG(AUD_MISC_CTRL_A); |
| 896 | printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); |
| 897 | printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); |
| 898 | printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); |
| 899 | printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); |
| 900 | dword = INREG(AUD_MISC_CTRL_B); |
| 901 | printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); |
| 902 | printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); |
| 903 | printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); |
| 904 | printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 905 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 906 | dword = INREG(AUD_PWRST); |
| 907 | printf("AUD_PWRST Function_Group_Device_Power_State_Current\t%s\n", power_state[BITS(dword, 23, 22)]); |
| 908 | printf("AUD_PWRST Function_Group_Device_Power_State_Set \t%s\n", power_state[BITS(dword, 21, 20)]); |
| 909 | printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); |
| 910 | printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); |
| 911 | printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); |
| 912 | printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); |
| 913 | printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); |
| 914 | printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); |
| 915 | printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); |
| 916 | printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); |
| 917 | printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); |
| 918 | printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 919 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 920 | dword = INREG(AUD_PORT_EN_HD_CFG); |
| 921 | printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0)); |
| 922 | printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1)); |
| 923 | printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); |
| 924 | printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); |
| 925 | printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 12)); |
| 926 | printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 13)); |
| 927 | printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 14)); |
| 928 | printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 16)); |
| 929 | printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 17)); |
| 930 | printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 18)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 931 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 932 | dword = INREG(AUD_OUT_DIG_CNVT_A); |
| 933 | printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 934 | printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2)); |
| 935 | printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); |
| 936 | printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4)); |
| 937 | printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); |
| 938 | printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); |
| 939 | printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7)); |
| 940 | printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); |
| 941 | printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16)); |
| 942 | printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 943 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 944 | dword = INREG(AUD_OUT_DIG_CNVT_B); |
| 945 | printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 946 | printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2)); |
| 947 | printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); |
| 948 | printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4)); |
| 949 | printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); |
| 950 | printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); |
| 951 | printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7)); |
| 952 | printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); |
| 953 | printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16)); |
| 954 | printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 955 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 956 | printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n"); |
| 957 | for (i = 0; i < 8; i++) { |
| 958 | OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16)); |
| 959 | dword = INREG(AUD_OUT_CH_STR); |
| 960 | printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", |
| 961 | 1 + BITS(dword, 3, 0), |
| 962 | 1 + BITS(dword, 7, 4), |
| 963 | 1 + BITS(dword, 15, 12), |
| 964 | 1 + BITS(dword, 23, 20)); |
| 965 | } |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 966 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 967 | dword = INREG(AUD_OUT_STR_DESC_A); |
| 968 | printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); |
| 969 | printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); |
| 970 | printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n", |
| 971 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 972 | printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 973 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 974 | dword = INREG(AUD_OUT_STR_DESC_B); |
| 975 | printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); |
| 976 | printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); |
| 977 | printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n", |
| 978 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 979 | printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 980 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 981 | dword = INREG(AUD_PINW_CONNLNG_SEL); |
| 982 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%lu\n", BITS(dword, 7, 0)); |
| 983 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%lu\n", BITS(dword, 15, 8)); |
| 984 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%lu\n", BITS(dword, 23, 16)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 985 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 986 | dword = INREG(AUD_CNTL_ST_A); |
| 987 | printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n", |
| 988 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 989 | printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); |
| 990 | printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); |
| 991 | printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); |
| 992 | printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n", |
| 993 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 994 | printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 995 | printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
| 996 | printf("AUD_CNTL_ST_A ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 997 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 998 | dword = INREG(AUD_CNTL_ST_B); |
| 999 | printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n", |
| 1000 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 1001 | printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); |
| 1002 | printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); |
| 1003 | printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); |
| 1004 | printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n", |
| 1005 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 1006 | printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1007 | printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
| 1008 | printf("AUD_CNTL_ST_B ELD_access_address\t\t\t%lu\n", BITS(dword, 9, 5)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1009 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1010 | dword = INREG(AUD_CNTL_ST2); |
| 1011 | printf("AUD_CNTL_ST2 CP_ReadyB\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1012 | printf("AUD_CNTL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0)); |
| 1013 | printf("AUD_CNTL_ST2 CP_ReadyC\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1014 | printf("AUD_CNTL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1015 | printf("AUD_CNTL_ST2 CP_ReadyD\t\t\t\t\t%lu\n", BIT(dword, 9)); |
| 1016 | printf("AUD_CNTL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1017 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1018 | dword = INREG(AUD_HDMIW_STATUS); |
| 1019 | printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); |
| 1020 | printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); |
| 1021 | printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); |
| 1022 | printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); |
| 1023 | printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25)); |
| 1024 | printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 29)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1025 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1026 | printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t"); |
| 1027 | dword = INREG(AUD_CNTL_ST_A); |
| 1028 | dword &= ~BITMASK(9, 5); |
| 1029 | OUTREG(AUD_CNTL_ST_A, dword); |
| 1030 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1031 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A))); |
| 1032 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1033 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1034 | printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t"); |
| 1035 | dword = INREG(AUD_CNTL_ST_B); |
| 1036 | dword &= ~BITMASK(9, 5); |
| 1037 | OUTREG(AUD_CNTL_ST_B, dword); |
| 1038 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1039 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B))); |
| 1040 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1041 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1042 | printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t"); |
| 1043 | dword = INREG(AUD_CNTL_ST_A); |
| 1044 | dword &= ~BITMASK(20, 18); |
| 1045 | dword &= ~BITMASK(3, 0); |
| 1046 | OUTREG(AUD_CNTL_ST_A, dword); |
| 1047 | for (i = 0; i < 8; i++) |
| 1048 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A))); |
| 1049 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1050 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1051 | printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t"); |
| 1052 | dword = INREG(AUD_CNTL_ST_B); |
| 1053 | dword &= ~BITMASK(20, 18); |
| 1054 | dword &= ~BITMASK(3, 0); |
| 1055 | OUTREG(AUD_CNTL_ST_B, dword); |
| 1056 | for (i = 0; i < 8; i++) |
| 1057 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B))); |
| 1058 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1059 | |
| 1060 | } |
| 1061 | |
| 1062 | |
| 1063 | #undef AUD_CONFIG_A |
| 1064 | #undef AUD_MISC_CTRL_A |
| 1065 | #undef AUD_VID_DID |
| 1066 | #undef AUD_RID |
| 1067 | #undef AUD_CTS_ENABLE_A |
| 1068 | #undef AUD_PWRST |
| 1069 | #undef AUD_HDMIW_HDMIEDID_A |
| 1070 | #undef AUD_HDMIW_INFOFR_A |
| 1071 | #undef AUD_PORT_EN_HD_CFG |
| 1072 | #undef AUD_OUT_DIG_CNVT_A |
| 1073 | #undef AUD_OUT_STR_DESC_A |
| 1074 | #undef AUD_OUT_CH_STR |
| 1075 | #undef AUD_PINW_CONNLNG_LIST |
| 1076 | #undef AUD_CNTL_ST_A |
| 1077 | #undef AUD_HDMIW_STATUS |
| 1078 | #undef AUD_CONFIG_B |
| 1079 | #undef AUD_MISC_CTRL_B |
| 1080 | #undef AUD_CTS_ENABLE_B |
| 1081 | #undef AUD_HDMIW_HDMIEDID_B |
| 1082 | #undef AUD_HDMIW_INFOFR_B |
| 1083 | #undef AUD_OUT_DIG_CNVT_B |
| 1084 | #undef AUD_OUT_STR_DESC_B |
| 1085 | #undef AUD_CNTL_ST_B |
| 1086 | |
| 1087 | /* |
| 1088 | * CougarPoint registers |
| 1089 | */ |
Wu Fengguang | 97d2031 | 2011-11-12 11:12:45 +0800 | [diff] [blame] | 1090 | #define DP_CTL_B 0xE4100 |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1091 | #define DP_CTL_C 0xE4200 |
| 1092 | #define DP_AUX_CTL_C 0xE4210 |
| 1093 | #define DP_AUX_TST_C 0xE4228 |
| 1094 | #define SPORT_DDI_CRC_C 0xE4250 |
| 1095 | #define SPORT_DDI_CRC_R 0xE4264 |
| 1096 | #define DP_CTL_D 0xE4300 |
| 1097 | #define DP_AUX_CTL_D 0xE4310 |
| 1098 | #define DP_AUX_TST_D 0xE4328 |
| 1099 | #define SPORT_DDI_CRC_CTL_D 0xE4350 |
| 1100 | #define AUD_CONFIG_A 0xE5000 |
| 1101 | #define AUD_MISC_CTRL_A 0xE5010 |
| 1102 | #define AUD_VID_DID 0xE5020 |
| 1103 | #define AUD_RID 0xE5024 |
| 1104 | #define AUD_CTS_ENABLE_A 0xE5028 |
| 1105 | #define AUD_PWRST 0xE504C |
| 1106 | #define AUD_HDMIW_HDMIEDID_A 0xE5050 |
| 1107 | #define AUD_HDMIW_INFOFR_A 0xE5054 |
| 1108 | #define AUD_PORT_EN_HD_CFG 0xE507C |
| 1109 | #define AUD_OUT_DIG_CNVT_A 0xE5080 |
| 1110 | #define AUD_OUT_STR_DESC_A 0xE5084 |
| 1111 | #define AUD_OUT_CH_STR 0xE5088 |
| 1112 | #define AUD_PINW_CONNLNG_LIST 0xE50A8 |
| 1113 | #define AUD_PINW_CONNLNG_SELA 0xE50AC |
| 1114 | #define AUD_CNTL_ST_A 0xE50B4 |
| 1115 | #define AUD_CNTRL_ST2 0xE50C0 |
| 1116 | #define AUD_CNTRL_ST3 0xE50C4 |
| 1117 | #define AUD_HDMIW_STATUS 0xE50D4 |
| 1118 | #define AUD_CONFIG_B 0xE5100 |
| 1119 | #define AUD_MISC_CTRL_B 0xE5110 |
| 1120 | #define AUD_CTS_ENABLE_B 0xE5128 |
| 1121 | #define AUD_HDMIW_HDMIEDID_B 0xE5150 |
| 1122 | #define AUD_HDMIW_INFOFR_B 0xE5154 |
| 1123 | #define AUD_OUT_DIG_CNVT_B 0xE5180 |
| 1124 | #define AUD_OUT_STR_DESC_B 0xE5184 |
| 1125 | #define AUD_CNTL_ST_B 0xE51B4 |
| 1126 | #define AUD_CONFIG_C 0xE5200 |
| 1127 | #define AUD_MISC_CTRL_C 0xE5210 |
| 1128 | #define AUD_CTS_ENABLE_C 0xE5228 |
| 1129 | #define AUD_HDMIW_HDMIEDID_C 0xE5250 |
| 1130 | #define AUD_HDMIW_INFOFR_C 0xE5254 |
| 1131 | #define AUD_OUT_DIG_CNVT_C 0xE5280 |
| 1132 | #define AUD_OUT_STR_DESC_C 0xE5284 |
| 1133 | #define AUD_CNTL_ST_C 0xE52B4 |
| 1134 | #define AUD_CONFIG_D 0xE5300 |
| 1135 | #define AUD_MISC_CTRL_D 0xE5310 |
| 1136 | #define AUD_CTS_ENABLE_D 0xE5328 |
| 1137 | #define AUD_HDMIW_HDMIEDID_D 0xE5350 |
| 1138 | #define AUD_HDMIW_INFOFR_D 0xE5354 |
| 1139 | #define AUD_OUT_DIG_CNVT_D 0xE5380 |
| 1140 | #define AUD_OUT_STR_DESC_D 0xE5384 |
| 1141 | #define AUD_CNTL_ST_D 0xE53B4 |
| 1142 | |
Wu Fengguang | e321f13 | 2011-11-12 11:12:52 +0800 | [diff] [blame] | 1143 | #define VIDEO_DIP_CTL_A 0xE0200 |
| 1144 | #define VIDEO_DIP_CTL_B 0xE1200 |
| 1145 | #define VIDEO_DIP_CTL_C 0xE2200 |
| 1146 | #define VIDEO_DIP_CTL_D 0xE3200 |
| 1147 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1148 | |
| 1149 | static void dump_cpt(void) |
| 1150 | { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1151 | uint32_t dword; |
| 1152 | int i; |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1153 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1154 | dump_reg(HDMIB, "sDVO/HDMI Port B Control"); |
| 1155 | dump_reg(HDMIC, "HDMI Port C Control"); |
| 1156 | dump_reg(HDMID, "HDMI Port D Control"); |
| 1157 | dump_reg(DP_CTL_B, "DisplayPort B Control"); |
| 1158 | dump_reg(DP_CTL_C, "DisplayPort C Control"); |
| 1159 | dump_reg(DP_CTL_D, "DisplayPort D Control"); |
| 1160 | dump_reg(TRANS_DP_CTL_A, "Transcoder A DisplayPort Control"); |
| 1161 | dump_reg(TRANS_DP_CTL_B, "Transcoder B DisplayPort Control"); |
| 1162 | dump_reg(TRANS_DP_CTL_C, "Transcoder C DisplayPort Control"); |
| 1163 | dump_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); |
| 1164 | dump_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); |
| 1165 | dump_reg(AUD_CONFIG_C, "Audio Configuration - Transcoder C"); |
| 1166 | dump_reg(AUD_CTS_ENABLE_A, "Audio CTS Programming Enable - Transcoder A"); |
| 1167 | dump_reg(AUD_CTS_ENABLE_B, "Audio CTS Programming Enable - Transcoder B"); |
| 1168 | dump_reg(AUD_CTS_ENABLE_C, "Audio CTS Programming Enable - Transcoder C"); |
| 1169 | dump_reg(AUD_MISC_CTRL_A, "Audio MISC Control for Transcoder A"); |
| 1170 | dump_reg(AUD_MISC_CTRL_B, "Audio MISC Control for Transcoder B"); |
| 1171 | dump_reg(AUD_MISC_CTRL_C, "Audio MISC Control for Transcoder C"); |
| 1172 | dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); |
| 1173 | dump_reg(AUD_RID, "Audio Revision ID"); |
| 1174 | dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); |
| 1175 | dump_reg(AUD_PORT_EN_HD_CFG, "Audio Port Enable HDAudio Config"); |
| 1176 | dump_reg(AUD_OUT_DIG_CNVT_A, "Audio Digital Converter - Conv A"); |
| 1177 | dump_reg(AUD_OUT_DIG_CNVT_B, "Audio Digital Converter - Conv B"); |
| 1178 | dump_reg(AUD_OUT_DIG_CNVT_C, "Audio Digital Converter - Conv C"); |
| 1179 | dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID"); |
| 1180 | dump_reg(AUD_OUT_STR_DESC_A, "Audio Stream Descriptor Format - Conv A"); |
| 1181 | dump_reg(AUD_OUT_STR_DESC_B, "Audio Stream Descriptor Format - Conv B"); |
| 1182 | dump_reg(AUD_OUT_STR_DESC_C, "Audio Stream Descriptor Format - Conv C"); |
| 1183 | dump_reg(AUD_PINW_CONNLNG_LIST, "Audio Connection List"); |
| 1184 | dump_reg(AUD_PINW_CONNLNG_SEL, "Audio Connection Select"); |
| 1185 | dump_reg(AUD_CNTL_ST_A, "Audio Control State Register - Transcoder A"); |
| 1186 | dump_reg(AUD_CNTL_ST_B, "Audio Control State Register - Transcoder B"); |
| 1187 | dump_reg(AUD_CNTL_ST_C, "Audio Control State Register - Transcoder C"); |
| 1188 | dump_reg(AUD_CNTRL_ST2, "Audio Control State 2"); |
| 1189 | dump_reg(AUD_CNTRL_ST3, "Audio Control State 3"); |
| 1190 | dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status"); |
| 1191 | dump_reg(AUD_HDMIW_HDMIEDID_A, "HDMI Data EDID Block - Transcoder A"); |
| 1192 | dump_reg(AUD_HDMIW_HDMIEDID_B, "HDMI Data EDID Block - Transcoder B"); |
| 1193 | dump_reg(AUD_HDMIW_HDMIEDID_C, "HDMI Data EDID Block - Transcoder C"); |
| 1194 | dump_reg(AUD_HDMIW_INFOFR_A, "Audio Widget Data Island Packet - Transcoder A"); |
| 1195 | dump_reg(AUD_HDMIW_INFOFR_B, "Audio Widget Data Island Packet - Transcoder B"); |
| 1196 | dump_reg(AUD_HDMIW_INFOFR_C, "Audio Widget Data Island Packet - Transcoder C"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1197 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1198 | printf("\nDetails:\n\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1199 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1200 | dword = INREG(VIDEO_DIP_CTL_A); |
| 1201 | printf("VIDEO_DIP_CTL_A Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), |
| 1202 | printf("VIDEO_DIP_CTL_A GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), |
| 1203 | printf("VIDEO_DIP_CTL_A Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); |
| 1204 | printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); |
| 1205 | printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); |
| 1206 | printf("VIDEO_DIP_CTL_A Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); |
| 1207 | printf("VIDEO_DIP_CTL_A Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", |
| 1208 | BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); |
| 1209 | printf("VIDEO_DIP_CTL_A Video_DIP_frequency\t\t\t[0x%lx] %s\n", |
| 1210 | BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); |
| 1211 | printf("VIDEO_DIP_CTL_A Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); |
| 1212 | printf("VIDEO_DIP_CTL_A Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | e321f13 | 2011-11-12 11:12:52 +0800 | [diff] [blame] | 1213 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1214 | dword = INREG(VIDEO_DIP_CTL_B); |
| 1215 | printf("VIDEO_DIP_CTL_B Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), |
| 1216 | printf("VIDEO_DIP_CTL_B GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), |
| 1217 | printf("VIDEO_DIP_CTL_B Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); |
| 1218 | printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); |
| 1219 | printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); |
| 1220 | printf("VIDEO_DIP_CTL_B Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); |
| 1221 | printf("VIDEO_DIP_CTL_B Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", |
| 1222 | BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); |
| 1223 | printf("VIDEO_DIP_CTL_B Video_DIP_frequency\t\t\t[0x%lx] %s\n", |
| 1224 | BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); |
| 1225 | printf("VIDEO_DIP_CTL_B Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); |
| 1226 | printf("VIDEO_DIP_CTL_B Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | e321f13 | 2011-11-12 11:12:52 +0800 | [diff] [blame] | 1227 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1228 | dword = INREG(VIDEO_DIP_CTL_C); |
| 1229 | printf("VIDEO_DIP_CTL_C Enable_Graphics_DIP\t\t\t%ld\n", BIT(dword, 31)), |
| 1230 | printf("VIDEO_DIP_CTL_C GCP_DIP_enable\t\t\t\t%ld\n", BIT(dword, 25)), |
| 1231 | printf("VIDEO_DIP_CTL_C Video_DIP_type_enable AVI\t\t%lu\n", BIT(dword, 21)); |
| 1232 | printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Vendor\t\t%lu\n", BIT(dword, 22)); |
| 1233 | printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Gamut\t\t%lu\n", BIT(dword, 23)); |
| 1234 | printf("VIDEO_DIP_CTL_C Video_DIP_type_enable Source \t\t%lu\n", BIT(dword, 24)); |
| 1235 | printf("VIDEO_DIP_CTL_C Video_DIP_buffer_index\t\t\t[0x%lx] %s\n", |
| 1236 | BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]); |
| 1237 | printf("VIDEO_DIP_CTL_C Video_DIP_frequency\t\t\t[0x%lx] %s\n", |
| 1238 | BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]); |
| 1239 | printf("VIDEO_DIP_CTL_C Video_DIP_buffer_size\t\t\t%lu\n", BITS(dword, 11, 8)); |
| 1240 | printf("VIDEO_DIP_CTL_C Video_DIP_access_address\t\t%lu\n", BITS(dword, 3, 0)); |
Wu Fengguang | e321f13 | 2011-11-12 11:12:52 +0800 | [diff] [blame] | 1241 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1242 | dword = INREG(AUD_VID_DID); |
| 1243 | printf("AUD_VID_DID vendor id\t\t\t\t\t0x%x\n", dword >> 16); |
| 1244 | printf("AUD_VID_DID device id\t\t\t\t\t0x%x\n", dword & 0xffff); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1245 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1246 | dword = INREG(AUD_RID); |
| 1247 | printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 1248 | printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 1249 | printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); |
| 1250 | printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1251 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1252 | dword = INREG(HDMIB); |
| 1253 | printf("HDMIB Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 1254 | printf("HDMIB Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", |
| 1255 | BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); |
| 1256 | printf("HDMIB sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1257 | printf("HDMIB HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1258 | printf("HDMIB SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); |
| 1259 | printf("HDMIB Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1260 | printf("HDMIB Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 1261 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 1262 | printf("HDMIB HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); |
| 1263 | printf("HDMIB Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1264 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1265 | dword = INREG(HDMIC); |
| 1266 | printf("HDMIC Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 1267 | printf("HDMIC Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", |
| 1268 | BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); |
| 1269 | printf("HDMIC sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1270 | printf("HDMIC HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1271 | printf("HDMIC SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); |
| 1272 | printf("HDMIC Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1273 | printf("HDMIC Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 1274 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 1275 | printf("HDMIC HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); |
| 1276 | printf("HDMIC Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1277 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1278 | dword = INREG(HDMID); |
| 1279 | printf("HDMID Port_Enable\t\t\t\t\t%u\n", !!(dword & SDVO_ENABLE)); |
| 1280 | printf("HDMID Transcoder_Select\t\t\t\t\t[0x%lx] %s\n", |
| 1281 | BITS(dword, 30, 29), transcoder_select[BITS(dword, 30, 29)]); |
| 1282 | printf("HDMID sDVO_Border_Enable\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1283 | printf("HDMID HDCP_Port_Select\t\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1284 | printf("HDMID SDVO_HPD_Interrupt_Enable\t\t\t\t%lu\n", BIT(dword, 23)); |
| 1285 | printf("HDMID Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1286 | printf("HDMID Encoding\t\t\t\t\t\t[0x%lx] %s\n", |
| 1287 | BITS(dword, 11, 10), sdvo_hdmi_encoding[BITS(dword, 11, 10)]); |
| 1288 | printf("HDMID HDMI_or_DVI_Select\t\t\t\t%s\n", BIT(dword, 9) ? "HDMI" : "DVI"); |
| 1289 | printf("HDMID Audio_Output_Enable\t\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1290 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1291 | dword = INREG(DP_CTL_B); |
| 1292 | printf("DP_CTL_B DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 1293 | printf("DP_CTL_B Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 1294 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 1295 | printf("DP_CTL_B Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1296 | printf("DP_CTL_B HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1297 | printf("DP_CTL_B Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1298 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1299 | dword = INREG(DP_CTL_C); |
| 1300 | printf("DP_CTL_C DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 1301 | printf("DP_CTL_C Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 1302 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 1303 | printf("DP_CTL_C Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1304 | printf("DP_CTL_C HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1305 | printf("DP_CTL_C Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1306 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1307 | dword = INREG(DP_CTL_D); |
| 1308 | printf("DP_CTL_D DisplayPort_Enable\t\t\t\t%lu\n", BIT(dword, 31)); |
| 1309 | printf("DP_CTL_D Port_Width_Selection\t\t\t\t[0x%lx] %s\n", |
| 1310 | BITS(dword, 21, 19), dp_port_width[BITS(dword, 21, 19)]); |
| 1311 | printf("DP_CTL_D Port_Detected\t\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1312 | printf("DP_CTL_D HDCP_Port_Select\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1313 | printf("DP_CTL_D Audio_Output_Enable\t\t\t\t%lu\n", BIT(dword, 6)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1314 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1315 | dword = INREG(AUD_CONFIG_A); |
| 1316 | printf("AUD_CONFIG_A N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), |
| 1317 | n_index_value[BIT(dword, 29)]); |
| 1318 | printf("AUD_CONFIG_A N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); |
| 1319 | printf("AUD_CONFIG_A Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); |
| 1320 | printf("AUD_CONFIG_A Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); |
| 1321 | printf("AUD_CONFIG_A Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 1322 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 1323 | printf("AUD_CONFIG_A Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); |
| 1324 | dword = INREG(AUD_CONFIG_B); |
| 1325 | printf("AUD_CONFIG_B N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), |
| 1326 | n_index_value[BIT(dword, 29)]); |
| 1327 | printf("AUD_CONFIG_B N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); |
| 1328 | printf("AUD_CONFIG_B Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); |
| 1329 | printf("AUD_CONFIG_B Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); |
| 1330 | printf("AUD_CONFIG_B Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 1331 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 1332 | printf("AUD_CONFIG_B Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); |
| 1333 | dword = INREG(AUD_CONFIG_C); |
| 1334 | printf("AUD_CONFIG_C N_index_value\t\t\t\t[0x%lx] %s\n", BIT(dword, 29), |
| 1335 | n_index_value[BIT(dword, 29)]); |
| 1336 | printf("AUD_CONFIG_C N_programming_enable\t\t\t%lu\n", BIT(dword, 28)); |
| 1337 | printf("AUD_CONFIG_C Upper_N_value\t\t\t\t0x%02lx\n", BITS(dword, 27, 20)); |
| 1338 | printf("AUD_CONFIG_C Lower_N_value\t\t\t\t0x%03lx\n", BITS(dword, 15, 4)); |
| 1339 | printf("AUD_CONFIG_C Pixel_Clock_HDMI\t\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16), |
| 1340 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 1341 | printf("AUD_CONFIG_C Disable_NCTS\t\t\t\t%lu\n", BIT(dword, 3)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1342 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1343 | dword = INREG(AUD_CTS_ENABLE_A); |
| 1344 | printf("AUD_CTS_ENABLE_A Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); |
| 1345 | printf("AUD_CTS_ENABLE_A CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); |
| 1346 | printf("AUD_CTS_ENABLE_A CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); |
| 1347 | dword = INREG(AUD_CTS_ENABLE_B); |
| 1348 | printf("AUD_CTS_ENABLE_B Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); |
| 1349 | printf("AUD_CTS_ENABLE_B CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); |
| 1350 | printf("AUD_CTS_ENABLE_B CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); |
| 1351 | dword = INREG(AUD_CTS_ENABLE_C); |
| 1352 | printf("AUD_CTS_ENABLE_C Enable_CTS_or_M_programming\t\t%lu\n", BIT(dword, 20)); |
| 1353 | printf("AUD_CTS_ENABLE_C CTS_M value Index\t\t\t%s\n", BIT(dword, 21) ? "CTS" : "M"); |
| 1354 | printf("AUD_CTS_ENABLE_C CTS_programming\t\t\t%#lx\n", BITS(dword, 19, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1355 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1356 | dword = INREG(AUD_MISC_CTRL_A); |
| 1357 | printf("AUD_MISC_CTRL_A Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); |
| 1358 | printf("AUD_MISC_CTRL_A Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); |
| 1359 | printf("AUD_MISC_CTRL_A Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); |
| 1360 | printf("AUD_MISC_CTRL_A Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1361 | dword = INREG(AUD_MISC_CTRL_B); |
| 1362 | printf("AUD_MISC_CTRL_B Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); |
| 1363 | printf("AUD_MISC_CTRL_B Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); |
| 1364 | printf("AUD_MISC_CTRL_B Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); |
| 1365 | printf("AUD_MISC_CTRL_B Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1366 | dword = INREG(AUD_MISC_CTRL_C); |
| 1367 | printf("AUD_MISC_CTRL_C Sample_Fabrication_EN_bit\t\t%lu\n", BIT(dword, 2)); |
| 1368 | printf("AUD_MISC_CTRL_C Sample_present_Disable\t\t\t%lu\n", BIT(dword, 8)); |
| 1369 | printf("AUD_MISC_CTRL_C Output_Delay\t\t\t\t%lu\n", BITS(dword, 7, 4)); |
| 1370 | printf("AUD_MISC_CTRL_C Pro_Allowed\t\t\t\t%lu\n", BIT(dword, 1)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1371 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1372 | dword = INREG(AUD_PWRST); |
| 1373 | printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]); |
| 1374 | printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]); |
| 1375 | printf("AUD_PWRST ConvertorA_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); |
| 1376 | printf("AUD_PWRST ConvertorA_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); |
| 1377 | printf("AUD_PWRST ConvertorB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); |
| 1378 | printf("AUD_PWRST ConvertorB_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); |
| 1379 | printf("AUD_PWRST ConvC_Widget_PwrSt_Curr \t%s\n", power_state[BITS(dword, 23, 22)]); |
| 1380 | printf("AUD_PWRST ConvC_Widget_PwrSt_Req \t%s\n", power_state[BITS(dword, 21, 20)]); |
| 1381 | printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); |
| 1382 | printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); |
| 1383 | printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); |
| 1384 | printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); |
| 1385 | printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); |
| 1386 | printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1387 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1388 | dword = INREG(AUD_PORT_EN_HD_CFG); |
| 1389 | printf("AUD_PORT_EN_HD_CFG Convertor_A_Digen\t\t\t%lu\n", BIT(dword, 0)); |
| 1390 | printf("AUD_PORT_EN_HD_CFG Convertor_B_Digen\t\t\t%lu\n", BIT(dword, 1)); |
| 1391 | printf("AUD_PORT_EN_HD_CFG Convertor_C_Digen\t\t\t%lu\n", BIT(dword, 2)); |
| 1392 | printf("AUD_PORT_EN_HD_CFG ConvertorA_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); |
| 1393 | printf("AUD_PORT_EN_HD_CFG ConvertorB_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); |
| 1394 | printf("AUD_PORT_EN_HD_CFG ConvertorC_Stream_ID\t\t%lu\n", BITS(dword, 15, 12)); |
| 1395 | printf("AUD_PORT_EN_HD_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16)); |
| 1396 | printf("AUD_PORT_EN_HD_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17)); |
| 1397 | printf("AUD_PORT_EN_HD_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18)); |
| 1398 | printf("AUD_PORT_EN_HD_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20)); |
| 1399 | printf("AUD_PORT_EN_HD_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21)); |
| 1400 | printf("AUD_PORT_EN_HD_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1401 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1402 | dword = INREG(AUD_OUT_DIG_CNVT_A); |
| 1403 | printf("AUD_OUT_DIG_CNVT_A V\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1404 | printf("AUD_OUT_DIG_CNVT_A VCFG\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1405 | printf("AUD_OUT_DIG_CNVT_A PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); |
| 1406 | printf("AUD_OUT_DIG_CNVT_A Copy\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1407 | printf("AUD_OUT_DIG_CNVT_A NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1408 | printf("AUD_OUT_DIG_CNVT_A PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); |
| 1409 | printf("AUD_OUT_DIG_CNVT_A Level\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1410 | printf("AUD_OUT_DIG_CNVT_A Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); |
| 1411 | printf("AUD_OUT_DIG_CNVT_A Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16)); |
| 1412 | printf("AUD_OUT_DIG_CNVT_A Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1413 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1414 | dword = INREG(AUD_OUT_DIG_CNVT_B); |
| 1415 | printf("AUD_OUT_DIG_CNVT_B V\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1416 | printf("AUD_OUT_DIG_CNVT_B VCFG\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1417 | printf("AUD_OUT_DIG_CNVT_B PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); |
| 1418 | printf("AUD_OUT_DIG_CNVT_B Copy\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1419 | printf("AUD_OUT_DIG_CNVT_B NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1420 | printf("AUD_OUT_DIG_CNVT_B PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); |
| 1421 | printf("AUD_OUT_DIG_CNVT_B Level\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1422 | printf("AUD_OUT_DIG_CNVT_B Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); |
| 1423 | printf("AUD_OUT_DIG_CNVT_B Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16)); |
| 1424 | printf("AUD_OUT_DIG_CNVT_B Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1425 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1426 | dword = INREG(AUD_OUT_DIG_CNVT_C); |
| 1427 | printf("AUD_OUT_DIG_CNVT_C V\t\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1428 | printf("AUD_OUT_DIG_CNVT_C VCFG\t\t\t\t%lu\n", BIT(dword, 2)); |
| 1429 | printf("AUD_OUT_DIG_CNVT_C PRE\t\t\t\t\t%lu\n", BIT(dword, 3)); |
| 1430 | printf("AUD_OUT_DIG_CNVT_C Copy\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1431 | printf("AUD_OUT_DIG_CNVT_C NonAudio\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1432 | printf("AUD_OUT_DIG_CNVT_C PRO\t\t\t\t\t%lu\n", BIT(dword, 6)); |
| 1433 | printf("AUD_OUT_DIG_CNVT_C Level\t\t\t\t%lu\n", BIT(dword, 7)); |
| 1434 | printf("AUD_OUT_DIG_CNVT_C Category_Code\t\t\t%lu\n", BITS(dword, 14, 8)); |
| 1435 | printf("AUD_OUT_DIG_CNVT_C Lowest_Channel_Number\t\t%lu\n", BITS(dword, 19, 16)); |
| 1436 | printf("AUD_OUT_DIG_CNVT_C Stream_ID\t\t\t\t%lu\n", BITS(dword, 23, 20)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1437 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1438 | printf("AUD_OUT_CH_STR Converter_Channel_MAP PORTB PORTC PORTD\n"); |
| 1439 | for (i = 0; i < 8; i++) { |
| 1440 | OUTREG(AUD_OUT_CH_STR, i | (i << 8) | (i << 16)); |
| 1441 | dword = INREG(AUD_OUT_CH_STR); |
| 1442 | printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", |
| 1443 | 1 + BITS(dword, 3, 0), |
| 1444 | 1 + BITS(dword, 7, 4), |
| 1445 | 1 + BITS(dword, 15, 12), |
| 1446 | 1 + BITS(dword, 23, 20)); |
| 1447 | } |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1448 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1449 | dword = INREG(AUD_OUT_STR_DESC_A); |
| 1450 | printf("AUD_OUT_STR_DESC_A HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); |
| 1451 | printf("AUD_OUT_STR_DESC_A Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); |
| 1452 | printf("AUD_OUT_STR_DESC_A Bits_per_Sample\t\t\t[%#lx] %s\n", |
| 1453 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 1454 | printf("AUD_OUT_STR_DESC_A Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1455 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1456 | dword = INREG(AUD_OUT_STR_DESC_B); |
| 1457 | printf("AUD_OUT_STR_DESC_B HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); |
| 1458 | printf("AUD_OUT_STR_DESC_B Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); |
| 1459 | printf("AUD_OUT_STR_DESC_B Bits_per_Sample\t\t\t[%#lx] %s\n", |
| 1460 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 1461 | printf("AUD_OUT_STR_DESC_B Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1462 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1463 | dword = INREG(AUD_OUT_STR_DESC_C); |
| 1464 | printf("AUD_OUT_STR_DESC_C HBR_enable\t\t\t\t%lu\n", BITS(dword, 28, 27)); |
| 1465 | printf("AUD_OUT_STR_DESC_C Convertor_Channel_Count\t\t%lu\n", BITS(dword, 20, 16) + 1); |
| 1466 | printf("AUD_OUT_STR_DESC_C Bits_per_Sample\t\t\t[%#lx] %s\n", |
| 1467 | BITS(dword, 6, 4), OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 1468 | printf("AUD_OUT_STR_DESC_C Number_of_Channels_in_a_Stream\t%lu\n", 1 + BITS(dword, 3, 0)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1469 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1470 | dword = INREG(AUD_PINW_CONNLNG_SEL); |
| 1471 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_B\t%#lx\n", BITS(dword, 7, 0)); |
| 1472 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_C\t%#lx\n", BITS(dword, 15, 8)); |
| 1473 | printf("AUD_PINW_CONNLNG_SEL Connection_select_Control_D\t%#lx\n", BITS(dword, 23, 16)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1474 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1475 | dword = INREG(AUD_CNTL_ST_A); |
| 1476 | printf("AUD_CNTL_ST_A DIP_Port_Select\t\t\t\t[%#lx] %s\n", |
| 1477 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 1478 | printf("AUD_CNTL_ST_A DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); |
| 1479 | printf("AUD_CNTL_ST_A DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); |
| 1480 | printf("AUD_CNTL_ST_A DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); |
| 1481 | printf("AUD_CNTL_ST_A DIP_transmission_frequency\t\t[0x%lx] %s\n", |
| 1482 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 1483 | printf("AUD_CNTL_ST_A ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1484 | printf("AUD_CNTL_ST_A ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1485 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1486 | dword = INREG(AUD_CNTL_ST_B); |
| 1487 | printf("AUD_CNTL_ST_B DIP_Port_Select\t\t\t\t[%#lx] %s\n", |
| 1488 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 1489 | printf("AUD_CNTL_ST_B DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); |
| 1490 | printf("AUD_CNTL_ST_B DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); |
| 1491 | printf("AUD_CNTL_ST_B DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); |
| 1492 | printf("AUD_CNTL_ST_B DIP_transmission_frequency\t\t[0x%lx] %s\n", |
| 1493 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 1494 | printf("AUD_CNTL_ST_B ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1495 | printf("AUD_CNTL_ST_B ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1496 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1497 | dword = INREG(AUD_CNTL_ST_C); |
| 1498 | printf("AUD_CNTL_ST_C DIP_Port_Select\t\t\t\t[%#lx] %s\n", |
| 1499 | BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]); |
| 1500 | printf("AUD_CNTL_ST_C DIP_type_enable_status Audio DIP\t\t%lu\n", BIT(dword, 21)); |
| 1501 | printf("AUD_CNTL_ST_C DIP_type_enable_status ACP DIP\t\t%lu\n", BIT(dword, 22)); |
| 1502 | printf("AUD_CNTL_ST_C DIP_type_enable_status Generic 2 DIP\t%lu\n", BIT(dword, 23)); |
| 1503 | printf("AUD_CNTL_ST_C DIP_transmission_frequency\t\t[0x%lx] %s\n", |
| 1504 | BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]); |
| 1505 | printf("AUD_CNTL_ST_C ELD_ACK\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1506 | printf("AUD_CNTL_ST_C ELD_buffer_size\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1507 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1508 | dword = INREG(AUD_CNTRL_ST2); |
| 1509 | printf("AUD_CNTRL_ST2 CP_ReadyB\t\t\t\t%lu\n", BIT(dword, 1)); |
| 1510 | printf("AUD_CNTRL_ST2 ELD_validB\t\t\t\t%lu\n", BIT(dword, 0)); |
| 1511 | printf("AUD_CNTRL_ST2 CP_ReadyC\t\t\t\t%lu\n", BIT(dword, 5)); |
| 1512 | printf("AUD_CNTRL_ST2 ELD_validC\t\t\t\t%lu\n", BIT(dword, 4)); |
| 1513 | printf("AUD_CNTRL_ST2 CP_ReadyD\t\t\t\t%lu\n", BIT(dword, 9)); |
| 1514 | printf("AUD_CNTRL_ST2 ELD_validD\t\t\t\t%lu\n", BIT(dword, 8)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1515 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1516 | dword = INREG(AUD_CNTRL_ST3); |
| 1517 | printf("AUD_CNTRL_ST3 TransA_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 3)); |
| 1518 | printf("AUD_CNTRL_ST3 TransA_to_Port_Sel\t\t\t[%#lx] %s\n", |
| 1519 | BITS(dword, 2, 0), trans_to_port_sel[BITS(dword, 2, 0)]); |
| 1520 | printf("AUD_CNTRL_ST3 TransB_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 7)); |
| 1521 | printf("AUD_CNTRL_ST3 TransB_to_Port_Sel\t\t\t[%#lx] %s\n", |
| 1522 | BITS(dword, 6, 4), trans_to_port_sel[BITS(dword, 6, 4)]); |
| 1523 | printf("AUD_CNTRL_ST3 TransC_DPT_Audio_Output_En\t\t%lu\n", BIT(dword, 11)); |
| 1524 | printf("AUD_CNTRL_ST3 TransC_to_Port_Sel\t\t\t[%#lx] %s\n", |
| 1525 | BITS(dword, 10, 8), trans_to_port_sel[BITS(dword, 10, 8)]); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1526 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1527 | dword = INREG(AUD_HDMIW_STATUS); |
| 1528 | printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27)); |
| 1529 | printf("AUD_HDMIW_STATUS Conv_A_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26)); |
| 1530 | printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); |
| 1531 | printf("AUD_HDMIW_STATUS Conv_B_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); |
| 1532 | printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); |
| 1533 | printf("AUD_HDMIW_STATUS Conv_C_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); |
| 1534 | printf("AUD_HDMIW_STATUS BCLK/CDCLK_FIFO_Overrun\t\t%lu\n", BIT(dword, 25)); |
| 1535 | printf("AUD_HDMIW_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24)); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1536 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1537 | printf("AUD_HDMIW_HDMIEDID_A HDMI ELD:\n\t"); |
| 1538 | dword = INREG(AUD_CNTL_ST_A); |
| 1539 | dword &= ~BITMASK(9, 5); |
| 1540 | OUTREG(AUD_CNTL_ST_A, dword); |
| 1541 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1542 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_A))); |
| 1543 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1544 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1545 | printf("AUD_HDMIW_HDMIEDID_B HDMI ELD:\n\t"); |
| 1546 | dword = INREG(AUD_CNTL_ST_B); |
| 1547 | dword &= ~BITMASK(9, 5); |
| 1548 | OUTREG(AUD_CNTL_ST_B, dword); |
| 1549 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1550 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_B))); |
| 1551 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1552 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1553 | printf("AUD_HDMIW_HDMIEDID_C HDMI ELD:\n\t"); |
| 1554 | dword = INREG(AUD_CNTL_ST_C); |
| 1555 | dword &= ~BITMASK(9, 5); |
| 1556 | OUTREG(AUD_CNTL_ST_C, dword); |
| 1557 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1558 | printf("%08x ", htonl(INREG(AUD_HDMIW_HDMIEDID_C))); |
| 1559 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1560 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1561 | printf("AUD_HDMIW_INFOFR_A HDMI audio Infoframe:\n\t"); |
| 1562 | dword = INREG(AUD_CNTL_ST_A); |
| 1563 | dword &= ~BITMASK(20, 18); |
| 1564 | dword &= ~BITMASK(3, 0); |
| 1565 | OUTREG(AUD_CNTL_ST_A, dword); |
| 1566 | for (i = 0; i < 8; i++) |
| 1567 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_A))); |
| 1568 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1569 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1570 | printf("AUD_HDMIW_INFOFR_B HDMI audio Infoframe:\n\t"); |
| 1571 | dword = INREG(AUD_CNTL_ST_B); |
| 1572 | dword &= ~BITMASK(20, 18); |
| 1573 | dword &= ~BITMASK(3, 0); |
| 1574 | OUTREG(AUD_CNTL_ST_B, dword); |
| 1575 | for (i = 0; i < 8; i++) |
| 1576 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_B))); |
| 1577 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1578 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 1579 | printf("AUD_HDMIW_INFOFR_C HDMI audio Infoframe:\n\t"); |
| 1580 | dword = INREG(AUD_CNTL_ST_C); |
| 1581 | dword &= ~BITMASK(20, 18); |
| 1582 | dword &= ~BITMASK(3, 0); |
| 1583 | OUTREG(AUD_CNTL_ST_C, dword); |
| 1584 | for (i = 0; i < 8; i++) |
| 1585 | printf("%08x ", htonl(INREG(AUD_HDMIW_INFOFR_C))); |
| 1586 | printf("\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 1587 | |
| 1588 | } |
| 1589 | |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1590 | #undef AUD_CONFIG_A |
| 1591 | #undef AUD_MISC_CTRL_A |
| 1592 | #undef AUD_VID_DID |
| 1593 | #undef AUD_RID |
| 1594 | #undef AUD_CTS_ENABLE_A |
| 1595 | #undef AUD_PWRST |
| 1596 | #undef AUD_HDMIW_HDMIEDID_A |
| 1597 | #undef AUD_HDMIW_INFOFR_A |
| 1598 | #undef AUD_PORT_EN_HD_CFG |
| 1599 | #undef AUD_OUT_DIG_CNVT_A |
| 1600 | #undef AUD_OUT_STR_DESC_A |
| 1601 | #undef AUD_OUT_CH_STR |
| 1602 | #undef AUD_PINW_CONNLNG_LIST |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 1603 | #undef AUD_PINW_CONNLNG_SEL |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1604 | #undef AUD_CNTL_ST_A |
| 1605 | #undef AUD_HDMIW_STATUS |
| 1606 | #undef AUD_CONFIG_B |
| 1607 | #undef AUD_MISC_CTRL_B |
| 1608 | #undef AUD_CTS_ENABLE_B |
| 1609 | #undef AUD_HDMIW_HDMIEDID_B |
| 1610 | #undef AUD_HDMIW_INFOFR_B |
| 1611 | #undef AUD_OUT_DIG_CNVT_B |
| 1612 | #undef AUD_OUT_STR_DESC_B |
| 1613 | #undef AUD_CNTL_ST_B |
| 1614 | #undef AUD_CONFIG_C |
| 1615 | #undef AUD_MISC_CTRL_C |
| 1616 | #undef AUD_CTS_ENABLE_C |
| 1617 | #undef AUD_HDMIW_HDMIEDID_C |
| 1618 | #undef AUD_HDMIW_INFOFR_C |
| 1619 | #undef AUD_OUT_DIG_CNVT_C |
| 1620 | #undef AUD_OUT_STR_DESC_C |
| 1621 | |
| 1622 | #undef VIDEO_DIP_CTL_A |
| 1623 | #undef VIDEO_DIP_CTL_B |
| 1624 | #undef VIDEO_DIP_CTL_C |
| 1625 | #undef VIDEO_DIP_CTL_D |
| 1626 | #undef VIDEO_DIP_DATA |
| 1627 | |
| 1628 | /* |
| 1629 | * Haswell registers |
| 1630 | */ |
| 1631 | |
| 1632 | /* DisplayPort Transport Control */ |
| 1633 | #define DP_TP_CTL_A 0x64040 |
| 1634 | #define DP_TP_CTL_B 0x64140 |
| 1635 | #define DP_TP_CTL_C 0x64240 |
| 1636 | #define DP_TP_CTL_D 0x64340 |
| 1637 | #define DP_TP_CTL_E 0x64440 |
| 1638 | |
| 1639 | /* DisplayPort Transport Status */ |
| 1640 | #define DP_TP_ST_A 0x64044 |
| 1641 | #define DP_TP_ST_B 0x64144 |
| 1642 | #define DP_TP_ST_C 0x64244 |
| 1643 | #define DP_TP_ST_D 0x64344 |
| 1644 | #define DP_TP_ST_E 0x64444 |
| 1645 | |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1646 | /* DDI Buffer Control */ |
| 1647 | #define DDI_BUF_CTL_A 0x64000 |
| 1648 | #define DDI_BUF_CTL_B 0x64100 |
| 1649 | #define DDI_BUF_CTL_C 0x64200 |
| 1650 | #define DDI_BUF_CTL_D 0x64300 |
| 1651 | #define DDI_BUF_CTL_E 0x64400 |
| 1652 | |
| 1653 | /* DDI Buffer Translation */ |
| 1654 | #define DDI_BUF_TRANS_A 0x64e00 |
| 1655 | #define DDI_BUF_TRANS_B 0x64e60 |
| 1656 | #define DDI_BUF_TRANS_C 0x64ec0 |
| 1657 | #define DDI_BUF_TRANS_D 0x64f20 |
| 1658 | #define DDI_BUF_TRANS_E 0x64f80 |
| 1659 | |
| 1660 | /* DDI Aux Channel */ |
| 1661 | #define DDI_AUX_CHANNEL_CTRL 0x64010 |
| 1662 | #define DDI_AUX_DATA 0x64014 |
| 1663 | #define DDI_AUX_TST 0x64028 |
| 1664 | |
| 1665 | /* DDI CRC Control */ |
| 1666 | #define DDI_CRC_CTL_A 0x64050 |
| 1667 | #define DDI_CRC_CTL_B 0x64150 |
| 1668 | #define DDI_CRC_CTL_C 0x64250 |
| 1669 | #define DDI_CRC_CTL_D 0x64350 |
| 1670 | #define DDI_CRC_CTL_E 0x64450 |
| 1671 | |
| 1672 | /* Pipe DDI Function Control */ |
| 1673 | #define PIPE_DDI_FUNC_CTL_A 0x60400 |
| 1674 | #define PIPE_DDI_FUNC_CTL_B 0x61400 |
| 1675 | #define PIPE_DDI_FUNC_CTL_C 0x62400 |
| 1676 | #define PIPE_DDI_FUNC_CTL_EDP 0x6F400 |
| 1677 | |
| 1678 | /* Pipe Configuration */ |
| 1679 | #define PIPE_CONF_A 0x70008 |
| 1680 | #define PIPE_CONF_B 0x71008 |
| 1681 | #define PIPE_CONF_C 0x72008 |
| 1682 | #define PIPE_CONF_EDP 0x7F008 |
| 1683 | |
| 1684 | /* Audio registers */ |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 1685 | #define AUD_TCA_CONFIG 0x65000 |
| 1686 | #define AUD_TCB_CONFIG 0x65100 |
| 1687 | #define AUD_TCC_CONFIG 0x65200 |
| 1688 | #define AUD_C1_MISC_CTRL 0x65010 |
| 1689 | #define AUD_C2_MISC_CTRL 0x65110 |
| 1690 | #define AUD_C3_MISC_CTRL 0x65210 |
| 1691 | #define AUD_VID_DID 0x65020 |
| 1692 | #define AUD_RID 0x65024 |
| 1693 | #define AUD_TCA_M_CTS_ENABLE 0x65028 |
| 1694 | #define AUD_TCB_M_CTS_ENABLE 0x65128 |
| 1695 | #define AUD_TCC_M_CTS_ENABLE 0x65228 |
| 1696 | #define AUD_PWRST 0x6504C |
| 1697 | #define AUD_TCA_EDID_DATA 0x65050 |
| 1698 | #define AUD_TCB_EDID_DATA 0x65150 |
| 1699 | #define AUD_TCC_EDID_DATA 0x65250 |
| 1700 | #define AUD_TCA_INFOFR 0x65054 |
| 1701 | #define AUD_TCB_INFOFR 0x65154 |
| 1702 | #define AUD_TCC_INFOFR 0x65254 |
| 1703 | #define AUD_PIPE_CONV_CFG 0x6507C |
| 1704 | #define AUD_C1_DIG_CNVT 0x65080 |
| 1705 | #define AUD_C2_DIG_CNVT 0x65180 |
| 1706 | #define AUD_C3_DIG_CNVT 0x65280 |
| 1707 | #define AUD_C1_STR_DESC 0x65084 |
| 1708 | #define AUD_C2_STR_DESC 0x65184 |
| 1709 | #define AUD_C3_STR_DESC 0x65284 |
| 1710 | #define AUD_OUT_CHAN_MAP 0x65088 |
| 1711 | #define AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH 0x650A8 |
| 1712 | #define AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH 0x651A8 |
| 1713 | #define AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH 0x652A8 |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1714 | #define AUD_PIPE_CONN_SEL_CTRL 0x650AC |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 1715 | #define AUD_TCA_DIP_ELD_CTRL_ST 0x650b4 |
| 1716 | #define AUD_TCB_DIP_ELD_CTRL_ST 0x651b4 |
| 1717 | #define AUD_TCC_DIP_ELD_CTRL_ST 0x652b4 |
| 1718 | #define AUD_PIN_ELD_CP_VLD 0x650C0 |
| 1719 | #define AUD_HDMI_FIFO_STATUS 0x650D4 |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1720 | |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 1721 | /* Audio debug registers */ |
| 1722 | #define AUD_ICOI 0x65f00 |
| 1723 | #define AUD_IRII 0x65f04 |
| 1724 | #define AUD_ICS 0x65f08 |
Mengdong Lin | f075c3c | 2013-08-13 00:22:14 -0400 | [diff] [blame] | 1725 | #define AUD_CHICKENBIT_REG 0x65f10 |
Mengdong Lin | 97e5cf6 | 2013-08-13 00:22:24 -0400 | [diff] [blame] | 1726 | #define AUD_DP_DIP_STATUS 0x65f20 |
Mengdong Lin | e35126d | 2013-08-13 00:22:33 -0400 | [diff] [blame] | 1727 | #define AUD_TCA_M_CTS 0x65f44 |
| 1728 | #define AUD_TCB_M_CTS 0x65f54 |
| 1729 | #define AUD_TCC_M_CTS 0x65f64 |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 1730 | |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 1731 | /* Video DIP Control */ |
| 1732 | #define VIDEO_DIP_CTL_A 0x60200 |
| 1733 | #define VIDEO_DIP_CTL_B 0x61200 |
| 1734 | #define VIDEO_DIP_CTL_C 0x62200 |
| 1735 | #define VIDEO_DIP_CTL_D 0x63200 |
| 1736 | |
| 1737 | #define VIDEO_DIP_DATA 0x60220 |
| 1738 | #define VIDEO_DIP_ECC 0x60240 |
| 1739 | |
| 1740 | #define AUD_DP_DIP_STATUS 0x65f20 |
| 1741 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 1742 | #define MAX_PREFIX_SIZE 128 |
| 1743 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 1744 | static void dump_ddi_buf_ctl(int port) |
| 1745 | { |
| 1746 | uint32_t dword; |
| 1747 | |
| 1748 | dword = INREG(DDI_BUF_CTL_A + (port - PORT_A) * 0x100); |
| 1749 | printf("DDI %c Buffer control\n", 'A' + port - PORT_A); |
| 1750 | printf("\tDP port width\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 3, 1), |
| 1751 | OPNAME(dp_port_width, BITS(dword, 3, 1))); |
| 1752 | printf("\tDDI Buffer Enable\t\t\t\t%ld\n", BIT(dword, 31)); |
| 1753 | } |
| 1754 | |
| 1755 | static void dump_ddi_func_ctl(int pipe) |
| 1756 | { |
| 1757 | uint32_t dword; |
| 1758 | |
| 1759 | dword = INREG(PIPE_DDI_FUNC_CTL_A + (pipe - PIPE_A) * 0x1000); |
| 1760 | printf("Pipe %c DDI Function Control\n", 'A' + pipe - PIPE_A); |
| 1761 | printf("\tBITS per color\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 22, 20), |
| 1762 | OPNAME(bits_per_color, BITS(dword, 22, 20))); |
| 1763 | printf("\tPIPE DDI Mode\t\t\t\t\t[0x%lx] %s\n", BITS(dword, 26, 24), |
| 1764 | OPNAME(ddi_mode, BITS(dword, 26, 24))); |
| 1765 | printf("\tPIPE DDI selection\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 28), |
| 1766 | OPNAME(trans_to_port_sel, BITS(dword, 30, 28))); |
| 1767 | printf("\tPIPE DDI Function Enable\t\t\t[0x%lx]\n", BIT(dword, 31)); |
| 1768 | } |
| 1769 | |
| 1770 | static void dump_aud_transcoder_config(int transcoder) |
| 1771 | { |
| 1772 | uint32_t dword; |
| 1773 | char prefix[MAX_PREFIX_SIZE]; |
| 1774 | |
| 1775 | dword = INREG(AUD_TCA_CONFIG + (transcoder - TRANSCODER_A) * 0x100); |
| 1776 | sprintf(prefix, "AUD_TC%c_CONFIG", 'A' + transcoder - TRANSCODER_A); |
| 1777 | |
| 1778 | printf("%s Disable_NCTS\t\t\t\t%lu\n", prefix, BIT(dword, 3)); |
| 1779 | printf("%s Lower_N_value\t\t\t\t0x%03lx\n", prefix, BITS(dword, 15, 4)); |
| 1780 | printf("%s Pixel_Clock_HDMI\t\t\t[0x%lx] %s\n", prefix, BITS(dword, 19, 16), |
| 1781 | OPNAME(pixel_clock, BITS(dword, 19, 16))); |
| 1782 | printf("%s Upper_N_value\t\t\t\t0x%02lx\n", prefix, BITS(dword, 27, 20)); |
| 1783 | printf("%s N_programming_enable\t\t\t%lu\n", prefix, BIT(dword, 28)); |
| 1784 | printf("%s N_index_value\t\t\t\t[0x%lx] %s\n", prefix, BIT(dword, 29), |
| 1785 | OPNAME(n_index_value, BIT(dword, 29))); |
| 1786 | } |
| 1787 | |
| 1788 | static void dump_aud_misc_control(int converter) |
| 1789 | { |
| 1790 | uint32_t dword; |
| 1791 | char prefix[MAX_PREFIX_SIZE]; |
| 1792 | |
| 1793 | dword = INREG(AUD_C1_MISC_CTRL + (converter - CONVERTER_1) * 0x100); |
| 1794 | sprintf(prefix, "AUD_C%c_MISC_CTRL", '1' + converter - CONVERTER_1); |
| 1795 | |
| 1796 | printf("%s Pro_Allowed\t\t\t\t%lu\n", prefix, BIT(dword, 1)); |
| 1797 | printf("%s Sample_Fabrication_EN_bit\t\t%lu\n", prefix, BIT(dword, 2)); |
| 1798 | printf("%s Output_Delay\t\t\t\t%lu\n", prefix, BITS(dword, 7, 4)); |
| 1799 | printf("%s Sample_present_Disable\t\t%lu\n", prefix, BIT(dword, 8)); |
| 1800 | } |
| 1801 | |
| 1802 | static void dump_aud_vendor_device_id(void) |
| 1803 | { |
| 1804 | uint32_t dword; |
| 1805 | |
| 1806 | dword = INREG(AUD_VID_DID); |
| 1807 | printf("AUD_VID_DID device id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 0)); |
| 1808 | printf("AUD_VID_DID vendor id\t\t\t\t\t0x%lx\n", BITS(dword, 31, 16)); |
| 1809 | } |
| 1810 | |
| 1811 | static void dump_aud_revision_id(void) |
| 1812 | { |
| 1813 | uint32_t dword; |
| 1814 | |
| 1815 | dword = INREG(AUD_RID); |
| 1816 | printf("AUD_RID Stepping_Id\t\t\t\t\t0x%lx\n", BITS(dword, 7, 0)); |
| 1817 | printf("AUD_RID Revision_Id\t\t\t\t\t0x%lx\n", BITS(dword, 15, 8)); |
| 1818 | printf("AUD_RID Minor_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 19, 16)); |
| 1819 | printf("AUD_RID Major_Revision\t\t\t\t\t0x%lx\n", BITS(dword, 23, 20)); |
| 1820 | } |
| 1821 | |
| 1822 | static void dump_aud_m_cts_enable(int transcoder) |
| 1823 | { |
| 1824 | uint32_t dword; |
| 1825 | char prefix[MAX_PREFIX_SIZE]; |
| 1826 | |
| 1827 | dword = INREG(AUD_TCA_M_CTS_ENABLE + (transcoder - TRANSCODER_A) * 0x100); |
| 1828 | sprintf(prefix, "AUD_TC%c_M_CTS_ENABLE", 'A' + transcoder - TRANSCODER_A); |
| 1829 | |
| 1830 | printf("%s CTS_programming\t\t\t%#lx\n", prefix, BITS(dword, 19, 0)); |
| 1831 | printf("%s Enable_CTS_or_M_programming\t%lu\n", prefix, BIT(dword, 20)); |
| 1832 | printf("%s CTS_M value Index\t\t\t%s\n", prefix, BIT(dword, 21) ? "CTS" : "M"); |
| 1833 | } |
| 1834 | |
| 1835 | static void dump_aud_power_state(void) |
| 1836 | { |
| 1837 | uint32_t dword; |
| 1838 | |
| 1839 | dword = INREG(AUD_PWRST); |
| 1840 | printf("AUD_PWRST PinB_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 1, 0)]); |
| 1841 | printf("AUD_PWRST PinB_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 3, 2)]); |
| 1842 | printf("AUD_PWRST PinC_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 5, 4)]); |
| 1843 | printf("AUD_PWRST PinC_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 7, 6)]); |
| 1844 | printf("AUD_PWRST PinD_Widget_Power_State_Set \t%s\n", power_state[BITS(dword, 9, 8)]); |
| 1845 | printf("AUD_PWRST PinD_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 11, 10)]); |
| 1846 | printf("AUD_PWRST Convertor1_Widget_Power_State_Requsted \t%s\n", power_state[BITS(dword, 13, 12)]); |
| 1847 | printf("AUD_PWRST Convertor1_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 15, 14)]); |
| 1848 | printf("AUD_PWRST Convertor2_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 17, 16)]); |
| 1849 | printf("AUD_PWRST Convertor2_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 19, 18)]); |
| 1850 | printf("AUD_PWRST Convertor3_Widget_Power_State_Requested \t%s\n", power_state[BITS(dword, 21, 20)]); |
| 1851 | printf("AUD_PWRST Convertor3_Widget_Power_State_Current \t%s\n", power_state[BITS(dword, 23, 22)]); |
| 1852 | printf("AUD_PWRST Func_Grp_Dev_PwrSt_Set \t%s\n", power_state[BITS(dword, 25, 24)]); |
| 1853 | printf("AUD_PWRST Func_Grp_Dev_PwrSt_Curr \t%s\n", power_state[BITS(dword, 27, 26)]); |
| 1854 | } |
| 1855 | |
| 1856 | static void dump_aud_edid_data(int transcoder) |
| 1857 | { |
| 1858 | uint32_t dword; |
| 1859 | int i; |
| 1860 | int offset = (transcoder - TRANSCODER_A) * 0x100; |
| 1861 | |
| 1862 | printf("AUD_TC%c_EDID_DATA ELD:\n\t", 'A' + transcoder - TRANSCODER_A); |
| 1863 | dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset); |
| 1864 | dword &= ~BITMASK(9, 5); |
| 1865 | OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword); |
| 1866 | for (i = 0; i < BITS(dword, 14, 10) / 4; i++) |
| 1867 | printf("%08x ", htonl(INREG(AUD_TCA_EDID_DATA + offset))); |
| 1868 | printf("\n"); |
| 1869 | } |
| 1870 | |
| 1871 | static void dump_aud_infoframe(int transcoder) |
| 1872 | { |
| 1873 | uint32_t dword; |
| 1874 | int i; |
| 1875 | int offset = (transcoder - TRANSCODER_A) * 0x100; |
| 1876 | |
| 1877 | printf("AUD_TC%c_INFOFR audio Infoframe:\n\t", 'A' + transcoder - TRANSCODER_A); |
| 1878 | dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset); |
| 1879 | dword &= ~BITMASK(20, 18); |
| 1880 | dword &= ~BITMASK(3, 0); |
| 1881 | OUTREG(AUD_TCA_DIP_ELD_CTRL_ST + offset, dword); |
| 1882 | for (i = 0; i < 8; i++) |
| 1883 | printf("%08x ", htonl(INREG(AUD_TCA_INFOFR + offset))); |
| 1884 | printf("\n"); |
| 1885 | } |
| 1886 | |
| 1887 | static void dump_aud_pipe_conv_cfg(void) |
| 1888 | { |
| 1889 | uint32_t dword; |
| 1890 | |
| 1891 | dword = INREG(AUD_PIPE_CONV_CFG); |
| 1892 | printf("AUD_PIPE_CONV_CFG Convertor_1_Digen\t\t\t%lu\n", BIT(dword, 0)); |
| 1893 | printf("AUD_PIPE_CONV_CFG Convertor_2_Digen\t\t\t%lu\n", BIT(dword, 1)); |
| 1894 | printf("AUD_PIPE_CONV_CFG Convertor_3_Digen\t\t\t%lu\n", BIT(dword, 2)); |
| 1895 | printf("AUD_PIPE_CONV_CFG Convertor_1_Stream_ID\t\t%lu\n", BITS(dword, 7, 4)); |
| 1896 | printf("AUD_PIPE_CONV_CFG Convertor_2_Stream_ID\t\t%lu\n", BITS(dword, 11, 8)); |
| 1897 | printf("AUD_PIPE_CONV_CFG Convertor_3_Stream_ID\t\t%lu\n", BITS(dword, 15, 12)); |
| 1898 | printf("AUD_PIPE_CONV_CFG Port_B_Out_Enable\t\t\t%lu\n", BIT(dword, 16)); |
| 1899 | printf("AUD_PIPE_CONV_CFG Port_C_Out_Enable\t\t\t%lu\n", BIT(dword, 17)); |
| 1900 | printf("AUD_PIPE_CONV_CFG Port_D_Out_Enable\t\t\t%lu\n", BIT(dword, 18)); |
| 1901 | printf("AUD_PIPE_CONV_CFG Port_B_Amp_Mute_Status\t\t%lu\n", BIT(dword, 20)); |
| 1902 | printf("AUD_PIPE_CONV_CFG Port_C_Amp_Mute_Status\t\t%lu\n", BIT(dword, 21)); |
| 1903 | printf("AUD_PIPE_CONV_CFG Port_D_Amp_Mute_Status\t\t%lu\n", BIT(dword, 22)); |
| 1904 | } |
| 1905 | |
| 1906 | static void dump_aud_dig_cnvt(int converter) |
| 1907 | { |
| 1908 | uint32_t dword; |
| 1909 | char prefix[MAX_PREFIX_SIZE]; |
| 1910 | |
| 1911 | dword = INREG(AUD_C1_DIG_CNVT + (converter - CONVERTER_1) * 0x100); |
| 1912 | sprintf(prefix, "AUD_C%c_DIG_CNVT", '1' + converter - CONVERTER_1); |
| 1913 | |
| 1914 | printf("%s V\t\t\t\t\t%lu\n", prefix, BIT(dword, 1)); |
| 1915 | printf("%s VCFG\t\t\t\t\t%lu\n", prefix, BIT(dword, 2)); |
| 1916 | printf("%s PRE\t\t\t\t\t%lu\n", prefix, BIT(dword, 3)); |
| 1917 | printf("%s Copy\t\t\t\t\t%lu\n", prefix, BIT(dword, 4)); |
| 1918 | printf("%s NonAudio\t\t\t\t%lu\n", prefix, BIT(dword, 5)); |
| 1919 | printf("%s PRO\t\t\t\t\t%lu\n", prefix, BIT(dword, 6)); |
| 1920 | printf("%s Level\t\t\t\t\t%lu\n", prefix, BIT(dword, 7)); |
| 1921 | printf("%s Category_Code\t\t\t\t%lu\n", prefix, BITS(dword, 14, 8)); |
| 1922 | printf("%s Lowest_Channel_Number\t\t\t%lu\n", prefix, BITS(dword, 19, 16)); |
| 1923 | printf("%s Stream_ID\t\t\t\t%lu\n", prefix, BITS(dword, 23, 20)); |
| 1924 | } |
| 1925 | |
| 1926 | static void dump_aud_str_desc(int converter) |
| 1927 | { |
| 1928 | uint32_t dword; |
| 1929 | char prefix[MAX_PREFIX_SIZE]; |
| 1930 | uint32_t rate; |
| 1931 | |
| 1932 | dword = INREG(AUD_C1_STR_DESC + (converter - CONVERTER_1) * 0x100); |
| 1933 | sprintf(prefix, "AUD_C%c_STR_DESC", '1' + converter - CONVERTER_1); |
| 1934 | |
| 1935 | printf("%s Number_of_Channels_in_a_Stream\t\t%lu\n", prefix, 1 + BITS(dword, 3, 0)); |
| 1936 | printf("%s Bits_per_Sample\t\t\t[%#lx] %s\n", prefix, BITS(dword, 6, 4), |
| 1937 | OPNAME(bits_per_sample, BITS(dword, 6, 4))); |
| 1938 | |
| 1939 | printf("%s Sample_Base_Rate_Divisor\t\t[%#lx] %s\n", prefix, BITS(dword, 10, 8), |
| 1940 | OPNAME(sample_base_rate_divisor, BITS(dword, 10, 8))); |
| 1941 | printf("%s Sample_Base_Rate_Mult\t\t\t[%#lx] %s\n", prefix, BITS(dword, 13, 11), |
| 1942 | OPNAME(sample_base_rate_mult, BITS(dword, 13, 11))); |
| 1943 | printf("%s Sample_Base_Rate\t\t\t[%#lx] %s\t", prefix, BIT(dword, 14), |
| 1944 | OPNAME(sample_base_rate, BIT(dword, 14))); |
| 1945 | rate = (BIT(dword, 14) ? 44100 : 48000) * (BITS(dword, 13, 11) + 1) |
| 1946 | /(BITS(dword, 10, 8) + 1); |
| 1947 | printf("=> Sample Rate %d Hz\n", rate); |
| 1948 | |
| 1949 | printf("%s Convertor_Channel_Count\t\t%lu\n", prefix, BITS(dword, 20, 16) + 1); |
| 1950 | } |
| 1951 | |
| 1952 | static void dump_aud_out_chan_map(void) |
| 1953 | { |
| 1954 | uint32_t dword; |
| 1955 | int i; |
| 1956 | |
| 1957 | printf("AUD_OUT_CHAN_MAP Converter_Channel_MAP PORTB PORTC PORTD\n"); |
| 1958 | for (i = 0; i < 8; i++) { |
| 1959 | OUTREG(AUD_OUT_CHAN_MAP, i | (i << 8) | (i << 16)); |
| 1960 | dword = INREG(AUD_OUT_CHAN_MAP); |
| 1961 | printf("\t\t\t\t%lu\t%lu\t%lu\t%lu\n", |
| 1962 | 1 + BITS(dword, 3, 0), |
| 1963 | 1 + BITS(dword, 7, 4), |
| 1964 | 1 + BITS(dword, 15, 12), |
| 1965 | 1 + BITS(dword, 23, 20)); |
| 1966 | } |
| 1967 | } |
| 1968 | |
| 1969 | static void dump_aud_connect_list_entry_length(int transcoder) |
| 1970 | { |
| 1971 | uint32_t dword; |
| 1972 | char prefix[MAX_PREFIX_SIZE]; |
| 1973 | |
| 1974 | dword = INREG(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH + (transcoder - TRANSCODER_A) * 0x100); |
| 1975 | sprintf(prefix, "AUD_TC%c_PIN_PIPE_CONN_ENTRY_LNGTH", 'A' + transcoder - TRANSCODER_A); |
| 1976 | |
| 1977 | printf("%s Connect_List_Length\t%lu\n", prefix, BITS(dword, 6, 0)); |
| 1978 | printf("%s Form \t\t[%#lx] %s\n", prefix, BIT(dword, 7), |
| 1979 | OPNAME(connect_list_form, BIT(dword, 7))); |
| 1980 | printf("%s Connect_List_Entry\t%lu\n", prefix, BITS(dword, 15, 8)); |
| 1981 | } |
| 1982 | |
| 1983 | static void dump_aud_connect_select_ctrl(void) |
| 1984 | { |
| 1985 | uint32_t dword; |
| 1986 | |
| 1987 | dword = INREG(AUD_PIPE_CONN_SEL_CTRL); |
| 1988 | printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_B\t%#lx\n", BITS(dword, 7, 0)); |
| 1989 | printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_C\t%#lx\n", BITS(dword, 15, 8)); |
| 1990 | printf("AUD_PIPE_CONN_SEL_CTRL Connection_select_Port_D\t%#lx\n", BITS(dword, 23, 16)); |
| 1991 | } |
| 1992 | |
| 1993 | static void dump_aud_dip_eld_ctrl_st(int transcoder) |
| 1994 | { |
| 1995 | uint32_t dword; |
| 1996 | int offset = (transcoder - TRANSCODER_A) * 0x100; |
| 1997 | |
| 1998 | dword = INREG(AUD_TCA_DIP_ELD_CTRL_ST + offset); |
| 1999 | printf("Audio DIP and ELD control state for Transcoder %c\n", 'A' + transcoder - TRANSCODER_A); |
| 2000 | |
| 2001 | printf("\tELD_ACK\t\t\t\t\t\t%lu\n", BIT(dword, 4)); |
| 2002 | printf("\tELD_buffer_size\t\t\t\t\t%lu\n", BITS(dword, 14, 10)); |
| 2003 | printf("\tDIP_transmission_frequency\t\t\t[0x%lx] %s\n", BITS(dword, 17, 16), |
| 2004 | dip_trans[BITS(dword, 17, 16)]); |
| 2005 | printf("\tDIP Buffer Index \t\t\t\t[0x%lx] %s\n", BITS(dword, 20, 18), |
| 2006 | dip_index[BITS(dword, 20, 18)]); |
| 2007 | printf("\tAudio DIP type enable status\t\t\t[0x%04lx] %s, %s, %s\n", BITS(dword, 24, 21), |
| 2008 | dip_type[BIT(dword, 21)], dip_gen1_state[BIT(dword, 22)], dip_gen2_state[BIT(dword, 23)]); |
| 2009 | printf("\tAudio DIP port select\t\t\t\t[0x%lx] %s\n", BITS(dword, 30, 29), |
| 2010 | dip_port[BITS(dword, 30, 29)]); |
| 2011 | printf("\n"); |
| 2012 | } |
| 2013 | |
| 2014 | static void dump_aud_eld_cp_vld(void) |
| 2015 | { |
| 2016 | uint32_t dword; |
| 2017 | |
| 2018 | dword = INREG(AUD_PIN_ELD_CP_VLD); |
| 2019 | printf("AUD_PIN_ELD_CP_VLD Transcoder_A ELD_valid\t\t%lu\n", BIT(dword, 0)); |
| 2020 | printf("AUD_PIN_ELD_CP_VLD Transcoder_A CP_Ready \t\t%lu\n", BIT(dword, 1)); |
| 2021 | printf("AUD_PIN_ELD_CP_VLD Transcoder_A Out_enable\t\t%lu\n", BIT(dword, 2)); |
| 2022 | printf("AUD_PIN_ELD_CP_VLD Transcoder_A Inactive\t\t%lu\n", BIT(dword, 3)); |
| 2023 | printf("AUD_PIN_ELD_CP_VLD Transcoder_B ELD_valid\t\t%lu\n", BIT(dword, 4)); |
| 2024 | printf("AUD_PIN_ELD_CP_VLD Transcoder_B CP_Ready\t\t%lu\n", BIT(dword, 5)); |
| 2025 | printf("AUD_PIN_ELD_CP_VLD Transcoder_B OUT_enable\t\t%lu\n", BIT(dword, 6)); |
| 2026 | printf("AUD_PIN_ELD_CP_VLD Transcoder_B Inactive\t\t%lu\n", BIT(dword, 7)); |
| 2027 | printf("AUD_PIN_ELD_CP_VLD Transcoder_C ELD_valid\t\t%lu\n", BIT(dword, 8)); |
| 2028 | printf("AUD_PIN_ELD_CP_VLD Transcoder_C CP_Ready\t\t%lu\n", BIT(dword, 9)); |
| 2029 | printf("AUD_PIN_ELD_CP_VLD Transcoder_C OUT_enable\t\t%lu\n", BIT(dword, 10)); |
| 2030 | printf("AUD_PIN_ELD_CP_VLD Transcoder_C Inactive\t\t%lu\n", BIT(dword, 11)); |
| 2031 | } |
| 2032 | |
| 2033 | static void dump_hdmi_fifo_status(void) |
| 2034 | { |
| 2035 | uint32_t dword; |
| 2036 | |
| 2037 | dword = INREG(AUD_HDMI_FIFO_STATUS); |
| 2038 | printf("AUD_HDMI_FIFO_STATUS Function_Reset\t\t\t%lu\n", BIT(dword, 24)); |
| 2039 | printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 26)); |
| 2040 | printf("AUD_HDMI_FIFO_STATUS Conv_1_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 27)); |
| 2041 | printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 28)); |
| 2042 | printf("AUD_HDMI_FIFO_STATUS Conv_2_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 29)); |
| 2043 | printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Overrun\t%lu\n", BIT(dword, 30)); |
| 2044 | printf("AUD_HDMI_FIFO_STATUS Conv_3_CDCLK/DOTCLK_FIFO_Underrun\t%lu\n", BIT(dword, 31)); |
| 2045 | } |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2046 | |
Mengdong Lin | f075c3c | 2013-08-13 00:22:14 -0400 | [diff] [blame] | 2047 | static void parse_bdw_audio_chicken_bit_reg(uint32_t dword) |
| 2048 | { |
| 2049 | printf("\t"); |
| 2050 | printf("%s\n\t", OPNAME(vanilla_dp12_en, BIT(dword, 31))); |
| 2051 | printf("%s\n\t", OPNAME(vanilla_3_widgets_en, BIT(dword, 30))); |
| 2052 | printf("%s\n\t", OPNAME(block_audio, BIT(dword, 10))); |
| 2053 | printf("%s\n\t", OPNAME(dis_eld_valid_pulse_trans, BIT(dword, 9))); |
| 2054 | printf("%s\n\t", OPNAME(dis_pd_pulse_trans, BIT(dword, 8))); |
| 2055 | printf("%s\n\t", OPNAME(dis_ts_delta_err, BIT(dword, 7))); |
| 2056 | printf("%s\n\t", OPNAME(dis_ts_fix_dp_hbr, BIT(dword, 6))); |
| 2057 | printf("%s\n\t", OPNAME(pattern_gen_8_ch_en, BIT(dword, 5))); |
| 2058 | printf("%s\n\t", OPNAME(pattern_gen_2_ch_en, BIT(dword, 4))); |
| 2059 | printf("%s\n\t", OPNAME(fabric_32_44_dis, BIT(dword, 3))); |
| 2060 | printf("%s\n\t", OPNAME(epss_dis, BIT(dword, 2))); |
| 2061 | printf("%s\n\t", OPNAME(ts_test_mode, BIT(dword, 1))); |
| 2062 | printf("%s\n", OPNAME(en_mmio_program, BIT(dword, 0))); |
| 2063 | } |
| 2064 | |
Mengdong Lin | 69cc00b | 2013-07-17 13:29:17 -0400 | [diff] [blame] | 2065 | /* Dump audio registers for Haswell and its successors (eg. Broadwell). |
| 2066 | * Their register layout are same in the north display engine. |
| 2067 | */ |
| 2068 | static void dump_hsw_plus(void) |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2069 | { |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2070 | uint32_t dword; |
Mengdong Lin | 97e5cf6 | 2013-08-13 00:22:24 -0400 | [diff] [blame] | 2071 | int i; |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2072 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2073 | /* HSW DDI Buffer */ |
| 2074 | dump_reg(DDI_BUF_CTL_A, "DDI Buffer Controler A"); |
| 2075 | dump_reg(DDI_BUF_CTL_B, "DDI Buffer Controler B"); |
| 2076 | dump_reg(DDI_BUF_CTL_C, "DDI Buffer Controler C"); |
| 2077 | dump_reg(DDI_BUF_CTL_D, "DDI Buffer Controler D"); |
| 2078 | dump_reg(DDI_BUF_CTL_E, "DDI Buffer Controler E"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2079 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2080 | /* HSW Pipe Function */ |
| 2081 | dump_reg(PIPE_CONF_A, "PIPE Configuration A"); |
| 2082 | dump_reg(PIPE_CONF_B, "PIPE Configuration B"); |
| 2083 | dump_reg(PIPE_CONF_C, "PIPE Configuration C"); |
| 2084 | dump_reg(PIPE_CONF_EDP, "PIPE Configuration EDP"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2085 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2086 | dump_reg(PIPE_DDI_FUNC_CTL_A, "PIPE DDI Function Control A"); |
| 2087 | dump_reg(PIPE_DDI_FUNC_CTL_B, "PIPE DDI Function Control B"); |
| 2088 | dump_reg(PIPE_DDI_FUNC_CTL_C, "PIPE DDI Function Control C"); |
| 2089 | dump_reg(PIPE_DDI_FUNC_CTL_EDP, "PIPE DDI Function Control EDP"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2090 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2091 | /* HSW Display port */ |
| 2092 | dump_reg(DP_TP_CTL_A, "DisplayPort Transport A Control"); |
| 2093 | dump_reg(DP_TP_CTL_B, "DisplayPort Transport B Control"); |
| 2094 | dump_reg(DP_TP_CTL_C, "DisplayPort Transport C Control"); |
| 2095 | dump_reg(DP_TP_CTL_D, "DisplayPort Transport D Control"); |
| 2096 | dump_reg(DP_TP_CTL_E, "DisplayPort Transport E Control"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2097 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2098 | dump_reg(DP_TP_ST_A, "DisplayPort Transport A Status"); |
| 2099 | dump_reg(DP_TP_ST_B, "DisplayPort Transport B Status"); |
| 2100 | dump_reg(DP_TP_ST_C, "DisplayPort Transport C Status"); |
| 2101 | dump_reg(DP_TP_ST_D, "DisplayPort Transport D Status"); |
| 2102 | dump_reg(DP_TP_ST_E, "DisplayPort Transport E Status"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2103 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2104 | /* HSW North Display Audio */ |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2105 | dump_reg(AUD_TCA_CONFIG, "Audio Configuration - Transcoder A"); |
| 2106 | dump_reg(AUD_TCB_CONFIG, "Audio Configuration - Transcoder B"); |
| 2107 | dump_reg(AUD_TCC_CONFIG, "Audio Configuration - Transcoder C"); |
| 2108 | dump_reg(AUD_C1_MISC_CTRL, "Audio Converter 1 MISC Control"); |
| 2109 | dump_reg(AUD_C2_MISC_CTRL, "Audio Converter 2 MISC Control"); |
| 2110 | dump_reg(AUD_C3_MISC_CTRL, "Audio Converter 3 MISC Control"); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2111 | dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID"); |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2112 | dump_reg(AUD_RID, "Audio Revision ID"); |
| 2113 | dump_reg(AUD_TCA_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder A"); |
| 2114 | dump_reg(AUD_TCB_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder B"); |
| 2115 | dump_reg(AUD_TCC_M_CTS_ENABLE, "Audio M & CTS Programming Enable - Transcoder C"); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2116 | dump_reg(AUD_PWRST, "Audio Power State (Function Group, Convertor, Pin Widget)"); |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2117 | dump_reg(AUD_TCA_EDID_DATA, "Audio EDID Data Block - Transcoder A"); |
| 2118 | dump_reg(AUD_TCB_EDID_DATA, "Audio EDID Data Block - Transcoder B"); |
| 2119 | dump_reg(AUD_TCC_EDID_DATA, "Audio EDID Data Block - Transcoder C"); |
| 2120 | dump_reg(AUD_TCA_INFOFR, "Audio Widget Data Island Packet - Transcoder A"); |
| 2121 | dump_reg(AUD_TCB_INFOFR, "Audio Widget Data Island Packet - Transcoder B"); |
| 2122 | dump_reg(AUD_TCC_INFOFR, "Audio Widget Data Island Packet - Transcoder C"); |
| 2123 | dump_reg(AUD_PIPE_CONV_CFG, "Audio Pipe and Converter Configs"); |
| 2124 | dump_reg(AUD_C1_DIG_CNVT, "Audio Digital Converter - Converter 1"); |
| 2125 | dump_reg(AUD_C2_DIG_CNVT, "Audio Digital Converter - Converter 2"); |
| 2126 | dump_reg(AUD_C3_DIG_CNVT, "Audio Digital Converter - Converter 3"); |
| 2127 | dump_reg(AUD_C1_STR_DESC, "Audio Stream Descriptor Format - Converter 1"); |
| 2128 | dump_reg(AUD_C2_STR_DESC, "Audio Stream Descriptor Format - Converter 2"); |
| 2129 | dump_reg(AUD_C3_STR_DESC, "Audio Stream Descriptor Format - Converter 3"); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2130 | dump_reg(AUD_OUT_CHAN_MAP, "Audio Output Channel Mapping"); |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2131 | dump_reg(AUD_TCA_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder A"); |
| 2132 | dump_reg(AUD_TCB_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder B"); |
| 2133 | dump_reg(AUD_TCC_PIN_PIPE_CONN_ENTRY_LNGTH, "Audio Connection List entry and Length - Transcoder C"); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2134 | dump_reg(AUD_PIPE_CONN_SEL_CTRL, "Audio Pipe Connection Select Control"); |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2135 | dump_reg(AUD_TCA_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder A"); |
| 2136 | dump_reg(AUD_TCB_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder B"); |
| 2137 | dump_reg(AUD_TCC_DIP_ELD_CTRL_ST, "Audio DIP and ELD control state - Transcoder C"); |
| 2138 | dump_reg(AUD_PIN_ELD_CP_VLD, "Audio pin ELD valid and CP ready status"); |
| 2139 | dump_reg(AUD_HDMI_FIFO_STATUS, "Audio HDMI FIFO Status"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2140 | |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 2141 | /* Audio debug registers */ |
| 2142 | dump_reg(AUD_ICOI, "Audio Immediate Command Output Interface"); |
| 2143 | dump_reg(AUD_IRII, "Audio Immediate Response Input Interface"); |
| 2144 | dump_reg(AUD_ICS, "Audio Immediate Command Status"); |
Mengdong Lin | f075c3c | 2013-08-13 00:22:14 -0400 | [diff] [blame] | 2145 | dump_reg(AUD_CHICKENBIT_REG, "Audio Chicken Bit Register"); |
Mengdong Lin | 97e5cf6 | 2013-08-13 00:22:24 -0400 | [diff] [blame] | 2146 | dump_reg(AUD_DP_DIP_STATUS, "Audio DP and DIP FIFO Debug Status"); |
Mengdong Lin | e35126d | 2013-08-13 00:22:33 -0400 | [diff] [blame] | 2147 | dump_reg(AUD_TCA_M_CTS, "Audio M CTS Read Back Transcoder A"); |
| 2148 | dump_reg(AUD_TCB_M_CTS, "Audio M CTS Read Back Transcoder B"); |
| 2149 | dump_reg(AUD_TCC_M_CTS, "Audio M CTS Read Back Transcoder C"); |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 2150 | |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2151 | printf("\nDetails:\n\n"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2152 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2153 | dump_ddi_buf_ctl(PORT_A); |
| 2154 | dump_ddi_buf_ctl(PORT_B); |
| 2155 | dump_ddi_buf_ctl(PORT_C); |
| 2156 | dump_ddi_buf_ctl(PORT_D); |
| 2157 | dump_ddi_buf_ctl(PORT_E); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2158 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2159 | dump_ddi_func_ctl(PIPE_A); |
| 2160 | dump_ddi_func_ctl(PIPE_B); |
| 2161 | dump_ddi_func_ctl(PIPE_C); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2162 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2163 | /* audio configuration - details */ |
| 2164 | dump_aud_transcoder_config(TRANSCODER_A); |
| 2165 | dump_aud_transcoder_config(TRANSCODER_B); |
| 2166 | dump_aud_transcoder_config(TRANSCODER_C); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2167 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2168 | dump_aud_misc_control(CONVERTER_1); |
| 2169 | dump_aud_misc_control(CONVERTER_2); |
| 2170 | dump_aud_misc_control(CONVERTER_3); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2171 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2172 | dump_aud_vendor_device_id(); |
| 2173 | dump_aud_revision_id(); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2174 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2175 | dump_aud_m_cts_enable(TRANSCODER_A); |
| 2176 | dump_aud_m_cts_enable(TRANSCODER_B); |
| 2177 | dump_aud_m_cts_enable(TRANSCODER_C); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2178 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2179 | dump_aud_power_state(); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2180 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2181 | dump_aud_edid_data(TRANSCODER_A); |
| 2182 | dump_aud_edid_data(TRANSCODER_B); |
| 2183 | dump_aud_edid_data(TRANSCODER_C); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2184 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2185 | dump_aud_infoframe(TRANSCODER_A); |
| 2186 | dump_aud_infoframe(TRANSCODER_B); |
| 2187 | dump_aud_infoframe(TRANSCODER_C); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2188 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2189 | dump_aud_pipe_conv_cfg(); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2190 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2191 | dump_aud_dig_cnvt(CONVERTER_1); |
| 2192 | dump_aud_dig_cnvt(CONVERTER_2); |
| 2193 | dump_aud_dig_cnvt(CONVERTER_3); |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2194 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2195 | dump_aud_str_desc(CONVERTER_1); |
| 2196 | dump_aud_str_desc(CONVERTER_2); |
| 2197 | dump_aud_str_desc(CONVERTER_3); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2198 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2199 | dump_aud_out_chan_map(); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2200 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2201 | dump_aud_connect_list_entry_length(TRANSCODER_A); |
| 2202 | dump_aud_connect_list_entry_length(TRANSCODER_B); |
| 2203 | dump_aud_connect_list_entry_length(TRANSCODER_C); |
| 2204 | dump_aud_connect_select_ctrl(); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2205 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2206 | dump_aud_dip_eld_ctrl_st(TRANSCODER_A); |
| 2207 | dump_aud_dip_eld_ctrl_st(TRANSCODER_B); |
| 2208 | dump_aud_dip_eld_ctrl_st(TRANSCODER_C); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2209 | |
Mengdong Lin | deba868 | 2013-09-09 15:38:40 -0400 | [diff] [blame] | 2210 | dump_aud_eld_cp_vld(); |
| 2211 | dump_hdmi_fifo_status(); |
Mengdong Lin | 8535720 | 2013-08-13 00:21:57 -0400 | [diff] [blame] | 2212 | |
| 2213 | printf("\nDetails:\n\n"); |
| 2214 | |
| 2215 | printf("IRV [%1lx] %s\t", BIT(dword, 1), |
| 2216 | OPNAME(immed_result_valid, BIT(dword, 1))); |
| 2217 | printf("ICB [%1lx] %s\n", BIT(dword, 1), |
| 2218 | OPNAME(immed_cmd_busy, BIT(dword, 0))); |
Mengdong Lin | f075c3c | 2013-08-13 00:22:14 -0400 | [diff] [blame] | 2219 | |
| 2220 | dword = INREG(AUD_CHICKENBIT_REG); |
| 2221 | printf("AUD_CHICKENBIT_REG Audio Chicken Bits: %08x\n", dword); |
| 2222 | if (IS_BROADWELL(devid)) |
| 2223 | parse_bdw_audio_chicken_bit_reg(dword); |
| 2224 | |
Mengdong Lin | 97e5cf6 | 2013-08-13 00:22:24 -0400 | [diff] [blame] | 2225 | dword = INREG(AUD_DP_DIP_STATUS); |
| 2226 | printf("AUD_DP_DIP_STATUS Audio DP & DIP FIFO Status: %08x\n\t", dword); |
| 2227 | for (i = 31; i >= 0; i--) |
| 2228 | if (BIT(dword, i)) |
| 2229 | printf("%s\n\t", audio_dp_dip_status[i]); |
| 2230 | printf("\n"); |
Wang Xingchao | c407722 | 2012-08-15 16:13:38 +0800 | [diff] [blame] | 2231 | } |
| 2232 | |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 2233 | int main(int argc, char **argv) |
| 2234 | { |
| 2235 | struct pci_device *pci_dev; |
| 2236 | |
| 2237 | pci_dev = intel_get_pci_device(); |
| 2238 | devid = pci_dev->device_id; /* XXX not true when mapping! */ |
| 2239 | |
| 2240 | do_self_tests(); |
| 2241 | |
| 2242 | if (argc == 2) |
| 2243 | intel_map_file(argv[1]); |
| 2244 | else |
| 2245 | intel_get_mmio(pci_dev); |
| 2246 | |
Mengdong Lin | 69cc00b | 2013-07-17 13:29:17 -0400 | [diff] [blame] | 2247 | if (IS_BROADWELL(devid) || IS_HASWELL(devid)) { |
| 2248 | printf("%s audio registers:\n\n", |
| 2249 | IS_BROADWELL(devid) ? "Broadwell" : "Haswell"); |
| 2250 | dump_hsw_plus(); |
| 2251 | } else if (IS_GEN6(devid) || IS_GEN7(devid) |
| 2252 | || getenv("HAS_PCH_SPLIT")) { |
Wu Fengguang | 6fcb5cd | 2011-11-12 11:12:49 +0800 | [diff] [blame] | 2253 | printf("%s audio registers:\n\n", |
Mengdong Lin | 3c7dc5c | 2013-09-09 15:38:32 -0400 | [diff] [blame] | 2254 | IS_GEN6(devid) ? "SandyBridge" : "IvyBridge"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 2255 | intel_check_pch(); |
| 2256 | dump_cpt(); |
Wu Fengguang | 6fcb5cd | 2011-11-12 11:12:49 +0800 | [diff] [blame] | 2257 | } else if (IS_GEN5(devid)) { |
| 2258 | printf("Ironlake audio registers:\n\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 2259 | dump_ironlake(); |
Wu Fengguang | 6fcb5cd | 2011-11-12 11:12:49 +0800 | [diff] [blame] | 2260 | } else if (IS_G4X(devid)) { |
| 2261 | printf("G45 audio registers:\n\n"); |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 2262 | dump_eaglelake(); |
Wu Fengguang | 6fcb5cd | 2011-11-12 11:12:49 +0800 | [diff] [blame] | 2263 | } |
Wu Fengguang | 020abdb | 2010-04-19 13:13:06 +0800 | [diff] [blame] | 2264 | |
| 2265 | return 0; |
Wu Fengguang | 9e9c9f2 | 2009-11-06 11:06:22 +0800 | [diff] [blame] | 2266 | } |