linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: Richard Weinberger <richard@nod.at>,
	tudor.ambarus@microchip.com, vigneshr@ti.com,
	miquel.raynal@bootlin.com
Subject: [RFC][PATCH 2/3] spi-nor: Add INFO_PGZ
Date: Sun, 18 Oct 2020 23:31:02 +0200	[thread overview]
Message-ID: <20201018213103.28798-2-richard@nod.at> (raw)
In-Reply-To: <20201018213103.28798-1-richard@nod.at>

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 --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,			\
-- 
2.26.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-10-18 21:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-18 21:31 [RFC][PATCH 1/3] spi-nor: Add SPI_NOR_NO_WIP Richard Weinberger
2020-10-18 21:31 ` Richard Weinberger [this message]
2020-10-18 21:31 ` [RFC][PATCH 3/3] spi-nor: Speedup mb85rs1mt FRAM writes Richard Weinberger

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=20201018213103.28798-2-richard@nod.at \
    --to=richard@nod.at \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=tudor.ambarus@microchip.com \
    --cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).