nand flash disable ecc

Ivan Riabtsov ivriabtsov at gmail.com
Tue Aug 3 05:42:34 EDT 2021


Hello. Please tell me how to disable ecc checking in nand memory? I
only found this:
https://www.kernel.org/doc/html/v4.14/driver-api/mtdnand.html#ecc-selection-constants
but didn't figure out how to disable ecc checking.
What i did:

diff -Naur linux-5.10.50_orig/drivers/mtd/nand/raw/nand_base.c
linux-5.10.50/drivers/mtd/nand/raw/nand_base.c
--- linux-5.10.50_orig/drivers/mtd/nand/raw/nand_base.c 2021-07-14
17:56:55.000000000 +0300
+++ linux-5.10.50/drivers/mtd/nand/raw/nand_base.c 2021-08-03
11:20:41.566988751 +0300
@@ -43,6 +43,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/of.h>
 #include <linux/gpio/consumer.h>
+#include <linux/printk.h>

 #include "internals.h"

@@ -4902,9 +4903,12 @@
  int err;

  err = of_property_read_string(np, "nand-ecc-mode", &pm);
####### at this point the checkout is turned off, as I assume. Since
the debug message in the kernel appears exactly in this place
+ pr_emerg("!!!!!!!!!!!!err is %d, prop is: %s\n", err, pm);
  if (err)
- return NAND_ECC_ENGINE_TYPE_INVALID;
+ return NAND_ECC_ENGINE_TYPE_NONE;
+ /*return NAND_ECC_ENGINE_TYPE_INVALID;*/

+ printk(KERN_EMERG "!!!!!!!!!prop is: %s\n", pm);
  for (eng_type = NAND_ECC_NONE;
       eng_type < ARRAY_SIZE(nand_ecc_legacy_modes); eng_type++) {
  if (!strcasecmp(pm, nand_ecc_legacy_modes[eng_type])) {

but it doesn't work. Please, tell me, how i can disable ecc checking?



More information about the Kernelnewbies mailing list