[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 6/8] hw/misc/riscv_iopmp: Add API to configure RISCV CPU IOPMP
From: |
Ethan Chen |
Subject: |
[PATCH v8 6/8] hw/misc/riscv_iopmp: Add API to configure RISCV CPU IOPMP support |
Date: |
Mon, 15 Jul 2024 18:14:09 +0800 |
The iopmp_setup_cpu() function configures the RISCV CPU to support IOPMP and
specifies the CPU's RRID.
Signed-off-by: Ethan Chen <ethan84@andestech.com>
---
hw/misc/riscv_iopmp.c | 6 ++++++
include/hw/misc/riscv_iopmp.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/hw/misc/riscv_iopmp.c b/hw/misc/riscv_iopmp.c
index e62ac57437..374bf5c610 100644
--- a/hw/misc/riscv_iopmp.c
+++ b/hw/misc/riscv_iopmp.c
@@ -1211,5 +1211,11 @@ void iopmp_setup_system_memory(DeviceState *dev, const
MemMapEntry *memmap,
"iopmp-downstream-as");
}
+void iopmp_setup_cpu(RISCVCPU *cpu, uint32_t rrid)
+{
+ cpu->cfg.iopmp = true;
+ cpu->cfg.iopmp_rrid = rrid;
+}
+
type_init(iopmp_register_types);
diff --git a/include/hw/misc/riscv_iopmp.h b/include/hw/misc/riscv_iopmp.h
index ebe9c4bc4a..7e7da56d10 100644
--- a/include/hw/misc/riscv_iopmp.h
+++ b/include/hw/misc/riscv_iopmp.h
@@ -167,5 +167,6 @@ typedef struct IopmpState {
void iopmp_setup_system_memory(DeviceState *dev, const MemMapEntry *memmap,
uint32_t mapentry_num);
+void iopmp_setup_cpu(RISCVCPU *cpu, uint32_t rrid);
#endif
--
2.34.1
- [PATCH v8 0/8] Support RISC-V IOPMP, Ethan Chen, 2024/07/15
- [PATCH v8 1/8] memory: Introduce memory region fetch operation, Ethan Chen, 2024/07/15
- [PATCH v8 2/8] system/physmem: Support IOMMU granularity smaller than TARGET_PAGE size, Ethan Chen, 2024/07/15
- [PATCH v8 3/8] target/riscv: Add support for IOPMP, Ethan Chen, 2024/07/15
- [PATCH v8 4/8] hw/misc/riscv_iopmp: Add RISC-V IOPMP device, Ethan Chen, 2024/07/15
- [PATCH v8 5/8] hw/misc/riscv_iopmp: Add API to set up IOPMP protection for system memory, Ethan Chen, 2024/07/15
- [PATCH v8 6/8] hw/misc/riscv_iopmp: Add API to configure RISCV CPU IOPMP support,
Ethan Chen <=
- [PATCH v8 7/8] hw/misc/riscv_iopmp: Add DMA operation with IOPMP support API, Ethan Chen, 2024/07/15
- [PATCH v8 8/8] hw/riscv/virt: Add IOPMP support, Ethan Chen, 2024/07/15