Skip to content

Commit 863c092

Browse files
svenpeter42joergroedel
authored andcommitted
iommu/apple-dart: Add support for t8103 USB4 DART
This variant of the regular t8103 DART is used for the two USB4/Thunderbolt PCIe controllers. It supports 64 instead of 16 streams which requires a slightly different MMIO layout. Acked-by: Hector Martin <marcan@marcan.st> Signed-off-by: Sven Peter <sven@svenpeter.dev> Link: https://lore.kernel.org/r/20231126151701.16534-4-sven@svenpeter.dev Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent c58a17a commit 863c092

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#define DART_T8020_TCR_BYPASS_DAPF BIT(12)
8282

8383
#define DART_T8020_TTBR 0x200
84+
#define DART_T8020_USB4_TTBR 0x400
8485
#define DART_T8020_TTBR_VALID BIT(31)
8586
#define DART_T8020_TTBR_ADDR_FIELD_SHIFT 0
8687
#define DART_T8020_TTBR_SHIFT 12
@@ -1217,6 +1218,33 @@ static const struct apple_dart_hw apple_dart_hw_t8103 = {
12171218
.ttbr_shift = DART_T8020_TTBR_SHIFT,
12181219
.ttbr_count = 4,
12191220
};
1221+
1222+
static const struct apple_dart_hw apple_dart_hw_t8103_usb4 = {
1223+
.type = DART_T8020,
1224+
.irq_handler = apple_dart_t8020_irq,
1225+
.invalidate_tlb = apple_dart_t8020_hw_invalidate_tlb,
1226+
.oas = 36,
1227+
.fmt = APPLE_DART,
1228+
.max_sid_count = 64,
1229+
1230+
.enable_streams = DART_T8020_STREAMS_ENABLE,
1231+
.lock = DART_T8020_CONFIG,
1232+
.lock_bit = DART_T8020_CONFIG_LOCK,
1233+
1234+
.error = DART_T8020_ERROR,
1235+
1236+
.tcr = DART_T8020_TCR,
1237+
.tcr_enabled = DART_T8020_TCR_TRANSLATE_ENABLE,
1238+
.tcr_disabled = 0,
1239+
.tcr_bypass = 0,
1240+
1241+
.ttbr = DART_T8020_USB4_TTBR,
1242+
.ttbr_valid = DART_T8020_TTBR_VALID,
1243+
.ttbr_addr_field_shift = DART_T8020_TTBR_ADDR_FIELD_SHIFT,
1244+
.ttbr_shift = DART_T8020_TTBR_SHIFT,
1245+
.ttbr_count = 4,
1246+
};
1247+
12201248
static const struct apple_dart_hw apple_dart_hw_t6000 = {
12211249
.type = DART_T6000,
12221250
.irq_handler = apple_dart_t8020_irq,
@@ -1309,6 +1337,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(apple_dart_pm_ops, apple_dart_suspend, apple_dar
13091337

13101338
static const struct of_device_id apple_dart_of_match[] = {
13111339
{ .compatible = "apple,t8103-dart", .data = &apple_dart_hw_t8103 },
1340+
{ .compatible = "apple,t8103-usb4-dart", .data = &apple_dart_hw_t8103_usb4 },
13121341
{ .compatible = "apple,t8110-dart", .data = &apple_dart_hw_t8110 },
13131342
{ .compatible = "apple,t6000-dart", .data = &apple_dart_hw_t6000 },
13141343
{},

0 commit comments

Comments
 (0)