Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
baa45ab
iommu/io-pgtable: Introduce unmap_pages() as a page table op
Jun 16, 2021
e0ba04d
iommu: Add an unmap_pages() op for IOMMU drivers
Jun 16, 2021
d2b972c
iommu/io-pgtable: Introduce map_pages() as a page table op
Jun 16, 2021
6ccb88e
iommu: Add a map_pages() op for IOMMU drivers
Jun 16, 2021
3510271
iommu: Use bitmap to calculate page size in iommu_pgsize()
willdeacon Jun 16, 2021
f9f844e
iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts
willdeacon Jun 16, 2021
14d0ba1
iommu: Hook up '->unmap_pages' driver callback
willdeacon Jun 16, 2021
3ee5e6d
iommu: Add support for the map_pages() callback
Jun 16, 2021
553e347
iommu/io-pgtable-arm: Prepare PTE methods for handling multiple entries
Jun 16, 2021
f835a4b
iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()
Jun 16, 2021
3a3f4e1
iommu/io-pgtable-arm: Implement arm_lpae_map_pages()
Jun 16, 2021
0cce8f9
iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages()
Jun 16, 2021
3b9cd8f
iommu/io-pgtable-arm-v7s: Implement arm_v7s_map_pages()
Jun 16, 2021
ea2fbf1
iommu/arm-smmu: Implement the unmap_pages() IOMMU driver callback
Jun 16, 2021
9a3c053
iommu/arm-smmu: Implement the map_pages() IOMMU driver callback
Jun 16, 2021
84981c0
iommu/io-pgtable: Add DART pagetable format
svenpeter42 Mar 19, 2021
c18b10f
dt-bindings: iommu: add DART iommu bindings
svenpeter42 Mar 19, 2021
d84c04f
iommu/dart: Add DART iommu driver
svenpeter42 Mar 19, 2021
5a8cd2b
arm64: apple: add dwc3 controller and DART nodes
svenpeter42 Jun 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions Documentation/devicetree/bindings/iommu/apple,dart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iommu/apple,dart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple DART IOMMU

maintainers:
- Sven Peter <sven@svenpeter.dev>

description: |+
Apple SoCs may contain an implementation of their Device Address
Resolution Table which provides a mandatory layer of address
translations for various masters.

Each DART instance is capable of handling up to 16 different streams
with individual pagetables and page-level read/write protection flags.

This DART IOMMU also raises interrupts in response to various
fault conditions.

properties:
compatible:
const: apple,t8103-dart

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
description:
Reference to the gate clock phandle if required for this IOMMU.
Optional since not all IOMMUs are attached to a clock gate.

'#iommu-cells':
const: 1
description:
Has to be one. The single cell describes the stream id emitted by
a master to the IOMMU.

required:
- compatible
- reg
- '#iommu-cells'
- interrupts

additionalProperties: false

examples:
- |+
dart1: iommu@82f80000 {
compatible = "apple,t8103-dart";
reg = <0x82f80000 0x4000>;
interrupts = <1 781 4>;
#iommu-cells = <1>;
};

master1 {
iommus = <&dart1 0>;
};

- |+
dart2a: iommu@82f00000 {
compatible = "apple,t8103-dart";
reg = <0x82f00000 0x4000>;
interrupts = <1 781 4>;
#iommu-cells = <1>;
};
dart2b: iommu@82f80000 {
compatible = "apple,t8103-dart";
reg = <0x82f80000 0x4000>;
interrupts = <1 781 4>;
#iommu-cells = <1>;
};

master2 {
iommus = <&dart2a 0>, <&dart2b 1>;
};
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,13 @@ L: linux-input@vger.kernel.org
S: Odd fixes
F: drivers/input/mouse/bcm5974.c

APPLE DART IOMMU DRIVER
M: Sven Peter <sven@svenpeter.dev>
L: iommu@lists.linux-foundation.org
S: Maintained
F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
F: drivers/iommu/apple-dart.c

APPLE SMC DRIVER
M: Henrik Rydberg <rydberg@bitmath.org>
L: linux-hwmon@vger.kernel.org
Expand Down
51 changes: 51 additions & 0 deletions arch/arm64/boot/dts/apple/t8103.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
#size-cells = <2>;

ranges;
dma-ranges;
nonposted-mmio;

serial0: serial@235200000 {
Expand All @@ -131,5 +132,55 @@
interrupt-controller;
reg = <0x2 0x3b100000 0x0 0x8000>;
};

dwc3_0_dart_0: iommu@382f00000 {
compatible = "apple,t8103-dart";
reg = <0x3 0x82f00000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 781 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};

dwc3_0_dart_1: iommu@382f80000 {
compatible = "apple,t8103-dart";
reg = <0x3 0x82f80000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 781 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};

dwc3_0: usb@382280000{
compatible = "snps,dwc3";
reg = <0x3 0x82280000 0x0 0x100000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 777 IRQ_TYPE_LEVEL_HIGH>;
dr_mode = "host";
iommus = <&dwc3_0_dart_0 0>, <&dwc3_0_dart_1 1>;
};

dwc3_1_dart_0: iommu@502f00000 {
compatible = "apple,t8103-dart";
reg = <0x5 0x02f00000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 861 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};

dwc3_1_dart_1: iommu@502f80000 {
compatible = "apple,t8103-dart";
reg = <0x5 0x02f80000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 861 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
};

dwc3_1: usb@502280000{
compatible = "snps,dwc3";
reg = <0x5 0x02280000 0x0 0x100000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 857 IRQ_TYPE_LEVEL_HIGH>;
dr_mode = "host";
iommus = <&dwc3_1_dart_0 0>, <&dwc3_1_dart_1 1>;
};
};
};
14 changes: 14 additions & 0 deletions drivers/iommu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,20 @@ config SPAPR_TCE_IOMMU
Enables bits of IOMMU API required by VFIO. The iommu_ops
is not implemented as it is not necessary for VFIO.

config APPLE_DART
tristate "Apple DART IOMMU Support"
depends on ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
select IOMMU_API
select IOMMU_IO_PGTABLE_LPAE
default ARCH_APPLE
help
Support for Apple DART (Device Address Resolution Table) IOMMUs
found in Apple ARM SoCs like the M1.
This IOMMU is required for most peripherals using DMA to access
the main memory.

Say Y here if you are using an Apple SoC.

# ARM IOMMU support
config ARM_SMMU
tristate "ARM Ltd. System MMU (SMMU) Support"
Expand Down
1 change: 1 addition & 0 deletions drivers/iommu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
obj-$(CONFIG_IOMMU_SVA_LIB) += iommu-sva-lib.o io-pgfault.o
obj-$(CONFIG_SPRD_IOMMU) += sprd-iommu.o
obj-$(CONFIG_APPLE_DART) += apple-dart.o
Loading