From patchwork Tue Mar 4 16:29:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Mengdong" X-Patchwork-Id: 3758701 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 585DFBF13A for ; Tue, 4 Mar 2014 03:28:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61B3E203DF for ; Tue, 4 Mar 2014 03:28:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6DD7C203DA for ; Tue, 4 Mar 2014 03:28:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C2F6FC033; Mon, 3 Mar 2014 19:28:21 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 91B0BFC033 for ; Mon, 3 Mar 2014 19:28:13 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 03 Mar 2014 19:23:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,582,1389772800"; d="scan'208";a="493546426" Received: from amanda-hsw-pc.sh.intel.com ([10.239.37.140]) by orsmga002.jf.intel.com with ESMTP; 03 Mar 2014 19:27:59 -0800 From: mengdong.lin@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 4 Mar 2014 11:29:30 -0500 Message-Id: X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: Subject: [Intel-gfx] [PATCH 7/7] intel_audio_dump: add support for Valleyview X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_12_24, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mengdong Lin This patch adds support for dumping audio registers of Valleyview, by reusing Ironlake code with a different base address and pipe number. Signed-off-by: Mengdong Lin Reviewed-by: Haihao Xiang diff --git a/tools/intel_audio_dump.c b/tools/intel_audio_dump.c index e36bb69..46eebdb 100644 --- a/tools/intel_audio_dump.c +++ b/tools/intel_audio_dump.c @@ -1748,7 +1748,7 @@ static void dump_aud_hdmi_status(void) } /* - * IronLake display registers + * Display registers of Ironlake and Valleyview */ #undef DP_CTL_B #undef DP_CTL_C @@ -1758,10 +1758,15 @@ static void dump_aud_hdmi_status(void) #define DP_CTL_C 0x4200 #define DP_CTL_D 0x4300 +/* ILK HDMI port ctrl */ #define HDMI_CTL_B 0x1140 #define HDMI_CTL_C 0x1150 #define HDMI_CTL_D 0x1160 +/* VLV HDMI port ctrl */ +#define SDVO_HDMI_CTL_B 0x1140 +#define SDVO_HDMI_CTL_C 0x1160 + static void dump_dp_port_ctrl(int port) { uint32_t dword; @@ -1787,9 +1792,14 @@ static void dump_hdmi_port_ctrl(int port) int port_ctrl; char prefix[MAX_PREFIX_SIZE]; - sprintf(prefix, "HDMI%c", 'B' + port - PORT_B); + if (IS_VALLEYVIEW(devid)) { + sprintf(prefix, "SDVO/HDMI%c", 'B' + port - PORT_B); + port_ctrl = disp_reg_base + SDVO_HDMI_CTL_B + (port - PORT_B) * 0x20; + } else { + sprintf(prefix, "HDMI%c ", 'B' + port - PORT_B); + port_ctrl = disp_reg_base + HDMI_CTL_B + (port - PORT_B) * 0x10; + } - port_ctrl = disp_reg_base + HDMI_CTL_B + (port - PORT_B) * 0x10; dword = INREG(port_ctrl); printf("%s HDMI_Enable\t\t\t\t\t%u\n", prefix, !!(dword & SDVO_ENABLE)); printf("%s Transcoder_Select\t\t\t\t%s\n", prefix, BIT(dword, 30) ? "Transcoder B" : "Transcoder A"); @@ -1807,14 +1817,24 @@ static void dump_ironlake(void) { uint32_t dword; - set_reg_base(0xe0000, 0x2000); + if (!IS_VALLEYVIEW(devid)) + set_reg_base(0xe0000, 0x2000); /* ironlake */ + else + set_reg_base(0x60000 + VLV_DISPLAY_BASE, 0x2000); + + if (!IS_VALLEYVIEW(devid)) { + dump_disp_reg(HDMI_CTL_B, "sDVO/HDMI Port B Control"); + dump_disp_reg(HDMI_CTL_C, "HDMI Port C Control"); + dump_disp_reg(HDMI_CTL_D, "HDMI Port D Control"); + } else { + dump_disp_reg(SDVO_HDMI_CTL_B, "sDVO/HDMI Port B Control"); + dump_disp_reg(SDVO_HDMI_CTL_C, "sDVO/HDMI Port C Control"); + } - dump_disp_reg(HDMI_CTL_B, "sDVO/HDMI Port B Control"); - dump_disp_reg(HDMI_CTL_C, "HDMI Port C Control"); - dump_disp_reg(HDMI_CTL_D, "HDMI Port D Control"); dump_disp_reg(DP_CTL_B, "DisplayPort B Control Register"); dump_disp_reg(DP_CTL_C, "DisplayPort C Control Register"); - dump_disp_reg(DP_CTL_D, "DisplayPort D Control Register"); + if (!IS_VALLEYVIEW(devid)) + dump_disp_reg(DP_CTL_D, "DisplayPort D Control Register"); dump_aud_reg(AUD_CONFIG_A, "Audio Configuration - Transcoder A"); dump_aud_reg(AUD_CONFIG_B, "Audio Configuration - Transcoder B"); @@ -1849,11 +1869,13 @@ static void dump_ironlake(void) dump_hdmi_port_ctrl(PORT_B); dump_hdmi_port_ctrl(PORT_C); - dump_hdmi_port_ctrl(PORT_D); + if (!IS_VALLEYVIEW(devid)) + dump_hdmi_port_ctrl(PORT_D); dump_dp_port_ctrl(PORT_B); dump_dp_port_ctrl(PORT_C); - dump_dp_port_ctrl(PORT_D); + if (!IS_VALLEYVIEW(devid)) + dump_dp_port_ctrl(PORT_D); dump_aud_config(PIPE_A); dump_aud_config(PIPE_B); @@ -2250,7 +2272,10 @@ int main(int argc, char **argv) else intel_get_mmio(pci_dev); - if (IS_BROADWELL(devid) || IS_HASWELL(devid)) { + if (IS_VALLEYVIEW(devid)) { + printf("Valleyview audio registers:\n\n"); + dump_ironlake(); + } else if (IS_BROADWELL(devid) || IS_HASWELL(devid)) { printf("%s audio registers:\n\n", IS_BROADWELL(devid) ? "Broadwell" : "Haswell"); dump_hsw_plus();