From: Cheng Ming Lin <linchengming884@gmail.com>
To: miquel.raynal@bootlin.com, vigneshr@ti.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: richard@nod.at, alvinzhou@mxic.com.tw, leoyu@mxic.com.tw,
Cheng Ming Lin <chengminglin@mxic.com.tw>
Subject: [PATCH 1/3] include/linux/mtd/spinand.h: Add fixups for spinand
Date: Wed, 10 Jul 2024 09:15:39 +0800 [thread overview]
Message-ID: <20240710011541.342682-2-linchengming884@gmail.com> (raw)
In-Reply-To: <20240710011541.342682-1-linchengming884@gmail.com>
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Add struct spi_nand_fixups as SPI NAND fixup hooks.
To determine whether the Plane Select bit should be
inserted into the column address in core.c, add the
member struct spinand_info to struct spinand_device
to ascertain whether the device has fixups.
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
include/linux/mtd/spinand.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 5c19ead60499..c079c6ac1541 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -354,6 +354,7 @@ struct spinand_info {
} op_variants;
int (*select_target)(struct spinand_device *spinand,
unsigned int target);
+ const struct spi_nand_fixups *fixups;
};
#define SPINAND_ID(__method, ...) \
@@ -379,6 +380,9 @@ struct spinand_info {
#define SPINAND_SELECT_TARGET(__func) \
.select_target = __func,
+#define SPINAND_PLANE_SELECT_BIT(__func) \
+ .fixups = __func,
+
#define SPINAND_INFO(__model, __id, __memorg, __eccreq, __op_variants, \
__flags, ...) \
{ \
@@ -398,6 +402,18 @@ struct spinand_dirmap {
struct spi_mem_dirmap_desc *rdesc_ecc;
};
+/**
+ * struct spi_nand_fixups - SPI NAND fixup hooks
+ * @write_to_cache: program load requires Plane Select bit in CADD.
+ * @read_from_cache: read from cache requires Plane Select bit in CADD.
+ */
+struct spi_nand_fixups {
+ unsigned int (*write_to_cache)(struct spinand_device *spinand,
+ const struct nand_page_io_req *req, unsigned int column);
+ u16 (*read_from_cache)(struct spinand_device *spinand,
+ const struct nand_page_io_req *req, u16 column);
+};
+
/**
* struct spinand_device - SPI NAND device instance
* @base: NAND device instance
@@ -449,6 +465,7 @@ struct spinand_device {
u8 *databuf;
u8 *oobbuf;
u8 *scratchbuf;
+ const struct spinand_info *info;
const struct spinand_manufacturer *manufacturer;
void *priv;
};
--
2.25.1
next prev parent reply other threads:[~2024-07-10 1:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 1:15 [PATCH 0/3] Add fixups for two-plane serial NAND flash Cheng Ming Lin
2024-07-10 1:15 ` Cheng Ming Lin [this message]
2024-07-10 1:15 ` [PATCH 2/3] mtd: spinand: macronix: Fixups for PLANE_SELECT_BIT Cheng Ming Lin
2024-07-10 22:09 ` kernel test robot
2024-07-10 1:15 ` [PATCH 3/3] mtd: spinand: Insert Plane Select bit for the column address Cheng Ming Lin
2024-07-17 8:16 ` [PATCH 0/3] Add fixups for two-plane serial NAND flash Miquel Raynal
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=20240710011541.342682-2-linchengming884@gmail.com \
--to=linchengming884@gmail.com \
--cc=alvinzhou@mxic.com.tw \
--cc=chengminglin@mxic.com.tw \
--cc=leoyu@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--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
all inboxes | Powered by JetHome®