From patchwork Fri Feb 1 16:06:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157253 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp618730jaa; Fri, 1 Feb 2019 08:08:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN59zDUCknwoVeU+zovb52X1iSpnJ4sD4KH7tX5j+gzS2VKuFqzp0aZFNaIfBsBVwWsSXrkG X-Received: by 2002:a5b:5cc:: with SMTP id w12mr39569702ybp.6.1549037288536; Fri, 01 Feb 2019 08:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549037288; cv=none; d=google.com; s=arc-20160816; b=JqHOOoysXptVa9cD1vGtemc9j9epLQEmI/98dWsSbg2BVS33belwiV6sEqLtmwQ77Z 63T0S6RQwHJ1Xlr/Yvlcn12WWrxaHrsrpTj5A0RihD5yFfQlTTxpwHNF6TPYzsjZzZDU 6BSBLQhhiCBnHz6aKmR4pN23GWuxQIY4YoDIR4KyKjXDxtl6sT9qI5PXhw2PCB88O1vF rZZ3e6wPK1NOEOHDxjDdaec0yCa7aXwkMrPJZD7v54cb3mzldcMFnQXMYaoml4n/oMTv K3qvSS9ZyZEDjXk91Mu9kesJrYq0l2X4MkVlXzCRsFy/EwhKqTBsgTUWvWLWRHgPZplf pdUA== 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=zI7ToX9Re0giJRf/qMtWQNULRFkakXxcwLNbjejd2a8=; b=GXztYspbpsaagDOLIj75h7Xcm9/mjty9mHnvRuOocA6e0xZy7eeQ7/3tOPdINkA0qq pt1GWHodATjcJKnyN3PmlFLp1oDXCu+cJWUei2ezDwyHBx3MqS6EcEZC6TtD2bSLPRUp ACZBi2MMEr5P9CD1VK0vbB8SNtmtS63ncBQZCeNhN44FQbz2gsNtJVk2lOKiT6gZIr6O 8MwwNplTZAgRB5VUhSU8YGIVFZLv4r1BLp+PviJr6XEiJ3pX61o96IA6maPTF1e13Ioe tlcA3yruMfWPzWF8hvFogTcJGKBBr2Y9mglzp39aAQ+enSH4HmRRDqrffgBq1xqP72BG Wacg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UFsBJ5YQ; 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 u125si4710187ywf.318.2019.02.01.08.08.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:08:08 -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=UFsBJ5YQ; 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]:57244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMN-00082N-UX for patch@linaro.org; Fri, 01 Feb 2019 11:08:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbLv-0007yk-EV for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbLl-0003RK-BZ for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:33 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:39481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbLd-0003MQ-NX for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:23 -0500 Received: by mail-wm1-x32b.google.com with SMTP id y8so6725722wmi.4 for ; Fri, 01 Feb 2019 08:07:20 -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=zI7ToX9Re0giJRf/qMtWQNULRFkakXxcwLNbjejd2a8=; b=UFsBJ5YQEQz/guV2kqipCk2Ts+xCwfJVRHw+hs0mOVbNuG/2kMz4FRg/JMotG+TnsK DiN4B3jQErwq+ytnrNGM00rGrRxjr5tYU18/0Mo7Tv3ciayh3fv8BTzVlPYmY9Ni7flu F/3xDU7guXuNnfyE4ciq2H1xKen8M027sdLuU= 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=zI7ToX9Re0giJRf/qMtWQNULRFkakXxcwLNbjejd2a8=; b=M6utSjGgEDZHTsgKalVyKoBQYyFzwN5MwFyKJx5F4iK7gPD94479yg7fba5hbgBwNI CzbRRn1eApbNnD1Zogd9IjXLYimc5byykKUz3yQm2QZdjgKCwSBRDgwG9GRMPUJ45nFr YiaM9N3W8zatbLN1ZEoHv+poO0+3u8LCH88tFdqUa9Lx0P72F1jcaCq6lroWw/eAU+/P 2+K0gUimdGsPWODL4zqbdSwB6IJYTFRyVoJg+P1LNNp8JUAo4d9gvz0bYozxehV+84yl J0+cMkCpf/EP4FtAH6I21KJXGcMoY8Bntjttxju57h+Gvp0seeAfRkUK5rFFOx5j2eCa wSyw== X-Gm-Message-State: AHQUAuY1FC0GekW1VHtpHbQNuvNovwH171whnI7VvK08aXputQ9EQ/Uw jZgah822R41ObMQ5py7nGlXlNtmLybFo2A== X-Received: by 2002:a1c:a00f:: with SMTP id j15mr2927402wme.84.1549037239783; Fri, 01 Feb 2019 08:07:19 -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.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:24 +0000 Message-Id: <20190201160653.13829-19-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::32b Subject: [Qemu-devel] [PULL 18/47] hw/arm/armsse: Add unimplemented-device stub for cache control registers 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 gives each CPU a register bank to use to control its L1 instruction cache. Put in an unimplemented-device stub for this. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20190121185118.18550-18-peter.maydell@linaro.org --- include/hw/arm/armsse.h | 1 + hw/arm/armsse.c | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 9855ec5f269..9d830057d5c 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -150,6 +150,7 @@ typedef struct ARMSSE { UnimplementedDeviceState mhu[2]; UnimplementedDeviceState ppu[NUM_PPUS]; + UnimplementedDeviceState cachectrl[SSE_MAX_CPUS]; /* * 'container' holds all devices seen by all CPUs. diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 280ba5c78be..41e4a781e11 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -32,6 +32,7 @@ struct ARMSSEInfo { SysConfigFormat sys_config_format; bool has_mhus; bool has_ppus; + bool has_cachectrl; }; static const ARMSSEInfo armsse_variants[] = { @@ -43,6 +44,7 @@ static const ARMSSEInfo armsse_variants[] = { .sys_config_format = IoTKitFormat, .has_mhus = false, .has_ppus = false, + .has_cachectrl = false, }, }; @@ -290,6 +292,16 @@ static void armsse_init(Object *obj) g_free(name); } } + if (info->has_cachectrl) { + for (i = 0; i < info->num_cpus; i++) { + char *name = g_strdup_printf("cachectrl%d", i); + + sysbus_init_child_obj(obj, name, &s->cachectrl[i], + sizeof(s->cachectrl[i]), + 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); @@ -795,7 +807,32 @@ static void armsse_realize(DeviceState *dev, Error **errp) qdev_connect_gpio_out(DEVICE(&s->ppc_irq_orgate), 0, armsse_get_common_irq_in(s, 10)); - /* 0x40010000 .. 0x4001ffff: private CPU region: unused in IoTKit */ + /* + * 0x40010000 .. 0x4001ffff (and the 0x5001000... secure-only alias): + * private per-CPU region (all these devices are SSE-200 only): + * 0x50010000: L1 icache control registers + * 0x50011000: CPUSECCTRL (CPU local security control registers) + * 0x4001f000 and 0x5001f000: CPU_IDENTITY register block + */ + if (info->has_cachectrl) { + for (i = 0; i < info->num_cpus; i++) { + char *name = g_strdup_printf("cachectrl%d", i); + MemoryRegion *mr; + + qdev_prop_set_string(DEVICE(&s->cachectrl[i]), "name", name); + g_free(name); + qdev_prop_set_uint64(DEVICE(&s->cachectrl[i]), "size", 0x1000); + object_property_set_bool(OBJECT(&s->cachectrl[i]), true, + "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + + mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->cachectrl[i]), 0); + memory_region_add_subregion(&s->cpu_container[i], 0x50010000, mr); + } + } /* 0x40020000 .. 0x4002ffff : ARMSSE system control peripheral region */ /* Devices behind APB PPC1: