iommu/dart: Initialize DART_STREAMS_ENABLE
Subsystems (2)
PATCH 1/1 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.
---
While this could technically count as a fix I don't think it needs to go to 5.15 since no driver that requires this is in there. The first driver that needs this will likely only be ready for the 5.17 merge window.
drivers/iommu/apple-dart.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/iommu/apple-dart.c +5 -0
@@ -70,6 +70,8 @@#define DART_ERROR_ADDR_HI 0x54#define DART_ERROR_ADDR_LO 0x50 +#define DART_STREAMS_ENABLE 0xfc +#define DART_TCR (sid) (0x100 + 4 * (sid))#define DART_TCR_TRANSLATE_ENABLE BIT(7)#define DART_TCR_BYPASS0_ENABLE BIT(8)
@@ -299,6 +301,9 @@ static int apple_dart_hw_reset(struct apple_dart *dart)apple_dart_hw_disable_dma (&stream_map);apple_dart_hw_clear_all_ttbrs (&stream_map); +/* enable all streams globally since TCR is used to control isolation */ +writel (DART_STREAM_ALL , dart->regs +DART_STREAMS_ENABLE ); +/* clear any pending errors before the interrupt is unmasked */ writel (readl (dart->regs +DART_ERROR ), dart->regs +DART_ERROR );
Signature · 1 line
2.25.1
Quoted 33 lines · Sven Peter
DART has an additional global register to control which streams are isolated. This register is a bit redundant since
DART_TCRcan already be used to control isolation and is usually initialized toDART_STREAM_ALLby 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 initializingDART_STREAMS_ENABLEduring reset.Reported-by Martin Povišer <[email protected]>Signed-off-by Sven Peter <[email protected]>---
While this could technically count as a fix I don't think it needs to go to 5.15 since no driver that requires this is in there. The first driver that needs this will likely only be ready for the 5.17 merge window.
drivers/iommu/apple-dart.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/iommu/apple-dart.c +2
-0@@ -70,6 +70,8 @@#define DART_ERROR_ADDR_HI 0x54#define DART_ERROR_ADDR_LO 0x50 +#define DART_STREAMS_ENABLE 0xfc +#define DART_TCR (sid) (0x100 + 4 * (sid))#define DART_TCR_TRANSLATE_ENABLE BIT(7)#define DART_TCR_BYPASS0_ENABLE BIT(8)
drivers/iommu/apple-dart.c static int apple_dart_hw_reset(struct apple_dart *dart) · line 309
Quoted 9 lines
drivers/iommu/apple-dart.c +3
-0@@ -299,6 +301,9 @@ static int apple_dart_hw_reset(struct apple_dart *dart)apple_dart_hw_disable_dma (&stream_map);apple_dart_hw_clear_all_ttbrs (&stream_map); +/* enable all streams globally since TCR is used to control isolation */ +writel (DART_STREAM_ALL , dart->regs +DART_STREAMS_ENABLE ); +/* clear any pending errors before the interrupt is unmasked */ writel (readl (dart->regs +DART_ERROR ), dart->regs +DART_ERROR );
Signature · 2 lines
Hector Martin ([email protected]) Public Key: https://mrcn.st/pub
Quoted 10 lines · Sven Peter
DART has an additional global register to control which streams are isolated. This register is a bit redundant since
DART_TCRcan already be used to control isolation and is usually initialized toDART_STREAM_ALLby 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 initializingDART_STREAMS_ENABLEduring reset.Reported-by Martin Povišer <[email protected]>Signed-off-by Sven Peter <[email protected]>---
Applied, thanks.