ARM: shmobile: IPMMU and DMAC prototype
Subsystems (3)
PATCH 1/1 ARM: shmobile: IPMMU and DMAC prototype
From: Magnus Damm <[email protected]>
This patch is a prototype hack to enable DMA Engine over IPMMU for devices such as QSPI, SDHI and MMCIF. The simple approach taken here is to identity map the DMA Engine slave devices in the IPMMU driver.
As expected this is just a test to see if the actual hardware works. I believe it at least half-works - the IPMMU fault errors go away when I test on r8a7791 Koelsch.
The code is far from ready for upstream merge for various reasons:
- The code is one huge layering violation (topology fixes should be elsewhere)
- It also clobbers the virtual I/O space without reservation (corruption!)
- Moreover, the identity mappings are added for all devices (just plain wrong)
Next step would be to figure out how to fix this properly.
---
arch/arm/boot/dts/r8a7791.dtsi | 32 +++++++++++++++++++++- drivers/iommu/ipmmu-vmsa.c | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-)
arch/arm/boot/dts/r8a7791.dtsi +31 -1
@@ -270,6 +270,21 @@ clock-names = "fck"; #dma-cells = <1>; dma-channels = <15>; + iommus = <&ipmmu_ds 0>, + <&ipmmu_ds 1>, + <&ipmmu_ds 2>, + <&ipmmu_ds 3>, + <&ipmmu_ds 4>, + <&ipmmu_ds 5>, + <&ipmmu_ds 6>, + <&ipmmu_ds 7>, + <&ipmmu_ds 8>, + <&ipmmu_ds 9>, + <&ipmmu_ds 10>, + <&ipmmu_ds 11>, + <&ipmmu_ds 12>, + <&ipmmu_ds 13>, + <&ipmmu_ds 14>; }; dmac1: dma-controller@e6720000 {
@@ -300,6 +315,21 @@ clock-names = "fck"; #dma-cells = <1>; dma-channels = <15>; + iommus = <&ipmmu_ds 15>, + <&ipmmu_ds 16>, + <&ipmmu_ds 17>, + <&ipmmu_ds 18>, + <&ipmmu_ds 19>, + <&ipmmu_ds 20>, + <&ipmmu_ds 21>, + <&ipmmu_ds 22>, + <&ipmmu_ds 23>, + <&ipmmu_ds 24>, + <&ipmmu_ds 25>, + <&ipmmu_ds 26>, + <&ipmmu_ds 27>, + <&ipmmu_ds 28>, + <&ipmmu_ds 29>; }; audma0: dma-controller@ec700000 {
@@ -1522,7 +1552,7 @@ interrupts = <0 198 IRQ_TYPE_LEVEL_HIGH>, <0 199 IRQ_TYPE_LEVEL_HIGH>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; ipmmu_mp: mmu@ec680000 {
drivers/iommu/ipmmu-vmsa.c +57 -0
69 lines not on this page · raw message