Skip to content

Commit 8988ba7

Browse files
legoaterbroonie
authored andcommitted
spi: aspeed: Add dev_dbg() to dump the spi-mem direct mapping descriptor
The default value of the control register is set using the direct mapping information passed to the ->dirmap_create() handler. Dump the mapping range and the SPI memory operation characteristics to analyze how the register value has been computed. spi-aspeed-smc 1e630000.spi: CE0 read dirmap [ 0x00000000 - 0x04000000 ] OP 0x6c mode:1.1.1.4 naddr:0x4 ndummies:0x1 ... spi-aspeed-smc 1e630000.spi: CE0 write dirmap [ 0x00000000 - 0x04000000 ] OP 0x12 mode:1.1.0.1 naddr:0x4 ndummies:0x0 Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/20220622161617.3719096-2-clg@kaod.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 419bc8f commit 8988ba7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/spi/spi-aspeed-smc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,14 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)
558558
u32 ctl_val;
559559
int ret = 0;
560560

561+
dev_dbg(aspi->dev,
562+
"CE%d %s dirmap [ 0x%.8llx - 0x%.8llx ] OP %#x mode:%d.%d.%d.%d naddr:%#x ndummies:%#x\n",
563+
chip->cs, op->data.dir == SPI_MEM_DATA_IN ? "read" : "write",
564+
desc->info.offset, desc->info.offset + desc->info.length,
565+
op->cmd.opcode, op->cmd.buswidth, op->addr.buswidth,
566+
op->dummy.buswidth, op->data.buswidth,
567+
op->addr.nbytes, op->dummy.nbytes);
568+
561569
chip->clk_freq = desc->mem->spi->max_speed_hz;
562570

563571
/* Only for reads */

0 commit comments

Comments
 (0)