From: Tomer Maimon <tmaimon77@gmail.com>
To: andrew@codeconstruct.com.au, broonie@kernel.org
Cc: openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, avifishman70@gmail.com,
tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com,
yuenn@google.com, benjaminfair@google.com
Subject: [PATCH v1] spi: npcm-fiu: support dual and quad UMA writes
Date: Tue, 9 Jun 2026 10:14:58 +0300 [thread overview]
Message-ID: <20260609071458.2692482-1-tmaimon77@gmail.com> (raw)
The manual page-program path used the UMA command byte for the
first byte of each continuation chunk. That forced command-lane
semantics onto chunked writes and blocked dual/quad payload
writes.
Switch continuation chunks to data-only UMA transactions so WDBPCK
controls the payload bus width.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
drivers/spi/spi-npcm-fiu.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index 6617751009c3..ebe3387d11f5 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -393,7 +393,7 @@ static int npcm_fiu_uma_write(struct spi_mem *mem,
{
struct npcm_fiu_spi *fiu =
spi_controller_get_devdata(mem->spi->controller);
- u32 uma_cfg = BIT(10);
+ u32 uma_cfg = cmd ? BIT(10) : 0;
u32 data_reg[4] = {0};
u32 val;
u32 i;
@@ -403,8 +403,11 @@ static int npcm_fiu_uma_write(struct spi_mem *mem,
(spi_get_chipselect(mem->spi, 0) <<
NPCM_FIU_UMA_CTS_DEV_NUM_SHIFT));
- regmap_update_bits(fiu->regmap, NPCM_FIU_UMA_CMD,
- NPCM_FIU_UMA_CMD_CMD, cmd);
+ if (cmd)
+ regmap_update_bits(fiu->regmap, NPCM_FIU_UMA_CMD,
+ NPCM_FIU_UMA_CMD_CMD, cmd);
+ else
+ uma_cfg |= ilog2(op->data.buswidth) << NPCM_FIU_UMA_CFG_WDBPCK_SHIFT;
if (data_size) {
memcpy(data_reg, data, data_size);
@@ -464,8 +467,7 @@ static int npcm_fiu_manualwrite(struct spi_mem *mem,
/* Starting the data writing loop in multiples of 8 */
for (idx = 0; idx < num_data_chunks; ++idx) {
- ret = npcm_fiu_uma_write(mem, op, data[0], false,
- &data[1], CHUNK_SIZE - 1);
+ ret = npcm_fiu_uma_write(mem, op, 0, false, &data[0], CHUNK_SIZE);
if (ret)
return ret;
@@ -474,8 +476,7 @@ static int npcm_fiu_manualwrite(struct spi_mem *mem,
/* Handling chunk remains */
if (remain_data > 0) {
- ret = npcm_fiu_uma_write(mem, op, data[0], false,
- &data[1], remain_data - 1);
+ ret = npcm_fiu_uma_write(mem, op, 0, false, &data[0], remain_data);
if (ret)
return ret;
}
--
2.34.1
reply other threads:[~2026-06-09 7:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260609071458.2692482-1-tmaimon77@gmail.com \
--to=tmaimon77@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=tali.perry1@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.com \
/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