qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@iki.fi>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Pekka Enberg <penberg@iki.fi>
Subject: [Qemu-devel] [PATCH v2 3/3] raspi: Add "raspi3" machine type
Date: Fri, 16 Feb 2018 09:02:01 +0200	[thread overview]
Message-ID: <20180216070201.4271-4-penberg@iki.fi> (raw)
In-Reply-To: <20180216070201.4271-1-penberg@iki.fi>

This patch adds a "raspi3" machine type, which can now be selected as
the machine to run on by users via the "-M" command line option to QEMU.

The machine type does *not* ignore memory transaction failures so we
likely need to add some dummy devices later when people run something
more complicated than what I'm using for testing.

Signed-off-by: Pekka Enberg <penberg@iki.fi>
---
 hw/arm/raspi.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 66fe10e376..ff54f45e3e 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -187,3 +187,26 @@ static void raspi2_machine_init(MachineClass *mc)
     mc->ignore_memory_transaction_failures = true;
 };
 DEFINE_MACHINE("raspi2", raspi2_machine_init)
+
+#ifdef TARGET_AARCH64
+static void raspi3_init(MachineState *machine)
+{
+    raspi_init(machine, 3);
+}
+
+static void raspi3_machine_init(MachineClass *mc)
+{
+    mc->desc = "Raspberry Pi 3";
+    mc->init = raspi3_init;
+    mc->block_default_type = IF_SD;
+    mc->no_parallel = 1;
+    mc->no_floppy = 1;
+    mc->no_cdrom = 1;
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a53");
+    mc->max_cpus = BCM2836_NCPUS;
+    mc->min_cpus = BCM2836_NCPUS;
+    mc->default_cpus = BCM2836_NCPUS;
+    mc->default_ram_size = 1024 * 1024 * 1024;
+}
+DEFINE_MACHINE("raspi3", raspi3_machine_init)
+#endif
-- 
2.14.3

  parent reply	other threads:[~2018-02-16  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  7:01 [Qemu-devel] [PATCH v2 0/3] Raspberry Pi 3 support Pekka Enberg
2018-02-16  7:01 ` [Qemu-devel] [PATCH v2 1/3] bcm2836: Make CPU type configurable Pekka Enberg
2018-02-16  7:02 ` [Qemu-devel] [PATCH v2 2/3] raspi: Raspberry Pi 3 support Pekka Enberg
2019-09-03 12:42   ` Philippe Mathieu-Daudé
2019-09-04 14:35     ` bzt
2018-02-16  7:02 ` Pekka Enberg [this message]
2018-02-16  9:16 ` [Qemu-devel] [PATCH v2 0/3] " 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=20180216070201.4271-4-penberg@iki.fi \
    --to=penberg@iki.fi \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).