From patchwork Fri Feb 1 16:06:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157283 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp648752jaa; Fri, 1 Feb 2019 08:33:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN6BHW9wnbk2w83n2WGdxEjbQjybZRZy+dsgUSb0WhV8XJ3yHi3YVhnKOCUDdzvx/ZLV9vcZ X-Received: by 2002:a81:1d43:: with SMTP id d64mr38691588ywd.450.1549038783565; Fri, 01 Feb 2019 08:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549038783; cv=none; d=google.com; s=arc-20160816; b=N+GBL5X3BvmXFkQUFeZmm0GPccK6Wex6GBp2Xi9MUY5ZkRkocXZqD0mV9B43JoE9ws YDoH4tTFUDjh1OszMu+LDR6b8S0s+yCkeOr2EjCchNtqu7Xv+j0W49DsZBOxFp4QaWiY XyygIvC6sV8n/WoxiXfmrpDb0YbTHqTVSp3DmIBG5+uWDmIPiPuMa9dgIFsObn2rcTes JxzI8Y9VGWtw6y455cUE7I/b+bxpO6TyeGcHd8k8kCBtlrhx1paTzoI+jkKaw02tRt32 E51OkGrV1a+tW4voq/bDLziYRMAIjiCbKTVwXsE69xf9lE9ejAx50qSeTzcRK6QWue22 dlkA== 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=ddxrppjz4iXH4w1jigFjxw+FhNBgdMRMsFsr9FMtHbY=; b=AiTLsX2ueP0BvQSNHyCrV6DD0rCdELvix2w0VsmsjX7yCbs2XN4mz1vI1lfpnSM+1K p02q2+/7FnIpiGp3rcC5PNKlsG9XbgkfkY7vLKCwh7bg+GQIvgRZC7key6HCKTtwHIDu b5Fj8IRF7dANRrkkelYhOOSIWxNCzTvULv+OZL6REW/pOoT/wzhmKlqLJel56f/DDLO2 m0U1I2DXbRPmkuI2EdvYecqsHkXZmiiBbM0dBwE1zlU3N0rey01yrmLwomJzYVxPj7fA hFVbGqlfMHnXbVi2NjVt5numueg0rhWhy5441CbzLh6MlfZctyRoMgXkTtiwe9CUUqZc rXYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HhIxaZBL; 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 s4si4797827ywf.128.2019.02.01.08.33.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:33:03 -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=HhIxaZBL; 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]:57597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbkU-0003KU-Vj for patch@linaro.org; Fri, 01 Feb 2019 11:33:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMD-0008Gf-Nk for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbMA-0003iT-En for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:57 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbMA-0003P0-06 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:54 -0500 Received: by mail-wm1-x343.google.com with SMTP id f188so6726654wmf.5 for ; Fri, 01 Feb 2019 08:07:28 -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=ddxrppjz4iXH4w1jigFjxw+FhNBgdMRMsFsr9FMtHbY=; b=HhIxaZBL5wRiSUpx3e8+IPF6P/TazDJpM8TPcENIaRqTiHEi+CWUrWeLoNLJyxzxoN o2ihEIgqDrYxIplGVEgDsybH39/48LJhqqdyBf1Nm/4xTcRoR8ownCczKHAN1ukPOmQk jPImTrRCl9p5NfETg7/wtt8CmcFfZi7YkUm1A= 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=ddxrppjz4iXH4w1jigFjxw+FhNBgdMRMsFsr9FMtHbY=; b=Fsw/oeQHIjqGVSW2Zwm+ixubsdcofhuirPlyOUgAH9tD+p9HHFFHndIZ15LbUswmXx WytqxYdK/30cj0MZnSvgW5113kkUoS7fyrZFdakFMzpwPOYSKgghwEtxjifX1d3rEMJg TA4CAhYhjrTgnGoMngoOx8vlSA/Xlzrs4XiJPviwHdKrleWeQOnPzcmSuoRX0F4wKo8j ch4JtJA3FA6fSfjHwBTRGs/PfkXAMyYa3xD5lK9MkZrf9n7ak1EkglGE9yq/wZdoylHS YWQsL9t/sUNmuc5q5f/p1jUmSfn+rQkSGlWOSraVfkBTOl1s5XFiETIw3DIVPq/RbInZ ks5Q== X-Gm-Message-State: AHQUAuaECE4KsDQBVJplvfXDh58p1TfU+T+9IP2rw1b3dOPiDKecYjhp H1y5UBWn6+SQuN3f3KE6xBcL8lkhedOp2A== X-Received: by 2002:a1c:1f83:: with SMTP id f125mr2969259wmf.56.1549037247370; Fri, 01 Feb 2019 08:07:27 -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.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:26 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:30 +0000 Message-Id: <20190201160653.13829-25-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::343 Subject: [Qemu-devel] [PULL 24/47] hw/arm/mps2-tz: Add mps2-an521 model 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" Add a model of the MPS2 FPGA image described in Application Note AN521. This is identical to the AN505 image, except that it uses the SSE-200 rather than the IoTKit and so has two Cortex-M33 CPUs. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20190121185118.18550-24-peter.maydell@linaro.org --- hw/arm/mps2-tz.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 95adcd478ab..f5f0b0e0fa5 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -15,6 +15,7 @@ * as seen by the guest depend significantly on the FPGA image. * This source file covers the following FPGA images, for TrustZone cores: * "mps2-an505" -- Cortex-M33 as documented in ARM Application Note AN505 + * "mps2-an521" -- Dual Cortex-M33 as documented in Application Note AN521 * * Links to the TRM for the board itself and to the various Application * Notes which document the FPGA images can be found here: @@ -24,10 +25,16 @@ * http://infocenter.arm.com/help/topic/com.arm.doc.100112_0200_06_en/versatile_express_cortex_m_prototyping_systems_v2m_mps2_and_v2m_mps2plus_technical_reference_100112_0200_06_en.pdf * Application Note AN505: * http://infocenter.arm.com/help/topic/com.arm.doc.dai0505b/index.html + * Application Note AN521: + * http://infocenter.arm.com/help/topic/com.arm.doc.dai0521c/index.html * * The AN505 defers to the Cortex-M33 processor ARMv8M IoT Kit FVP User Guide * (ARM ECM0601256) for the details of some of the device layout: * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ecm0601256/index.html + * Similarly, the AN521 uses the SSE-200, and the SSE-200 TRM defines + * most of the device layout: + * http://infocenter.arm.com/help/topic/com.arm.doc.101104_0100_00_en/corelink_sse200_subsystem_for_embedded_technical_reference_manual_101104_0100_00_en.pdf + * */ #include "qemu/osdep.h" @@ -64,6 +71,7 @@ typedef struct { MachineClass parent; MPS2TZFPGAType fpga_type; uint32_t scc_id; + const char *armsse_type; } MPS2TZMachineClass; typedef struct { @@ -93,6 +101,7 @@ typedef struct { #define TYPE_MPS2TZ_MACHINE "mps2tz" #define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505") +#define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521") #define MPS2TZ_MACHINE(obj) \ OBJECT_CHECK(MPS2TZMachineState, obj, TYPE_MPS2TZ_MACHINE) @@ -379,7 +388,7 @@ static void mps2tz_common_init(MachineState *machine) } sysbus_init_child_obj(OBJECT(machine), "iotkit", &mms->iotkit, - sizeof(mms->iotkit), TYPE_IOTKIT); + sizeof(mms->iotkit), mmc->armsse_type); iotkitdev = DEVICE(&mms->iotkit); object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory), "memory", &error_abort); @@ -632,7 +641,6 @@ static void mps2tz_class_init(ObjectClass *oc, void *data) IDAUInterfaceClass *iic = IDAU_INTERFACE_CLASS(oc); mc->init = mps2tz_common_init; - mc->max_cpus = 1; iic->check = mps2_tz_idau_check; } @@ -642,9 +650,28 @@ static void mps2tz_an505_class_init(ObjectClass *oc, void *data) MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_CLASS(oc); mc->desc = "ARM MPS2 with AN505 FPGA image for Cortex-M33"; + mc->default_cpus = 1; + mc->min_cpus = mc->default_cpus; + mc->max_cpus = mc->default_cpus; mmc->fpga_type = FPGA_AN505; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m33"); mmc->scc_id = 0x41045050; + mmc->armsse_type = TYPE_IOTKIT; +} + +static void mps2tz_an521_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_CLASS(oc); + + mc->desc = "ARM MPS2 with AN521 FPGA image for dual Cortex-M33"; + mc->default_cpus = 2; + mc->min_cpus = mc->default_cpus; + mc->max_cpus = mc->default_cpus; + mmc->fpga_type = FPGA_AN521; + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m33"); + mmc->scc_id = 0x41045210; + mmc->armsse_type = TYPE_SSE200; } static const TypeInfo mps2tz_info = { @@ -666,10 +693,17 @@ static const TypeInfo mps2tz_an505_info = { .class_init = mps2tz_an505_class_init, }; +static const TypeInfo mps2tz_an521_info = { + .name = TYPE_MPS2TZ_AN521_MACHINE, + .parent = TYPE_MPS2TZ_MACHINE, + .class_init = mps2tz_an521_class_init, +}; + static void mps2tz_machine_init(void) { type_register_static(&mps2tz_info); type_register_static(&mps2tz_an505_info); + type_register_static(&mps2tz_an521_info); } type_init(mps2tz_machine_init);