All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 12/21] mtd: nand: Pass mode information to nand_page_io_req
Date: Thu, 12 Jul 2018 15:24:57 +0200	[thread overview]
Message-ID: <20180712132506.26359-13-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20180712132506.26359-1-miquel.raynal@bootlin.com>

From: Boris Brezillon <boris.brezillon@bootlin.com>

The NAND sub-layers are likely to need the MTD_OPS_XXX mode information
in order to decide if they should enable/disable ECC or how they should
place the OOB bytes in the provided OOB buffer.

Add a field to nand_page_io_req to pass this information.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 include/linux/mtd/nand.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ada7af4a41..13e8dd1103 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -86,6 +86,7 @@ struct nand_pos {
  * @ooboffs: the OOB offset within the page
  * @ooblen: the number of OOB bytes to read from/write to this page
  * @oobbuf: buffer to store OOB data in or get OOB data from
+ * @mode: one of the %MTD_OPS_XXX mode
  *
  * This object is used to pass per-page I/O requests to NAND sub-layers. This
  * way all useful information are already formatted in a useful way and
@@ -106,6 +107,7 @@ struct nand_page_io_req {
 		const void *out;
 		void *in;
 	} oobbuf;
+	int mode;
 };
 
 /**
@@ -599,6 +601,7 @@ static inline void nanddev_io_iter_init(struct nand_device *nand,
 {
 	struct mtd_info *mtd = nanddev_to_mtd(nand);
 
+	iter->req.mode = req->mode;
 	iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos);
 	iter->req.ooboffs = req->ooboffs;
 	iter->oobbytes_per_page = mtd_oobavail(mtd, req);
-- 
2.14.1

  parent reply	other threads:[~2018-07-12 13:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 13:24 [U-Boot] [PATCH v3 00/21] SPI-NAND support Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 01/21] mtd: Fallback to ->_read/write_oob() when ->_read/write() is missing Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 02/21] mtd: Uninline mtd_write_oob and move it to mtdcore.c Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 03/21] mtd: Add sanity checks in mtd_write/read_oob() Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 04/21] mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 05/21] mtd: add get/set of_node/flash_node helpers Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 06/21] mtd: fix build issue with includes Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 07/21] mtd: move definitions to enlarge their range Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 08/21] mtd: move all flash categories inside MTD submenu Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 09/21] mtd: move NAND files into a raw/ subdirectory Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 10/21] mtd: rename nand into rawnand in Kconfig prompt Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 11/21] mtd: nand: Add core infrastructure to deal with NAND devices Miquel Raynal
2018-07-12 13:24 ` Miquel Raynal [this message]
2018-07-12 13:24 ` [U-Boot] [PATCH v3 13/21] spi: Extend the core to ease integration of SPI memory controllers Miquel Raynal
2018-07-12 13:24 ` [U-Boot] [PATCH v3 14/21] mtd: nand: Add core infrastructure to support SPI NANDs Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 15/21] mtd: spinand: Add initial support for Micron MT29F2G01ABAGD Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 16/21] mtd: spinand: Add initial support for Winbond W25M02GV Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 17/21] mtd: spinand: Add initial support for the MX35LF1GE4AB chip Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 18/21] mtd: spinand: Add initial support for the MX35LF2GE4AB chip Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 19/21] mtd: uclass: add probe function Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 20/21] cmd: mtd: add 'mtd' command Miquel Raynal
2018-07-12 13:25 ` [U-Boot] [PATCH v3 21/21] dt-bindings: Add bindings for SPI NAND devices Miquel Raynal
2018-07-13 12:26 ` [U-Boot] [PATCH v3 00/21] SPI-NAND support 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=20180712132506.26359-13-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.