hw/pci-bridge: format special OFW unit address for PXB host
commit48ea3dedc54dbcb3c738ddef02a336739910ecfd
authorLaszlo Ersek <lersek@redhat.com>
Fri, 19 Jun 2015 02:40:17 +0000 (19 04:40 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 23 Jun 2015 20:58:36 +0000 (23 22:58 +0200)
tree9d3f5f1bdccc56e19f4d71bc888082e0119baf14
parent0b336b3b98d8983d821ef9b0f159acc7c77cbac7
hw/pci-bridge: format special OFW unit address for PXB host

We have agreed that OpenFirmware device paths in the "bootorder" fw_cfg
file should follow the pattern

  /pci@i0cf8,%x/...

for devices that live behind an extra root bus. The extra root bus in
question is the %x'th among the extra root buses. (In other words, %x
gives the position of the affected extra root bus relative to the other
extra root buses, in bus_nr order.) %x starts at 1, and is formatted in
hex.

The portion of the unit address that comes before the comma is dynamically
taken from the main host bridge, similarly to sysbus_get_fw_dev_path().

Cc: Kevin O'Connor <kevin@koconnor.net>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci-bridge/pci_expander_bridge.c