Skip to content

Commit 5a009fc

Browse files
svenpeter42joergroedel
authored andcommitted
iommu/dart: Initialize DART_STREAMS_ENABLE
DART has an additional global register to control which streams are isolated. This register is a bit redundant since DART_TCR can already be used to control isolation and is usually initialized to DART_STREAM_ALL by the time we get control. Some DARTs (namely the one used for the audio controller) however have some streams disabled initially. Make sure those work by initializing DART_STREAMS_ENABLE during reset. Reported-by: Martin Povišer <povik@protonmail.com> Signed-off-by: Sven Peter <sven@svenpeter.dev> Reviewed-by: Hector Martin <marcan@marcan.st> Link: https://lore.kernel.org/r/20211019162253.45919-1-sven@svenpeter.dev Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 260aecd commit 5a009fc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
#define DART_ERROR_ADDR_HI 0x54
7171
#define DART_ERROR_ADDR_LO 0x50
7272

73+
#define DART_STREAMS_ENABLE 0xfc
74+
7375
#define DART_TCR(sid) (0x100 + 4 * (sid))
7476
#define DART_TCR_TRANSLATE_ENABLE BIT(7)
7577
#define DART_TCR_BYPASS0_ENABLE BIT(8)
@@ -301,6 +303,9 @@ static int apple_dart_hw_reset(struct apple_dart *dart)
301303
apple_dart_hw_disable_dma(&stream_map);
302304
apple_dart_hw_clear_all_ttbrs(&stream_map);
303305

306+
/* enable all streams globally since TCR is used to control isolation */
307+
writel(DART_STREAM_ALL, dart->regs + DART_STREAMS_ENABLE);
308+
304309
/* clear any pending errors before the interrupt is unmasked */
305310
writel(readl(dart->regs + DART_ERROR), dart->regs + DART_ERROR);
306311

0 commit comments

Comments
 (0)