mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
68d5efaa10
This patch implements the spi-nand controller driver as an ECC-capable spi-mem controller to use the upstream SPI-NAND driver. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From 433b76fa0f3ca2865841abc21538dd8077ca3edd Mon Sep 17 00:00:00 2001
|
|
From: Chuanhong Guo <gch981213@gmail.com>
|
|
Date: Mon, 4 Apr 2022 00:05:38 +0800
|
|
Subject: [PATCH 13/15] mtd: nand: mtk-ecc: also parse nand-ecc-engine if
|
|
available
|
|
|
|
The recently added ECC engine support introduced a generic property
|
|
named nand-ecc-engine for ecc engine phandle. This patch adds support
|
|
for this new property.
|
|
|
|
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
|
|
(cherry picked from commit a41f25feb6e47c1c4d8d3279ae990ccbd8dfab54)
|
|
---
|
|
drivers/mtd/nand/ecc-mtk.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/mtd/nand/ecc-mtk.c b/drivers/mtd/nand/ecc-mtk.c
|
|
index c64c3c45cdbc..79c7622af563 100644
|
|
--- a/drivers/mtd/nand/ecc-mtk.c
|
|
+++ b/drivers/mtd/nand/ecc-mtk.c
|
|
@@ -279,7 +279,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct device_node *of_node)
|
|
struct mtk_ecc *ecc = NULL;
|
|
struct device_node *np;
|
|
|
|
- np = of_parse_phandle(of_node, "ecc-engine", 0);
|
|
+ np = of_parse_phandle(of_node, "nand-ecc-engine", 0);
|
|
+ /* for backward compatibility */
|
|
+ if (!np)
|
|
+ np = of_parse_phandle(of_node, "ecc-engine", 0);
|
|
if (np) {
|
|
ecc = mtk_ecc_get(np);
|
|
of_node_put(np);
|
|
--
|
|
2.35.1
|
|
|