hw/misc/tz-ppc: Support having unused ports in the middle of the range
commit37e571f1e0101f9aab29235afa651028723eb4c5
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Feb 2019 18:17:46 +0000 (21 18:17 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Feb 2019 18:17:46 +0000 (21 18:17 +0000)
treed3b7bf1a5229fcb179fa865920a1c90c97cc074e
parent6c1f6f2733a7692793135ea5ce72b829add99a50
hw/misc/tz-ppc: Support having unused ports in the middle of the range

The Peripheral Protection Controller's handling of unused ports
is that if there is nothing connected to the port's downstream
then it does not create the sysbus MMIO region for the upstream
end of the port. This results in odd behaviour when there is
an unused port in the middle of the range: since sysbus MMIO
regions are implicitly consecutively allocated, any used ports
above the unused ones end up with sysbus MMIO region numbers
that don't match the port number.

Avoid this numbering mismatch by creating dummy MMIO regions
for the unused ports. This doesn't change anything for our
existing boards, which don't have any gaps in the middle of
the port ranges they use; but it will be needed for the Musca
board.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
hw/misc/tz-ppc.c
include/hw/misc/tz-ppc.h