aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 21:51:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 21:51:35 -0400
commit10f39f04b2cb7a06ba5d4ea0f20bd156d0367bee (patch)
tree758f9736bcf0303da4edd5f52afd8ed10e8ea642 /drivers/mtd/nand/gpmi-nand/gpmi-nand.h
parent72055425e53540d9d0e59a57ac8c9b8ce77b62d5 (diff)
parentf5cf8f07423b2677cebebcebc863af77223a4972 (diff)
Merge tag 'for-linus-20121009' of git://git.infradead.org/mtd-2.6
Pull MTD updates from David Woodhouse: - Disable broken mtdchar mmap() on MMU systems - Additional ECC tests for NAND flash, and some test cleanups - New NAND and SPI chip support - Fixes/cleanup for SH FLCTL NAND controller driver - Improved hardware support for GPMI NAND controller - Conversions to device-tree support for various drivers - Removal of obsolete drivers (sbc8xxx, bcmring, etc.) - New LPC32xx drivers for MLC and SLC NAND - Further cleanup of NAND OOB/ECC handling - UAPI cleanup merge from David Howells (just moving files, since MTD headers were sorted out long ago to separate user-visible from kernel bits) * tag 'for-linus-20121009' of git://git.infradead.org/mtd-2.6: (168 commits) mtd: Disable mtdchar mmap on MMU systems UAPI: (Scripted) Disintegrate include/mtd mtd: nand: detect Samsung K9GBG08U0A, K9GAG08U0F ID mtd: nand: decode Hynix MLC, 6-byte ID length mtd: nand: increase max OOB size to 640 mtd: nand: add generic READ ID length calculation functions mtd: nand: split simple ID decode into its own function mtd: nand: split extended ID decoding into its own function mtd: nand: split BB marker options decoding into its own function mtd: nand: remove redundant ID read mtd: nand: remove unnecessary variable mtd: docg4: add missing HAS_IOMEM dependency mtd: gpmi: initialize the timing registers only one time mtd: gpmi: add EDO feature for imx6q mtd: gpmi: do not set the default values for the extra clocks mtd: gpmi: simplify the DLL setting code mtd: gpmi: add a new field for HW_GPMI_CTRL1 mtd: gpmi: do not get the clock frequency in gpmi_begin() mtd: gpmi: add a new field for HW_GPMI_TIMING1 mtd: add helpers to get the supportted ONFI timing mode ...
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand/gpmi-nand.h')
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index ce5daa160920..7ac25c1e58f9 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -22,14 +22,15 @@
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/fsl/mxs-dma.h> 23#include <linux/fsl/mxs-dma.h>
24 24
25#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */
25struct resources { 26struct resources {
26 void *gpmi_regs; 27 void __iomem *gpmi_regs;
27 void *bch_regs; 28 void __iomem *bch_regs;
28 unsigned int bch_low_interrupt; 29 unsigned int bch_low_interrupt;
29 unsigned int bch_high_interrupt; 30 unsigned int bch_high_interrupt;
30 unsigned int dma_low_channel; 31 unsigned int dma_low_channel;
31 unsigned int dma_high_channel; 32 unsigned int dma_high_channel;
32 struct clk *clock; 33 struct clk *clock[GPMI_CLK_MAX];
33}; 34};
34 35
35/** 36/**
@@ -121,6 +122,11 @@ struct nand_timing {
121}; 122};
122 123
123struct gpmi_nand_data { 124struct gpmi_nand_data {
125 /* flags */
126#define GPMI_ASYNC_EDO_ENABLED (1 << 0)
127#define GPMI_TIMING_INIT_OK (1 << 1)
128 int flags;
129
124 /* System Interface */ 130 /* System Interface */
125 struct device *dev; 131 struct device *dev;
126 struct platform_device *pdev; 132 struct platform_device *pdev;
@@ -131,6 +137,7 @@ struct gpmi_nand_data {
131 137
132 /* Flash Hardware */ 138 /* Flash Hardware */
133 struct nand_timing timing; 139 struct nand_timing timing;
140 int timing_mode;
134 141
135 /* BCH */ 142 /* BCH */
136 struct bch_geometry bch_geometry; 143 struct bch_geometry bch_geometry;
@@ -188,16 +195,28 @@ struct gpmi_nand_data {
188 * @data_setup_in_cycles: The data setup time, in cycles. 195 * @data_setup_in_cycles: The data setup time, in cycles.
189 * @data_hold_in_cycles: The data hold time, in cycles. 196 * @data_hold_in_cycles: The data hold time, in cycles.
190 * @address_setup_in_cycles: The address setup time, in cycles. 197 * @address_setup_in_cycles: The address setup time, in cycles.
198 * @device_busy_timeout: The timeout waiting for NAND Ready/Busy,
199 * this value is the number of cycles multiplied
200 * by 4096.
191 * @use_half_periods: Indicates the clock is running slowly, so the 201 * @use_half_periods: Indicates the clock is running slowly, so the
192 * NFC DLL should use half-periods. 202 * NFC DLL should use half-periods.
193 * @sample_delay_factor: The sample delay factor. 203 * @sample_delay_factor: The sample delay factor.
204 * @wrn_dly_sel: The delay on the GPMI write strobe.
194 */ 205 */
195struct gpmi_nfc_hardware_timing { 206struct gpmi_nfc_hardware_timing {
207 /* for HW_GPMI_TIMING0 */
196 uint8_t data_setup_in_cycles; 208 uint8_t data_setup_in_cycles;
197 uint8_t data_hold_in_cycles; 209 uint8_t data_hold_in_cycles;
198 uint8_t address_setup_in_cycles; 210 uint8_t address_setup_in_cycles;
211
212 /* for HW_GPMI_TIMING1 */
213 uint16_t device_busy_timeout;
214#define GPMI_DEFAULT_BUSY_TIMEOUT 0x500 /* default busy timeout value.*/
215
216 /* for HW_GPMI_CTRL1 */
199 bool use_half_periods; 217 bool use_half_periods;
200 uint8_t sample_delay_factor; 218 uint8_t sample_delay_factor;
219 uint8_t wrn_dly_sel;
201}; 220};
202 221
203/** 222/**
@@ -246,6 +265,7 @@ extern int start_dma_with_bch_irq(struct gpmi_nand_data *,
246 265
247/* GPMI-NAND helper function library */ 266/* GPMI-NAND helper function library */
248extern int gpmi_init(struct gpmi_nand_data *); 267extern int gpmi_init(struct gpmi_nand_data *);
268extern int gpmi_extra_init(struct gpmi_nand_data *);
249extern void gpmi_clear_bch(struct gpmi_nand_data *); 269extern void gpmi_clear_bch(struct gpmi_nand_data *);
250extern void gpmi_dump_info(struct gpmi_nand_data *); 270extern void gpmi_dump_info(struct gpmi_nand_data *);
251extern int bch_set_geometry(struct gpmi_nand_data *); 271extern int bch_set_geometry(struct gpmi_nand_data *);