Skip to content

Commit

Permalink
hw/arm: versal: Create an APU CPU Cluster
Browse files Browse the repository at this point in the history
Create an APU CPU Cluster. This is in preparation to add the RPU.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
Message-id: 20220406174303.2022038-2-edgar.iglesias@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
edgarigl authored and pm215 committed Apr 21, 2022
1 parent 51af623 commit 8779d00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hw/arm/xlnx-versal.c
Expand Up @@ -34,10 +34,15 @@ static void versal_create_apu_cpus(Versal *s)
{
int i;

object_initialize_child(OBJECT(s), "apu-cluster", &s->fpd.apu.cluster,
TYPE_CPU_CLUSTER);
qdev_prop_set_uint32(DEVICE(&s->fpd.apu.cluster), "cluster-id", 0);

for (i = 0; i < ARRAY_SIZE(s->fpd.apu.cpu); i++) {
Object *obj;

object_initialize_child(OBJECT(s), "apu-cpu[*]", &s->fpd.apu.cpu[i],
object_initialize_child(OBJECT(&s->fpd.apu.cluster),
"apu-cpu[*]", &s->fpd.apu.cpu[i],
XLNX_VERSAL_ACPU_TYPE);
obj = OBJECT(&s->fpd.apu.cpu[i]);
if (i) {
Expand All @@ -52,6 +57,8 @@ static void versal_create_apu_cpus(Versal *s)
&error_abort);
qdev_realize(DEVICE(obj), NULL, &error_fatal);
}

qdev_realize(DEVICE(&s->fpd.apu.cluster), NULL, &error_fatal);
}

static void versal_create_apu_gic(Versal *s, qemu_irq *pic)
Expand Down
2 changes: 2 additions & 0 deletions include/hw/arm/xlnx-versal.h
Expand Up @@ -14,6 +14,7 @@

#include "hw/sysbus.h"
#include "hw/arm/boot.h"
#include "hw/cpu/cluster.h"
#include "hw/or-irq.h"
#include "hw/sd/sdhci.h"
#include "hw/intc/arm_gicv3.h"
Expand Down Expand Up @@ -49,6 +50,7 @@ struct Versal {
struct {
struct {
MemoryRegion mr;
CPUClusterState cluster;
ARMCPU cpu[XLNX_VERSAL_NR_ACPUS];
GICv3State gic;
} apu;
Expand Down

0 comments on commit 8779d00

Please sign in to comment.