]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi: renesas: Write DREAR register once
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 31 Aug 2024 20:31:44 +0000 (22:31 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 8 Sep 2024 23:10:33 +0000 (01:10 +0200)
Instead of writing DREAR with 0 first and then overwriting DREAR again
in case of 4 byte addressing mode, write DREAR in every case once with
the correct content right away. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
drivers/spi/renesas_rpc_spi.c

index e6b602cf7b47b79e59be4ad762a12373940669bb..749c686a6c470834682958356e9dcf84d76665b9 100644 (file)
@@ -277,14 +277,15 @@ static int rpc_spi_mem_exec_op(struct spi_slave *spi,
                writel(RPC_DRCMR_CMD(op->cmd.opcode), priv->regs + RPC_DRCMR);
                smenr |= RPC_DRENR_CDE;
 
-               writel(0, priv->regs + RPC_DREAR);
                if (op->addr.nbytes == 4) {
                        writel(RPC_DREAR_EAV(offset >> 25) | RPC_DREAR_EAC(1),
                               priv->regs + RPC_DREAR);
                        smenr |= RPC_DRENR_ADE(0xF);
                } else if (op->addr.nbytes == 3) {
+                       writel(0, priv->regs + RPC_DREAR);
                        smenr |= RPC_DRENR_ADE(0x7);
                } else {
+                       writel(0, priv->regs + RPC_DREAR);
                        smenr |= RPC_DRENR_ADE(0);
                }