1
2
3
4
5
6
7
8
9
10 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
11 #define __ARCH_ARM_MACH_OMAP2_PRM_H
12
13 #include "prcm-common.h"
14
15 # ifndef __ASSEMBLER__
16 extern struct omap_domain_base prm_base;
17 extern u16 prm_features;
18 extern void omap2_set_globals_prm(void __iomem *prm);
19 int omap_prcm_init(void);
20 int omap2_prm_base_init(void);
21 int omap2_prcm_base_init(void);
22 # endif
23
24
25
26
27
28
29
30 #define PRM_HAS_IO_WAKEUP BIT(0)
31 #define PRM_HAS_VOLTAGE BIT(1)
32
33
34
35
36
37 #define MAX_MODULE_SOFTRESET_WAIT 10000
38
39
40
41
42
43 #define MAX_MODULE_HARDRESET_WAIT 10000
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 #define OMAP_INTRANSITION_MASK (1 << 20)
59
60
61
62
63
64
65
66
67
68
69
70 #define OMAP_POWERSTATEST_SHIFT 0
71 #define OMAP_POWERSTATEST_MASK (0x3 << 0)
72
73
74
75
76
77
78
79
80
81
82
83 #define OMAP_POWERSTATE_SHIFT 0
84 #define OMAP_POWERSTATE_MASK (0x3 << 0)
85
86
87
88
89
90
91
92
93
94
95
96 #define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
97 #define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
98 #define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT 2
99 #define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
100 #define OMAP_SECU_WD_RST_SRC_ID_SHIFT 4
101 #define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
102 #define OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT 6
103 #define OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT 7
104 #define OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT 8
105 #define OMAP_ICEPICK_RST_SRC_ID_SHIFT 9
106 #define OMAP_ICECRUSHER_RST_SRC_ID_SHIFT 10
107 #define OMAP_C2C_RST_SRC_ID_SHIFT 11
108 #define OMAP_UNKNOWN_RST_SRC_ID_SHIFT 12
109
110 #ifndef __ASSEMBLER__
111
112
113
114
115
116
117
118
119 struct prm_reset_src_map {
120 s8 reg_shift;
121 s8 std_shift;
122 };
123
124
125
126
127
128
129
130
131
132
133
134
135
136 struct prm_ll_data {
137 u32 (*read_reset_sources)(void);
138 bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx);
139 void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx);
140 int (*late_init)(void);
141 int (*assert_hardreset)(u8 shift, u8 part, s16 prm_mod, u16 offset);
142 int (*deassert_hardreset)(u8 shift, u8 st_shift, u8 part, s16 prm_mod,
143 u16 offset, u16 st_offset);
144 int (*is_hardreset_asserted)(u8 shift, u8 part, s16 prm_mod,
145 u16 offset);
146 void (*reset_system)(void);
147 int (*clear_mod_irqs)(s16 module, u8 regs, u32 wkst_mask);
148 u32 (*vp_check_txdone)(u8 vp_id);
149 void (*vp_clear_txdone)(u8 vp_id);
150 };
151
152 extern int prm_register(struct prm_ll_data *pld);
153 extern int prm_unregister(struct prm_ll_data *pld);
154
155 int omap_prm_assert_hardreset(u8 shift, u8 part, s16 prm_mod, u16 offset);
156 int omap_prm_deassert_hardreset(u8 shift, u8 st_shift, u8 part, s16 prm_mod,
157 u16 offset, u16 st_offset);
158 int omap_prm_is_hardreset_asserted(u8 shift, u8 part, s16 prm_mod, u16 offset);
159 extern u32 prm_read_reset_sources(void);
160 extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
161 extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
162 void omap_prm_reset_system(void);
163
164 void omap_prm_reconfigure_io_chain(void);
165 int omap_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask);
166
167
168
169
170 #define OMAP3_VP_VDD_MPU_ID 0
171 #define OMAP3_VP_VDD_CORE_ID 1
172 #define OMAP4_VP_VDD_CORE_ID 0
173 #define OMAP4_VP_VDD_IVA_ID 1
174 #define OMAP4_VP_VDD_MPU_ID 2
175
176 u32 omap_prm_vp_check_txdone(u8 vp_id);
177 void omap_prm_vp_clear_txdone(u8 vp_id);
178
179 #endif
180
181
182 #endif