public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Cc: Bin Meng <bmeng.cn@gmail.com>
Subject: [PATCH v1 2/2] x86: scu: Add a few debug messages to the driver
Date: Tue,  9 Nov 2021 15:02:55 +0300	[thread overview]
Message-ID: <20211109120255.77679-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20211109120255.77679-1-andriy.shevchenko@linux.intel.com>

For some devices that have slightly different firmware implementation
it's good to see what's going on when communicating with the SCU. Add
a few debug messages for that purpose.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/lib/scu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/lib/scu.c b/arch/x86/lib/scu.c
index 90ef239bcd3d..c7274e064647 100644
--- a/arch/x86/lib/scu.c
+++ b/arch/x86/lib/scu.c
@@ -11,6 +11,7 @@
  */
 #include <common.h>
 #include <dm.h>
+#include <hexdump.h>
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/cpu.h>
@@ -48,6 +49,7 @@ struct scu {
  */
 static void scu_ipc_send_command(struct ipc_regs *regs, u32 cmd)
 {
+	debug("%s(): 0x%08x\n", __func__, cmd);
 	writel(cmd, &regs->cmd);
 }
 
@@ -92,12 +94,18 @@ static int scu_ipc_cmd(struct ipc_regs *regs, u32 cmd, u32 sub,
 	for (i = 0; i < inlen; i++)
 		writel(*in++, &regs->wbuf[i]);
 
+	debug_hex_dump("SCU in", DUMP_PREFIX_OFFSET, 16, 4, in, inlen * 4, false);
+
 	scu_ipc_send_command(regs, (inlen << 16) | (sub << 12) | cmd);
 	err = scu_ipc_check_status(regs);
 
 	if (!err) {
+		u32 *buf = out;
+
 		for (i = 0; i < outlen; i++)
 			*out++ = readl(&regs->rbuf[i]);
+
+		debug_hex_dump("SCU out", DUMP_PREFIX_OFFSET, 16, 4, buf, outlen * 4, false);
 	}
 
 	return err;
-- 
2.33.0


  reply	other threads:[~2021-11-09 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 12:02 [PATCH v1 1/2] hexdump: Introduce debug APIs Andy Shevchenko
2021-11-09 12:02 ` Andy Shevchenko [this message]
2021-11-13 18:14   ` [PATCH v1 2/2] x86: scu: Add a few debug messages to the driver Simon Glass
2021-11-13 18:14 ` [PATCH v1 1/2] hexdump: Introduce debug APIs Simon Glass
2022-03-30  9:30   ` Andy Shevchenko
2022-03-30 15:54     ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211109120255.77679-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bmeng.cn@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox