qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Alistair Francis <alistair@alistair23.me>,
	joel@jms.id.au, qemu-arm@nongnu.org, jim@groklearning.com,
	mail@steffen-goertz.de, jusual@mail.ru,
	Subbaraya Sundeep <sundeep.lkml@gmail.com>,
	ilg@livius.net, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 3/3] target/arm: add "cortex-m0" CPU model
Date: Sat, 30 Jun 2018 10:13:43 +0100	[thread overview]
Message-ID: <20180630091343.14391-4-stefanha@redhat.com> (raw)
In-Reply-To: <20180630091343.14391-1-stefanha@redhat.com>

Define a "cortex-m0" ARMv6-M CPU model.

Most of the register reset values set by other CPU models are not
relevant for the cut-down ARMv6-M architecture.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 target/arm/cpu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 2ae4fffafb..10951fa0eb 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1233,6 +1233,15 @@ static void arm11mpcore_initfn(Object *obj)
     cpu->reset_auxcr = 1;
 }
 
+static void cortex_m0_initfn(Object *obj)
+{
+    ARMCPU *cpu = ARM_CPU(obj);
+    set_feature(&cpu->env, ARM_FEATURE_V6);
+    set_feature(&cpu->env, ARM_FEATURE_M);
+
+    cpu->midr = 0x410cc200;
+}
+
 static void cortex_m3_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
@@ -1825,6 +1834,8 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1136",     .initfn = arm1136_initfn },
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
+    { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
+                             .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m4",   .initfn = cortex_m4_initfn,
-- 
2.17.1

  parent reply	other threads:[~2018-06-30  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-30  9:13 [Qemu-devel] [PATCH v2 0/3] arm: add skeleton Cortex M0 CPU model Stefan Hajnoczi
2018-06-30  9:13 ` [Qemu-devel] [PATCH v2 1/3] hw/arm: extract ARM M Profile base class from ARMv7-M Stefan Hajnoczi
2018-07-05 15:45   ` Peter Maydell
2018-07-05 15:49     ` Peter Maydell
2018-07-11 12:51       ` Stefan Hajnoczi
2018-07-11 13:32         ` Peter Maydell
2018-06-30  9:13 ` [Qemu-devel] [PATCH v2 2/3] hw/arm: add ARMv6M object Stefan Hajnoczi
2018-07-05 15:46   ` Peter Maydell
2018-06-30  9:13 ` Stefan Hajnoczi [this message]
2018-07-05 15:28   ` [Qemu-devel] [PATCH v2 3/3] target/arm: add "cortex-m0" CPU model Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180630091343.14391-4-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=ilg@livius.net \
    --cc=jim@groklearning.com \
    --cc=joel@jms.id.au \
    --cc=jusual@mail.ru \
    --cc=mail@steffen-goertz.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sundeep.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).