openwrt-mirror/target/linux/d1/patches-6.1/0051-iommu-sun50i-Ensure-bypass-is-disabled.patch
Zoltan HERPAI 766570d60b kernel/d1: Restore kernel files for v6.1
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-05-29 17:56:28 +02:00

27 lines
931 B
Diff

From 384e2ca3c049fe36f4e679fc76fcc8dfdc9297f9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 27 Apr 2022 19:06:28 -0500
Subject: [PATCH 051/117] iommu/sun50i: Ensure bypass is disabled
The H6 variant of the hardware disables bypass by default. The D1
variant of the hardware enables bypass for all masters by default.
Since the driver expects bypass to be disabled, ensure that is the case.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/iommu/sun50i-iommu.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -445,6 +445,8 @@ static int sun50i_iommu_enable(struct su
spin_lock_irqsave(&iommu->iommu_lock, flags);
+ iommu_write(iommu, IOMMU_BYPASS_REG, 0);
+
iommu_write(iommu, IOMMU_TTB_REG, sun50i_domain->dt_dma);
iommu_write(iommu, IOMMU_TLB_PREFETCH_REG,
IOMMU_TLB_PREFETCH_MASTER_ENABLE(0) |