iommu/exynos: Abstract non-common registers on different variants
authorSam Protsenko <semen.protsenko@linaro.org>
Thu, 14 Jul 2022 16:55:48 +0000 (19:55 +0300)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:30:44 +0000 (10:30 +0200)
commit2125afbed8418b212c336509ddd5458aac01744d
tree2c2f54499844a7534c10e60286d26266c4778973
parent5f26ad58be8c0ca4dc8b13788a35e71b42cb3b4e
iommu/exynos: Abstract non-common registers on different variants

At the moment the driver supports SysMMU v1..v5 versions. SysMMU v5 has
different register layout than SysMMU v1..v3. Instead of checking the
version each time before reading/writing the registers, let's create
corresponding register structure for each SysMMU version and set the
needed structure on init, checking the SysMMU version one single time.
This way is faster and more elegant.

No behavior changes from the user's point of view, it's only a
refactoring patch.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20220714165550.8884-5-semen.protsenko@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/exynos-iommu.c