aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
diff options
context:
space:
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 *);