1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __BRCMNAND_H__
15#define __BRCMNAND_H__
16
17#include <linux/types.h>
18#include <linux/io.h>
19
20struct platform_device;
21struct dev_pm_ops;
22
23struct brcmnand_soc {
24 bool (*ctlrdy_ack)(struct brcmnand_soc *soc);
25 void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en);
26 void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare,
27 bool is_param);
28};
29
30static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc,
31 bool is_param)
32{
33 if (soc && soc->prepare_data_bus)
34 soc->prepare_data_bus(soc, true, is_param);
35}
36
37static inline void brcmnand_soc_data_bus_unprepare(struct brcmnand_soc *soc,
38 bool is_param)
39{
40 if (soc && soc->prepare_data_bus)
41 soc->prepare_data_bus(soc, false, is_param);
42}
43
44static inline u32 brcmnand_readl(void __iomem *addr)
45{
46
47
48
49
50
51
52
53
54 if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
55 return __raw_readl(addr);
56 else
57 return readl_relaxed(addr);
58}
59
60static inline void brcmnand_writel(u32 val, void __iomem *addr)
61{
62
63 if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
64 __raw_writel(val, addr);
65 else
66 writel_relaxed(val, addr);
67}
68
69int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc);
70int brcmnand_remove(struct platform_device *pdev);
71
72extern const struct dev_pm_ops brcmnand_pm_ops;
73
74#endif
75