iommu/tegra: smmu: Support variable MMIO ranges/blocks
authorHiroshi Doyu <hdoyu@nvidia.com>
Thu, 31 Jan 2013 08:14:10 +0000 (10:14 +0200)
committerJoerg Roedel <joro@8bytes.org>
Tue, 5 Feb 2013 13:18:01 +0000 (14:18 +0100)
commita6870e928d1b2a97d95e7bf1aaefd3da34b83a85
treeedb13665e5cbfe256fd5dc52bdfc55d15ec26839
parent0fde671b81d406a59ae21f35f121851509c3b138
iommu/tegra: smmu: Support variable MMIO ranges/blocks

Presently SMMU registers are located in discontiguous 3 blocks. They
are interleaved by MC registers. Ideally SMMU register blocks should
be in an independent one block, but it is too late to change this H/W
design. In the future Tegra chips over some generations, it is
expected that some of register block "size" can be extended towards
the end and also more new register blocks will be added at most a few
blocks. The starting address of each existing block won't change. This
patch allocates multiple number of register blocks dynamically based
on the info passed from DT. Those ranges are verified in the
accessors{read,write}. This may sacrifice some performance because a
new accessors prevents compiler optimization of a fixed size register
offset calculation. Since SMMU register accesses are not so frequent,
this would be acceptable. This patch is necessary to unify
"tegra-smmu.ko" over some Tegra SoC generations.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/tegra-smmu.c