From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 02/10] spi: spi-mem: Add debug message for spi-mem ops
Date: Fri, 2 Apr 2021 19:05:07 -0400 [thread overview]
Message-ID: <20210402230515.177825-3-seanga2@gmail.com> (raw)
In-Reply-To: <20210402230515.177825-1-seanga2@gmail.com>
This prints some basic metadata about the SPI memory op. This information
may be used to debug SPI drivers (e.g. determining the expected SPI mode).
It is also helpful for verifying that the data on the wire matches the data
intended to be transmitted (e.g. with a logic analyzer). The opcode is
printed with a format of %02Xh to match the notation commonly used in flash
datasheets.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
---
(no changes since v2)
Changes in v2:
- Add more information to exec_op debug message
drivers/spi/spi-mem.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index c095ae9505..6772367ef7 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -220,6 +220,13 @@ int spi_mem_exec_op(struct spi_slave *slave, const struct spi_mem_op *op)
int ret;
int i;
+ dev_dbg(slave->dev,
+ "exec %02Xh %u-%u-%u addr=%llx dummy cycles=%u data bytes=%u\n",
+ op->cmd.opcode, op->cmd.buswidth, op->addr.buswidth,
+ op->data.buswidth, op->addr.val,
+ op->dummy.buswidth ? op->dummy.nbytes * 8 / op->dummy.buswidth : 0,
+ op->data.nbytes);
+
if (!spi_mem_supports_op(slave, op))
return -ENOTSUPP;
--
2.31.0
next prev parent reply other threads:[~2021-04-02 23:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-02 23:05 [PATCH v2 00/10] spi: dw: Add support for DUAL/QUAD/OCTAL modes Sean Anderson
2021-04-02 23:05 ` [PATCH v2 01/10] mtd: spi-mem: Export spi_mem_default_supports_op Sean Anderson
2021-04-02 23:05 ` Sean Anderson [this message]
2021-04-02 23:05 ` [PATCH v2 03/10] spi: dw: Log status register on timeout Sean Anderson
2021-04-02 23:05 ` [PATCH v2 04/10] spi: dw: Actually mask interrupts Sean Anderson
2021-04-02 23:05 ` [PATCH v2 05/10] spi: dw: Switch to capabilities Sean Anderson
2021-04-02 23:05 ` [PATCH v2 06/10] spi: dw: Rewrite poll_transfer logic Sean Anderson
2021-04-05 0:47 ` Damien Le Moal
2021-04-05 1:11 ` Sean Anderson
2021-04-02 23:05 ` [PATCH v2 07/10] spi: dw: Add ENHANCED cap Sean Anderson
2021-04-02 23:05 ` [PATCH v2 08/10] spi: dw: Define registers for enhanced mode Sean Anderson
2021-04-02 23:05 ` [PATCH v2 09/10] spi: dw: Support enhanced SPI Sean Anderson
2021-04-02 23:05 ` [PATCH v2 10/10] spi: dw: Support clock stretching Sean Anderson
2021-04-02 23:07 ` [PATCH v2 00/10] spi: dw: Add support for DUAL/QUAD/OCTAL modes Sean Anderson
2021-04-19 7:06 ` Jagan Teki
2021-04-19 13:19 ` Sean Anderson
2021-04-19 13:45 ` Jagan Teki
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=20210402230515.177825-3-seanga2@gmail.com \
--to=seanga2@gmail.com \
--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