mirror of
https://github.com/qemu/qemu.git
synced 2024-12-16 16:53:28 +08:00
5ba76b61a2
We have two very similar root-port devices, pnv-phb3-root-port and pnv-phb4-root-port. Both consist of a wrapper around the PCIESlot device that, until now, has no additional attributes. The main difference between the PHB3 and PHB4 root ports is that pnv-phb4-root-port has the pnv_phb4_root_port_reset() callback. All other differences can be merged in a single device without too much trouble. This patch introduces the unified pnv-phb-root-port that, in time, will be used as the default root port for the pnv-phb device. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Message-Id: <20220624084921.399219-7-danielhb413@gmail.com>
56 lines
1.1 KiB
C
56 lines
1.1 KiB
C
/*
|
|
* QEMU PowerPC PowerNV Proxy PHB model
|
|
*
|
|
* Copyright (c) 2022, IBM Corporation.
|
|
*
|
|
* This code is licensed under the GPL version 2 or later. See the
|
|
* COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef PCI_HOST_PNV_PHB_H
|
|
#define PCI_HOST_PNV_PHB_H
|
|
|
|
#include "hw/pci/pcie_host.h"
|
|
#include "hw/pci/pcie_port.h"
|
|
#include "qom/object.h"
|
|
|
|
typedef struct PnvChip PnvChip;
|
|
typedef struct PnvPhb4PecState PnvPhb4PecState;
|
|
|
|
struct PnvPHB {
|
|
PCIExpressHost parent_obj;
|
|
|
|
uint32_t chip_id;
|
|
uint32_t phb_id;
|
|
uint32_t version;
|
|
char bus_path[8];
|
|
|
|
PnvChip *chip;
|
|
|
|
PnvPhb4PecState *pec;
|
|
|
|
/* The PHB backend (PnvPHB3, PnvPHB4 ...) being used */
|
|
Object *backend;
|
|
};
|
|
|
|
#define TYPE_PNV_PHB "pnv-phb"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB, PNV_PHB)
|
|
|
|
/*
|
|
* PHB PCIe Root port
|
|
*/
|
|
#define PNV_PHB3_DEVICE_ID 0x03dc
|
|
#define PNV_PHB4_DEVICE_ID 0x04c1
|
|
#define PNV_PHB5_DEVICE_ID 0x0652
|
|
|
|
typedef struct PnvPHBRootPort {
|
|
PCIESlot parent_obj;
|
|
|
|
uint32_t version;
|
|
} PnvPHBRootPort;
|
|
|
|
#define TYPE_PNV_PHB_ROOT_PORT "pnv-phb-root-port"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(PnvPHBRootPort, PNV_PHB_ROOT_PORT)
|
|
|
|
#endif /* PCI_HOST_PNV_PHB_H */
|