From patchwork Mon Dec 21 15:05:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 7896471 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64FA89F318 for ; Mon, 21 Dec 2015 15:06:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 916BD20502 for ; Mon, 21 Dec 2015 15:06:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 744D32055C for ; Mon, 21 Dec 2015 15:06:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E709D6E468; Mon, 21 Dec 2015 07:06:07 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 0111B6E468 for ; Mon, 21 Dec 2015 07:06:05 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 21 Dec 2015 07:06:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,459,1444719600"; d="scan'208";a="878268549" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 21 Dec 2015 07:06:03 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Mon, 21 Dec 2015 17:05:55 +0200 Message-Id: <1450710356-9594-4-git-send-email-jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450710356-9594-1-git-send-email-jani.nikula@intel.com> References: <1450710356-9594-1-git-send-email-jani.nikula@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: jani.nikula@intel.com Subject: [Intel-gfx] [i-g-t PATCH 4/5] intel_bios_reader: improve element dumpers X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Try to print something useful and helpful for the user. Signed-off-by: Jani Nikula --- tools/intel_bios_reader.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c index 1b1cb6bc8ebf..7c3e1bcaa387 100644 --- a/tools/intel_bios_reader.c +++ b/tools/intel_bios_reader.c @@ -851,41 +851,46 @@ static void dump_mipi_config(const struct bdb_block *block) static const uint8_t *mipi_dump_send_packet(const uint8_t *data) { - uint8_t type, byte, count; - uint16_t len; + uint8_t flags, type; + uint16_t len, i; - byte = *data++; - /* get packet type and increment the pointer */ + flags = *data++; type = *data++; - len = *((uint16_t *) data); data += 2; - printf("\t\t SEND COMMAND: "); - printf("0x%x 0x%x 0x%x", byte, type, len); - for (count = 0; count < len; count++) - printf(" 0x%x",*(data+count)); + + printf("\t\tSend DCS: Port %s, VC %d, %s, Type %02x, Length %u, Data", + (flags >> 3) & 1 ? "C" : "A", + (flags >> 1) & 3, + flags & 1 ? "HS" : "LP", + type, + len); + for (i = 0; i < len; i++) + printf(" %02x", *data++); printf("\n"); - data += len; + return data; } static const uint8_t *mipi_dump_delay(const uint8_t *data) { - printf("\t\t Delay : 0x%x 0x%x 0x%x 0x%x\n", data[0], data[1], data[2], data[3]); - data += 4; - return data; + printf("\t\tDelay: %u us\n", *((const uint32_t *)data)); + + return data + 4; } static const uint8_t *mipi_dump_gpio(const uint8_t *data) { - uint8_t gpio, action; + uint8_t index, flags; + + index = *data++; + flags = *data++; - printf("\t\t GPIO value:"); - gpio = *data++; + printf("\t\tGPIO index %u, source %d, set %d\n", + index, + (flags >> 1) & 3, + flags & 1); - /* pull up/down */ - action = *data++; - printf(" 0x%x 0x%x\n", gpio, action); return data; }