From nobody Fri Nov 7 12:01:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548099106738900.7979553005341; Mon, 21 Jan 2019 11:31:46 -0800 (PST) Received: from localhost ([127.0.0.1]:58703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glfIL-0001bW-0J for importer@patchew.org; Mon, 21 Jan 2019 14:31:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glevR-0008OH-Fz for qemu-devel@nongnu.org; Mon, 21 Jan 2019 14:08:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gleff-0002u5-LZ for qemu-devel@nongnu.org; Mon, 21 Jan 2019 13:51:47 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:35306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gleff-0002qf-2P for qemu-devel@nongnu.org; Mon, 21 Jan 2019 13:51:43 -0500 Received: by mail-wr1-x443.google.com with SMTP id 96so24652761wrb.2 for ; Mon, 21 Jan 2019 10:51:39 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n82sm50386660wma.42.2019.01.21.10.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Jan 2019 10:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LzRvPMbQkQGhAdwFKIwhiAq/gXzdlKz74UrTsx5pEqs=; b=HTFIpc6plfz5Oe4OMdVqt3PxMZFqJEa+VBhskWdK6sf8arXNcOMps+Q2BlZwycXeBf E9lnYWNq7kxZO4dLaFcxCQRB6rSV2JVVGHFzwh4N5lTSiy/x7kh53azg+JKckGvl3nCj CNzGrg5OHRU7RTpouszJJTG1tcRz6D45isqDo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LzRvPMbQkQGhAdwFKIwhiAq/gXzdlKz74UrTsx5pEqs=; b=e9KWs+sHPLAll4V252i7QMWFgZRMasoPuFhhswOA10oi2K9gQkFZv1Y+t4ncbz0VUg +/aHJkoM/Qbmu68So5UQ6dnyYgS5LQaPjfOD/jpbaL18l4KiXyu0lp4u3Luc4bg89FOB dlWy/YTbQoW6p3iH+Bz2ZTY0N2flYkZNioyXd3vQOCY1BGYWntqEKorLmM4tJGzPiXkU WSeAGtbrn0NpwmYcdu7Nf3krLXMV2XxtQCbmIBNYA1ghUREyLTxI/g0m/YL2xbAml1R4 h71+itmrLttNZteaZBc15QMAM5LxMB0TlrWQhvHlAy+nJUSGGShRoOzomy+OR0C+jthP xoQw== X-Gm-Message-State: AJcUukcKVVug+wqSSbJbBXHCMhUAubxAuoO121tEdKdVVwKllt8maKuP G+MarV3Yy0SB8Fkfc0HBAAgmpA== X-Google-Smtp-Source: ALg8bN45w2p1E0/xf2Y5Eyksdnp2txrpoYFYaJsaqJco8ucxFZZc/SaZX9YLqFIbsSGYJH5Kn0HJGg== X-Received: by 2002:a5d:678b:: with SMTP id v11mr31459517wru.245.1548096698977; Mon, 21 Jan 2019 10:51:38 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Mon, 21 Jan 2019 18:51:11 +0000 Message-Id: <20190121185118.18550-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121185118.18550-1-peter.maydell@linaro.org> References: <20190121185118.18550-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 16/23] hw/arm/armsse: Add unimplemented-device stubs for PPUs 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: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add unimplemented-device stubs for the various Power Policy Unit devices that the SSE-200 has. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/hw/arm/armsse.h | 11 ++++++++ hw/arm/armsse.c | 58 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index dbfcb280605..9855ec5f269 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -106,6 +106,16 @@ =20 #define SSE_MAX_CPUS 2 =20 +/* These define what each PPU in the ppu[] index is for */ +#define CPU0CORE_PPU 0 +#define CPU1CORE_PPU 1 +#define DBG_PPU 2 +#define RAM0_PPU 3 +#define RAM1_PPU 4 +#define RAM2_PPU 5 +#define RAM3_PPU 6 +#define NUM_PPUS 7 + typedef struct ARMSSE { /*< private >*/ SysBusDevice parent_obj; @@ -139,6 +149,7 @@ typedef struct ARMSSE { IoTKitSysCtl sysinfo; =20 UnimplementedDeviceState mhu[2]; + UnimplementedDeviceState ppu[NUM_PPUS]; =20 /* * 'container' holds all devices seen by all CPUs. diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 1f3dc89c8e8..280ba5c78be 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -31,6 +31,7 @@ struct ARMSSEInfo { uint32_t sys_version; SysConfigFormat sys_config_format; bool has_mhus; + bool has_ppus; }; =20 static const ARMSSEInfo armsse_variants[] =3D { @@ -41,6 +42,7 @@ static const ARMSSEInfo armsse_variants[] =3D { .sys_version =3D 0x41743, .sys_config_format =3D IoTKitFormat, .has_mhus =3D false, + .has_ppus =3D false, }, }; =20 @@ -265,6 +267,29 @@ static void armsse_init(Object *obj) sysbus_init_child_obj(obj, "mhu1", &s->mhu[1], sizeof(s->mhu[1]), TYPE_UNIMPLEMENTED_DEVICE); } + if (info->has_ppus) { + for (i =3D 0; i < info->num_cpus; i++) { + char *name =3D g_strdup_printf("CPU%dCORE_PPU", i); + int ppuidx =3D CPU0CORE_PPU + i; + + sysbus_init_child_obj(obj, name, &s->ppu[ppuidx], + sizeof(s->ppu[ppuidx]), + TYPE_UNIMPLEMENTED_DEVICE); + g_free(name); + } + sysbus_init_child_obj(obj, "DBG_PPU", &s->ppu[DBG_PPU], + sizeof(s->ppu[DBG_PPU]), + TYPE_UNIMPLEMENTED_DEVICE); + for (i =3D 0; i < info->sram_banks; i++) { + char *name =3D g_strdup_printf("RAM%d_PPU", i); + int ppuidx =3D RAM0_PPU + i; + + sysbus_init_child_obj(obj, name, &s->ppu[ppuidx], + sizeof(s->ppu[ppuidx]), + TYPE_UNIMPLEMENTED_DEVICE); + g_free(name); + } + } object_initialize_child(obj, "nmi-orgate", &s->nmi_orgate, sizeof(s->nmi_orgate), TYPE_OR_IRQ, &error_abort, NULL); @@ -329,6 +354,17 @@ static qemu_irq armsse_get_common_irq_in(ARMSSE *s, in= t irqno) } } =20 +static void map_ppu(ARMSSE *s, int ppuidx, const char *name, hwaddr addr) +{ + /* Map a PPU unimplemented device stub */ + DeviceState *dev =3D DEVICE(&s->ppu[ppuidx]); + + qdev_prop_set_string(dev, "name", name); + qdev_prop_set_uint64(dev, "size", 0x1000); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->ppu[ppuidx]), 0, addr); +} + static void armsse_realize(DeviceState *dev, Error **errp) { ARMSSE *s =3D ARMSSE(dev); @@ -833,6 +869,28 @@ static void armsse_realize(DeviceState *dev, Error **e= rrp) } sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctl), 0, 0x50021000); =20 + if (info->has_ppus) { + /* CPUnCORE_PPU for each CPU */ + for (i =3D 0; i < info->num_cpus; i++) { + char *name =3D g_strdup_printf("CPU%dCORE_PPU", i); + + map_ppu(s, CPU0CORE_PPU + i, name, 0x50023000 + i * 0x2000); + /* + * We don't support CPU debug so don't create the + * CPU0DEBUG_PPU at 0x50024000 and 0x50026000. + */ + g_free(name); + } + map_ppu(s, DBG_PPU, "DBG_PPU", 0x50029000); + + for (i =3D 0; i < info->sram_banks; i++) { + char *name =3D g_strdup_printf("RAM%d_PPU", i); + + map_ppu(s, RAM0_PPU + i, name, 0x5002a000 + i * 0x1000); + g_free(name); + } + } + /* This OR gate wires together outputs from the secure watchdogs to NM= I */ object_property_set_int(OBJECT(&s->nmi_orgate), 2, "num-lines", &err); if (err) { --=20 2.20.1