]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: gpmi: add gpmi_devdata{} to simplify the code
authorHuang Shijie <b32955@freescale.com>
Fri, 21 Mar 2014 10:19:39 +0000 (18:19 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 16 Apr 2014 07:46:55 +0000 (00:46 -0700)
commitb7bf09d3a034e25e51b1a3ae0f694da9fc287001
tree5ce8cae393373382a6e162d4bf32b9745a671336
parent5ce6fd3f244fa6c6db3c20bff12b8bdddd04839f
mtd: gpmi: add gpmi_devdata{} to simplify the code

More and more chips use the GPMI controller, but these chips may use different
version of the IPs for GPMI and BCH. Different IPs have
 different features, such as the BCH's maximum ECC strength:

     imx23/imx28 -- the BCH's maximum ECC strength is 20
     imx6q       -- the BCH's maximum ECC strength is 40
     imx6sx      -- the BCH's maximum ECC strength is 62

This patch does the following things:

  [1] add a new data structure, gpmi_devdata{}, to store the information for
      each IP. Besides the IP version, we store the following information:
         <1> BCH's maximum ECC strength.
         <2> the maximum chain delay in ns used by the EDO mode.

      but we may add more information in future.

  [2] add the gpmi_devdata_imx{23|28|6q} to replace the gpmi_ids.

  [3] simplify the code by using the ECC strength from gpmi_devdata, such as
      gpmi_check_ecc() and legacy_set_geometry();

  [4] use the maximum chain delay to initialize the EDO mode,
      see gpmi_compute_edo_timing().

  [5] rewrite the macros, such GPMI_IS_MX{23|28|6Q}.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/gpmi-nand/gpmi-lib.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.h