]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: brcmnand: respect ECC algorithm set by NAND subsystem
authorBrian Norris <computersforpeace@gmail.com>
Tue, 26 Apr 2016 05:53:55 +0000 (22:53 -0700)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 5 May 2016 21:55:15 +0000 (23:55 +0200)
commit02bf7e5a632605239dad55f3bdf1b552ddfc7ee9
treec784f713f3cbf7c94aede09cf6008666ed020060
parent6124ebad8c7282fbdb14bf38ed7d45ba0e0bc2c2
mtd: brcmnand: respect ECC algorithm set by NAND subsystem

This is more obvious than guessing based on ECC strength. It allows
using NAND on devices with BCH-1 (e.g. D-Link DIR-885L).

This maintains DT backward compatibility by defaulting to Hamming if a
1-bit ECC algorithm is specified without a corresponding algorithm
selection. i.e., to use BCH-1, you must specify:

  nand-ecc-strength = <1>;
  nand-ecc-step-size = <512>;
  nand-ecc-algo = "bch";

Also adds a check to ensure we haven't allowed someone to get by with SW
ECC. If we want to support SW ECC, we need to refactor some other pieces
of this driver.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/brcmnand/brcmnand.c