Skip to content

Commit

Permalink
versal: set gem0 and gem1 stream-id
Browse files Browse the repository at this point in the history
The Versal BSP identifies the SMMU stream ID for GEM0 and
GEM1 as 0x234 and 0x235. Configure the GEM property as such.

Signed-off-by: Nelson Ho <Nelson.Ho@windriver.com>
  • Loading branch information
ho28 committed Jan 14, 2025
1 parent abc7e24 commit cc12f81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/arm/xlnx-versal.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
static const int irqs[] = { VERSAL_GEM0_IRQ_0, VERSAL_GEM1_IRQ_0};
static const uint64_t addrs[] = { MM_GEM0, MM_GEM1 };
static const int tbu_ids[] = {VERSAL_GEM0_TBUID, VERSAL_GEM1_TBUID };
static const int stream_ids[] = { VERSAL_GEM0_STREAM_ID, VERSAL_GEM1_STREAM_ID };
char *name = g_strdup_printf("gem%d", i);
DeviceState *dev;
MemoryRegion *mr;
Expand All @@ -277,6 +278,7 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
object_property_set_int(OBJECT(dev), "phy-addr", 23, &error_abort);
object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
&error_abort);
object_property_set_int(OBJECT(dev), "stream-id", stream_ids[i], &error_abort);
versal_connect_dev_iommu(s, dev, "dma", tbu_ids[i]);
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);

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 @@ -371,4 +371,8 @@ struct Versal {

G_STATIC_ASSERT(VERSAL_SMMU_TBUID_MAX <= MAX_TBU);

/* SMMU Stream ID */
#define VERSAL_GEM0_STREAM_ID 0x234
#define VERSAL_GEM1_STREAM_ID 0x235

#endif

0 comments on commit cc12f81

Please sign in to comment.