[PATCH] mtd: nand: Print warning for unsupported ecc modes

Venkatesh Yadav Abbarapu venkatesh.abbarapu at amd.com
Wed Jan 17 05:08:22 CET 2024


Currently only hw ecc is supported in U-Boot. If any other ecc mode is
given in DT, it simply ignores and switches to hw ecc. So better print
what is being done.

Revert this patch once soft ecc support is fixed in future.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma at amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
---
 drivers/mtd/nand/raw/nand_base.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index c40a0f23d7..200f7f8ba0 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4463,6 +4463,9 @@ static int nand_dt_init(struct mtd_info *mtd, struct nand_chip *chip, ofnode nod
 
 	str = ofnode_read_string(node, "nand-ecc-mode");
 	if (str) {
+		if (strcmp(str, "hw"))
+			printf("%s ecc is not supported, switching to hw ecc\n", str);
+
 		if (!strcmp(str, "none"))
 			ecc_mode = NAND_ECC_NONE;
 		else if (!strcmp(str, "soft"))
-- 
2.25.1



More information about the U-Boot mailing list