Skip to content

Commit

Permalink
versal: integrate LPD_IOU_SLCR into Versal SoC
Browse files Browse the repository at this point in the history
Realize the LPD IOU SLCR as part of Versal SoC creation.
Map the LPD IOU SLCR into the PS address space.

Signed-off-by: Nelson Ho <[email protected]>
  • Loading branch information
ho28 committed Dec 6, 2024
1 parent 7171ca6 commit 59ebbf0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ config XLNX_VERSAL
select XLNX_USB_SUBSYS
select XLNX_VERSAL_TRNG
select XLNX_CSU_DMA
select XLNX_LPD_IOU_SLCR

config NPCM7XX
bool
Expand Down
16 changes: 16 additions & 0 deletions hw/arm/xlnx-versal.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,21 @@ static void versal_create_smmu(Versal *s, qemu_irq *pic)
sysbus_connect_irq(sbd, 0, pic[VERSAL_SMMU_IRQ]);
}

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

object_initialize_child(OBJECT(s), "lpd_iou_slcr", &s->lpd.iou.slcr,
TYPE_XLNX_LPD_IOU_SLCR);
sbd = SYS_BUS_DEVICE(&s->lpd.iou.slcr);
sysbus_realize(sbd, &error_fatal);

mr = sysbus_mmio_get_region(sbd, 0);

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

/* This takes the board allocated linear DDR memory and creates aliases
* for each split DDR range/aperture on the Versal address map.
*/
Expand Down Expand Up @@ -937,6 +952,7 @@ static void versal_realize(DeviceState *dev, Error **errp)
versal_create_canfds(s, pic);
versal_create_smmu(s, pic);
versal_create_usbs(s, pic);
versal_create_lpd_iou_slcr(s);
versal_create_gems(s, pic);
versal_create_admas(s, pic);
versal_create_sds(s, pic);
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 @@ -32,6 +32,7 @@
#include "hw/misc/xlnx-versal-crl.h"
#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/net/xlnx-versal-canfd.h"
#include "hw/misc/xlnx-versal-cfu.h"
#include "hw/misc/xlnx-versal-cframe-reg.h"
Expand Down Expand Up @@ -85,6 +86,7 @@ struct Versal {
VersalUsb2 usb;
CanBusState *canbus[XLNX_VERSAL_NR_CANFD];
XlnxVersalCANFDState canfd[XLNX_VERSAL_NR_CANFD];
LPD_IOU_SLCR slcr;
} iou;

/* Real-time Processing Unit. */
Expand Down Expand Up @@ -191,6 +193,8 @@ struct Versal {
#define MM_CANFD1 0xff070000U
#define MM_CANFD1_SIZE 0x10000

#define MM_LPD_IOU_SLCR 0xff080000U

#define MM_GEM0 0xff0c0000U
#define MM_GEM0_SIZE 0x10000
#define MM_GEM0_PHY_ID 0xc
Expand Down

0 comments on commit 59ebbf0

Please sign in to comment.