• Robin Murphy's avatar
    iommu/arm-smmu: Tidy up context bank indexing · 452107c7
    Robin Murphy authored
    ARM_AMMU_CB() is calculated relative to ARM_SMMU_CB_BASE(), but the
    latter is never of use on its own, and what we end up with is the same
    ARM_SMMU_CB_BASE() + ARM_AMMU_CB() expression being duplicated at every
    callsite. Folding the two together gives us a self-contained context
    bank accessor which is much more pleasant to work with.
    
    Secondly, we might as well simplify CB_BASE itself at the same time.
    We use the address space size for its own sake precisely once, at probe
    time, and every other usage is to dynamically calculate CB_BASE over
    and over and over again. Let's flip things around so that we just
    maintain the CB_BASE address directly.
    Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
    Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    452107c7
arm-smmu.c 61.2 KB