1
2
3
4 #ifndef __RTL8723E_PWRSEQ_H__
5 #define __RTL8723E_PWRSEQ_H__
6
7 #include "../pwrseqcmd.h"
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #define RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS 10
31 #define RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 10
32 #define RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS 10
33 #define RTL8723A_TRANS_SUS_TO_CARDEMU_STEPS 10
34 #define RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 10
35 #define RTL8723A_TRANS_PDN_TO_CARDEMU_STEPS 10
36 #define RTL8723A_TRANS_ACT_TO_LPS_STEPS 15
37 #define RTL8723A_TRANS_LPS_TO_ACT_STEPS 15
38 #define RTL8723A_TRANS_END_STEPS 1
39
40
41
42
43 #define RTL8723A_TRANS_CARDEMU_TO_ACT \
44 \
45 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
46 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(2), 0},\
47 \
48 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
49 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)},\
50 \
51 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
52 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)},\
53 \
54 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
55 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},\
56 \
57 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
58 PWR_BASEADDR_MAC, PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0},\
59 \
60 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
61 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)},\
62 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
63 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0},
64
65
66
67
68 #define RTL8723A_TRANS_ACT_TO_CARDEMU \
69 \
70 {0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
71 PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0}, \
72 {0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
73 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},\
74 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
75 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
76 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
77 PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0},
78
79
80
81 #define RTL8723A_TRANS_CARDEMU_TO_SUS \
82 \
83 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK,\
84 PWR_BASEADDR_MAC, PWR_CMD_WRITE, \
85 BIT(4)|BIT(3), (BIT(4)|BIT(3))},\
86 \
87 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK| \
88 PWR_INTF_SDIO_MSK,\
89 PWR_BASEADDR_MAC, \
90 PWR_CMD_WRITE, \
91 BIT(3)|BIT(4), BIT(3)}, \
92 \
93 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
94 PWR_INTF_PCI_MSK, PWR_BASEADDR_MAC, \
95 PWR_CMD_WRITE, BIT(3)|BIT(4), \
96 BIT(3)|BIT(4)}, \
97 \
98 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
99 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
100 PWR_CMD_WRITE, BIT(0), BIT(0)}, \
101 \
102 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
103 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
104 PWR_CMD_POLLING, BIT(1), 0},
105
106
107
108
109 #define RTL8723A_TRANS_SUS_TO_CARDEMU \
110 \
111 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,\
112 PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0},\
113 \
114 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK,\
115 PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)},\
116 \
117 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
118 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0},
119
120
121
122
123 #define RTL8723A_TRANS_CARDEMU_TO_CARDDIS \
124 \
125 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
126 PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, \
127 PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \
128 \
129 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
130 PWR_INTF_PCI_MSK, PWR_BASEADDR_MAC,\
131 PWR_CMD_WRITE, BIT(2), BIT(2)}, \
132 \
133 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
134 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
135 PWR_CMD_WRITE, BIT(0), BIT(0)}, \
136 \
137 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
138 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
139 PWR_CMD_POLLING, BIT(1), 0},
140
141
142
143
144 #define RTL8723A_TRANS_CARDDIS_TO_CARDEMU\
145 \
146 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
147 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
148 PWR_CMD_WRITE, BIT(0), 0}, \
149 \
150 {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
151 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
152 PWR_CMD_POLLING, BIT(1), BIT(1)},\
153 \
154 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
155 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
156 PWR_CMD_WRITE, BIT(3)|BIT(4), 0},\
157 \
158 {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
159 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
160 PWR_CMD_WRITE, 0xFF, 0},
161
162
163
164 #define RTL8723A_TRANS_CARDEMU_TO_PDN \
165 {0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
166 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
167 PWR_CMD_WRITE, BIT(0), 0},\
168 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
169 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
170 PWR_CMD_WRITE, BIT(7), BIT(7)},
171
172
173
174 #define RTL8723A_TRANS_PDN_TO_CARDEMU \
175 {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
176 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
177 PWR_CMD_WRITE, BIT(7), 0},
178
179
180
181
182 #define RTL8723A_TRANS_ACT_TO_LPS \
183 {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
184 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
185 PWR_CMD_WRITE, 0xFF, 0xFF}, \
186 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
187 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
188 PWR_CMD_WRITE, 0xFF, 0x7F}, \
189 \
190 {0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
191 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
192 PWR_CMD_POLLING, 0xFF, 0},\
193 \
194 {0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
195 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
196 PWR_CMD_POLLING, 0xFF, 0},\
197 \
198 {0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
199 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
200 PWR_CMD_POLLING, 0xFF, 0},\
201 \
202 {0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
203 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
204 PWR_CMD_POLLING, 0xFF, 0},\
205 \
206 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
207 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
208 PWR_CMD_WRITE, BIT(0), 0},\
209 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
210 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
211 PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},\
212 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
213 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
214 PWR_CMD_WRITE, BIT(1), 0}, \
215 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
216 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
217 PWR_CMD_WRITE, 0xFF, 0x3F}, \
218 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
219 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
220 PWR_CMD_WRITE, BIT(1), 0}, \
221 \
222 {0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
223 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
224 PWR_CMD_WRITE, BIT(5), BIT(5)},\
225
226 #define RTL8723A_TRANS_LPS_TO_ACT\
227 \
228 \
229 {0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
230 PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO,\
231 PWR_CMD_WRITE, 0xFF, 0x84}, \
232 {0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
233 PWR_INTF_USB_MSK, PWR_BASEADDR_MAC,\
234 PWR_CMD_WRITE, 0xFF, 0x84}, \
235 {0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
236 PWR_INTF_PCI_MSK, PWR_BASEADDR_MAC,\
237 PWR_CMD_WRITE, 0xFF, 0x84}, \
238 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
239 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
240 PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, \
241 \
242 {0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
243 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
244 PWR_CMD_WRITE, BIT(4), 0}, \
245 \
246 {0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
247 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
248 PWR_CMD_POLLING, BIT(7), 0}, \
249 \
250 {0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
251 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
252 PWR_CMD_WRITE, BIT(6)|BIT(7), 0},\
253 \
254 {0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
255 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
256 PWR_CMD_WRITE, BIT(1), BIT(1)},\
257 \
258 {0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
259 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
260 PWR_CMD_WRITE, 0xFF, 0xFF},\
261 \
262 {0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
263 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
264 PWR_CMD_WRITE, BIT(1)|BIT(0), BIT(1)|BIT(0)},\
265 {0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
266 PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC,\
267 PWR_CMD_WRITE, 0xFF, 0},
268
269
270
271
272 #define RTL8723A_TRANS_END \
273 {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
274 0, PWR_CMD_END, 0, 0}
275
276 extern struct wlan_pwr_cfg rtl8723A_power_on_flow
277 [RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS +
278 RTL8723A_TRANS_END_STEPS];
279 extern struct wlan_pwr_cfg rtl8723A_radio_off_flow
280 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
281 RTL8723A_TRANS_END_STEPS];
282 extern struct wlan_pwr_cfg rtl8723A_card_disable_flow
283 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
284 RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS +
285 RTL8723A_TRANS_END_STEPS];
286 extern struct wlan_pwr_cfg rtl8723A_card_enable_flow
287 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
288 RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS +
289 RTL8723A_TRANS_END_STEPS];
290 extern struct wlan_pwr_cfg rtl8723A_suspend_flow
291 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
292 RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS +
293 RTL8723A_TRANS_END_STEPS];
294 extern struct wlan_pwr_cfg rtl8723A_resume_flow
295 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
296 RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS +
297 RTL8723A_TRANS_END_STEPS];
298 extern struct wlan_pwr_cfg rtl8723A_hwpdn_flow
299 [RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS +
300 RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS +
301 RTL8723A_TRANS_END_STEPS];
302 extern struct wlan_pwr_cfg rtl8723A_enter_lps_flow
303 [RTL8723A_TRANS_ACT_TO_LPS_STEPS + RTL8723A_TRANS_END_STEPS];
304 extern struct wlan_pwr_cfg rtl8723A_leave_lps_flow
305 [RTL8723A_TRANS_LPS_TO_ACT_STEPS + RTL8723A_TRANS_END_STEPS];
306
307
308 #define RTL8723_NIC_PWR_ON_FLOW rtl8723A_power_on_flow
309 #define RTL8723_NIC_RF_OFF_FLOW rtl8723A_radio_off_flow
310 #define RTL8723_NIC_DISABLE_FLOW rtl8723A_card_disable_flow
311 #define RTL8723_NIC_ENABLE_FLOW rtl8723A_card_enable_flow
312 #define RTL8723_NIC_SUSPEND_FLOW rtl8723A_suspend_flow
313 #define RTL8723_NIC_RESUME_FLOW rtl8723A_resume_flow
314 #define RTL8723_NIC_PDN_FLOW rtl8723A_hwpdn_flow
315 #define RTL8723_NIC_LPS_ENTER_FLOW rtl8723A_enter_lps_flow
316 #define RTL8723_NIC_LPS_LEAVE_FLOW rtl8723A_leave_lps_flow
317
318 #endif