<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2022, at 4:57 AM, Cédric Le Goater <<a href="mailto:clg@kaod.org" class="">clg@kaod.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 6/13/22 10:39, Pratyush Yadav wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">On 11/06/22 12:39PM, Cédric Le Goater wrote:<br class=""><blockquote type="cite" class="">When using the normal read operation for data transfers, the dummy bus<br class="">width is zero. In that case, they are no dummy bytes to transfer and<br class="">setting the dummy field in the controller register becomes useless.<br class=""><br class="">Issue was found on a custom "Bifrost" board with a AST2500 SoC and<br class="">using a MX25L51245GMI-08G SPI Flash.<br class=""><br class="">Cc: Chin-Ting Kuo <<a href="mailto:chin-ting_kuo@aspeedtech.com" class="">chin-ting_kuo@aspeedtech.com</a>><br class="">Reported-by: Ian Woloschin <<a href="mailto:ian.woloschin@akamai.com" class="">ian.woloschin@akamai.com</a>><br class="">Fixes: 54613fc6659b ("spi: aspeed: Add support for direct mapping")<br class="">Signed-off-by: Cédric Le Goater <<a href="mailto:clg@kaod.org" class="">clg@kaod.org</a>><br class="">---<br class="">drivers/spi/spi-aspeed-smc.c | 12 +++++++++++-<br class="">1 file changed, 11 insertions(+), 1 deletion(-)<br class=""><br class="">diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c<br class="">index 496f3e1e9079..3e891bf22470 100644<br class="">--- a/drivers/spi/spi-aspeed-smc.c<br class="">+++ b/drivers/spi/spi-aspeed-smc.c<br class="">@@ -558,6 +558,14 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>u32 ctl_val;<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>int ret = 0;<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span>dev_dbg(aspi->dev,<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>"CE%d %s dirmap [ 0x%.8llx - 0x%.8llx ] OP %#x mode:%d.%d.%d.%d naddr:%#x ndummies:%#x\n",<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>chip->cs, op->data.dir == SPI_MEM_DATA_IN ? "read" : "write",<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>desc->info.offset, desc->info.offset + desc->info.length,<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>op->cmd.opcode, op->cmd.buswidth, op->addr.buswidth,<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>op->dummy.buswidth, op->data.buswidth,<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>op->addr.nbytes, op->dummy.nbytes);<br class="">+<br class=""></blockquote>Unrelated change. Please send as a separate patch.<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">OK.</span><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>chip->clk_freq = desc->mem->spi->max_speed_hz;<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>/* Only for reads */<br class="">@@ -574,9 +582,11 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>ctl_val = readl(chip->ctl) & ~CTRL_IO_CMD_MASK;<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>ctl_val |= aspeed_spi_get_io_mode(op) |<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>op->cmd.opcode << CTRL_COMMAND_SHIFT |<br class="">-<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth) |<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>CTRL_IO_MODE_READ;<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span>if (op->dummy.nbytes)<br class="">+<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>ctl_val |= CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth);<br class="">+<br class=""></blockquote>LGTM. With the above fixed,<br class=""><br class="">Reviewed-by: Pratyush Yadav <<a href="mailto:p.yadav@ti.com" class="">p.yadav@ti.com</a>><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thanks,</span><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">C.</span><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>I tested just the relevant change and it fixed my problem, allowing my board to boot.</div><div><br class=""></div><div>Tested-by: Ian Woloschin <<a href="mailto:iwolosch@akamai.com" class="">iwolosch@akamai.com</a>></div><div><br class=""></div><div>Thanks!</div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: RecMonoDuotone-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>/* Tune 4BYTE address mode */<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>if (op->addr.nbytes) {<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>u32 addr_mode = readl(aspi->regs + CE_CTRL_REG);<br class="">--<span class="Apple-converted-space"> </span><br class="">2.35.3</blockquote></blockquote></div></blockquote></div><br class=""></body></html>