summaryrefslogtreecommitdiffstats
path: root/hw/mips/cps.c
diff options
context:
space:
mode:
authorYongbok Kim2019-01-03 16:46:32 +0100
committerAleksandar Markovic2019-01-18 16:53:28 +0100
commit043715d1e0fbb3e3411be3f898c5b77b7f90327a (patch)
tree1e92367ebcd199a0e18f4b4233e076299946c440 /hw/mips/cps.c
parenttarget/mips: Add field and R/W access to ITU control register ICR0 (diff)
downloadqemu-043715d1e0fbb3e3411be3f898c5b77b7f90327a.tar.gz
qemu-043715d1e0fbb3e3411be3f898c5b77b7f90327a.tar.xz
qemu-043715d1e0fbb3e3411be3f898c5b77b7f90327a.zip
target/mips: Update ITU to utilize SAARI and SAAR CP0 registers
Update ITU to utilize SAARI and SAAR CP0 registers. Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com> Signed-off-by: Yongbok Kim <yongbok.kim@mips.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Diffstat (limited to 'hw/mips/cps.c')
-rw-r--r--hw/mips/cps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/mips/cps.c b/hw/mips/cps.c
index 4285d1964e..fc97f59af4 100644
--- a/hw/mips/cps.c
+++ b/hw/mips/cps.c
@@ -69,6 +69,7 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
Error *err = NULL;
target_ulong gcr_base;
bool itu_present = false;
+ bool saar_present = false;
for (i = 0; i < s->num_vp; i++) {
cpu = MIPS_CPU(cpu_create(s->cpu_type));
@@ -82,12 +83,14 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
itu_present = true;
/* Attach ITC Tag to the VP */
env->itc_tag = mips_itu_get_tag_region(&s->itu);
+ env->itu = &s->itu;
}
qemu_register_reset(main_cpu_reset, cpu);
}
cpu = MIPS_CPU(first_cpu);
env = &cpu->env;
+ saar_present = (bool)env->saarp;
/* Inter-Thread Communication Unit */
if (itu_present) {
@@ -96,6 +99,11 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
object_property_set_int(OBJECT(&s->itu), 16, "num-fifo", &err);
object_property_set_int(OBJECT(&s->itu), 16, "num-semaphores", &err);
+ object_property_set_bool(OBJECT(&s->itu), saar_present, "saar-present",
+ &err);
+ if (saar_present) {
+ qdev_prop_set_ptr(DEVICE(&s->itu), "saar", (void *)&env->CP0_SAAR);
+ }
object_property_set_bool(OBJECT(&s->itu), true, "realized", &err);
if (err != NULL) {
error_propagate(errp, err);