• Hiroshi Doyu's avatar
    iommu/tegra: smmu: Support variable MMIO ranges/blocks · a6870e92
    Hiroshi Doyu authored
    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: default avatarHiroshi Doyu <hdoyu@nvidia.com>
    Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
    Signed-off-by: default avatarJoerg Roedel <joro@8bytes.org>
    a6870e92
tegra-smmu.c 32.2 KB