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