ARM: OMAP2+: gpmc: Add gpmc timings and settings to platform data
[deliverable/linux.git] / include / linux / omap-gpmc.h
CommitLineData
e639cd5b
TL
1/*
2 * OMAP GPMC (General Purpose Memory Controller) defines
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
58bc67fc 10#include <linux/platform_data/gpmc-omap.h>
e639cd5b
TL
11
12#define GPMC_CONFIG_WP 0x00000005
13
14#define GPMC_IRQ_FIFOEVENTENABLE 0x01
15#define GPMC_IRQ_COUNT_EVENT 0x02
16
e639cd5b
TL
17extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
18 struct gpmc_settings *gpmc_s,
19 struct gpmc_device_timings *dev_t);
20
21struct gpmc_nand_regs;
22struct device_node;
23
24extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
25extern int gpmc_get_client_irq(unsigned irq_config);
26
27extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
28
29extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
30extern int gpmc_calc_divider(unsigned int sync_clk);
2e676901
RA
31extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
32 const struct gpmc_settings *s);
e639cd5b
TL
33extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p);
34extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
35extern void gpmc_cs_free(int cs);
36extern int gpmc_configure(int cmd, int wval);
37extern void gpmc_read_settings_dt(struct device_node *np,
38 struct gpmc_settings *p);
39
40extern void omap3_gpmc_save_context(void);
41extern void omap3_gpmc_restore_context(void);
42
43struct gpmc_timings;
44struct omap_nand_platform_data;
45struct omap_onenand_platform_data;
46
47#if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
48extern int gpmc_nand_init(struct omap_nand_platform_data *d,
49 struct gpmc_timings *gpmc_t);
50#else
51static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
52 struct gpmc_timings *gpmc_t)
53{
54 return 0;
55}
56#endif
57
58#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
59extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
60#else
61#define board_onenand_data NULL
62static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
63{
64}
65#endif
This page took 0.115154 seconds and 5 git commands to generate.