]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/omap-gpmc.h
mm/hotplug: invalid PFNs from pfn_to_online_page()
[mirror_ubuntu-bionic-kernel.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
384258f2
RQ
14/* IRQ numbers in GPMC IRQ domain for legacy boot use */
15#define GPMC_IRQ_FIFOEVENTENABLE 0
16#define GPMC_IRQ_COUNT_EVENT 1
e639cd5b 17
f47fcad6
RQ
18/**
19 * gpmc_nand_ops - Interface between NAND and GPMC
20 * @nand_write_buffer_empty: get the NAND write buffer empty status.
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
0680b0ca
RQ
32static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
33 int cs)
f47fcad6
RQ
34{
35 return NULL;
36}
37#endif /* CONFIG_OMAP_GPMC */
38
e639cd5b
TL
39extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
40 struct gpmc_settings *gpmc_s,
41 struct gpmc_device_timings *dev_t);
42
e639cd5b
TL
43struct device_node;
44
e639cd5b
TL
45extern int gpmc_get_client_irq(unsigned irq_config);
46
47extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
48
49extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
50extern int gpmc_calc_divider(unsigned int sync_clk);
2e676901
RA
51extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
52 const struct gpmc_settings *s);
e639cd5b
TL
53extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p);
54extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
55extern void gpmc_cs_free(int cs);
56extern int gpmc_configure(int cmd, int wval);
57extern void gpmc_read_settings_dt(struct device_node *np,
58 struct gpmc_settings *p);
59
60extern void omap3_gpmc_save_context(void);
61extern void omap3_gpmc_restore_context(void);
62
63struct gpmc_timings;
64struct omap_nand_platform_data;
65struct omap_onenand_platform_data;
66
e639cd5b 67#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
7807e086 68extern int gpmc_onenand_init(struct omap_onenand_platform_data *d);
e639cd5b
TL
69#else
70#define board_onenand_data NULL
7807e086 71static inline int gpmc_onenand_init(struct omap_onenand_platform_data *d)
e639cd5b 72{
7807e086 73 return 0;
e639cd5b
TL
74}
75#endif