From patchwork Fri Oct 25 09:08:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 177715 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp3322491ocf; Fri, 25 Oct 2019 02:13:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrQalKNbRnXVJSSAZGchRCFcWfp7pW4tvim2UXaCfMr7THk7n/fl4vq0Gczx/bWpmnIPtf X-Received: by 2002:ae9:c313:: with SMTP id n19mr1817470qkg.479.1571994822444; Fri, 25 Oct 2019 02:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571994822; cv=none; d=google.com; s=arc-20160816; b=k1TJJbIaFGnVSiQxE/QCb/TNn0AfLtQFWsK2K/ObxfagLRnma599HR/li3sRdH9oUl pEU7wSXKEeoJF7hQOZdP+EfBx4DyotpYzOjCe3ai0iaaSyi4Z9ZtPq5nEC4C0dPKTCWm 5tY6WoL9TmjCu2a3OtJ7OwajbM4VyA4+eARUXtcoeCDHnn2y4JPh6b3lMciq4DPShXXs hQlR6PGS4n1sthgnYdG04JBu+oogcGllp5d2aqwOzWSQs7A5O43Cow5hMzKfyjDYD+5f vj+0MFOEkyGoNcd0WNHYzKJ/3um4gO1QpLDUfMn+sicBSPAW4CQLbITPX9U4we9CgNFz HhHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=T2Z4YHKvtz2RFJb2xofyZipBdt3nobxmh7q3mnQybHk=; b=by4JzXVaB/z13iF2lDwJlJMSwxVRfJfMwWBsHx5Yw7ArcXmEXCuOlZChkQBR16dMK7 0qLm+4yjflRVtsckUTA2iK4y0RsYAQyUVlwLfn0l+/KsAZgRldHHpFn8MqWO04aQYxha xezX9+rMz9nji1HDbJKQY88HcB+pyvrBro9BC5asTwTk9h4Ug6F04+lb2yWhctKNF2yN +LKmFqQGAMvPv2y7MLO8qddYwlgg2LSZg8aK6zRHL3En9Uh3BaHUymCrW7BfvQwhGeyG GHpd3mjoGtQdFZvZKw1zu92TZIG2SiYTNl9hrVeDndq/hx9PAotaq3i/QgOKOXBr8oXS CpDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nVj66Ax4; 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 s12si366511qvl.122.2019.10.25.02.13.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 02:13:42 -0700 (PDT) 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=nVj66Ax4; 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 ([::1]:57948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvfC-00056E-0y for patch@linaro.org; Fri, 25 Oct 2019 05:13:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55476) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvag-0003Ip-VT for qemu-devel@nongnu.org; Fri, 25 Oct 2019 05:09:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNvaf-0004g3-61 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 05:09:02 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNvae-0004fL-Sw for qemu-devel@nongnu.org; Fri, 25 Oct 2019 05:09:01 -0400 Received: by mail-wm1-x344.google.com with SMTP id n7so1234409wmc.3 for ; Fri, 25 Oct 2019 02:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=T2Z4YHKvtz2RFJb2xofyZipBdt3nobxmh7q3mnQybHk=; b=nVj66Ax4XUPAPAohSfDgRY+kwJQF3vveiM6/fEN4sWHAdKoa6GuU86h7sX6HCpaDbd 0t9DJ53T/LAQlC2i5jnIu5ZdLXWltqWSqvo4GiaxrRtAV4qU1o6xDiv+rGlSAjveHv/Z IoPPhVvC8vN8Q3vQX7QBXtFlkmIBItBhC0F9IyBjEUyoIBfgKq8S808A8pROfHbe8j8d KkIbkFeIFcX33W05+dZ4W8umB9WdFm9bFfRbDQWMZu4LiYRhz4tUfQDhZmhdj693Cj70 y36sMosei9k4HXdPioKbTXuBhCcIYS+CmfzgRujSUYYro3xhBLtsLp6wQG9NnA8IcHMo b1nw== 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; bh=T2Z4YHKvtz2RFJb2xofyZipBdt3nobxmh7q3mnQybHk=; b=K1GQ1R0HiIiaCChzBSBKL/NIq4ldPCgyXE69ZyhNt/bSuFcRXVvDKNCRy2pCLqXT+s vkDeRSfDQtnrZVPgqw+pXuRG7ZGyjO1siExpGuts/Qp/9yjLspHrG6ivz8sYbgu+JlOr Fg4iAmK9JP/5ikw3m53IpC5ZfiFXXoFjovWLckkGVG0j8b+626TmWuAFk5B71C6Kkdo3 AGGbj7rZuR1f/lO19g2dlKsPJQr4SWHoRsLvAD9btWWcx/EjdcqIRwhzal+2d6iekIKI zZHGKneKkIMxsijGV4BPZehpDF7HTli8ezi+1mVLsW6wY76XLCCMHQovJBnoSYa2PvH7 xD/w== X-Gm-Message-State: APjAAAWXRwjCN7p9ba2P3+FkedJzSMCTNL9528yrziCgwP3LwQRozBF3 i3AqqICqZYgIYSYvcxNffyaPAgZ2Ge4= X-Received: by 2002:a05:600c:143:: with SMTP id w3mr2316378wmm.132.1571994538815; Fri, 25 Oct 2019 02:08:58 -0700 (PDT) Received: from babel.clyon.hd.free.fr ([2a01:e0a:283:3130:606f:6dc3:545e:fa5c]) by smtp.gmail.com with ESMTPSA id b186sm1286199wmb.21.2019.10.25.02.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 02:08:58 -0700 (PDT) From: Christophe Lyon To: qemu-devel@nongnu.org Subject: [PATCH 1/1] target/arm: Add support for cortex-m7 CPU Date: Fri, 25 Oct 2019 11:08:41 +0200 Message-Id: <20191025090841.10299-1-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Christophe Lyon , richard.henderson@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is derived from cortex-m4 description, adding DP support and FPv5 instructions with the corresponding flags in isar and mvfr2. Checked that it could successfully execute vrinta.f32 s15, s15 while cortex-m4 emulation rejects it with "illegal instruction". Signed-off-by: Christophe Lyon --- target/arm/cpu.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.7.4 Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 13813fb..ccae849 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1954,6 +1954,37 @@ static void cortex_m4_initfn(Object *obj) cpu->isar.id_isar6 = 0x00000000; } +static void cortex_m7_initfn(Object *obj) +{ + ARMCPU *cpu = ARM_CPU(obj); + + set_feature(&cpu->env, ARM_FEATURE_V7); + set_feature(&cpu->env, ARM_FEATURE_M); + set_feature(&cpu->env, ARM_FEATURE_M_MAIN); + set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); + set_feature(&cpu->env, ARM_FEATURE_VFP4); + cpu->midr = 0x411fc272; /* r1p2 */ + cpu->pmsav7_dregion = 8; + cpu->isar.mvfr0 = 0x10110221; + cpu->isar.mvfr1 = 0x12000011; + cpu->isar.mvfr2 = 0x00000040; + cpu->id_pfr0 = 0x00000030; + cpu->id_pfr1 = 0x00000200; + cpu->id_dfr0 = 0x00100000; + cpu->id_afr0 = 0x00000000; + cpu->id_mmfr0 = 0x00100030; + cpu->id_mmfr1 = 0x00000000; + cpu->id_mmfr2 = 0x01000000; + cpu->id_mmfr3 = 0x00000000; + cpu->isar.id_isar0 = 0x01101110; + cpu->isar.id_isar1 = 0x02112000; + cpu->isar.id_isar2 = 0x20232231; + cpu->isar.id_isar3 = 0x01111131; + cpu->isar.id_isar4 = 0x01310132; + cpu->isar.id_isar5 = 0x00000000; + cpu->isar.id_isar6 = 0x00000000; +} + static void cortex_m33_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -2538,6 +2569,8 @@ static const ARMCPUInfo arm_cpus[] = { .class_init = arm_v7m_class_init }, { .name = "cortex-m4", .initfn = cortex_m4_initfn, .class_init = arm_v7m_class_init }, + { .name = "cortex-m7", .initfn = cortex_m7_initfn, + .class_init = arm_v7m_class_init }, { .name = "cortex-m33", .initfn = cortex_m33_initfn, .class_init = arm_v7m_class_init }, { .name = "cortex-r5", .initfn = cortex_r5_initfn },