On 01/11/18 18:16, Stefan Berger wrote:
I can only point to the standard for the address. If QEMU has an API where we can first try to allocate fed4 0000 and if that fails ask for another address, then we can use that. But does driver initialization work that way that we can first let all other devices register their MMIO requirements and then the TPM device ask whether fed4 0000 is available and then falls back to using a random address?
As far as I understand, QEMU would keep the base address generally fixed, but it could be moved if (a) another platform device comes along that needs a large contiguous area and it cannot be accommodated without moving other devices around, or (b) the user wanted to move the address on the command line for whatever reason.
So, I don't think the QEMU API that you describe exists, or that there's a use case for it. AFAICT board code is expected to place platform devices up-front so that the latter peacefully co-exist.
Thanks, Laszlo