qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Davidsaver <mdavidsaver@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com,
	Michael Davidsaver <mdavidsaver@gmail.com>,
	alistair23@gmail.com
Subject: [Qemu-devel] [PATCH v4 3/3] arm: stellaris: exit on external reset request
Date: Sat, 31 Oct 2015 10:05:11 -0500	[thread overview]
Message-ID: <b55f92b61da8c49762094ce55cd7491ae14ee019.1446302575.git.mdavidsaver@gmail.com> (raw)
In-Reply-To: <cover.1446302575.git.mdavidsaver@gmail.com>

Add GPIO in for the stellaris board which calls
qemu_system_reset_request() on reset request.
---
 hw/arm/stellaris.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 82a4ad5..0114e0a 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -16,6 +16,7 @@
 #include "net/net.h"
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
+#include "sysemu/sysemu.h"
 
 #define GPIO_A 0
 #define GPIO_B 1
@@ -1176,6 +1177,14 @@ static int stellaris_adc_init(SysBusDevice *sbd)
     return 0;
 }
 
+static
+void do_sys_reset(void *opaque, int n, int level)
+{
+    if (level) {
+        qemu_system_reset_request();
+    }
+}
+
 /* Board init.  */
 static stellaris_board_info stellaris_boards[] = {
   { "LM3S811EVB",
@@ -1243,6 +1252,9 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
     nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES,
                       kernel_filename, cpu_model);
 
+    qdev_connect_gpio_out_named(nvic, "SYSRESETREQ", 0,
+                                qemu_allocate_irq(&do_sys_reset, NULL, 0));
+
     if (board->dc1 & (1 << 16)) {
         dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000,
                                     qdev_get_gpio_in(nvic, 14),
-- 
2.1.4

  parent reply	other threads:[~2015-10-31 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31 15:05 [Qemu-devel] [PATCH v4 0/3] armv7-m: exit on external reset request Michael Davidsaver
2015-10-31 15:05 ` [Qemu-devel] [PATCH v4 1/3] armv7-m: Return DeviceState* from armv7m_init() Michael Davidsaver
2015-10-31 15:05 ` [Qemu-devel] [PATCH v4 2/3] armv7-m: Implement SYSRESETREQ Michael Davidsaver
2015-10-31 15:05 ` Michael Davidsaver [this message]
2015-11-02 14:05 ` [Qemu-devel] [PATCH v4 0/3] armv7-m: exit on external reset request 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=b55f92b61da8c49762094ce55cd7491ae14ee019.1446302575.git.mdavidsaver@gmail.com \
    --to=mdavidsaver@gmail.com \
    --cc=alistair23@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --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).