linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	<linux-mtd@lists.infradead.org>
Cc: Julien Su <juliensu@mxic.com.tw>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Mason Yang <masonccyang@mxic.com.tw>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v4 09/21] mtd: rawnand: Create a new enumeration to describe properly ECC types
Date: Fri, 17 Jan 2020 22:41:39 +0100	[thread overview]
Message-ID: <20200117214151.20767-10-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20200117214151.20767-1-miquel.raynal@bootlin.com>

Now that the misleading mix between ECC engine type and OOB placement
has been addressed, add a new enumeration to properly define ECC types
(also called provider or mode).

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/nand_base.c |  7 +++++++
 include/linux/mtd/rawnand.h      | 16 ++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 0fdc9d63f259..ddd886fb92c4 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4775,6 +4775,13 @@ static const char * const nand_ecc_modes[] = {
 	[NAND_ECC_ON_DIE]	= "on-die",
 };
 
+static const char * const nand_ecc_engine_providers[] = {
+	[NAND_ECC_ENGINE_NONE] = "none",
+	[NAND_ECC_ENGINE_SOFT] = "soft",
+	[NAND_ECC_ENGINE_CONTROLLER] = "hw",
+	[NAND_ECC_ENGINE_ON_DIE] = "on-die",
+};
+
 static const char * const nand_ecc_placement[] = {
 	[NAND_ECC_PLACEMENT_INTERLEAVED] = "interleaved",
 };
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 64de0015edbd..aeef31a68c7a 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -92,6 +92,22 @@ enum nand_ecc_mode {
 	NAND_ECC_ON_DIE,
 };
 
+/**
+ * enum nand_ecc_engine_type - NAND ECC engine type/provider
+ * @NAND_ECC_ENGINE_INVALID: Invalid value
+ * @NAND_ECC_ENGINE_NONE: No ECC correction
+ * @NAND_ECC_ENGINE_SOFT: Software ECC correction
+ * @NAND_ECC_ENGINE_CONTROLLER: Hardware controller ECC correction
+ * @NAND_ECC_ENGINE_ON_DIE: On chip hardware ECC correction
+ */
+enum nand_ecc_engine_type {
+	NAND_ECC_ENGINE_INVALID,
+	NAND_ECC_ENGINE_NONE,
+	NAND_ECC_ENGINE_SOFT,
+	NAND_ECC_ENGINE_CONTROLLER,
+	NAND_ECC_ENGINE_ON_DIE,
+};
+
 /**
  * enum nand_ecc_placement - NAND ECC placement
  * @NAND_ECC_PLACEMENT_FREE: The driver can decide where to put ECC bytes.
-- 
2.20.1


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

  parent reply	other threads:[~2020-01-17 21:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 21:41 [PATCH v4 00/21] Prepare the introduction of generic ECC engines Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 01/21] mtd: Fix typo in mtd_ooblayout_set_databytes() description Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 02/21] mtd: rawnand: Avoid a typedef Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 03/21] mtd: rawnand: Drop OOB_FIRST placement scheme Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 04/21] dt-bindings: mtd: Deprecate OOB_FIRST mode Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 05/21] mtd: rawnand: Return an enum from of_get_nand_ecc_algo() Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 06/21] mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 07/21] mtd: rawnand: Create a new enumeration to describe OOB placement Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 08/21] mtd: rawnand: Separate the ECC engine type and the " Miquel Raynal
2020-01-17 21:41 ` Miquel Raynal [this message]
2020-01-17 21:41 ` [PATCH v4 10/21] mtd: rawnand: Create a helper to retrieve the ECC placement Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 11/21] mtd: rawnand: Use the new ECC engine type enumeration Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 12/21] mtd: rawnand: Deprecate nand-ecc-mode in favor of nand-ecc-provider Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 13/21] mtd: rawnand: Drop the legacy ECC type enumeration Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 14/21] dt-bindings: mtd: Add the nand-ecc-placement property Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 15/21] dt-bindings: mtd: Deprecate hw_syndrome from the ECC modes Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 16/21] dt-bindings: mtd: Deprecate the nand-ecc-mode property Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 17/21] mtd: nand: Move nand_device forward declaration to the top Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 18/21] mtd: nand: Add an extra level in the Kconfig hierarchy Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 19/21] mtd: nand: Drop useless 'depends on' in Kconfig Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 20/21] mtd: nand: Add a NAND page I/O request type Miquel Raynal
2020-01-17 21:41 ` [PATCH v4 21/21] mtd: nand: Rename a core structure 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=20200117214151.20767-10-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=boris.brezillon@collabora.com \
    --cc=juliensu@mxic.com.tw \
    --cc=linux-mtd@lists.infradead.org \
    --cc=masonccyang@mxic.com.tw \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@bootlin.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).