diff mbox series

[RFC,2/3] spi-nor: Add INFO_PGZ

Message ID 20201018213103.28798-2-richard@nod.at
State RFC
Delegated to: Vignesh R
Headers show
Series [RFC,1/3] spi-nor: Add SPI_NOR_NO_WIP | expand

Commit Message

Richard Weinberger Oct. 18, 2020, 9:31 p.m. UTC
Allow much larger page sizes than just 256 bytes.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/spi-nor/core.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index 621202fda5d0..76c3f8ef47e9 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -268,7 +268,7 @@  struct flash_info {
 	unsigned	sector_size;
 	u16		n_sectors;
 
-	u16		page_size;
+	u32		page_size;
 	u16		addr_width;
 
 	u32		flags;
@@ -319,7 +319,7 @@  struct flash_info {
 };
 
 /* Used when the "_ext_id" is two bytes at most */
-#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)	\
+#define INFO_PGZ(_jedec_id, _ext_id, _sector_size, _n_sectors, _page_size, _flags)	\
 		.id = {							\
 			((_jedec_id) >> 16) & 0xff,			\
 			((_jedec_id) >> 8) & 0xff,			\
@@ -330,9 +330,12 @@  struct flash_info {
 		.id_len = (!(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0))),	\
 		.sector_size = (_sector_size),				\
 		.n_sectors = (_n_sectors),				\
-		.page_size = 256,					\
+		.page_size = (_page_size),				\
 		.flags = (_flags),
 
+#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)	\
+	INFO_PGZ(_jedec_id, _ext_id, _sector_size, _n_sectors, 256, _flags)
+
 #define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)	\
 		.id = {							\
 			((_jedec_id) >> 16) & 0xff,			\