1. 20 3月, 2018 2 次提交
  2. 20 1月, 2018 1 次提交
  3. 16 12月, 2017 1 次提交
    • M
      mtd: nand: add ->exec_op() implementation · 8878b126
      Miquel Raynal 提交于
      Introduce a new interface to instruct NAND controllers to send specific
      NAND operations. The new interface takes the form of a single method
      called ->exec_op(). This method is designed to replace ->cmd_ctrl(),
      ->cmdfunc() and ->read/write_byte/word/buf() hooks.
      
      ->exec_op() is passed a set of instructions describing the operation
      to execute. Each instruction has a type (ADDR, CMD, DATA, WAITRDY)
      and delay. The delay is here to help simple controllers wait enough
      time between each instruction, advanced controllers with integrated
      timings control can ignore these delays.
      
      Controllers that natively support complex operations (operations
      formed of several instructions) can use the NAND op parser
      infrastructure. This infrastructure allows controller drivers to
      describe the sequence of instructions they support (called
      nand_op_pattern) and a hook for each of these supported sequences. The
      core then tries to find the best match for a given NAND operation, and
      calls the associated hook.
      
      Various other helpers are also added to ease NAND controller drivers
      writing.
      
      This new interface should ease support of vendor specific operations
      in that NAND manufacturer drivers now have a way to check if the
      controller they are connected to supports a specific operation, and
      complain or refuse to probe the NAND chip when that's not the case.
      Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      8878b126
  4. 14 12月, 2017 5 次提交
  5. 18 9月, 2017 1 次提交
  6. 30 8月, 2017 1 次提交
  7. 13 8月, 2017 1 次提交
  8. 03 8月, 2017 1 次提交
  9. 02 8月, 2017 1 次提交
  10. 10 6月, 2017 2 次提交
    • M
      mtd: nand: add a shorthand to generate nand_ecc_caps structure · a03c6017
      Masahiro Yamada 提交于
      struct nand_ecc_caps was designed as flexible as possible to support
      multiple stepsizes (like sunxi_nand.c).
      
      So, we need to write multiple arrays even for the simplest case.
      I guess many controllers support a single stepsize, so here is a
      shorthand macro for the case.
      
      It allows to describe like ...
      
      NAND_ECC_CAPS_SINGLE(denali_pci_ecc_caps, denali_calc_ecc_bytes, 512, 8, 15);
      
      ... instead of
      
      static const int denali_pci_ecc_strengths[] = {8, 15};
      static const struct nand_ecc_step_info denali_pci_ecc_stepinfo = {
              .stepsize = 512,
              .strengths = denali_pci_ecc_strengths,
              .nstrengths = ARRAY_SIZE(denali_pci_ecc_strengths),
      };
      static const struct nand_ecc_caps denali_pci_ecc_caps = {
              .stepinfos = &denali_pci_ecc_stepinfo,
              .nstepinfos = 1,
              .calc_ecc_bytes = denali_calc_ecc_bytes,
      };
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      a03c6017
    • M
      mtd: nand: add generic helpers to check, match, maximize ECC settings · 2c8f8afa
      Masahiro Yamada 提交于
      Driver are responsible for setting up ECC parameters correctly.
      Those include:
        - Check if ECC parameters specified (usually by DT) are valid
        - Meet the chip's ECC requirement
        - Maximize ECC strength if NAND_ECC_MAXIMIZE flag is set
      
      The logic can be generalized by factoring out common code.
      
      This commit adds 3 helpers to the NAND framework:
      nand_check_ecc_caps - Check if preset step_size and strength are valid
      nand_match_ecc_req - Match the chip's requirement
      nand_maximize_ecc - Maximize the ECC strength
      
      To use the helpers above, a driver needs to provide:
        - Data array of supported ECC step size and strength
        - A hook that calculates ECC bytes from the combination of
          step_size and strength.
      
      By using those helpers, code duplication among drivers will be
      reduced.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      2c8f8afa
  11. 01 6月, 2017 3 次提交
    • B
      mtd: nand: Drop the ->errstat() hook · 7d135bcc
      Boris Brezillon 提交于
      The ->errstat() hook is no longer implemented NAND controller drivers.
      Get rid of it before someone starts abusing it.
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      7d135bcc
    • B
      mtd: nand: Pass the CS line to ->setup_data_interface() · 104e442a
      Boris Brezillon 提交于
      Some NAND controllers can assign different NAND timings to different
      CS lines. Pass the CS line information to ->setup_data_interface() so
      that the NAND controller driver knows which CS line is concerned by
      the setup_data_interface() request.
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      104e442a
    • T
      mtd: nand: add support for Micron on-die ECC · 9748e1d8
      Thomas Petazzoni 提交于
      Now that the core NAND subsystem has support for on-die ECC, this commit
      brings the necessary code to support on-die ECC on Micron NANDs.
      
      In micron_nand_init(), we detect if the Micron NAND chip supports on-die
      ECC mode, by checking a number of conditions:
      
       - It must be an ONFI NAND
       - It must be a SLC NAND
      
       - Enabling *and* disabling on-die ECC must work
      
       - The on-die ECC must be correcting 4 bits per 512 bytes of data. Some
         Micron NAND chips have an on-die ECC able to correct 8 bits per 512
         bytes of data, but they work slightly differently and therefore we
         don't support them in this patch.
      
      Then, if the on-die ECC cannot be disabled (some Micron NAND have on-die
      ECC forcefully enabled), we bail out, as we don't support such
      NANDs. Indeed, the implementation of raw_read()/raw_write() make the
      assumption that on-die ECC can be disabled. Support for Micron NANDs
      with on-die ECC forcefully enabled can easily be added, but in the
      absence of such HW for testing, we preferred to simply bail out.
      
      If the on-die ECC is supported, and requested in the Device Tree, then
      it is indeed enabled, by using custom implementations of the
      ->read_page(), ->read_page_raw(), ->write_page() and ->write_page_raw()
      operation to properly handle the on-die ECC.
      
      In the non-raw functions, we need to enable the internal ECC engine
      before issuing the NAND_CMD_READ0 or NAND_CMD_SEQIN commands, which is
      why we set the NAND_ECC_CUSTOM_PAGE_ACCESS option at initialization
      time (it asks the NAND core to let the NAND driver issue those
      commands).
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      9748e1d8
  12. 30 5月, 2017 1 次提交
  13. 16 5月, 2017 1 次提交
  14. 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
  15. 25 4月, 2017 3 次提交
  16. 09 3月, 2017 10 次提交
  17. 09 2月, 2017 1 次提交
  18. 06 2月, 2017 1 次提交
  19. 30 1月, 2017 1 次提交
  20. 19 11月, 2016 1 次提交