From patchwork Mon Jan 21 18:51:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 156251 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6701336jaa; Mon, 21 Jan 2019 10:51:47 -0800 (PST) X-Received: by 2002:adf:bb44:: with SMTP id x4mr30605081wrg.24.1548096707159; Mon, 21 Jan 2019 10:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548096707; cv=none; d=google.com; s=arc-20160816; b=L7ubaw7Qqmu/MulYdz5txNMb0FKVCb5+LnI7Qwr0jUjDpryrAObtGyrLK5L1Cbe94C /PsLZJZ0dPC7+jV9U6z//ixMNl4Up37tfL1sLA23/gTTk9X40vcWk+2JoiAEqd7il/ze GP8O6IGzQy5xNgFWAD5ih46CbMTgB9gO93+xSo7WFeYcH7g/0xKjcfUdhhT+07Glkikc wqW/4FacOxXk5CrtERUtdlYA6v/yS7zEh8+Yr+y8r7QW3kSqz4KuUYuzhv02353zdRNu PneQm5my8iO1CzmOAbaPSBP0QBRdJGci22oc5S3dTq6DbS9QIdOa5de4AGd0YkX/rDsq 8GxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=JNtduwYQb9S31DnKOmDqWMP8TZCY2KnxF33CO6L/1os=; b=qMb6p3U6KSI+7JVRSJkgye/9UldNsOYYpVQ8jmXWg1cZgdkUKMBkkVq9L/C+5pl9hw Dw8n51z6POY84HCyOYlZFpwzmzlp/gNpe8/ZDo9QZVfl6+AjH3ecm88D58Y9JhyiI1kJ acNdGQRos4x9VDe5bGGHwccFUHKfbVRjvKDGHoJhTeSvGUUxM5EbriX8OwoteatMMwdj mUJP3tmEdhYzjgFIiYPTCCHTi0L61Yl/rs4ql4/QYYIKHHEdk2IzuEvauZ93RMocOJZS vTxD8evjtDXjSGCouIUkmQ5y45V16whcKT3e/OrIQwlKANLdrGnc2hinIh/kvVx95WNF j3RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmFxpTCy; spf=pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.maydell@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y72sor32873335wme.1.2019.01.21.10.51.47 for (Google Transport Security); Mon, 21 Jan 2019 10:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmFxpTCy; spf=pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.maydell@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=JNtduwYQb9S31DnKOmDqWMP8TZCY2KnxF33CO6L/1os=; b=UmFxpTCyQNPsd5yCz3IUG6NDUQgDTjtRNvrJkg/jl0KKO9fLl6vg6uJsaM+7eIVoOC Oze52UFN9sCOQqMHMzDYLIvmT6oMGkaY8HzgYdEp+f9QGE+hqqQeLrJ0zDb7uPapXqMw EHeR8uZdmLNyhUH7P/18x96aaILmDt8Nwxweo= 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=JNtduwYQb9S31DnKOmDqWMP8TZCY2KnxF33CO6L/1os=; b=IirLKnUJQkXzpPWMly5zFKda/1iNLLUfro5E5jUSZ1n8x0zqwE9lXIIN0aD3PMe+ad 9ytuGNEkuTfV+WWX2ZBKBEH5sUc0PcnRybLZSff7eykqMdN0AJYnEf1mJx9BQnpklCZZ kJt5mUx1SPfrSGI3GzYXSh37tbolx+/CiCaKGWViMDpKuzWzEEszD3/OHsL63FwEQpTt WVfuJt113wIJz0/mNIRfs6z/kJ0+m/KGuE1ml+Lo2Q228L6WDhLgdVZ2rJ4ti+PrShUC 7dOYJhsGZA3R+iZI7fxNgUkqqzYCtvohoz2YOtyd4Z3ftfK19VCmHqNlxjfD0agngO/L KYoQ== X-Gm-Message-State: AJcUukfPlNM+LaJySGazS5Hg6P696NGysm+pDprpGobhSRJ9dVymefT+ MsEqqvPuA82fRCvFDBsDl8mJRTrcNoM7pJyr X-Google-Smtp-Source: ALg8bN69eiRqlsu349udfgkapvP9rtlYzrrbqAcJPe9kkJfgGAjBPd7BDEtg37MjdCYsq+HZZFuJaQ== X-Received: by 2002:a1c:d74a:: with SMTP id o71mr531544wmg.73.1548096706692; Mon, 21 Jan 2019 10:51:46 -0800 (PST) Return-Path: 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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Jan 2019 10:51:46 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 23/23] hw/arm/mps2-tz: Add mps2-an521 model Date: Mon, 21 Jan 2019 18:51:18 +0000 Message-Id: <20190121185118.18550-24-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 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 --- hw/arm/mps2-tz.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson 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);