1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2021 AMD.All rights reserved.
4  *
5  * Author:      Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
6  *              Anup Kulkarni <anup.kulkarni@amd.com>
7  *              Bala Kishore <balakishore.pati@amd.com>
8  */
9 #if !defined(_RN_REG_HEADER)
10 #define _RN_REG_HEADER
11 
12 typedef	union acp_dma_cntl_0 {
13 	struct {
14 	unsigned int	dmachrst:1;
15 	unsigned int	dmachrun:1;
16 	unsigned int	dmachiocen:1;
17 	unsigned int	:29;
18 	} bits;
19 unsigned int	u32all;
20 } acp_dma_cntl_0_t;
21 
22 typedef	union acp_dma_ch_sts {
23 	struct {
24 	unsigned int	dmachrunsts:8;
25 	unsigned int	:24;
26 	} bits;
27 unsigned int	u32all;
28 } acp_dma_ch_sts_t;
29 
30 typedef	union acp_external_intr_enb {
31 	struct {
32 	unsigned int	acpextintrenb:1;
33 	unsigned int	:31;
34 	} bits;
35 unsigned int	u32all;
36 } acp_external_intr_enb_t;
37 
38 typedef	union acp_dsp0_intr_cntl {
39 	struct {
40 	unsigned int	dmaiocmask:8;
41 	unsigned int	:8;
42 	unsigned int	wov_dma_intr_mask:1;
43 	unsigned int	:6;
44 	unsigned int	audio_buffer_int_mask:6;
45 	unsigned int	:3;
46 	} bits;
47 unsigned int	u32all;
48 } acp_dsp0_intr_cntl_t;
49 
50 typedef	union acp_dsp0_intr_stat {
51 	struct {
52 	unsigned int	dmaiocstat:8;
53 	unsigned int	:8;
54 	unsigned int	wov_dma_stat:1;
55 	unsigned int	:6;
56 	unsigned int	audio_buffer_int_stat:6;
57 	unsigned int	:3;
58 	} bits;
59 unsigned int	u32all;
60 } acp_dsp0_intr_stat_t;
61 
62 typedef	union acp_dsp_sw_intr_cntl {
63 	struct {
64 	unsigned int	:2;
65 	unsigned int	dsp0_to_host_intr_mask:1;
66 	unsigned int	:29;
67 	} bits;
68 unsigned int	u32all;
69 } acp_dsp_sw_intr_cntl_t;
70 
71 typedef	union acp_dsp_sw_intr_stat {
72 	struct {
73 	unsigned int	host_to_dsp0_intr1_stat:1;
74 	unsigned int	host_to_dsp0_intr2_stat:1;
75 	unsigned int	dsp0_to_host_intr_stat:1;
76 	unsigned int	host_to_dsp0_intr3_stat:1;
77 	unsigned int	:28;
78 	} bits;
79 unsigned int	u32all;
80 } acp_dsp_sw_intr_stat_t;
81 
82 typedef	union acp_sw_intr_trig {
83 	struct {
84 	unsigned int	trig_host_to_dsp0_intr1:1;
85 	unsigned int	:1;
86 	unsigned int	trig_dsp0_to_host_intr:1;
87 	unsigned int	:29;
88 	} bits;
89 unsigned int	u32all;
90 } acp_sw_intr_trig_t;
91 
92 typedef	union dsp_interrupt_routing_ctrl {
93 	struct {
94 	unsigned int	dma_intr_level:2;
95 	unsigned int	:14;
96 	unsigned int	az_sw_i2s_intr_level:2;
97 	unsigned int	:2;
98 	unsigned int	host_to_dsp_intr1_level:2;
99 	unsigned int	:8;
100 	unsigned int	wov_intr_level:2;
101 	} bits;
102 unsigned int	u32all;
103 } dsp_interrupt_routing_ctrl_t;
104 
105 typedef	union acp_i2s_rx_ringbufaddr {
106 	struct {
107 	unsigned int	i2s_rx_ringbufaddr:27;
108 	unsigned int	:5;
109 	} bits;
110 unsigned int	u32all;
111 } acp_i2s_rx_ringbufaddr_t;
112 
113 typedef	union acp_i2s_rx_ringbufsize {
114 	struct {
115 	unsigned int	i2s_rx_ringbufsize:26;
116 	unsigned int	:6;
117 	} bits;
118 unsigned int	u32all;
119 } acp_i2s_rx_ringbufsize_t;
120 
121 typedef	union acp_i2s_rx_linkpositioncntr {
122 	struct {
123 	unsigned int	i2s_rx_linkpositioncntr:26;
124 	unsigned int	:6;
125 	} bits;
126 unsigned int	u32all;
127 } acp_i2s_rx_linkpositioncntr_t;
128 
129 typedef	union acp_i2s_rx_fifoaddr {
130 	struct {
131 	unsigned int	i2s_rx_fifoaddr:27;
132 	unsigned int	:5;
133 	} bits;
134 unsigned int	u32all;
135 } acp_i2s_rx_fifoaddr_t;
136 
137 typedef	union acp_i2s_rx_fifosize {
138 	struct {
139 	unsigned int	i2s_rx_fifosize:13;
140 	unsigned int	:19;
141 	} bits;
142 unsigned int	u32all;
143 } acp_i2s_rx_fifosize_t;
144 
145 typedef	union acp_i2s_rx_dma_size {
146 	struct {
147 	unsigned int	i2s_rx_dma_size:13;
148 	unsigned int	:19;
149 	} bits;
150 unsigned int	u32all;
151 } acp_i2s_rx_dma_size_t;
152 
153 typedef	union acp_i2s_rx_linearpositioncntr_high {
154 	struct {
155 	unsigned int	i2s_rx_linearpositioncntr_high:32;
156 	} bits;
157 unsigned int	u32all;
158 } acp_i2s_rx_linearpositioncntr_high_t;
159 
160 typedef	union acp_i2s_rx_linearpositioncntr_low {
161 	struct {
162 	unsigned int	i2s_rx_linearpositioncntr_low:32;
163 	} bits;
164 unsigned int	u32all;
165 } acp_i2s_rx_linearpositioncntr_low_t;
166 
167 typedef	union acp_i2s_rx_watermark_size {
168 	struct {
169 	unsigned int	i2s_rx_intr_watermark_size:26;
170 	unsigned int	:6;
171 	} bits;
172 unsigned int	u32all;
173 } acp_i2s_rx_intr_watermark_size_t;
174 
175 typedef	union acp_i2s_tx_ringbufaddr {
176 	struct {
177 	unsigned int	i2s_tx_ringbufaddr:27;
178 	unsigned int	:5;
179 	} bits;
180 unsigned int	u32all;
181 } acp_i2s_tx_ringbufaddr_t;
182 
183 typedef	union acp_i2s_tx_ringbufsize {
184 	struct {
185 	unsigned int	i2s_tx_ringbufsize:26;
186 	unsigned int	:6;
187 	} bits;
188 unsigned int	u32all;
189 } acp_i2s_tx_ringbufsize_t;
190 
191 typedef	union acp_i2s_tx_linkpositioncntr {
192 	struct {
193 	unsigned int	i2s_tx_linkpositioncntr:26;
194 	unsigned int	:6;
195 	} bits;
196 unsigned int	u32all;
197 } acp_i2s_tx_linkpositioncntr_t;
198 
199 typedef	union acp_i2s_tx_fifoaddr {
200 	struct {
201 	unsigned int	i2s_tx_fifoaddr:27;
202 	unsigned int	:5;
203 	} bits;
204 unsigned int	u32all;
205 } acp_i2s_tx_fifoaddr_t;
206 
207 typedef	union acp_i2s_tx_fifosize {
208 	struct {
209 	unsigned int	i2s_tx_fifosize:13;
210 	unsigned int	:19;
211 	} bits;
212 unsigned int	u32all;
213 } acp_i2s_tx_fifosize_t;
214 
215 typedef	union acp_i2s_tx_dma_size {
216 	struct {
217 	unsigned int	i2s_tx_dma_size:13;
218 	unsigned int	:19;
219 	} bits;
220 unsigned int	u32all;
221 } acp_i2s_tx_dma_size_t;
222 
223 typedef	union acp_i2s_tx_linearpositioncntr_high {
224 	struct {
225 	unsigned int	i2s_tx_linearpositioncntr_high:32;
226 	} bits;
227 unsigned int	u32all;
228 } acp_i2s_tx_linearpositioncntr_hight_t;
229 
230 typedef	union acp_i2s_tx_linearpositioncntr_low {
231 	struct {
232 	unsigned int	i2s_tx_linearpositioncntr_low:32;
233 	} bits;
234 unsigned int	u32all;
235 } acp_i2s_tx_linearpositioncntr_low_t;
236 
237 typedef	union acp_i2s_tx_intr_watermark_size {
238 	struct {
239 	unsigned int	i2s_tx_intr_watermark_size:26;
240 	unsigned int	:6;
241 	} bits;
242 unsigned int	u32all;
243 } acp_i2s_tx_intr_watermark_size_t;
244 
245 typedef	union acp_bt_rx_ringbufaddr {
246 	struct {
247 	unsigned int	bt_rx_ringbufaddr:27;
248 	unsigned int	:5;
249 	} bits;
250 unsigned int	u32all;
251 } acp_bt_rx_ringbufaddr_t;
252 
253 typedef	union acp_bt_rx_ringbufsize {
254 	struct {
255 	unsigned int	bt_rx_ringbufsize:26;
256 	unsigned int	:6;
257 	} bits;
258 unsigned int	u32all;
259 } acp_bt_rx_ringbufsize_t;
260 
261 typedef	union acp_bt_rx_linkpositioncntr {
262 	struct {
263 	unsigned int	bt_rx_linkpositioncntr:26;
264 	unsigned int	:6;
265 	} bits;
266 unsigned int	u32all;
267 } acp_bt_rx_linkpositioncntr_t;
268 
269 typedef	union acp_bt_rx_fifoaddr {
270 	struct {
271 	unsigned int	bt_rx_fifoaddr:27;
272 	unsigned int	:5;
273 	} bits;
274 unsigned int	u32all;
275 } acp_bt_rx_fifoaddr_t;
276 
277 typedef	union acp_bt_rx_fifosize {
278 	struct {
279 	unsigned int	bt_rx_fifosize:13;
280 	unsigned int	:19;
281 	} bits;
282 unsigned int	u32all;
283 } acp_bt_rx_fifosize_t;
284 
285 typedef	union acp_bt_rx_dma_size {
286 	struct {
287 	unsigned int	bt_rx_dma_size:13;
288 	unsigned int	:19;
289 	} bits;
290 unsigned int	u32all;
291 } acp_bt_rx_dma_size_t;
292 
293 typedef	union acp_bt_rx_linearpositioncntr_high {
294 	struct {
295 	unsigned int	bt_rx_linearpositioncntr_high:32;
296 	} bits;
297 unsigned int	u32all;
298 } acp_bt_rx_linearpositioncntr_high_t;
299 
300 typedef	union acp_bt_rx_linearpositioncntr_low {
301 	struct {
302 	unsigned int	bt_rx_linearpositioncntr_low:32;
303 	} bits;
304 unsigned int	u32all;
305 } acp_bt_rx_linearpositioncntr_low_t;
306 
307 typedef	union acp_bt_rx_intr_watermark_size {
308 	struct {
309 	unsigned int	bt_rx_intr_watermark_size:26;
310 	unsigned int	:6;
311 	} bits;
312 unsigned int	u32all;
313 } acp_bt_rx_intr_watermark_size_t;
314 
315 typedef	union acp_bt_tx_ringbufaddr {
316 	struct {
317 	unsigned int	bt_tx_ringbufaddr:27;
318 	unsigned int	:5;
319 	} bits;
320 unsigned int	u32all;
321 } acp_bt_tx_ringbufaddr_t;
322 
323 typedef	union acp_bt_tx_ringbufsize {
324 	struct {
325 	unsigned int	bt_tx_ringbufsize:26;
326 	unsigned int	:6;
327 	} bits;
328 unsigned int	u32all;
329 } acp_bt_tx_ringbufsize_t;
330 
331 typedef	union acp_bt_tx_linkpositiontcntr {
332 	struct {
333 	unsigned int	bt_tx_linkpositioncntr:26;
334 	unsigned int	:6;
335 	} bits;
336 unsigned int	u32all;
337 } acp_bt_tx_linkpositiontcntr_t;
338 
339 typedef	union acp_bt_tx_fifoaddr {
340 	struct {
341 	unsigned int	bt_tx_fifoaddr:27;
342 	unsigned int	:5;
343 	} bits;
344 unsigned int	u32all;
345 } acp_bt_tx_fifoaddr_t;
346 
347 typedef	union acp_bt_tx_fifosize {
348 	struct {
349 	unsigned int	bt_tx_fifosize:13;
350 	unsigned int	:19;
351 	} bits;
352 unsigned int	u32all;
353 } acp_bt_tx_fifosize_t;
354 typedef	union acp_bt_tx_dmasize {
355 	struct {
356 	unsigned int	bt_tx_dma_size:13;
357 	unsigned int	:19;
358 	} bits;
359 unsigned int	u32all;
360 } acp_bt_tx_dmasize_t;
361 
362 typedef	union acp_bt_tx_linearpositioncntr_high {
363 	struct {
364 	unsigned int	bt_tx_linearpositioncntr_high:32;
365 	} bits;
366 unsigned int	u32all;
367 } acp_bt_tx_linearpositioncntr_high_t;
368 
369 typedef	union acp_bt_tx_linearpositioncntr_low {
370 	struct {
371 	unsigned int	bt_tx_linearpositioncntr_low:32;
372 	} bits;
373 unsigned int	u32all;
374 } acp_bt_tx_linearpositioncntr_low_t;
375 
376 typedef	union acp_bt_tx_intr_watermark_size {
377 	struct {
378 	unsigned int	bt_tx_intr_watermark_size:26;
379 	unsigned int	:6;
380 	} bits;
381 unsigned int	u32all;
382 } acp_bt_tx_intr_watermark_size_t;
383 
384 typedef	union acp_i2stdm_ier {
385 	struct {
386 	unsigned int	i2stdm_ien:1;
387 	unsigned int	:31;
388 	} bits;
389 unsigned int	u32all;
390 } acp_i2stdm_ier_t;
391 typedef	union acp_i2stdm_irer {
392 	struct {
393 	unsigned int	i2stdm_rx_en:1;
394 	unsigned int	i2stdm_rx_protocol_mode:1;
395 	unsigned int	i2stdm_rx_data_path_mode:1;
396 	unsigned int	i2stdm_rx_samplen:3;
397 	unsigned int	i2stdm_rx_status:1;
398 	unsigned int	:25;
399 
400 	} bits;
401 unsigned int	u32all;
402 } acp_i2stdm_irer_t;
403 
404 typedef	union acp_i2stdm_iter {
405 	struct {
406 	unsigned int	i2stdm_txen:1;
407 	unsigned int	i2stdm_tx_protocol_mode:1;
408 	unsigned int	i2stdm_tx_data_path_mode:1;
409 	unsigned int	i2stdm_tx_samp_len:3;
410 	unsigned int	i2stdm_tx_status:1;
411 	unsigned int	:25;
412 	} bits;
413 unsigned int	u32all;
414 } acp_i2stdm_iter_t;
415 
416 typedef	union acp_bttdm_ier {
417 	struct {
418 	unsigned int	bttdm_ien:1;
419 	unsigned int	:31;
420 	} bits;
421 unsigned int	u32all;
422 } acp_bttdm_ier_t;
423 
424 typedef	union acp_bttdm_irer {
425 	struct {
426 	unsigned int	bttdm_rx_en:1;
427 	unsigned int	bttdm_rx_protocol_mode:1;
428 	unsigned int	bttdm_rx_data_path_mode:1;
429 	unsigned int	bttdm_rx_samplen:3;
430 	unsigned int	bttdm_rx_status:1;
431 	unsigned int	:25;
432 	} bits;
433 unsigned int	u32all;
434 } acp_bttdm_irer_t;
435 
436 typedef	union acp_bttdm_iter {
437 	struct {
438 	unsigned int	bttdm_txen:1;
439 	unsigned int	bttdm_tx_protocol_mode:1;
440 	unsigned int	bttdm_tx_data_path_mode:1;
441 	unsigned int	bttdm_tx_samp_len:3;
442 	unsigned int	bttdm_tx_status:1;
443 	unsigned int	:25;
444 	} bits;
445 unsigned int	u32all;
446 } acp_bttdm_iter_t;
447 
448 typedef	union acp_wov_pdm_dma_enable {
449 	struct {
450 	unsigned int	pdm_dma_en:1;
451 	unsigned int	pdm_dma_en_status:1;
452 	unsigned int	:30;
453 	} bits;
454 unsigned int	u32all;
455 } acp_wov_pdm_dma_enable_t;
456 
457 typedef	union acp_wov_rx_ringbufaddr {
458 	struct {
459 	unsigned int	rx_ringbufaddr:27;
460 	unsigned int	:5;
461 	} bits;
462 unsigned int	u32all;
463 } acp_wov_rx_ringbufaddr_t;
464 
465 typedef	union acp_wov_rx_ringbufsize {
466 	struct {
467 	unsigned int	rx_ringbufsize:26;
468 	unsigned int	:6;
469 	} bits;
470 unsigned int	u32all;
471 } acp_wov_rx_ringbufsize_t;
472 
473 typedef	union acp_wov_rx_intr_watermark_size {
474 	struct {
475 	unsigned int	rx_intr_watermark_size:26;
476 	unsigned int	:6;
477 	} bits;
478 unsigned int	u32all;
479 } acp_wov_rx_intr_watermark_size_t;
480 
481 typedef	union acp_wov_pdm_no_of_channels {
482 	struct {
483 	unsigned int	pdm_no_of_channels:2;
484 	unsigned int	:30;
485 	} bits;
486 unsigned int	u32all;
487 } acp_wov_pdm_no_of_channels_t;
488 
489 typedef	union acp_wov_pdm_decimation_factor {
490 	struct {
491 	unsigned int	pdm_decimation_factor:2;
492 	unsigned int	:30;
493 	} bits;
494 unsigned int	u32all;
495 } acp_wov_pdm_decimation_factor_t;
496 typedef	union acp_wov_misc_ctrl {
497 	struct {
498 	unsigned int	:3;
499 	unsigned int	pcm_data_shift_ctrl:2;
500 	unsigned int	:27;
501 	} bits;
502 unsigned int	u32all;
503 } acp_wov_misc_ctrl_t;
504 
505 typedef	union acp_wov_clk_ctrl {
506 	struct {
507 	unsigned int	brm_clk_ctrl:4;
508 	unsigned int	pdm_vad_clkdiv:2;
509 	unsigned int	:26;
510 	} bits;
511 unsigned int	u32all;
512 } acp_wov_clk_ctrl_t;
513 
514 typedef	union acp_srbm_cycle_sts {
515 	struct {
516 	unsigned int	srbm_clients_sts:1;
517 	unsigned int	:7;
518 
519 	} bits;
520 unsigned int	u32all;
521 } acp_srbm_cycle_sts_t;
522 
523 #endif
524 
525