hw/arm/sysbus-fdt: Allow device matching with DT compatible value
commitaf7d64ede0b9a57948c4ad0a9464cc95ee067a7b
authorEric Auger <eric.auger@redhat.com>
Mon, 15 Oct 2018 16:52:09 +0000 (15 10:52 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 15 Oct 2018 17:22:04 +0000 (15 11:22 -0600)
tree721be574fb577a643334b3eb41ac2cd1c540495d
parenta49531ebd0bdf5677e0405cd7c01c184717cee52
hw/arm/sysbus-fdt: Allow device matching with DT compatible value

Up to now we have relied on the device type to identify a device tree
node creation function.  Since we would like the vfio-platform device to
be instantiable with different compatible strings we introduce the
capability to specialize the node creation depending on actual
compatible value.

NodeCreationPair is renamed into BindingEntry. The struct is enhanced
with compat and match_fn() fields.  We introduce a new matching function
adapted to the vfio-platform generic device.

Soon, the AMD XGBE can be instantiated with either manner, i.e.:

    -device vfio-amd-xgbe,host=e0900000.xgmac

or using the new option line:

    -device vfio-platform,host=e0900000.xgmac

Signed-off-by: Eric Auger <eric.auger@redhat.com>
[geert: Match using compatible values in sysfs instead of user-supplied
manufacturer/model options, reword]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/arm/sysbus-fdt.c