Skip to content

Commit

Permalink
mtd: nand: Introduce the ECC engine framework
Browse files Browse the repository at this point in the history
Create a generic ECC engine framework. This is a base to instantiate ECC
engine objects.

If we really want to be generic, bindings must evolve, so here is the
new logic. The following three properties are mutually exclusive:
- The nand-no-ecc-engine boolean property is set and there is no
  ECC engine to retrieve.
- The nand-use-soft-ecc-engine boolean property is set and the core
  will force using the use of software correction.
- There is a nand-ecc-engine property pointing at a node which will
  act as ECC engine.

It the later case, the property may reference:
- The NAND chip node itself (for the on-die ECC case).
- The parent node if the NAND controller embeds an ECC engine.
- Any other node being an external ECC controller as well.

Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
  • Loading branch information
miquelraynal committed Sep 2, 2020
1 parent b440915 commit a8c7ffd
Show file tree
Hide file tree
Showing 4 changed files with 608 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mtd/nand/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ source "drivers/mtd/nand/onenand/Kconfig"
source "drivers/mtd/nand/raw/Kconfig"
source "drivers/mtd/nand/spi/Kconfig"

menu "ECC engine support"

config MTD_NAND_ECC
bool
depends on MTD_NAND_CORE

endmenu

endmenu
2 changes: 2 additions & 0 deletions drivers/mtd/nand/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
obj-y += onenand/
obj-y += raw/
obj-y += spi/

nandcore-$(CONFIG_MTD_NAND_ECC) += ecc.o
Loading

0 comments on commit a8c7ffd

Please sign in to comment.