According to the ARM Design Document "IO Remapping Table Platform" (DEN 0049D), the "Number of IDs" field of the ID mapping format means "The number of IDs in the range minus one".
This means when interpreting that field, we have to *add* one, not subtract one more!
With the current code, a zero in that field (like we can find on the NXP Layerscape LX2160A) would cause the end to be lower than the beginning (!!!) so if the first mapping has that zero, it would always be chosen over the other ones.