Skip to content

Commit 3148d0e

Browse files
plappermaulmiquelraynal
authored andcommitted
mtd: nand: realtek-ecc: Add Realtek external ECC engine support
The Realtek RTl93xx switch SoC series has a built in ECC controller that can provide BCH6 or BCH12 over 512 data and 6 tag bytes. It generates 10 (BCH6) or 20 (BCH12) bytes of parity. This engine will most likely work in conjunction with the Realtek spi-mem based NAND controller but can work on its own. Therefore the initial implementation will be of type external. Remark! The engine can support any data blocks that are multiples of 512 bytes. For now limit it to data+oob layouts that have been analyzed from existing devices. This way it keeps compatibility and pre-existing vendor data can be read. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 12bfcb8 commit 3148d0e

3 files changed

Lines changed: 473 additions & 0 deletions

File tree

drivers/mtd/nand/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ config MTD_NAND_ECC_MEDIATEK
6161
help
6262
This enables support for the hardware ECC engine from Mediatek.
6363

64+
config MTD_NAND_ECC_REALTEK
65+
tristate "Realtek RTL93xx hardware ECC engine"
66+
depends on HAS_IOMEM
67+
depends on MACH_REALTEK_RTL || COMPILE_TEST
68+
select MTD_NAND_ECC
69+
help
70+
This enables support for the hardware ECC engine from Realtek.
71+
6472
endmenu
6573

6674
endmenu

drivers/mtd/nand/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
nandcore-objs := core.o bbt.o
44
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
55
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
6+
obj-$(CONFIG_MTD_NAND_ECC_REALTEK) += ecc-realtek.o
67
obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
78
obj-$(CONFIG_MTD_NAND_QCOM) += qpic_common.o
89
obj-y += onenand/

0 commit comments

Comments
 (0)