iommu/tegra: smmu: Compute PFN mask at runtime
authorThierry Reding <treding@nvidia.com>
Fri, 27 Mar 2015 10:07:27 +0000 (11:07 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 31 Mar 2015 14:35:35 +0000 (16:35 +0200)
commit804cb54cbb3ddac58218e830d64816617bdb6da8
tree2dcd8489f27b51dcdf99fe43267262ae80aced1a
parent836a8ac9fe60fb112e830464868791bf7470e7b6
iommu/tegra: smmu: Compute PFN mask at runtime

The SMMU on Tegra30 and Tegra114 supports addressing up to 4 GiB of
physical memory. On Tegra124 the addressable physical memory was
extended to 16 GiB. The page frame number stored in PTEs therefore
requires 20 or 22 bits, depending on SoC generation.

In order to cope with this, compute the proper value at runtime.

Reported-by: Joseph Lo <josephl@nvidia.com>
Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/tegra-smmu.c