Skip to content

Commit

Permalink
versal: integrate PMC interconnect CSR
Browse files Browse the repository at this point in the history
Integrate the Platform Management Controller interconnect
configuration and status register block model into the
Versal SoC. This is to satisfy the PMC INT DMA0 and DMA1
route configuration that HVP performs during system
initialization.

Signed-off-by: Nelson Ho <[email protected]>
  • Loading branch information
ho28 committed Dec 10, 2024
1 parent 3256454 commit d55e77f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hw/arm/xlnx-versal.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,21 @@ static void versal_create_crl(Versal *s, qemu_irq *pic)
sysbus_connect_irq(sbd, 0, pic[VERSAL_CRL_IRQ]);
}

static void versal_create_pmcint(Versal *s)
{
SysBusDevice *sbd;
MemoryRegion *mr;

object_initialize_child(OBJECT(s), "pmc-int", &s->pmc.pmcint,
TYPE_XILINX_PMC_INT_REGS);
sbd = SYS_BUS_DEVICE(&s->pmc.pmcint);
sysbus_realize(sbd, &error_fatal);

mr = sysbus_mmio_get_region(sbd, 0);

memory_region_add_subregion(&s->mr_ps, MM_PMC_INT_CSR, mr);
}

static void versal_create_smmu(Versal *s, qemu_irq *pic)
{
SysBusDevice *sbd;
Expand Down Expand Up @@ -998,6 +1013,7 @@ static void versal_realize(DeviceState *dev, Error **errp)
versal_create_lpd_slcr(s);
versal_create_crl(s, pic);
versal_create_cfu(s, pic);
versal_create_pmcint(s);
versal_map_ddr(s);
versal_unimp(s);

Expand Down
4 changes: 4 additions & 0 deletions include/hw/arm/xlnx-versal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "hw/misc/xlnx-versal-pmc-iou-slcr.h"
#include "hw/misc/xlnx-versal-trng.h"
#include "hw/misc/xlnx-versal-lpd-iou-slcr.h"
#include "hw/misc/xlnx-versal-pmc-int.h"
#include "hw/net/xlnx-versal-canfd.h"
#include "hw/misc/xlnx-versal-cfu.h"
#include "hw/misc/xlnx-versal-cframe-reg.h"
Expand Down Expand Up @@ -136,6 +137,7 @@ struct Versal {
XlnxVersalCFUSFR cfu_sfr;
XlnxVersalCFrameReg cframe[XLNX_VERSAL_NR_CFRAME];
XlnxVersalCFrameBcastReg cframe_bcast;
PMC_INT_REGS pmcint;

OrIRQState apb_irq_orgate;
} pmc;
Expand Down Expand Up @@ -353,4 +355,6 @@ struct Versal {
#define MM_PMC_RTC_SIZE 0x10000
#define MM_PMC_TRNG 0xf1230000
#define MM_PMC_TRNG_SIZE 0x10000

#define MM_PMC_INT_CSR 0xf1330000
#endif

0 comments on commit d55e77f

Please sign in to comment.