d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0051-iommu-sun50i-Ensure-bypass-is-disabled.patch
1 From 384e2ca3c049fe36f4e679fc76fcc8dfdc9297f9 Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Wed, 27 Apr 2022 19:06:28 -0500
4 Subject: [PATCH 051/117] iommu/sun50i: Ensure bypass is disabled
5
6 The H6 variant of the hardware disables bypass by default. The D1
7 variant of the hardware enables bypass for all masters by default.
8
9 Since the driver expects bypass to be disabled, ensure that is the case.
10
11 Signed-off-by: Samuel Holland <samuel@sholland.org>
12 ---
13 drivers/iommu/sun50i-iommu.c | 2 ++
14 1 file changed, 2 insertions(+)
15
16 --- a/drivers/iommu/sun50i-iommu.c
17 +++ b/drivers/iommu/sun50i-iommu.c
18 @@ -445,6 +445,8 @@ static int sun50i_iommu_enable(struct su
19
20 spin_lock_irqsave(&iommu->iommu_lock, flags);
21
22 + iommu_write(iommu, IOMMU_BYPASS_REG, 0);
23 +
24 iommu_write(iommu, IOMMU_TTB_REG, sun50i_domain->dt_dma);
25 iommu_write(iommu, IOMMU_TLB_PREFETCH_REG,
26 IOMMU_TLB_PREFETCH_MASTER_ENABLE(0) |