iommu/arm-smmu: Handle stream IDs more dynamically
authorRobin Murphy <robin.murphy@arm.com>
Mon, 12 Sep 2016 16:13:48 +0000 (17:13 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 16 Sep 2016 08:34:18 +0000 (09:34 +0100)
commit21174240e4f4439bb8ed6c116cdbdc03eba2126e
tree2498b0d9666a2d8abec99731efc42cc42039bd31
parent95fa99aa402ad516ec825057a168f395ece39a2e
iommu/arm-smmu: Handle stream IDs more dynamically

Rather than assuming fixed worst-case values for stream IDs and SMR
masks, keep track of whatever implemented bits the hardware actually
reports. This also obviates the slightly questionable validation of SMR
fields in isolation - rather than aborting the whole SMMU probe for a
hardware configuration which is still architecturally valid, we can
simply refuse masters later if they try to claim an unrepresentable ID
or mask (which almost certainly implies a DT error anyway).

Acked-by: Will Deacon <will.deacon@arm.com>
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu.c