From patchwork Fri Jun 19 13:47:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 50102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7BA3622903 for ; Fri, 19 Jun 2015 13:48:30 +0000 (UTC) Received: by wguu7 with SMTP id u7sf13200202wgu.0 for ; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=nUxxDJ8PTT8lKoMx/du4RgVJykrEzFD44GGUS164yYM=; b=OO2NSsNQKYTk7MpVWYFHBWWtBurVvNmEvOOQwPzy1DNPW30JvrWIkEgLI26fzN1FLN kXGHYYzYBckDJaUQaO2DDFAKmadNqivcDsQ1DdEEgBXihoClH2VDCmWye7StTDnuN777 TszMIvOeLtyAZ+m8phyW6xtqnMGEqbE3SxhywL3Ex8m0kSR5LTPciTmzMkrPUf6aoDow urDAv5VKE0FpBEtgYTz/YR0WGP71A1IKEhMl9zY0omu0ku7elMIiUbKqPhup5WLQ/63A DyGY8MJmjmLqx4p71ZCtr+XbngjrYUZhrwNLJa3rx8fTBrk6HDKLCw7k2Rvh1A08AClW 61Mw== X-Gm-Message-State: ALoCoQltdRMC7rrW0qFLoUR5prUDNFdo7xbxKqPsvEsGC8WuTlSABIzkAGzhSA3ace7R61Th0vsh X-Received: by 10.112.189.131 with SMTP id gi3mr15207601lbc.6.1434721709731; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.131 with SMTP id o3ls664074lal.101.gmail; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) X-Received: by 10.152.5.2 with SMTP id o2mr18040396lao.79.1434721709574; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id kj10si9226954lbb.43.2015.06.19.06.48.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jun 2015 06:48:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labbc20 with SMTP id bc20so74539699lab.1 for ; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr17656238lbc.117.1434721709454; Fri, 19 Jun 2015 06:48:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp606769lbb; Fri, 19 Jun 2015 06:48:28 -0700 (PDT) X-Received: by 10.140.101.8 with SMTP id t8mr751680qge.9.1434721708135; Fri, 19 Jun 2015 06:48:28 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d93si10889397qgf.92.2015.06.19.06.48.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Jun 2015 06:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:58157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5weh-0007eX-9W for patch@linaro.org; Fri, 19 Jun 2015 09:48:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5wdc-0006Gm-Gr for qemu-devel@nongnu.org; Fri, 19 Jun 2015 09:47:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5wda-0001IG-0r for qemu-devel@nongnu.org; Fri, 19 Jun 2015 09:47:20 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5wdZ-0001Hr-Q3 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 09:47:17 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z5wdY-0006bW-GJ for qemu-devel@nongnu.org; Fri, 19 Jun 2015 14:47:16 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 19 Jun 2015 14:47:05 +0100 Message-Id: <1434721636-25357-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434721636-25357-1-git-send-email-peter.maydell@linaro.org> References: <1434721636-25357-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 01/12] target-arm: Add the Cortex-M4 CPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: "Aurelio C. Remonda" This patch adds the Cortex-M4 CPU. The M4 is basically the same as the M3, the main differences being the DSP instructions and an optional FPU. Only no-FPU cortex-M4 is implemented here, cortex-M4F is not because the core target-arm code doesn't support the M-profile FPU model yet. Signed-off-by: Aurelio C. Remonda Message-id: 1434461850-4104-1-git-send-email-aurelioremonda@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target-arm/cpu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 7496983..524e841 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -812,6 +812,15 @@ static void cortex_m3_initfn(Object *obj) cpu->midr = 0x410fc231; } +static void cortex_m4_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_THUMB_DSP); + cpu->midr = 0x410fc240; /* r0p0 */ +} static void arm_v7m_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); @@ -1214,6 +1223,8 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "arm11mpcore", .initfn = arm11mpcore_initfn }, { .name = "cortex-m3", .initfn = cortex_m3_initfn, .class_init = arm_v7m_class_init }, + { .name = "cortex-m4", .initfn = cortex_m4_initfn, + .class_init = arm_v7m_class_init }, { .name = "cortex-a8", .initfn = cortex_a8_initfn }, { .name = "cortex-a9", .initfn = cortex_a9_initfn }, { .name = "cortex-a15", .initfn = cortex_a15_initfn },