1
2
3
4
5
6
7
8
9
10#include <linux/platform_data/gpmc-omap.h>
11
12#define GPMC_CONFIG_WP 0x00000005
13
14
15#define GPMC_IRQ_FIFOEVENTENABLE 0
16#define GPMC_IRQ_COUNT_EVENT 1
17
18
19
20
21
22struct gpmc_nand_ops {
23 bool (*nand_writebuffer_empty)(void);
24};
25
26struct gpmc_nand_regs;
27
28#if IS_ENABLED(CONFIG_OMAP_GPMC)
29struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
30 int cs);
31#else
32static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
33 int cs)
34{
35 return NULL;
36}
37#endif
38
39
40
41
42#if IS_ENABLED(CONFIG_OMAP_GPMC)
43void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
44#else
45static inline void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
46{
47}
48#endif
49
50
51extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
52 struct gpmc_settings *gpmc_s,
53 struct gpmc_device_timings *dev_t);
54
55struct device_node;
56
57extern int gpmc_get_client_irq(unsigned irq_config);
58
59extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
60
61extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
62extern int gpmc_calc_divider(unsigned int sync_clk);
63extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
64 const struct gpmc_settings *s);
65extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p);
66extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
67extern void gpmc_cs_free(int cs);
68extern int gpmc_configure(int cmd, int wval);
69extern void gpmc_read_settings_dt(struct device_node *np,
70 struct gpmc_settings *p);
71
72extern void omap3_gpmc_save_context(void);
73extern void omap3_gpmc_restore_context(void);
74
75struct gpmc_timings;
76struct omap_nand_platform_data;
77struct omap_onenand_platform_data;
78
79#if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
80extern int gpmc_nand_init(struct omap_nand_platform_data *d,
81 struct gpmc_timings *gpmc_t);
82#else
83static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
84 struct gpmc_timings *gpmc_t)
85{
86 return 0;
87}
88#endif
89
90#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
91extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
92#else
93#define board_onenand_data NULL
94static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
95{
96}
97#endif
98