mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/riscv: virt: Create a platform bus
Create a platform bus to allow dynamic devices to be connected. This is based on the ARM implementation. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220427234146.1130752-4-alistair.francis@opensource.wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
d24a7bc24e
commit
1832b7cb3f
3 changed files with 56 additions and 20 deletions
|
@ -46,6 +46,7 @@ struct RISCVVirtState {
|
|||
|
||||
/*< public >*/
|
||||
Notifier machine_done;
|
||||
DeviceState *platform_bus_dev;
|
||||
RISCVHartArrayState soc[VIRT_SOCKETS_MAX];
|
||||
DeviceState *irqchip[VIRT_SOCKETS_MAX];
|
||||
PFlashCFI01 *flash[2];
|
||||
|
@ -76,6 +77,7 @@ enum {
|
|||
VIRT_DRAM,
|
||||
VIRT_PCIE_MMIO,
|
||||
VIRT_PCIE_PIO,
|
||||
VIRT_PLATFORM_BUS,
|
||||
VIRT_PCIE_ECAM
|
||||
};
|
||||
|
||||
|
@ -85,9 +87,12 @@ enum {
|
|||
VIRTIO_IRQ = 1, /* 1 to 8 */
|
||||
VIRTIO_COUNT = 8,
|
||||
PCIE_IRQ = 0x20, /* 32 to 35 */
|
||||
VIRTIO_NDEV = 0x35 /* Arbitrary maximum number of interrupts */
|
||||
VIRT_PLATFORM_BUS_IRQ = 64, /* 64 to 96 */
|
||||
VIRTIO_NDEV = 96 /* Arbitrary maximum number of interrupts */
|
||||
};
|
||||
|
||||
#define VIRT_PLATFORM_BUS_NUM_IRQS 32
|
||||
|
||||
#define VIRT_IRQCHIP_IPI_MSI 1
|
||||
#define VIRT_IRQCHIP_NUM_MSIS 255
|
||||
#define VIRT_IRQCHIP_NUM_SOURCES VIRTIO_NDEV
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue