On 10/30/25 8:40 AM, Chao Liu wrote:
On Wed, May 28, 2025 at 05:01:29PM -0300, Daniel Henrique Barboza wrote:
Add an always present IOMMU platform device for the rvsp-ref board.
The IRQs being used are similar to what the 'virt' board is using: IRQs
36 to 39, one IRQ for queue.
Signed-off-by: Daniel Henrique Barboza <[email protected]>
---
hw/riscv/Kconfig | 1 +
hw/riscv/server_platform_ref.c | 78 ++++++++++++++++++++++++++++++++--
2 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig
index f626774c52..cd70095687 100644
--- a/hw/riscv/Kconfig
+++ b/hw/riscv/Kconfig
@@ -82,6 +82,7 @@ config SERVER_PLATFORM_REF
select RISCV_ACLINT
select RISCV_APLIC
select RISCV_IMSIC
+ select RISCV_IOMMU
config SHAKTI_C
bool
diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c
index 5102286103..9740b395f6 100644
--- a/hw/riscv/server_platform_ref.c
+++ b/hw/riscv/server_platform_ref.c
@@ -31,6 +31,8 @@
#include "hw/riscv/riscv_hart.h"
#include "hw/riscv/boot.h"
#include "hw/riscv/numa.h"
+#include "hw/riscv/iommu.h"
+#include "hw/riscv/riscv-iommu-bits.h"
#include "hw/intc/riscv_aclint.h"
#include "hw/intc/riscv_aplic.h"
#include "hw/intc/riscv_imsic.h"
@@ -94,6 +96,7 @@ enum {
RVSP_MROM,
RVSP_RESET_SYSCON,
RVSP_RTC,
+ RVSP_IOMMU_SYS,
RVSP_ACLINT,
RVSP_APLIC_M,
RVSP_APLIC_S,
@@ -112,6 +115,7 @@ enum {
RVSP_UART0_IRQ = 10,
RVSP_RTC_IRQ = 11,
RVSP_PCIE_IRQ = 0x20, /* 32 to 35 */
+ IOMMU_SYS_IRQ = 0x24 /* 36 to 39 */
};
/*
@@ -141,6 +145,7 @@ static const MemMapEntry rvsp_ref_memmap[] = {
[RVSP_MROM] = { 0x1000, 0xf000 },
[RVSP_RESET_SYSCON] = { 0x100000, 0x1000 },
[RVSP_RTC] = { 0x101000, 0x1000 },
+ [RVSP_IOMMU_SYS] = { 0102000, 0x1000 },
This might be a typo:
0102000 -> 0x102000
Good call. I'll fix it in v4. Thanks,
Daniel
Thanks,
Chao