1. 20 6月, 2017 1 次提交
    • M
      mtd: nand: denali: set NAND_ECC_CUSTOM_PAGE_ACCESS · b21ff825
      Masahiro Yamada 提交于
      The denali_cmdfunc() actually does nothing valuable for
      NAND_CMD_{PAGEPROG,READ0,SEQIN}.
      
      For NAND_CMD_{READ0,SEQIN}, it copies "page" to "denali->page", then
      denali_read_page(_raw) compares them just for the sanity check.
      (Inconsistently, this check is missing from denali_write_page(_raw).)
      
      The Denali controller is equipped with high level read/write interface,
      so let's skip unneeded call of cmdfunc().
      
      If NAND_ECC_CUSTOM_PAGE_ACCESS is set, nand_write_page() will not
      call ->waitfunc hook.  So, ->write_page(_raw) hooks should directly
      return -EIO on failure.  The error handling of page writes will be
      much simpler.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      b21ff825
  2. 13 6月, 2017 1 次提交
  3. 10 6月, 2017 11 次提交
  4. 01 6月, 2017 24 次提交
  5. 30 5月, 2017 1 次提交
  6. 15 5月, 2017 2 次提交
    • T
      mtd: nand: export nand_{read,write}_page_raw() · cc0f51ec
      Thomas Petazzoni 提交于
      The nand_read_page_raw() and nand_write_page_raw() functions might be
      re-used by vendor-specific implementations of the read_page/write_page
      functions. Instead of having vendor-specific code duplicate this code,
      it is much better to export those functions and allow them to be
      re-used.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      cc0f51ec
    • T
      mtd: nand: add core support for on-die ECC · 785818fa
      Thomas Petazzoni 提交于
      A number of NAND flashes have a capability called "on-die ECC" where the
      NAND chip itself is capable of detecting and correcting errors.
      
      Linux already has support for using the ECC implementation of the NAND
      controller, or a software based ECC implementation, but not for using
      the ECC implementation of the NAND controller. However, such an
      implementation is sometimes useful in situations where the NAND
      controller provides ECC algorithms that are not strong enough for the
      NAND chip used on the system. A typical case is a NAND chip that
      requires a 4-bit ECC, while the NAND controller only provides a 1-bit
      ECC algorithm.
      
      This commit introduces the support for the NAND_ECC_ON_DIE ECC mode:
      
       - Parsing of the "on-die" value for the "nand-ecc-mode" Device Tree
         property
      
       - Handling NAND_ECC_ON_DIE case in nand_scan_tail(). The idea is that
         the vendor specific code for the NAND chip must implement
         ->read_page() and ->write_page(). It may optionally provide its own
         ->read_page_raw() and ->write_page_raw() as well. For OOB operation,
         we assume the standard operations are good enough, but they can be
         overridden by the vendor specific code if needed.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      785818fa