1
2
3
4
5
6
7
8
9#ifndef _DW_EDMA_V0_REGS_H
10#define _DW_EDMA_V0_REGS_H
11
12#include <linux/dmaengine.h>
13
14#define EDMA_V0_MAX_NR_CH 8
15#define EDMA_V0_VIEWPORT_MASK GENMASK(2, 0)
16#define EDMA_V0_DONE_INT_MASK GENMASK(7, 0)
17#define EDMA_V0_ABORT_INT_MASK GENMASK(23, 16)
18#define EDMA_V0_WRITE_CH_COUNT_MASK GENMASK(3, 0)
19#define EDMA_V0_READ_CH_COUNT_MASK GENMASK(19, 16)
20#define EDMA_V0_CH_STATUS_MASK GENMASK(6, 5)
21#define EDMA_V0_DOORBELL_CH_MASK GENMASK(2, 0)
22#define EDMA_V0_LINKED_LIST_ERR_MASK GENMASK(7, 0)
23
24#define EDMA_V0_CH_ODD_MSI_DATA_MASK GENMASK(31, 16)
25#define EDMA_V0_CH_EVEN_MSI_DATA_MASK GENMASK(15, 0)
26
27struct dw_edma_v0_ch_regs {
28 u32 ch_control1;
29 u32 ch_control2;
30 u32 transfer_size;
31 u32 sar_low;
32 u32 sar_high;
33 u32 dar_low;
34 u32 dar_high;
35 u32 llp_low;
36 u32 llp_high;
37};
38
39struct dw_edma_v0_ch {
40 struct dw_edma_v0_ch_regs wr;
41 u32 padding_1[55];
42 struct dw_edma_v0_ch_regs rd;
43 u32 padding_2[55];
44};
45
46struct dw_edma_v0_unroll {
47 u32 padding_1;
48 u32 wr_engine_chgroup;
49 u32 rd_engine_chgroup;
50 u32 wr_engine_hshake_cnt_low;
51 u32 wr_engine_hshake_cnt_high;
52 u32 padding_2[2];
53 u32 rd_engine_hshake_cnt_low;
54 u32 rd_engine_hshake_cnt_high;
55 u32 padding_3[2];
56 u32 wr_ch0_pwr_en;
57 u32 wr_ch1_pwr_en;
58 u32 wr_ch2_pwr_en;
59 u32 wr_ch3_pwr_en;
60 u32 wr_ch4_pwr_en;
61 u32 wr_ch5_pwr_en;
62 u32 wr_ch6_pwr_en;
63 u32 wr_ch7_pwr_en;
64 u32 padding_4[8];
65 u32 rd_ch0_pwr_en;
66 u32 rd_ch1_pwr_en;
67 u32 rd_ch2_pwr_en;
68 u32 rd_ch3_pwr_en;
69 u32 rd_ch4_pwr_en;
70 u32 rd_ch5_pwr_en;
71 u32 rd_ch6_pwr_en;
72 u32 rd_ch7_pwr_en;
73 u32 padding_5[30];
74 struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH];
75};
76
77struct dw_edma_v0_legacy {
78 u32 viewport_sel;
79 struct dw_edma_v0_ch_regs ch;
80};
81
82struct dw_edma_v0_regs {
83
84 u32 ctrl_data_arb_prior;
85 u32 padding_1;
86 u32 ctrl;
87 u32 wr_engine_en;
88 u32 wr_doorbell;
89 u32 padding_2;
90 u32 wr_ch_arb_weight_low;
91 u32 wr_ch_arb_weight_high;
92 u32 padding_3[3];
93 u32 rd_engine_en;
94 u32 rd_doorbell;
95 u32 padding_4;
96 u32 rd_ch_arb_weight_low;
97 u32 rd_ch_arb_weight_high;
98 u32 padding_5[3];
99
100 u32 wr_int_status;
101 u32 padding_6;
102 u32 wr_int_mask;
103 u32 wr_int_clear;
104 u32 wr_err_status;
105 u32 wr_done_imwr_low;
106 u32 wr_done_imwr_high;
107 u32 wr_abort_imwr_low;
108 u32 wr_abort_imwr_high;
109 u32 wr_ch01_imwr_data;
110 u32 wr_ch23_imwr_data;
111 u32 wr_ch45_imwr_data;
112 u32 wr_ch67_imwr_data;
113 u32 padding_7[4];
114 u32 wr_linked_list_err_en;
115 u32 padding_8[3];
116 u32 rd_int_status;
117 u32 padding_9;
118 u32 rd_int_mask;
119 u32 rd_int_clear;
120 u32 padding_10;
121 u32 rd_err_status_low;
122 u32 rd_err_status_high;
123 u32 padding_11[2];
124 u32 rd_linked_list_err_en;
125 u32 padding_12;
126 u32 rd_done_imwr_low;
127 u32 rd_done_imwr_high;
128 u32 rd_abort_imwr_low;
129 u32 rd_abort_imwr_high;
130 u32 rd_ch01_imwr_data;
131 u32 rd_ch23_imwr_data;
132 u32 rd_ch45_imwr_data;
133 u32 rd_ch67_imwr_data;
134 u32 padding_13[4];
135
136 union dw_edma_v0_type {
137 struct dw_edma_v0_legacy legacy;
138 struct dw_edma_v0_unroll unroll;
139 } type;
140};
141
142struct dw_edma_v0_lli {
143 u32 control;
144 u32 transfer_size;
145 u32 sar_low;
146 u32 sar_high;
147 u32 dar_low;
148 u32 dar_high;
149};
150
151struct dw_edma_v0_llp {
152 u32 control;
153 u32 reserved;
154 u32 llp_low;
155 u32 llp_high;
156};
157
158#endif
159