diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-01-11 18:40:15 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-16 11:22:48 +0100 |
commit | 6acb364ab4b436a6bf27d4c80eaf4c0f4a5404f9 (patch) | |
tree | 898e4ed2dc29807d6beea4c41acc70f3e005a5da /include/linux | |
parent | 1aa2b423b9cee4f33d87e13b9b01c37e048dab71 (diff) | |
download | barebox-6acb364ab4b436a6bf27d4c80eaf4c0f4a5404f9.tar.gz |
mtd: nand: provide Linux' struct nand_ecc_ctrl::engine_type
The Linux MTD-NAND core doesn't seem to care much for the engine_type,
but different drivers use it to record during probe, which kind of
ECC engine should be used during future operation. Provide the member
to make porting drivers a tiny bit easier.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230111174023.1719129-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mtd/rawnand.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 9c8b0a1fe1..ce8944c481 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -95,6 +95,22 @@ enum nand_ecc_mode { NAND_ECC_SOFT_BCH }; +/** + * enum nand_ecc_engine_type - NAND ECC engine type + * @NAND_ECC_ENGINE_TYPE_INVALID: Invalid value + * @NAND_ECC_ENGINE_TYPE_NONE: No ECC correction + * @NAND_ECC_ENGINE_TYPE_SOFT: Software ECC correction + * @NAND_ECC_ENGINE_TYPE_ON_HOST: On host hardware ECC correction + * @NAND_ECC_ENGINE_TYPE_ON_DIE: On chip hardware ECC correction + */ +enum nand_ecc_engine_type { + NAND_ECC_ENGINE_TYPE_INVALID, + NAND_ECC_ENGINE_TYPE_NONE, + NAND_ECC_ENGINE_TYPE_SOFT, + NAND_ECC_ENGINE_TYPE_ON_HOST, + NAND_ECC_ENGINE_TYPE_ON_DIE, +}; + enum nand_ecc_algo { NAND_ECC_ALGO_UNKNOWN, NAND_ECC_ALGO_HAMMING, @@ -313,6 +329,7 @@ static const struct nand_ecc_caps __name = { \ /** * struct nand_ecc_ctrl - Control structure for ECC + * @engine_type: ECC engine type * @mode: ECC mode * @algo: ECC algorithm * @steps: number of ECC steps per page @@ -365,6 +382,7 @@ static const struct nand_ecc_caps __name = { \ * @write_oob: function to write chip OOB data */ struct nand_ecc_ctrl { + enum nand_ecc_engine_type engine_type; enum nand_ecc_mode mode; enum nand_ecc_algo algo; int steps; |