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: 1034868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="UFsBJ5YQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43rhqC0NZvz9sDX for ; Sat, 2 Feb 2019 03:08:39 +1100 (AEDT) Received: from localhost ([127.0.0.1]:57244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMq-00082N-Lf for incoming@patchwork.ozlabs.org; Fri, 01 Feb 2019 11:08:36 -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-Google-Smtp-Source: AHgI3IbiGCV1Ih79PRRDAhN9x4pKmNA/w4in01ig3O/ahEe65po9N7rFLF/KoTntik9H1jgBJ42Sdg== 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+incoming=patchwork.ozlabs.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(-) 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: