From: Andre Przywara <andre.przywara@arm.com>
To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Rob Herring <robh@kernel.org>
Cc: Chris Morgan <macromorgan@hotmail.com>,
Ryan Walklin <ryan@testtoast.com>,
Philippe Simons <simons.philippe@gmail.com>,
iommu@lists.linux.dev, devicetree@vger.kernel.org,
linux-sunxi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] iommu: sun50i: clear bypass register
Date: Sun, 16 Jun 2024 23:40:52 +0100 [thread overview]
Message-ID: <20240616224056.29159-2-andre.przywara@arm.com> (raw)
In-Reply-To: <20240616224056.29159-1-andre.przywara@arm.com>
From: Jernej Skrabec <jernej.skrabec@gmail.com>
The Allwinner H6 IOMMU has a bypass register, which allows to circumvent
the page tables for each possible master. The reset value for this
register is 0, which disables the bypass.
The Allwinner H616 IOMMU resets this register to 0x7f, which activates
the bypass for all masters, which is not what we want.
Always clear this register to 0, to enforce the usage of page tables,
and make this driver compatible with the H616 in this respect.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/iommu/sun50i-iommu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index c519b991749d7..dd3f07384624c 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -452,6 +452,7 @@ static int sun50i_iommu_enable(struct sun50i_iommu *iommu)
IOMMU_TLB_PREFETCH_MASTER_ENABLE(3) |
IOMMU_TLB_PREFETCH_MASTER_ENABLE(4) |
IOMMU_TLB_PREFETCH_MASTER_ENABLE(5));
+ iommu_write(iommu, IOMMU_BYPASS_REG, 0);
iommu_write(iommu, IOMMU_INT_ENABLE_REG, IOMMU_INT_MASK);
iommu_write(iommu, IOMMU_DM_AUT_CTRL_REG(SUN50I_IOMMU_ACI_NONE),
IOMMU_DM_AUT_CTRL_RD_UNAVAIL(SUN50I_IOMMU_ACI_NONE, 0) |
--
2.39.4
next prev parent reply other threads:[~2024-06-16 22:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-16 22:40 [PATCH v2 0/5] iommu: sun50i: Add Allwinner H616 support Andre Przywara
2024-06-16 22:40 ` Andre Przywara [this message]
2024-06-20 10:16 ` [PATCH v2 1/5] iommu: sun50i: clear bypass register Chen-Yu Tsai
2024-06-16 22:40 ` [PATCH v2 2/5] iommu: sun50i: allocate page tables from below 4 GiB Andre Przywara
2024-06-20 10:17 ` Chen-Yu Tsai
2024-11-19 13:45 ` Parthiban
2024-06-16 22:40 ` [PATCH v2 3/5] dt-bindings: iommu: add new compatible strings Andre Przywara
2024-06-20 10:17 ` Chen-Yu Tsai
2024-06-16 22:40 ` [PATCH v2 4/5] iommu: sun50i: Add H616 compatible string Andre Przywara
2024-06-20 10:17 ` Chen-Yu Tsai
2024-06-16 22:40 ` [PATCH v2 5/5] arm64: dts: allwinner: h616: add IOMMU node Andre Przywara
2024-06-20 9:45 ` Ryan Walklin
2024-06-25 12:03 ` [PATCH v2 0/5] iommu: sun50i: Add Allwinner H616 support Joerg Roedel
2024-06-25 16:20 ` Chen-Yu Tsai
2024-06-27 10:15 ` Joerg Roedel
2024-06-27 14:02 ` (subset) " Chen-Yu Tsai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240616224056.29159-2-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jernej.skrabec@gmail.com \
--cc=joro@8bytes.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=macromorgan@hotmail.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=ryan@testtoast.com \
--cc=samuel@sholland.org \
--cc=simons.philippe@gmail.com \
--cc=wens@csie.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).