Re: [RFC 2/3] iommu/samsung: Introduce Exynos sysmmu-v8 driver

2022-06-21 Thread Sam Protsenko
Hi Marek, On Fri, 21 Jan 2022 at 14:31, Marek Szyprowski wrote: [snip] > > Well, for starting point the existing exynos-iommu driver is really > enough. I've played a bit with newer Exyos SoCs some time ago. If I > remember right, if you limit the iommu functionality to the essential > things l

Re: [PATCH] iommu/exynos: Make driver independent of the system page size

2022-06-23 Thread Sam Protsenko
ski > --- Reviewed-by: Sam Protsenko with one note: SPAGE_SIZE and SPAGE_ORDER could be used instead of SZ_4K. But that's just a matter of taste, I'm ok with that as is, hence R-b tag. Thanks! > Untested, because Exynos based boards I have doesn't boot with non-4KB > page

[PATCH 0/4] iommu/exynos: Add basic support for SysMMU v7

2022-07-02 Thread Sam Protsenko
ux/tree/e850-96-mainline-iommu Sam Protsenko (4): iommu/exynos: Set correct dma mask for SysMMU v5+ iommu/exynos: Check if SysMMU v7 has VM registers iommu/exynos: Use lookup based approach to access v7 registers iommu/exynos: Add minimal support for SysMMU v7 with VM registers drivers/iommu

[PATCH 3/4] iommu/exynos: Use lookup based approach to access v7 registers

2022-07-02 Thread Sam Protsenko
on-VM SysMMU) each time before accessing v7 registers. For now the register table contains only most basic registers needed to add the SysMMU v7 support. This patch is based on downstream work of next authors: - Janghyuck Kim - Daniel Mentz Signed-off-by: Sam Protsenko --- drivers/iommu/e

[PATCH 1/4] iommu/exynos: Set correct dma mask for SysMMU v5+

2022-07-02 Thread Sam Protsenko
SysMMU v5+ supports 36 bit physical address space. Set corresponding DMA mask to avoid falling back to SWTLBIO usage in dma_map_single() because of failed dma_capable() check. The original code for this fix was suggested by Marek. Originally-by: Marek Szyprowski Signed-off-by: Sam Protsenko

[PATCH 2/4] iommu/exynos: Check if SysMMU v7 has VM registers

2022-07-02 Thread Sam Protsenko
ned-off-by: Sam Protsenko --- drivers/iommu/exynos-iommu.c | 42 ++-- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 28f8c8d93aa3..df6ddbebbe2b 100644 --- a/drivers/iommu/exynos-iom

[PATCH 4/4] iommu/exynos: Add minimal support for SysMMU v7 with VM registers

2022-07-02 Thread Sam Protsenko
result by reading the TLB info from corresponding registers. Thanks to Marek, who did let me know it only takes a slight change of registers to make this driver work with v7. Signed-off-by: Sam Protsenko --- drivers/iommu/exynos-iommu.c | 16 ++-- 1 file changed, 14 insertions(+), 2

Re: [PATCH 0/4] iommu/exynos: Add basic support for SysMMU v7

2022-07-02 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 00:37, Sam Protsenko wrote: > > Existing exynos-iommu driver only supports SysMMU versions up to v5. But > it's pretty much ready for basic usage with SysMMU v7, only small > changes have to be done. As SysMMU version is tested dynamically (by > readi

Re: [RFC 2/3] iommu/samsung: Introduce Exynos sysmmu-v8 driver

2022-07-02 Thread Sam Protsenko
On Wed, 22 Jun 2022 at 12:57, Marek Szyprowski wrote: > > > On 22.06.2022 11:14, Robin Murphy wrote: > > On 2022-06-21 20:57, Sam Protsenko wrote: > >> Hi Marek, > >> > >> On Fri, 21 Jan 2022 at 14:31, Marek Szyprowski > >> wrote: > >&g

[RFC 1/3] dt-bindings: iommu: Add bindings for samsung,sysmmu-v8

2022-01-20 Thread Sam Protsenko
Only example of usage and header for now. Signed-off-by: Sam Protsenko --- .../bindings/iommu/samsung,sysmmu-v8.txt | 31 + include/dt-bindings/soc/samsung,sysmmu-v8.h | 43 +++ 2 files changed, 74 insertions(+) create mode 100644 Documentation/devicetree

[RFC 0/3] iommu/samsung: Introduce Exynos sysmmu-v8 driver

2022-01-20 Thread Sam Protsenko
) Basically, I want to figure out what should be changed/fixed in this driver (on a high level), so it can be considered "upstreamable". [1] https://android.googlesource.com/kernel/gs/ [2] https://github.com/joe-skb7/linux/commits/iommu-exynos850-dev Sam Protsenko (3): dt-bindings: i

[RFC 3/3] arm64: defconfig: Enable sysmmu-v8 IOMMU

2022-01-20 Thread Sam Protsenko
Signed-off-by: Sam Protsenko --- arch/arm64/configs/defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 30516dc0b70e..bb03628b5e25 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1033,6

[RFC 2/3] iommu/samsung: Introduce Exynos sysmmu-v8 driver

2022-01-20 Thread Sam Protsenko
Signed-off-by: Sam Protsenko --- drivers/iommu/Kconfig | 13 + drivers/iommu/Makefile |3 + drivers/iommu/samsung-iommu-fault.c | 617 +++ drivers/iommu/samsung-iommu-group.c | 50 + drivers/iommu/samsung-iommu.c | 1521 +++

Re: [RFC 2/3] iommu/samsung: Introduce Exynos sysmmu-v8 driver

2022-01-21 Thread Sam Protsenko
On Fri, 21 Jan 2022 at 10:40, Krzysztof Kozlowski wrote: > > On 20/01/2022 21:19, Sam Protsenko wrote: > > Introduce new driver for modern Exynos ARMv8 SoCs, e.g. Exynos850. Also > > it's used for Google's GS101 SoC. > > > > This is squashed commit, contain

Re: [PATCH 0/4] iommu/exynos: Add basic support for SysMMU v7

2022-07-06 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 13:47, David Virag wrote: > > On Sun, 2022-07-03 at 00:48 +0300, Sam Protsenko wrote: > [...] > > Hi Marek, > > > > As I understand, you have some board with SysMMU v7, which is not VM > > capable (judging from the patches you shared earli

Re: [PATCH 2/4] iommu/exynos: Check if SysMMU v7 has VM registers

2022-07-09 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 22:10, Krzysztof Kozlowski wrote: > > On 02/07/2022 23:37, Sam Protsenko wrote: > > SysMMU v7 can have Virtual Machine registers, which implement multiple > > translation domains. The driver should know if it's true or not, as VM > > registers

Re: [PATCH 1/4] iommu/exynos: Set correct dma mask for SysMMU v5+

2022-07-09 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 21:50, Krzysztof Kozlowski wrote: > > On 02/07/2022 23:37, Sam Protsenko wrote: > > SysMMU v5+ supports 36 bit physical address space. Set corresponding DMA > > mask to avoid falling back to SWTLBIO usage in dma_map_single() because > > of fa

Re: [PATCH 3/4] iommu/exynos: Use lookup based approach to access v7 registers

2022-07-09 Thread Sam Protsenko
On Sun, 3 Jul 2022 at 22:29, Krzysztof Kozlowski wrote: > > On 02/07/2022 23:37, Sam Protsenko wrote: > > SysMMU v7 might have different register layouts (VM capable or non-VM > > capable). Check which layout is implemented in current SysMMU module and > > prepare the corr