OSDN Git Service

hw/pci: PCIe Data Object Exchange emulation
authorHuai-Cheng Kuo <hchkuo@avery-design.com.tw>
Fri, 14 Oct 2022 15:10:41 +0000 (16:10 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Nov 2022 18:12:19 +0000 (13:12 -0500)
commit5fb52f6cc8f621f2e51d181d81401d14e4d45102
treeaab49203893ec2446f119caca96ac20e60ce560f
parent535824f596d2e767a8824dde43ec11b6dfa9286a
hw/pci: PCIe Data Object Exchange emulation

Emulation of PCIe Data Object Exchange (DOE)
PCIE Base Specification r6.0 6.3 Data Object Exchange

Supports multiple DOE PCIe Extended Capabilities for a single PCIe
device. For each capability, a static array of DOEProtocol should be passed
to pcie_doe_init(). The protocols in that array will be registered under
the DOE capability structure. For each protocol, vendor ID, type, and
corresponding callback function (handle_request()) should be implemented.
This callback function represents how the DOE request for corresponding
protocol will be handled.

pcie_doe_{read/write}_config() must be appended to corresponding PCI
device's config_read/write() handler to enable DOE access. In
pcie_doe_read_config(), false will be returned if pci_config_read()
offset is not within DOE capability range. In pcie_doe_write_config(),
the function will have no affect if the address is not within the related
DOE PCIE extended capability.

Signed-off-by: Huai-Cheng Kuo <hchkuo@avery-design.com.tw>
Signed-off-by: Chris Browy <cbrowy@avery-design.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20221014151045.24781-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
MAINTAINERS
hw/pci/meson.build
hw/pci/pcie_doe.c [new file with mode: 0644]
include/hw/pci/pci_ids.h
include/hw/pci/pcie.h
include/hw/pci/pcie_doe.h [new file with mode: 0644]
include/hw/pci/pcie_regs.h