Lines Matching full:dw

12 #include "dw-edma-v0-debugfs.h"
13 #include "dw-edma-v0-regs.h"
14 #include "dw-edma-core.h"
16 #define REGS_ADDR(dw, name) \ argument
18 struct dw_edma_v0_regs __iomem *__regs = (dw)->chip->reg_base; \
23 #define REGS_CH_ADDR(dw, name, _dir, _ch) \ argument
27 if ((dw)->chip->mf == EDMA_MF_EDMA_LEGACY) \
28 __ch_regs = REGS_ADDR(dw, type.legacy.ch); \
30 __ch_regs = REGS_ADDR(dw, type.unroll.ch[_ch].rd); \
32 __ch_regs = REGS_ADDR(dw, type.unroll.ch[_ch].wr); \
37 #define REGISTER(dw, name) \ argument
38 { dw, #name, REGS_ADDR(dw, name) }
40 #define CTX_REGISTER(dw, name, dir, ch) \ argument
41 { dw, #name, REGS_CH_ADDR(dw, name, dir, ch), dir, ch }
43 #define WR_REGISTER(dw, name) \ argument
44 { dw, #name, REGS_ADDR(dw, wr_##name) }
45 #define RD_REGISTER(dw, name) \ argument
46 { dw, #name, REGS_ADDR(dw, rd_##name) }
48 #define WR_REGISTER_LEGACY(dw, name) \ argument
49 { dw, #name, REGS_ADDR(dw, type.legacy.wr_##name) }
51 { dw, #name, REGS_ADDR(dw, type.legacy.rd_##name) }
53 #define WR_REGISTER_UNROLL(dw, name) \ argument
54 { dw, #name, REGS_ADDR(dw, type.unroll.wr_##name) }
55 #define RD_REGISTER_UNROLL(dw, name) \ argument
56 { dw, #name, REGS_ADDR(dw, type.unroll.rd_##name) }
64 struct dw_edma *dw; member
74 struct dw_edma *dw = entry->dw; in dw_edma_debugfs_u32_get() local
77 if (dw->chip->mf == EDMA_MF_EDMA_LEGACY && in dw_edma_debugfs_u32_get()
78 reg >= REGS_ADDR(dw, type.legacy.ch)) { in dw_edma_debugfs_u32_get()
85 raw_spin_lock_irqsave(&dw->lock, flags); in dw_edma_debugfs_u32_get()
87 writel(viewport_sel, REGS_ADDR(dw, type.legacy.viewport_sel)); in dw_edma_debugfs_u32_get()
90 raw_spin_unlock_irqrestore(&dw->lock, flags); in dw_edma_debugfs_u32_get()
99 static void dw_edma_debugfs_create_x32(struct dw_edma *dw, in dw_edma_debugfs_create_x32() argument
106 entries = devm_kcalloc(dw->chip->dev, nr_entries, sizeof(*entries), in dw_edma_debugfs_create_x32()
119 static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, in dw_edma_debugfs_regs_ch() argument
123 CTX_REGISTER(dw, ch_control1, dir, ch), in dw_edma_debugfs_regs_ch()
124 CTX_REGISTER(dw, ch_control2, dir, ch), in dw_edma_debugfs_regs_ch()
125 CTX_REGISTER(dw, transfer_size, dir, ch), in dw_edma_debugfs_regs_ch()
126 CTX_REGISTER(dw, sar.lsb, dir, ch), in dw_edma_debugfs_regs_ch()
127 CTX_REGISTER(dw, sar.msb, dir, ch), in dw_edma_debugfs_regs_ch()
128 CTX_REGISTER(dw, dar.lsb, dir, ch), in dw_edma_debugfs_regs_ch()
129 CTX_REGISTER(dw, dar.msb, dir, ch), in dw_edma_debugfs_regs_ch()
130 CTX_REGISTER(dw, llp.lsb, dir, ch), in dw_edma_debugfs_regs_ch()
131 CTX_REGISTER(dw, llp.msb, dir, ch), in dw_edma_debugfs_regs_ch()
136 dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); in dw_edma_debugfs_regs_ch()
140 dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) in dw_edma_debugfs_regs_wr() argument
144 WR_REGISTER(dw, engine_en), in dw_edma_debugfs_regs_wr()
145 WR_REGISTER(dw, doorbell), in dw_edma_debugfs_regs_wr()
146 WR_REGISTER(dw, ch_arb_weight.lsb), in dw_edma_debugfs_regs_wr()
147 WR_REGISTER(dw, ch_arb_weight.msb), in dw_edma_debugfs_regs_wr()
149 WR_REGISTER(dw, int_status), in dw_edma_debugfs_regs_wr()
150 WR_REGISTER(dw, int_mask), in dw_edma_debugfs_regs_wr()
151 WR_REGISTER(dw, int_clear), in dw_edma_debugfs_regs_wr()
152 WR_REGISTER(dw, err_status), in dw_edma_debugfs_regs_wr()
153 WR_REGISTER(dw, done_imwr.lsb), in dw_edma_debugfs_regs_wr()
154 WR_REGISTER(dw, done_imwr.msb), in dw_edma_debugfs_regs_wr()
155 WR_REGISTER(dw, abort_imwr.lsb), in dw_edma_debugfs_regs_wr()
156 WR_REGISTER(dw, abort_imwr.msb), in dw_edma_debugfs_regs_wr()
157 WR_REGISTER(dw, ch01_imwr_data), in dw_edma_debugfs_regs_wr()
158 WR_REGISTER(dw, ch23_imwr_data), in dw_edma_debugfs_regs_wr()
159 WR_REGISTER(dw, ch45_imwr_data), in dw_edma_debugfs_regs_wr()
160 WR_REGISTER(dw, ch67_imwr_data), in dw_edma_debugfs_regs_wr()
161 WR_REGISTER(dw, linked_list_err_en), in dw_edma_debugfs_regs_wr()
165 WR_REGISTER_UNROLL(dw, engine_chgroup), in dw_edma_debugfs_regs_wr()
166 WR_REGISTER_UNROLL(dw, engine_hshake_cnt.lsb), in dw_edma_debugfs_regs_wr()
167 WR_REGISTER_UNROLL(dw, engine_hshake_cnt.msb), in dw_edma_debugfs_regs_wr()
168 WR_REGISTER_UNROLL(dw, ch0_pwr_en), in dw_edma_debugfs_regs_wr()
169 WR_REGISTER_UNROLL(dw, ch1_pwr_en), in dw_edma_debugfs_regs_wr()
170 WR_REGISTER_UNROLL(dw, ch2_pwr_en), in dw_edma_debugfs_regs_wr()
171 WR_REGISTER_UNROLL(dw, ch3_pwr_en), in dw_edma_debugfs_regs_wr()
172 WR_REGISTER_UNROLL(dw, ch4_pwr_en), in dw_edma_debugfs_regs_wr()
173 WR_REGISTER_UNROLL(dw, ch5_pwr_en), in dw_edma_debugfs_regs_wr()
174 WR_REGISTER_UNROLL(dw, ch6_pwr_en), in dw_edma_debugfs_regs_wr()
175 WR_REGISTER_UNROLL(dw, ch7_pwr_en), in dw_edma_debugfs_regs_wr()
184 dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, regs_dent); in dw_edma_debugfs_regs_wr()
186 if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { in dw_edma_debugfs_regs_wr()
188 dw_edma_debugfs_create_x32(dw, debugfs_unroll_regs, nr_entries, in dw_edma_debugfs_regs_wr()
192 for (i = 0; i < dw->wr_ch_cnt; i++) { in dw_edma_debugfs_regs_wr()
197 dw_edma_debugfs_regs_ch(dw, EDMA_DIR_WRITE, i, ch_dent); in dw_edma_debugfs_regs_wr()
201 static noinline_for_stack void dw_edma_debugfs_regs_rd(struct dw_edma *dw, in dw_edma_debugfs_regs_rd() argument
206 RD_REGISTER(dw, engine_en), in dw_edma_debugfs_regs_rd()
207 RD_REGISTER(dw, doorbell), in dw_edma_debugfs_regs_rd()
208 RD_REGISTER(dw, ch_arb_weight.lsb), in dw_edma_debugfs_regs_rd()
209 RD_REGISTER(dw, ch_arb_weight.msb), in dw_edma_debugfs_regs_rd()
211 RD_REGISTER(dw, int_status), in dw_edma_debugfs_regs_rd()
212 RD_REGISTER(dw, int_mask), in dw_edma_debugfs_regs_rd()
213 RD_REGISTER(dw, int_clear), in dw_edma_debugfs_regs_rd()
214 RD_REGISTER(dw, err_status.lsb), in dw_edma_debugfs_regs_rd()
215 RD_REGISTER(dw, err_status.msb), in dw_edma_debugfs_regs_rd()
216 RD_REGISTER(dw, linked_list_err_en), in dw_edma_debugfs_regs_rd()
217 RD_REGISTER(dw, done_imwr.lsb), in dw_edma_debugfs_regs_rd()
218 RD_REGISTER(dw, done_imwr.msb), in dw_edma_debugfs_regs_rd()
219 RD_REGISTER(dw, abort_imwr.lsb), in dw_edma_debugfs_regs_rd()
220 RD_REGISTER(dw, abort_imwr.msb), in dw_edma_debugfs_regs_rd()
221 RD_REGISTER(dw, ch01_imwr_data), in dw_edma_debugfs_regs_rd()
222 RD_REGISTER(dw, ch23_imwr_data), in dw_edma_debugfs_regs_rd()
223 RD_REGISTER(dw, ch45_imwr_data), in dw_edma_debugfs_regs_rd()
224 RD_REGISTER(dw, ch67_imwr_data), in dw_edma_debugfs_regs_rd()
228 RD_REGISTER_UNROLL(dw, engine_chgroup), in dw_edma_debugfs_regs_rd()
229 RD_REGISTER_UNROLL(dw, engine_hshake_cnt.lsb), in dw_edma_debugfs_regs_rd()
230 RD_REGISTER_UNROLL(dw, engine_hshake_cnt.msb), in dw_edma_debugfs_regs_rd()
231 RD_REGISTER_UNROLL(dw, ch0_pwr_en), in dw_edma_debugfs_regs_rd()
232 RD_REGISTER_UNROLL(dw, ch1_pwr_en), in dw_edma_debugfs_regs_rd()
233 RD_REGISTER_UNROLL(dw, ch2_pwr_en), in dw_edma_debugfs_regs_rd()
234 RD_REGISTER_UNROLL(dw, ch3_pwr_en), in dw_edma_debugfs_regs_rd()
235 RD_REGISTER_UNROLL(dw, ch4_pwr_en), in dw_edma_debugfs_regs_rd()
236 RD_REGISTER_UNROLL(dw, ch5_pwr_en), in dw_edma_debugfs_regs_rd()
237 RD_REGISTER_UNROLL(dw, ch6_pwr_en), in dw_edma_debugfs_regs_rd()
238 RD_REGISTER_UNROLL(dw, ch7_pwr_en), in dw_edma_debugfs_regs_rd()
247 dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, regs_dent); in dw_edma_debugfs_regs_rd()
249 if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { in dw_edma_debugfs_regs_rd()
251 dw_edma_debugfs_create_x32(dw, debugfs_unroll_regs, nr_entries, in dw_edma_debugfs_regs_rd()
255 for (i = 0; i < dw->rd_ch_cnt; i++) { in dw_edma_debugfs_regs_rd()
260 dw_edma_debugfs_regs_ch(dw, EDMA_DIR_READ, i, ch_dent); in dw_edma_debugfs_regs_rd()
264 static void dw_edma_debugfs_regs(struct dw_edma *dw) in dw_edma_debugfs_regs() argument
267 REGISTER(dw, ctrl_data_arb_prior), in dw_edma_debugfs_regs()
268 REGISTER(dw, ctrl), in dw_edma_debugfs_regs()
273 regs_dent = debugfs_create_dir(REGISTERS_STR, dw->dma.dbg_dev_root); in dw_edma_debugfs_regs()
276 dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, regs_dent); in dw_edma_debugfs_regs()
278 dw_edma_debugfs_regs_wr(dw, regs_dent); in dw_edma_debugfs_regs()
279 dw_edma_debugfs_regs_rd(dw, regs_dent); in dw_edma_debugfs_regs()
282 void dw_edma_v0_debugfs_on(struct dw_edma *dw) in dw_edma_v0_debugfs_on() argument
287 debugfs_create_u32("mf", 0444, dw->dma.dbg_dev_root, &dw->chip->mf); in dw_edma_v0_debugfs_on()
288 debugfs_create_u16("wr_ch_cnt", 0444, dw->dma.dbg_dev_root, &dw->wr_ch_cnt); in dw_edma_v0_debugfs_on()
289 debugfs_create_u16("rd_ch_cnt", 0444, dw->dma.dbg_dev_root, &dw->rd_ch_cnt); in dw_edma_v0_debugfs_on()
291 dw_edma_debugfs_regs(dw); in dw_edma_v0_debugfs_on()