All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH 15/23] hw/arm/armsse: Add unimplemented-device stubs for MHUs
Date: Mon, 21 Jan 2019 18:51:10 +0000	[thread overview]
Message-ID: <20190121185118.18550-16-peter.maydell@linaro.org> (raw)
In-Reply-To: <20190121185118.18550-1-peter.maydell@linaro.org>

The SSE-200 has two Message Handling Units (MHUs), which sit behind
the APB PPC0. Wire up some unimplemented-device stubs for these,
since we don't yet implement a real model of this device.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/hw/arm/armsse.h |  3 +++
 hw/arm/armsse.c         | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h
index 999c2e4f7e5..dbfcb280605 100644
--- a/include/hw/arm/armsse.h
+++ b/include/hw/arm/armsse.h
@@ -78,6 +78,7 @@
 #include "hw/watchdog/cmsdk-apb-watchdog.h"
 #include "hw/misc/iotkit-sysctl.h"
 #include "hw/misc/iotkit-sysinfo.h"
+#include "hw/misc/unimp.h"
 #include "hw/or-irq.h"
 #include "hw/core/split-irq.h"
 #include "hw/cpu/cluster.h"
@@ -137,6 +138,8 @@ typedef struct ARMSSE {
     IoTKitSysCtl sysctl;
     IoTKitSysCtl sysinfo;
 
+    UnimplementedDeviceState mhu[2];
+
     /*
      * 'container' holds all devices seen by all CPUs.
      * 'cpu_container[i]' is the view that CPU i has: this has the
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 19cae77e770..1f3dc89c8e8 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -30,6 +30,7 @@ struct ARMSSEInfo {
     int num_cpus;
     uint32_t sys_version;
     SysConfigFormat sys_config_format;
+    bool has_mhus;
 };
 
 static const ARMSSEInfo armsse_variants[] = {
@@ -39,6 +40,7 @@ static const ARMSSEInfo armsse_variants[] = {
         .num_cpus = 1,
         .sys_version = 0x41743,
         .sys_config_format = IoTKitFormat,
+        .has_mhus = false,
     },
 };
 
@@ -257,6 +259,12 @@ static void armsse_init(Object *obj)
                           sizeof(s->sysctl), TYPE_IOTKIT_SYSCTL);
     sysbus_init_child_obj(obj, "armsse-sysinfo", &s->sysinfo,
                           sizeof(s->sysinfo), TYPE_IOTKIT_SYSINFO);
+    if (info->has_mhus) {
+        sysbus_init_child_obj(obj, "mhu0", &s->mhu[0], sizeof(s->mhu[0]),
+                              TYPE_UNIMPLEMENTED_DEVICE);
+        sysbus_init_child_obj(obj, "mhu1", &s->mhu[1], sizeof(s->mhu[1]),
+                              TYPE_UNIMPLEMENTED_DEVICE);
+    }
     object_initialize_child(obj, "nmi-orgate", &s->nmi_orgate,
                             sizeof(s->nmi_orgate), TYPE_OR_IRQ,
                             &error_abort, NULL);
@@ -616,6 +624,8 @@ static void armsse_realize(DeviceState *dev, Error **errp)
      *   0x40000000: timer0
      *   0x40001000: timer1
      *   0x40002000: dual timer
+     *   0x40003000: MHU0 (SSE-200 only)
+     *   0x40004000: MHU1 (SSE-200 only)
      * We must configure and realize each downstream device and connect
      * it to the appropriate PPC port; then we can realize the PPC and
      * map its upstream ends to the right place in the container.
@@ -666,6 +676,31 @@ static void armsse_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    if (info->has_mhus) {
+        for (i = 0; i < ARRAY_SIZE(s->mhu); i++) {
+            char *name = g_strdup_printf("MHU%d", i);
+            char *port = g_strdup_printf("port[%d]", i + 3);
+
+            qdev_prop_set_string(DEVICE(&s->mhu[i]), "name", name);
+            qdev_prop_set_uint64(DEVICE(&s->mhu[i]), "size", 0x1000);
+            object_property_set_bool(OBJECT(&s->mhu[i]), true,
+                                     "realized", &err);
+            if (err) {
+                error_propagate(errp, err);
+                return;
+            }
+            mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->mhu[i]), 0);
+            object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr),
+                                     port, &err);
+            if (err) {
+                error_propagate(errp, err);
+                return;
+            }
+            g_free(name);
+            g_free(port);
+        }
+    }
+
     object_property_set_bool(OBJECT(&s->apb_ppc0), true, "realized", &err);
     if (err) {
         error_propagate(errp, err);
@@ -681,6 +716,12 @@ static void armsse_realize(DeviceState *dev, Error **errp)
     memory_region_add_subregion(&s->container, 0x40001000, mr);
     mr = sysbus_mmio_get_region(sbd_apb_ppc0, 2);
     memory_region_add_subregion(&s->container, 0x40002000, mr);
+    if (info->has_mhus) {
+        mr = sysbus_mmio_get_region(sbd_apb_ppc0, 3);
+        memory_region_add_subregion(&s->container, 0x40003000, mr);
+        mr = sysbus_mmio_get_region(sbd_apb_ppc0, 4);
+        memory_region_add_subregion(&s->container, 0x40004000, mr);
+    }
     for (i = 0; i < IOTS_APB_PPC0_NUM_PORTS; i++) {
         qdev_connect_gpio_out_named(dev_secctl, "apb_ppc0_nonsec", i,
                                     qdev_get_gpio_in_named(dev_apb_ppc0,
-- 
2.20.1

  parent reply	other threads:[~2019-01-21 19:08 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 18:50 [Qemu-devel] [PATCH 00/23] arm: Implement MPS2 AN521 FPGA image Peter Maydell
2019-01-21 18:50 ` [Qemu-devel] [PATCH 01/23] armv7m: Don't assume the NVIC's CPU is CPU 0 Peter Maydell
2019-01-21 20:26   ` Philippe Mathieu-Daudé
2019-01-23 23:44   ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 02/23] armv7m: Make cpu object a child of the armv7m container Peter Maydell
2019-01-21 20:30   ` Philippe Mathieu-Daudé
2019-01-23 23:44   ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 03/23] armv7m: Pass through start-powered-off CPU property Peter Maydell
2019-01-23 23:45   ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 04/23] hw/arm/iotkit: Rename IoTKit to ARMSSE Peter Maydell
2019-01-21 20:32   ` Philippe Mathieu-Daudé
2019-01-25 23:46   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 05/23] hw/arm/iotkit: Refactor into abstract base class and subclass Peter Maydell
2019-01-22 11:01   ` Philippe Mathieu-Daudé
2019-01-25 23:52   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 06/23] hw/arm/iotkit: Rename 'iotkit' local variables and functions Peter Maydell
2019-01-22 11:02   ` Philippe Mathieu-Daudé
2019-01-25 23:52   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 07/23] hw/arm/iotkit: Rename files to hw/arm/armsse.[ch] Peter Maydell
2019-01-22 11:03   ` Philippe Mathieu-Daudé
2019-01-26  0:01   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 08/23] hw/misc/iotkit-secctl: Support 4 internal MPCs Peter Maydell
2019-01-26  0:04   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 09/23] hw/arm/armsse: Make number of SRAM banks parameterised Peter Maydell
2019-01-26  0:06   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 10/23] hw/arm/armsse: Make SRAM bank size configurable Peter Maydell
2019-01-26  0:09   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 11/23] hw/arm/armsse: Support dual-CPU configuration Peter Maydell
2019-01-26  0:14   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 12/23] hw/arm/armsse: Give each CPU its own view of memory Peter Maydell
2019-01-26  0:24   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 13/23] hw/arm/armsse: Put each CPU in its own cluster object Peter Maydell
2019-01-26  0:29   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 14/23] iotkit-sysinfo: Make SYS_VERSION and SYS_CONFIG configurable Peter Maydell
2019-01-26  0:32   ` Richard Henderson
2019-01-21 18:51 ` Peter Maydell [this message]
2019-01-26  0:36   ` [Qemu-devel] [PATCH 15/23] hw/arm/armsse: Add unimplemented-device stubs for MHUs Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 16/23] hw/arm/armsse: Add unimplemented-device stubs for PPUs Peter Maydell
2019-01-28 16:17   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 17/23] hw/arm/armsse: Add unimplemented-device stub for cache control registers Peter Maydell
2019-01-28 16:24   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 18/23] hw/arm/armsse: Add unimplemented-device stub for CPU local " Peter Maydell
2019-01-28 16:25   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 19/23] hw/misc/armsse-cpuid: Implement SSE-200 CPU_IDENTITY register block Peter Maydell
2019-01-28 16:26   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 20/23] hw/arm/armsse: Add CPU_IDENTITY block to SSE-200 Peter Maydell
2019-01-28 16:27   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 21/23] hw/arm/armsse: Add SSE-200 model Peter Maydell
2019-01-28 16:28   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 22/23] hw/arm/mps2-tz: Add IRQ infrastructure to support SSE-200 Peter Maydell
2019-01-28 16:31   ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 23/23] hw/arm/mps2-tz: Add mps2-an521 model Peter Maydell
2019-01-28 16:33   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190121185118.18550-16-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=patches@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.