History log of /drivers/mtd/nand/gpmi-nand/gpmi-nand.h
Revision Date Author Comments
91f5498ebfb2352ed6b5eb2780adcfe019961565 27-Mar-2014 Huang Shijie <b32955@freescale.com> mtd: gpmi: add gpmi support for imx6sx

The gpmi's IP for imx6sx is nearly the same as the gpmi's IP for imx6q,
except the following two new features:

(1) the new BCH contoller has 62-BIT correcting ECC strength
(The BCH for imx6q only has 40-BIT ECC strength).

(2) add the hardware Randomizer support.

This patch does the follow changes:

(1) add a new macro GPMI_IS_MX6SX to represent the imx6sx's gpmi.

(2) add a new macro GPMI_IS_MX6.
We use this macro to initialize the same registers for both
imx6sx and imx6q, and so on.

(3) add a new gpmi_devdata instance, the gpmi_devdata_imx6sx, for
imx6sx.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
6189cccbe8d16d0ef175bd0dca18e3824ca01174 21-Mar-2014 Huang Shijie <b32955@freescale.com> 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>
3cb2c1ed4abe19d2881f74aa60c1a5b44524b2d0 14-Nov-2013 Huang Shijie <b32955@freescale.com> mtd: gpmi: use devm_request_irq

Use devm_request_irq to simplify the code.
Also remove the unused fields of structure resources{}.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
5fac0e18bd3dbd7e23276efa0e5d2b945b1165e8 26-Feb-2013 Shawn Guo <shawn.guo@linaro.org> mtd: gpmi: move to use generic DMA helper

With the generic DMA device tree helper supported by mxs-dma driver,
client devices only need to call dma_request_slave_channel() for
requesting a DMA channel from dmaengine.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
92d0e09abeebdd3f699c9f12401a9e3998a20546 29-Jan-2013 Huang Shijie <b32955@freescale.com> mtd: gpmi: add sanity check for the ECC

We do the check based on the following two facts:

[1] The mx23/mx28 can only support 20-bits ECC, while the mx6
can supports 40-bits ECC.

[2] The mx23/mx28 can only support the GF13, while the mx6
can supports GF13 and GF14.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
5de0b52ea8f8f5149502867acff2efb5efaf1fc2 13-Oct-2012 Huang Shijie <shijie8@gmail.com> mtd: gpmi: remove unneccessary header

The whole gpmi-nand driver has turned to pure devicetree supported.
So the linux/mtd/gpmi-nand.h is not neccessary now. Just remove it,
and move some macros to the gpmi-nand driver itself.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
9c95f11b9e743aa6134134a6dcf866a9d5661972 13-Sep-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: initialize the timing registers only one time

The current code initializes the timing registers at very time
we call the gpmi_begin(). This really wastes the cpu cycles.

Add a new flag to let the gpmi driver initializes the timing registers
only one time.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
995fbbf563fcec058a1135bdd112ac969c817e65 13-Sep-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: add EDO feature for imx6q

When the frequency on the nand chip pins is above 33MHz,
the nand EDO(extended Data Out) timing could be applied.
The GPMI implements a Feedback read strobe to sample the read data in
the EDO timing mode.

This patch adds the EDO feature for the gpmi-nand driver.

For some onfi nand chips, the mode 4 is the fastest;
while for other onfi nand chips, the mode 5 is the fastest.
This patch only adds the support for the fastest asynchronous timing mode.
So this patch only supports the mode 4 and mode 5.

I tested several Micron's ONFI nand chips with EDO enabled,
take Micron MT29F32G08MAA for example (in mode 5, 100MHz):

1) The test result BEFORE we add the EDO feature:
=================================================
mtd_speedtest: MTD device: 2
mtd_speedtest: MTD device size 209715200, eraseblock size 524288,
page size 4096, count of eraseblocks 400,
pages per eraseblock 128, OOB size 218
.......................................
mtd_speedtest: testing eraseblock read speed
mtd_speedtest: eraseblock read speed is 3632 KiB/s
.......................................
mtd_speedtest: testing page read speed
mtd_speedtest: page read speed is 3554 KiB/s
.......................................
mtd_speedtest: testing 2 page read speed
mtd_speedtest: 2 page read speed is 3592 KiB/s
.......................................
=================================================

2) The test result AFTER we add the EDO feature:
=================================================
mtd_speedtest: MTD device: 2
mtd_speedtest: MTD device size 209715200, eraseblock size 524288,
page size 4096, count of eraseblocks 400,
pages per eraseblock 128, OOB size 218
.......................................
mtd_speedtest: testing eraseblock read speed
mtd_speedtest: eraseblock read speed is 19555 KiB/s
.......................................
mtd_speedtest: testing page read speed
mtd_speedtest: page read speed is 17319 KiB/s
.......................................
mtd_speedtest: testing 2 page read speed
mtd_speedtest: 2 page read speed is 18339 KiB/s
.......................................
=================================================

3) The read data performance is much improved by more then 5 times.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
d37e02d8f3a892b57738f1c1431779d5939214d1 13-Sep-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: add a new field for HW_GPMI_CTRL1

add the WRN_DLY_SEL field for HW_GPMI_CTRL1.
This field is used as delay for gpmi write strobe.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
ddab3838aa3332ed2c8ea96accbed5218a2a72b7 13-Sep-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: add a new field for HW_GPMI_TIMING1

The gpmi_nfc_compute_hardware_timing{} should contains all the
fields setting for gpmi timing registers. It already contains the fields
for HW_GPMI_TIMING0 and HW_GPMI_CTRL1.

So it is better to add a new field setting for HW_GPMI_TIMING1 in
this data structure. This makes the code more clear in logic.

This patch also changes some comments to make the code more readable.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
513d57e1db53870cdc11e60df77c57c8b3897fdf 17-Jul-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: fix the compiler warnings

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
ff506172a30080963853dc0d259566c82fe8626c 03-Jul-2012 Huang Shijie <shijie8@gmail.com> mtd: gpmi: change the code for clocks

The gpmi nand driver may needs several clocks(MX6Q needs five clocks).

In the old clock framework, all these clocks are chained together,
all you need is to manipulate the first clock.

But the kernel uses the common clk framework now, which forces us to
get the clocks one by one. When we use them, we have to enable them
one by one too.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
9013bb40ae8e97d579015a3dc96a10aa9c625757 05-May-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: add gpmi support for mx6q

add gpmi support for mx6q.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
e10db1f00a5e3c2ec04d7fe26c7444dc55a59b19 05-May-2012 Huang Shijie <b32955@freescale.com> mtd: gpmi: add device tree support to gpmi-nand

This patch just adds the DT support to gpmi-nand.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
3946860409130038ef6e0e5c50f2203053eae2b7 16-Feb-2012 Huang Shijie <b32955@freescale.com> mxs-dma : move the mxs dma.h to a more common place

Move the header to a more common place.
The mxs dma engine is not only used in mx23/mx28, but also used
in mx50/mx6q. It will also be used in the future chips.

Rename it to mxs-dma.h, and create a new folder include/linux/fsl/ to
store the Freescale's header files.

change mxs-dma driver, mxs-mmc driver, gpmi-nand driver, mxs-saif driver
to the new header file.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-by: Chris Ball <cjb@laptop.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10a2bcae99267b28e058b089fda30de7397b69f5 08-Sep-2011 Huang Shijie <b32955@freescale.com> mtd: add the common code for GPMI-NAND controller driver

These files contain the common code for the GPMI-NAND driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Tested-by: Koen Beel <koen.beel@barco.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>