From patchwork Fri Feb 1 16:06:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157294 Delivered-To: patch@linaro.org Received: by 2002:ac9:7558:0:0:0:0:0 with SMTP id r24csp612566oct; Fri, 1 Feb 2019 08:42:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IZBJngc7vIlRaaLiRzlpruMSQKQZCzh0OrnVzwXu1rgWHYZcP5jfm4oZZLwyzUJgXzJgfpp X-Received: by 2002:a81:b64c:: with SMTP id h12mr14776786ywk.296.1549039339085; Fri, 01 Feb 2019 08:42:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549039339; cv=none; d=google.com; s=arc-20160816; b=rIE8Z5U12JiJRDoSWBFHQWmhOe5BgUbOWAaZsc1ofLLFLCTSXURacXLxh45xYtwaOq FWKvreeB2CxrOthc1PABSWi4SoPrtJs7OFQblGhw+NsliIv09rl0uUY3ePZtEagGvkC+ uEw4naFOzbg/lkuizbpoHteuIF7hdJ/LplzJi2rkKX3e2aVQGX9+UQ7nmRcILSfyNkhT 5kp5TQSuIDEf14QYTX81oZxfMyilnk/eZBnlnnlbp3c6L/vXPUNrcC08hsnLNGsJMvbK EMr4Mw+lrvJ1xwHu1R1iiHTrKz7Hcm9OpLuGXFaHEq3vDYZ52hTkyfrZW43FCMRUJ670 tPxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=cQ04enW49cn2P0IUdjm/RrVZoWBY20uByUc9joh4hxM=; b=ceZd/mZ5lF7LIhYX1w3arsXQ16CgrRFr3jEg8T3VKoEdhFv+OB35yHAuZVbsGOgXgR IlP1r7yHAdmC0gHpgP9gbNgSlaxAep+KtUui0RZ/WXJeB4dcHoCxFqMM2vGZjazDXcpj UKWjhpdgQf9sn9tIUOz+MD/2dpXxyckDVpEFSz7Gm8rO9VIcoqms6kpxVKCWP1OK1C/h r8gLmhpEe6W3lfx5k3tYOctq2PUa4Dq2RQI6P7PykxTmz02YdyjkzTbuWFjeOKr40JUb EME665XI5WOQ72XKHKiYprBM+90O8CVunlKRZUOe/ccqSs+EH2b2/O0h6ZoW6QQyUyJw 2UEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PBdQwHmt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s62si557512ybc.162.2019.02.01.08.42.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:42:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PBdQwHmt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:57746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbtS-0003rd-GA for patch@linaro.org; Fri, 01 Feb 2019 11:42:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMG-0008Iy-C0 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbMB-0003l0-Ks for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:00 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38385) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbMB-0003Lr-A5 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:55 -0500 Received: by mail-wr1-x42c.google.com with SMTP id v13so7654838wrw.5 for ; Fri, 01 Feb 2019 08:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=cQ04enW49cn2P0IUdjm/RrVZoWBY20uByUc9joh4hxM=; b=PBdQwHmt5HpM6pdLvsbQqyVzMi6AvpQ7sjDIx4FpX7Dh0tVI6ErcmmknYNIxQD9ZMS NrbC8k7Dd5i9rYU3BJKzF1mCTIGCt0EEBGcd+JNn2Q4uGwc5e2uuzzxiz8qAL1ULC8i+ lQyBcB5VYF6iVh6CQBGCPIZcuNtrnUiDSTk1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cQ04enW49cn2P0IUdjm/RrVZoWBY20uByUc9joh4hxM=; b=Rs3LBNrgFZVP+Ov1s3BMCA5C+szBuqHX48MJnYyJTfnGtjNm4wJ1XLa9DVBUm/FiJP LkGhjSz8b8uJO6IW6sXclUpJdzrjYzALF0afAqsARfiIKlAhmOXO4P50nOh1e08iiRkD RQqzKBXRjAFJWYd/K3vnfdGuS8yOQkDe3yf6/+xcnn828J+G6PtRtGgeQ6T7lr7MsH/l mQc3/VQSv0iyU+aMbWCkCJWUr6LnoAh414npRaoVMT0919I7RS6KPnnGOCPqoKh/xefv bVQVeTq2CV2lNQGcJOotU0pUJC39lqGWbhIo4RXhNQhh9UZmGKUSy9ycrz9G3mdlBYWX ANTA== X-Gm-Message-State: AHQUAuaL5Qv2qiTiP024TJ/5UxiHf/I33uO0skvo3uvnkx3cZstCMPRQ Y8ma83kWbRKKkcrO0WYYuv5EJ7iDzzraOQ== X-Received: by 2002:adf:80a9:: with SMTP id 38mr24298028wrl.137.1549037237167; Fri, 01 Feb 2019 08:07:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n6sm2847250wmk.9.2019.02.01.08.07.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:22 +0000 Message-Id: <20190201160653.13829-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201160653.13829-1-peter.maydell@linaro.org> References: <20190201160653.13829-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL 16/47] hw/arm/armsse: Add unimplemented-device stubs for MHUs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Richard Henderson Message-id: 20190121185118.18550-16-peter.maydell@linaro.org --- include/hw/arm/armsse.h | 3 +++ hw/arm/armsse.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) -- 2.20.1 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,