mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
First RISC-V PR for QEMU 8.0
* Fix PMP propagation for tlb * Collection of bug fixes * Bump the OpenTitan supported version * Add smstateen support * Support native debug icount trigger * Remove the redundant ipi-id property in the virt machine * Support cache-related PMU events in virtual mode * Add some missing PolarFire SoC io regions * Fix mret exception cause when no pmp rule is configured * Fix bug where disabling compressed instructions would crash QEMU * Add Zawrs ISA extension support * A range of code refactoring and cleanups -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE9sSsRtSTSGjTuM6PIeENKd+XcFQFAmO3b5sACgkQIeENKd+X cFTD8Af+L0OaGzE4C0jil7LdITFKk7ltdTg3yw84ZBvIxrEWMWlt5Yj3Ez5OIPbY WpPmCLoJ9XM/5CV5PuPjxcFFExWjXLNeMEvaaT/3/3jPPnA/M/AbZa4hefKRluTg kkvBiOuRMPXiYLki5xAHmjD/1j6SQ8ghylPLxYQqyGq87WZt4Dx9msOTZLVzmmYl 8y9oC8j6yO2UBZYC1TxSkKxFbj+Cp2HmtBZ09tDzwRL6DpRvIlfftiLl8X3awMlK YTzCIrmllc38/+cV9IpQhdXzDUZ1kM7Zy56JbJl3XOsS4VnUYGmEtrKYpYQ2CKLY /tcmrDKNw1ArWcP1axNN8FHfhy1FyQ== =SH+C -----END PGP SIGNATURE----- Merge tag 'pull-riscv-to-apply-20230106' of https://github.com/alistair23/qemu into staging First RISC-V PR for QEMU 8.0 * Fix PMP propagation for tlb * Collection of bug fixes * Bump the OpenTitan supported version * Add smstateen support * Support native debug icount trigger * Remove the redundant ipi-id property in the virt machine * Support cache-related PMU events in virtual mode * Add some missing PolarFire SoC io regions * Fix mret exception cause when no pmp rule is configured * Fix bug where disabling compressed instructions would crash QEMU * Add Zawrs ISA extension support * A range of code refactoring and cleanups # gpg: Signature made Fri 06 Jan 2023 00:47:23 GMT # gpg: using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054 # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full] # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8 CE8F 21E1 0D29 DF97 7054 * tag 'pull-riscv-to-apply-20230106' of https://github.com/alistair23/qemu: (43 commits) hw/intc: sifive_plic: Fix the pending register range check hw/riscv: opentitan: Drop "hartid-base" and "priority-base" initialization hw/intc: sifive_plic: Change "priority-base" to start from interrupt source 0 hw/riscv: virt: Fix the value of "riscv, ndev" in the dtb hw/riscv: sifive_u: Avoid using magic number for "riscv, ndev" hw/riscv: sifive_e: Fix the number of interrupt sources of PLIC hw/riscv: microchip_pfsoc: Fix the number of interrupt sources of PLIC hw/intc: sifive_plic: Update "num-sources" property default value hw/intc: sifive_plic: Use error_setg() to propagate the error up via errp in sifive_plic_realize() hw/intc: sifive_plic: Improve robustness of the PLIC config parser hw/intc: sifive_plic: Drop PLICMode_H hw/riscv: spike: Remove misleading comments hw/riscv: Sort machines Kconfig options in alphabetical order hw/riscv: Fix opentitan dependency to SIFIVE_PLIC hw/intc: Select MSI_NONBROKEN in RISC-V AIA interrupt controllers hw/riscv: Select MSI_NONBROKEN in SIFIVE_PLIC RISC-V: Add Zawrs ISA extension support target/riscv: Clear mstatus.MPRV when leaving M-mode for priv spec 1.12+ target/riscv: Simplify helper_sret() a little bit target/riscv: Set pc_succ_insn for !rvc illegal insn ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
052e6534c4
41 changed files with 1226 additions and 255 deletions
|
@ -33,7 +33,6 @@ DECLARE_INSTANCE_CHECKER(SiFivePLICState, SIFIVE_PLIC,
|
|||
typedef enum PLICMode {
|
||||
PLICMode_U,
|
||||
PLICMode_S,
|
||||
PLICMode_H,
|
||||
PLICMode_M
|
||||
} PLICMode;
|
||||
|
||||
|
|
|
@ -29,7 +29,10 @@ typedef struct MchpPfSoCIoscbState {
|
|||
MemoryRegion lane01;
|
||||
MemoryRegion lane23;
|
||||
MemoryRegion ctrl;
|
||||
MemoryRegion qspixip;
|
||||
MemoryRegion mailbox;
|
||||
MemoryRegion cfg;
|
||||
MemoryRegion ccc;
|
||||
MemoryRegion pll_mss;
|
||||
MemoryRegion cfm_mss;
|
||||
MemoryRegion pll_ddr;
|
||||
|
@ -40,6 +43,7 @@ typedef struct MchpPfSoCIoscbState {
|
|||
MemoryRegion cfm_sgmii;
|
||||
MemoryRegion bc_sgmii;
|
||||
MemoryRegion io_calib_sgmii;
|
||||
qemu_irq irq;
|
||||
} MchpPfSoCIoscbState;
|
||||
|
||||
#define TYPE_MCHP_PFSOC_IOSCB "mchp.pfsoc.ioscb"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
typedef struct MchpPfSoCSysregState {
|
||||
SysBusDevice parent;
|
||||
MemoryRegion sysreg;
|
||||
qemu_irq irq;
|
||||
} MchpPfSoCSysregState;
|
||||
|
||||
#define TYPE_MCHP_PFSOC_SYSREG "mchp.pfsoc.sysreg"
|
||||
|
|
|
@ -121,6 +121,8 @@ enum {
|
|||
MICROCHIP_PFSOC_USB,
|
||||
MICROCHIP_PFSOC_QSPI_XIP,
|
||||
MICROCHIP_PFSOC_IOSCB,
|
||||
MICROCHIP_PFSOC_FABRIC_FIC0,
|
||||
MICROCHIP_PFSOC_FABRIC_FIC1,
|
||||
MICROCHIP_PFSOC_FABRIC_FIC3,
|
||||
MICROCHIP_PFSOC_DRAM_LO,
|
||||
MICROCHIP_PFSOC_DRAM_LO_ALIAS,
|
||||
|
@ -145,14 +147,15 @@ enum {
|
|||
MICROCHIP_PFSOC_MMUART2_IRQ = 92,
|
||||
MICROCHIP_PFSOC_MMUART3_IRQ = 93,
|
||||
MICROCHIP_PFSOC_MMUART4_IRQ = 94,
|
||||
MICROCHIP_PFSOC_MAILBOX_IRQ = 96,
|
||||
};
|
||||
|
||||
#define MICROCHIP_PFSOC_MANAGEMENT_CPU_COUNT 1
|
||||
#define MICROCHIP_PFSOC_COMPUTE_CPU_COUNT 4
|
||||
|
||||
#define MICROCHIP_PFSOC_PLIC_NUM_SOURCES 185
|
||||
#define MICROCHIP_PFSOC_PLIC_NUM_SOURCES 187
|
||||
#define MICROCHIP_PFSOC_PLIC_NUM_PRIORITIES 7
|
||||
#define MICROCHIP_PFSOC_PLIC_PRIORITY_BASE 0x04
|
||||
#define MICROCHIP_PFSOC_PLIC_PRIORITY_BASE 0x00
|
||||
#define MICROCHIP_PFSOC_PLIC_PENDING_BASE 0x1000
|
||||
#define MICROCHIP_PFSOC_PLIC_ENABLE_BASE 0x2000
|
||||
#define MICROCHIP_PFSOC_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -81,7 +81,7 @@ enum {
|
|||
IBEX_DEV_RSTMGR,
|
||||
IBEX_DEV_CLKMGR,
|
||||
IBEX_DEV_PINMUX,
|
||||
IBEX_DEV_PADCTRL,
|
||||
IBEX_DEV_AON_TIMER,
|
||||
IBEX_DEV_USBDEV,
|
||||
IBEX_DEV_FLASH_CTRL,
|
||||
IBEX_DEV_PLIC,
|
||||
|
@ -109,10 +109,10 @@ enum {
|
|||
IBEX_UART0_RX_TIMEOUT_IRQ = 7,
|
||||
IBEX_UART0_RX_PARITY_ERR_IRQ = 8,
|
||||
IBEX_TIMER_TIMEREXPIRED0_0 = 127,
|
||||
IBEX_SPI_HOST0_ERR_IRQ = 151,
|
||||
IBEX_SPI_HOST0_SPI_EVENT_IRQ = 152,
|
||||
IBEX_SPI_HOST1_ERR_IRQ = 153,
|
||||
IBEX_SPI_HOST1_SPI_EVENT_IRQ = 154,
|
||||
IBEX_SPI_HOST0_ERR_IRQ = 134,
|
||||
IBEX_SPI_HOST0_SPI_EVENT_IRQ = 135,
|
||||
IBEX_SPI_HOST1_ERR_IRQ = 136,
|
||||
IBEX_SPI_HOST1_SPI_EVENT_IRQ = 137,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -65,7 +65,7 @@ enum {
|
|||
#define SHAKTI_C_PLIC_NUM_SOURCES 28
|
||||
/* Excluding Priority 0 */
|
||||
#define SHAKTI_C_PLIC_NUM_PRIORITIES 2
|
||||
#define SHAKTI_C_PLIC_PRIORITY_BASE 0x04
|
||||
#define SHAKTI_C_PLIC_PRIORITY_BASE 0x00
|
||||
#define SHAKTI_C_PLIC_PENDING_BASE 0x1000
|
||||
#define SHAKTI_C_PLIC_ENABLE_BASE 0x2000
|
||||
#define SHAKTI_C_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -82,9 +82,14 @@ enum {
|
|||
};
|
||||
|
||||
#define SIFIVE_E_PLIC_HART_CONFIG "M"
|
||||
#define SIFIVE_E_PLIC_NUM_SOURCES 127
|
||||
/*
|
||||
* Freedom E310 G002 and G003 supports 52 interrupt sources while
|
||||
* Freedom E310 G000 supports 51 interrupt sources. We use the value
|
||||
* of G002 and G003, so it is 53 (including interrupt source 0).
|
||||
*/
|
||||
#define SIFIVE_E_PLIC_NUM_SOURCES 53
|
||||
#define SIFIVE_E_PLIC_NUM_PRIORITIES 7
|
||||
#define SIFIVE_E_PLIC_PRIORITY_BASE 0x04
|
||||
#define SIFIVE_E_PLIC_PRIORITY_BASE 0x00
|
||||
#define SIFIVE_E_PLIC_PENDING_BASE 0x1000
|
||||
#define SIFIVE_E_PLIC_ENABLE_BASE 0x2000
|
||||
#define SIFIVE_E_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -158,7 +158,7 @@ enum {
|
|||
|
||||
#define SIFIVE_U_PLIC_NUM_SOURCES 54
|
||||
#define SIFIVE_U_PLIC_NUM_PRIORITIES 7
|
||||
#define SIFIVE_U_PLIC_PRIORITY_BASE 0x04
|
||||
#define SIFIVE_U_PLIC_PRIORITY_BASE 0x00
|
||||
#define SIFIVE_U_PLIC_PENDING_BASE 0x1000
|
||||
#define SIFIVE_U_PLIC_ENABLE_BASE 0x2000
|
||||
#define SIFIVE_U_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
|
@ -87,20 +87,18 @@ enum {
|
|||
VIRTIO_IRQ = 1, /* 1 to 8 */
|
||||
VIRTIO_COUNT = 8,
|
||||
PCIE_IRQ = 0x20, /* 32 to 35 */
|
||||
VIRT_PLATFORM_BUS_IRQ = 64, /* 64 to 96 */
|
||||
VIRTIO_NDEV = 96 /* Arbitrary maximum number of interrupts */
|
||||
VIRT_PLATFORM_BUS_IRQ = 64, /* 64 to 95 */
|
||||
};
|
||||
|
||||
#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
|
||||
#define VIRT_IRQCHIP_NUM_SOURCES 96
|
||||
#define VIRT_IRQCHIP_NUM_PRIO_BITS 3
|
||||
#define VIRT_IRQCHIP_MAX_GUESTS_BITS 3
|
||||
#define VIRT_IRQCHIP_MAX_GUESTS ((1U << VIRT_IRQCHIP_MAX_GUESTS_BITS) - 1U)
|
||||
|
||||
#define VIRT_PLIC_PRIORITY_BASE 0x04
|
||||
#define VIRT_PLIC_PRIORITY_BASE 0x00
|
||||
#define VIRT_PLIC_PENDING_BASE 0x1000
|
||||
#define VIRT_PLIC_ENABLE_BASE 0x2000
|
||||
#define VIRT_PLIC_ENABLE_STRIDE 0x80
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue