hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 27 Feb 2023 15:31:27 +0000 (15:31 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 8 Mar 2023 00:51:07 +0000 (19:51 -0500)
commit84344ee2da1f8a23819c15361298d997d9e69dbf
treeac01c4fec77128ae7c439f95422f8c1a2cae6410
parent415442a1b4ad31521bbe7ae8bf4ee5d25af3977f
hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers

These two helpers enable host bridges to operate differently depending on
the number of downstream ports, in particular if there is only a single
port.

Useful for CXL where HDM address decoders are allowed to be implicit in
the host bridge if there is only a single root port.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230227153128.8164-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie_port.c
include/hw/pci/pcie_port.h