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.shevche...@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 via email to