From patchwork Wed Apr 17 06:09:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2452541 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id CEE76DF2A1 for ; Wed, 17 Apr 2013 06:39:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8C1DE663B for ; Tue, 16 Apr 2013 23:39:03 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id D3CD2E652C for ; Tue, 16 Apr 2013 23:07:56 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id 0877F88626; Wed, 17 Apr 2013 06:07:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable version=3.3.2 Received: from lundgren.kumite (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by shiva.localdomain (Postfix) with ESMTPSA id AEA6088013; Wed, 17 Apr 2013 06:07:15 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Apr 2013 23:09:25 -0700 Message-Id: <1366178965-12229-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.2.1 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] quick_dump: Add dpio read 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org The sample usage is in reg_access.dpio_read(). We should add some semantics to the text files to detect DPIO registers, and do the right thing. Cc: Jesse Barnes Signed-off-by: Ben Widawsky Reviewed-by: Jesse Barnes --- tools/quick_dump/Makefile.am | 3 ++- tools/quick_dump/chipset.i | 2 ++ tools/quick_dump/reg_access.py | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/quick_dump/Makefile.am b/tools/quick_dump/Makefile.am index 42ab140..afd6814 100644 --- a/tools/quick_dump/Makefile.am +++ b/tools/quick_dump/Makefile.am @@ -11,7 +11,8 @@ I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c \ $(top_srcdir)/lib/intel_drm.c \ $(top_srcdir)/lib/intel_pci.c \ $(top_srcdir)/lib/intel_reg_map.c \ - $(top_srcdir)/lib/intel_mmio.c + $(top_srcdir)/lib/intel_mmio.c \ + $(top_srcdir)/lib/intel_dpio.c chipset_wrap_python.c chipset.py: chipset.i $(SWIG) $(AX_SWIG_PYTHON_OPT) -I/usr/include -I$(top_srcdir)/lib -o $@ $< diff --git a/tools/quick_dump/chipset.i b/tools/quick_dump/chipset.i index 36e7f4c..0a15d38 100644 --- a/tools/quick_dump/chipset.i +++ b/tools/quick_dump/chipset.i @@ -14,6 +14,7 @@ extern uint32_t intel_register_write(uint32_t reg, uint32_t val); extern void intel_register_access_fini(); extern int intel_register_access_needs_wake(); extern unsigned short pcidev_to_devid(struct pci_device *pci_dev); +extern uint32_t intel_dpio_reg_read(uint32_t reg); %} extern int is_sandybridge(unsigned short pciid); @@ -26,3 +27,4 @@ extern uint32_t intel_register_write(uint32_t reg, uint32_t val); extern void intel_register_access_fini(); extern int intel_register_access_needs_wake(); extern unsigned short pcidev_to_devid(struct pci_device *pci_dev); +extern uint32_t intel_dpio_reg_read(uint32_t reg); diff --git a/tools/quick_dump/reg_access.py b/tools/quick_dump/reg_access.py index b7f3100..e2a0a95 100755 --- a/tools/quick_dump/reg_access.py +++ b/tools/quick_dump/reg_access.py @@ -27,6 +27,12 @@ def get_wake(): mt_forcewake_get() vlv_forcewake_get() +def dpio_read(reg): + reg = int(reg, 16) + val = chipset.intel_dpio_reg_read(reg) + return val + + def init(): pci_dev = chipset.intel_get_pci_device() ret = chipset.intel_register_access_init(pci_dev, 0)