]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mtd: spinand: Use more specific naming for the program execution op
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 3 Apr 2025 09:19:22 +0000 (11:19 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 29 Apr 2025 09:05:34 +0000 (11:05 +0200)
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).

Let's clarify what the macro really means by describing the expected bus
topology in the program execution macro name.

Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
[Miquel: Fixed conflicts with -next by updating esmt and micron drivers]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/core.c
drivers/mtd/nand/spi/esmt.c
drivers/mtd/nand/spi/micron.c
include/linux/mtd/spinand.h

index 28b210a4fb1e2e26bb83d2d6029efd29641ae3f5..7099db7a62be61f563380b724ac849057a834211 100644 (file)
@@ -519,7 +519,7 @@ static int spinand_program_op(struct spinand_device *spinand,
 {
        struct nand_device *nand = spinand_to_nand(spinand);
        unsigned int row = nanddev_pos_to_row(nand, &req->pos);
-       struct spi_mem_op op = SPINAND_PROG_EXEC_OP(row);
+       struct spi_mem_op op = SPINAND_PROG_EXEC_1S_1S_0_OP(row);
 
        return spi_mem_exec_op(spinand->spimem, &op);
 }
index f7517d2730838dac2f3dbb925d474c2220d1ca3a..2b14726480f106da63d4a9840a0ca4dc722b0ebd 100644 (file)
@@ -138,7 +138,7 @@ static int f50l1g41lb_otp_lock(struct spinand_device *spinand, loff_t from,
                               size_t len)
 {
        struct spi_mem_op write_op = SPINAND_WR_EN_DIS_1S_0_0_OP(true);
-       struct spi_mem_op exec_op = SPINAND_PROG_EXEC_OP(0);
+       struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
        u8 status;
        int ret;
 
index a629c2ae10b9290af70f71a57d30b56e79a04539..5cd751435c5b6cc979e2bf0026feef788cbf18cd 100644 (file)
@@ -252,7 +252,7 @@ static int mt29f2g01abagd_otp_lock(struct spinand_device *spinand, loff_t from,
                                   size_t len)
 {
        struct spi_mem_op write_op = SPINAND_WR_EN_DIS_1S_0_0_OP(true);
-       struct spi_mem_op exec_op = SPINAND_PROG_EXEC_OP(0);
+       struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
        u8 status;
        int ret;
 
index 70f3e69e56b86fcbf37d8299766c51367cf06347..d84206b9e82436dd1211448e6ad567e0b76c584e 100644 (file)
                   SPI_MEM_DTR_OP_DATA_IN(len, buf, 4),                 \
                   SPI_MEM_OP_MAX_FREQ(freq))
 
-#define SPINAND_PROG_EXEC_OP(addr)                                     \
+#define SPINAND_PROG_EXEC_1S_1S_0_OP(addr)                             \
        SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1),                             \
                   SPI_MEM_OP_ADDR(3, addr, 1),                         \
                   SPI_MEM_OP_NO_DUMMY,                                 \