From: Keith Packard via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: Keith Packard <keithp@keithp.com>
Subject: [PATCH 1/2] riscv: Add sifive test device to sifive_e target
Date: Fri, 23 Oct 2020 14:45:05 -0700 [thread overview]
Message-ID: <20201023214506.917601-2-keithp@keithp.com> (raw)
In-Reply-To: <20201023214506.917601-1-keithp@keithp.com>
The SiFive test device provides a mechanism for terminating the qemu
instance from the emulated system. This patch adds that device to the
sifive_e target.
Signed-off-by: Keith Packard <keithp@keithp.com>
---
hw/riscv/sifive_e.c | 4 ++++
include/hw/riscv/sifive_e.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index fcfac16816..417e3a5409 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -11,6 +11,7 @@
* 3) PRCI (Power, Reset, Clock, Interrupt)
* 4) Registers emulated as RAM: AON, GPIO, QSPI, PWM
* 5) Flash memory emulated as RAM
+ * 6) TEST (Test device)
*
* The Mask ROM reset vector jumps to the flash payload at 0x2040_0000.
* The OTP ROM and Flash boot code will be emulated in a future version.
@@ -45,6 +46,7 @@
#include "hw/intc/sifive_clint.h"
#include "hw/intc/sifive_plic.h"
#include "hw/misc/sifive_e_prci.h"
+#include "hw/misc/sifive_test.h"
#include "chardev/char.h"
#include "sysemu/arch_init.h"
#include "sysemu/sysemu.h"
@@ -57,6 +59,7 @@ static const struct MemmapEntry {
[SIFIVE_E_DEV_DEBUG] = { 0x0, 0x1000 },
[SIFIVE_E_DEV_MROM] = { 0x1000, 0x2000 },
[SIFIVE_E_DEV_OTP] = { 0x20000, 0x2000 },
+ [SIFIVE_E_DEV_TEST] = { 0x100000, 0x1000 },
[SIFIVE_E_DEV_CLINT] = { 0x2000000, 0x10000 },
[SIFIVE_E_DEV_PLIC] = { 0xc000000, 0x4000000 },
[SIFIVE_E_DEV_AON] = { 0x10000000, 0x8000 },
@@ -216,6 +219,7 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp)
memmap[SIFIVE_E_DEV_CLINT].size, 0, ms->smp.cpus,
SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE,
SIFIVE_CLINT_TIMEBASE_FREQ, false);
+ sifive_test_create(memmap[SIFIVE_E_DEV_TEST].base);
create_unimplemented_device("riscv.sifive.e.aon",
memmap[SIFIVE_E_DEV_AON].base, memmap[SIFIVE_E_DEV_AON].size);
sifive_e_prci_create(memmap[SIFIVE_E_DEV_PRCI].base);
diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h
index 83604da805..92bab6d0d4 100644
--- a/include/hw/riscv/sifive_e.h
+++ b/include/hw/riscv/sifive_e.h
@@ -56,6 +56,7 @@ enum {
SIFIVE_E_DEV_DEBUG,
SIFIVE_E_DEV_MROM,
SIFIVE_E_DEV_OTP,
+ SIFIVE_E_DEV_TEST,
SIFIVE_E_DEV_CLINT,
SIFIVE_E_DEV_PLIC,
SIFIVE_E_DEV_AON,
--
2.28.0
next prev parent reply other threads:[~2020-10-23 21:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 21:45 [PATCH 0/2] riscv: Add SiFive test device to sifive targets Keith Packard via
2020-10-23 21:45 ` Keith Packard via [this message]
2020-10-23 23:38 ` [PATCH 1/2] riscv: Add sifive test device to sifive_e target Alistair Francis
2020-10-24 0:13 ` Keith Packard via
2020-10-24 0:03 ` Alistair Francis
2020-10-24 6:01 ` Keith Packard via
2020-10-23 21:45 ` [PATCH 2/2] riscv: Add sifive test device to sifive_u target Keith Packard via
2020-10-23 23:39 ` Alistair Francis
2020-10-24 0:15 ` Keith Packard via
2020-10-26 6:11 ` Bin Meng
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=20201023214506.917601-2-keithp@keithp.com \
--to=qemu-devel@nongnu.org \
--cc=keithp@keithp.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).