[PATCH] mtd: gpmi: add gpmi_devdata{} to simplify the code

Gupta, Pekon pekon at ti.com
Fri Mar 21 06:29:36 EDT 2014


>From: Huang Shijie
>
>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.
Please see if you can use existing DT binding and framework for all these.


> 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.
>
Ezequiel has got approval for 2 new generic MTD bindings (refer l2-mtd.git)
	commit 8dd49165ef5f46b5ad9ba296c559ccff315f9421
	mtd: nand: Add a devicetree binding for ECC strength and ECC step size
So, I think <1> can be replaced by "nand-ecc-strength".


>
>  [2] add the gpmi_devdata_imx{23|28|6q} to replace the gpmi_ids.
>
Can you use "compatible" string in DT for this ?


>  [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 at freescale.com>
>---

with regards, pekon



More information about the linux-mtd mailing list