Lines Matching refs:stream_map

179 #define for_each_stream_map(i, base, stream_map)                               \  argument
180 for (i = 0, stream_map = &(base)->stream_maps[0]; \
181 i < MAX_DARTS_PER_DEVICE && stream_map->dart; \
182 stream_map = &(base)->stream_maps[++i])
193 apple_dart_hw_enable_translation(struct apple_dart_stream_map *stream_map) in apple_dart_hw_enable_translation() argument
197 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_hw_enable_translation()
199 stream_map->dart->regs + DART_TCR(sid)); in apple_dart_hw_enable_translation()
202 static void apple_dart_hw_disable_dma(struct apple_dart_stream_map *stream_map) in apple_dart_hw_disable_dma() argument
206 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_hw_disable_dma()
207 writel(0, stream_map->dart->regs + DART_TCR(sid)); in apple_dart_hw_disable_dma()
211 apple_dart_hw_enable_bypass(struct apple_dart_stream_map *stream_map) in apple_dart_hw_enable_bypass() argument
215 WARN_ON(!stream_map->dart->supports_bypass); in apple_dart_hw_enable_bypass()
216 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_hw_enable_bypass()
218 stream_map->dart->regs + DART_TCR(sid)); in apple_dart_hw_enable_bypass()
221 static void apple_dart_hw_set_ttbr(struct apple_dart_stream_map *stream_map, in apple_dart_hw_set_ttbr() argument
227 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_hw_set_ttbr()
229 stream_map->dart->regs + DART_TTBR(sid, idx)); in apple_dart_hw_set_ttbr()
232 static void apple_dart_hw_clear_ttbr(struct apple_dart_stream_map *stream_map, in apple_dart_hw_clear_ttbr() argument
237 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_hw_clear_ttbr()
238 writel(0, stream_map->dart->regs + DART_TTBR(sid, idx)); in apple_dart_hw_clear_ttbr()
242 apple_dart_hw_clear_all_ttbrs(struct apple_dart_stream_map *stream_map) in apple_dart_hw_clear_all_ttbrs() argument
247 apple_dart_hw_clear_ttbr(stream_map, i); in apple_dart_hw_clear_all_ttbrs()
251 apple_dart_hw_stream_command(struct apple_dart_stream_map *stream_map, in apple_dart_hw_stream_command() argument
258 spin_lock_irqsave(&stream_map->dart->lock, flags); in apple_dart_hw_stream_command()
260 writel(stream_map->sidmap, stream_map->dart->regs + DART_STREAM_SELECT); in apple_dart_hw_stream_command()
261 writel(command, stream_map->dart->regs + DART_STREAM_COMMAND); in apple_dart_hw_stream_command()
264 stream_map->dart->regs + DART_STREAM_COMMAND, command_reg, in apple_dart_hw_stream_command()
268 spin_unlock_irqrestore(&stream_map->dart->lock, flags); in apple_dart_hw_stream_command()
271 dev_err(stream_map->dart->dev, in apple_dart_hw_stream_command()
273 command, stream_map->sidmap); in apple_dart_hw_stream_command()
281 apple_dart_hw_invalidate_tlb(struct apple_dart_stream_map *stream_map) in apple_dart_hw_invalidate_tlb() argument
283 return apple_dart_hw_stream_command(stream_map, in apple_dart_hw_invalidate_tlb()
290 struct apple_dart_stream_map stream_map; in apple_dart_hw_reset() local
299 stream_map.dart = dart; in apple_dart_hw_reset()
300 stream_map.sidmap = DART_STREAM_ALL; in apple_dart_hw_reset()
301 apple_dart_hw_disable_dma(&stream_map); in apple_dart_hw_reset()
302 apple_dart_hw_clear_all_ttbrs(&stream_map); in apple_dart_hw_reset()
307 return apple_dart_hw_invalidate_tlb(&stream_map); in apple_dart_hw_reset()
314 struct apple_dart_stream_map stream_map; in apple_dart_domain_flush_tlb() local
317 stream_map.dart = domain_stream_map->dart; in apple_dart_domain_flush_tlb()
318 stream_map.sidmap = atomic64_read(&domain_stream_map->sidmap); in apple_dart_domain_flush_tlb()
319 apple_dart_hw_invalidate_tlb(&stream_map); in apple_dart_domain_flush_tlb()
380 struct apple_dart_stream_map *stream_map) in apple_dart_setup_translation() argument
387 apple_dart_hw_set_ttbr(stream_map, i, in apple_dart_setup_translation()
390 apple_dart_hw_clear_ttbr(stream_map, i); in apple_dart_setup_translation()
392 apple_dart_hw_enable_translation(stream_map); in apple_dart_setup_translation()
393 apple_dart_hw_invalidate_tlb(stream_map); in apple_dart_setup_translation()
487 struct apple_dart_stream_map *stream_map; in apple_dart_attach_dev() local
509 for_each_stream_map(i, cfg, stream_map) in apple_dart_attach_dev()
510 apple_dart_setup_translation(dart_domain, stream_map); in apple_dart_attach_dev()
513 for_each_stream_map(i, cfg, stream_map) in apple_dart_attach_dev()
514 apple_dart_hw_disable_dma(stream_map); in apple_dart_attach_dev()
517 for_each_stream_map(i, cfg, stream_map) in apple_dart_attach_dev()
518 apple_dart_hw_enable_bypass(stream_map); in apple_dart_attach_dev()
529 struct apple_dart_stream_map *stream_map; in apple_dart_detach_dev() local
533 for_each_stream_map(i, cfg, stream_map) in apple_dart_detach_dev()
534 apple_dart_hw_disable_dma(stream_map); in apple_dart_detach_dev()
544 struct apple_dart_stream_map *stream_map; in apple_dart_probe_device() local
550 for_each_stream_map(i, cfg, stream_map) in apple_dart_probe_device()
552 dev, stream_map->dart->dev, in apple_dart_probe_device()
651 struct apple_dart_stream_map *stream_map; in apple_dart_release_group() local
656 for_each_stream_map(i, group_master_cfg, stream_map) in apple_dart_release_group()
657 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_release_group()
658 stream_map->dart->sid2group[sid] = NULL; in apple_dart_release_group()
668 struct apple_dart_stream_map *stream_map; in apple_dart_device_group() local
675 for_each_stream_map(i, cfg, stream_map) { in apple_dart_device_group()
676 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) { in apple_dart_device_group()
678 stream_map->dart->sid2group[sid]; in apple_dart_device_group()
715 for_each_stream_map(i, cfg, stream_map) in apple_dart_device_group()
716 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) in apple_dart_device_group()
717 stream_map->dart->sid2group[sid] = group; in apple_dart_device_group()