[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220712163823.428126-3-sudip.mukherjee@sifive.com>
Date: Tue, 12 Jul 2022 17:38:22 +0100
From: Sudip Mukherjee <sudip.mukherjee@...ive.com>
To: Tudor Ambarus <tudor.ambarus@...rochip.com>,
Pratyush Yadav <p.yadav@...com>,
Michael Walle <michael@...le.cc>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>
Cc: greentime.hu@...ive.com, jude.onyenegecha@...ive.com,
william.salmon@...ive.com, adnan.chowdhury@...ive.com,
ben.dooks@...ive.com, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Sudip Mukherjee <sudip.mukherjee@...ive.com>
Subject: [PATCH 2/3] mtd: spi-nor: add support for Quad Page Program to no_sfdp_flags
Some flash chips which does not have a SFDP table can support Quad
Input Page Program. Enable it in hwcaps if defined.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ive.com>
---
drivers/mtd/spi-nor/core.c | 5 +++++
drivers/mtd/spi-nor/core.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index e5f7691c5bd40..e299fc8fdd3d4 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -2375,6 +2375,11 @@ static void spi_nor_no_sfdp_init_params(struct spi_nor *nor)
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP_8_8_8_DTR],
SPINOR_OP_PP, SNOR_PROTO_8_8_8_DTR);
}
+ if (no_sfdp_flags & SPI_NOR_QUAD_PP) {
+ params->hwcaps.mask |= SNOR_HWCAPS_PP_1_1_4;
+ spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP_1_1_4],
+ SPINOR_OP_PP_1_1_4, SNOR_PROTO_1_1_4);
+ }
/*
* Sector Erase settings. Sort Erase Types in ascending order, with the
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index 58fbedc94080f..dde636bdb1a7c 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -462,6 +462,7 @@ struct spi_nor_fixups {
* SPI_NOR_OCTAL_READ: flash supports Octal Read.
* SPI_NOR_OCTAL_DTR_READ: flash supports octal DTR Read.
* SPI_NOR_OCTAL_DTR_PP: flash supports Octal DTR Page Program.
+ * SPI_NOR_QUAD_PP: flash supports Quad Input Page Program.
*
* @fixup_flags: flags that indicate support that can be discovered via SFDP
* ideally, but can not be discovered for this particular flash
@@ -509,6 +510,7 @@ struct flash_info {
#define SPI_NOR_OCTAL_READ BIT(5)
#define SPI_NOR_OCTAL_DTR_READ BIT(6)
#define SPI_NOR_OCTAL_DTR_PP BIT(7)
+#define SPI_NOR_QUAD_PP BIT(8)
u8 fixup_flags;
#define SPI_NOR_4B_OPCODES BIT(0)
--
2.30.2
Powered by blists - more mailing lists