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