summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMichael Davidsaver <mdavidsaver@gmail.com>2015-11-03 13:49:41 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-11-03 13:49:41 +0000
commitd69ffb5b48701d8f33cdfa2570a4ea1d5eb9de4d (patch)
treea5fb9c1fc1e4b0f541a7b1f24733e8852d9a4d48 /hw
parente192becdc7b05276a41ebef9fe11e6c30ddb91e3 (diff)
downloadqemu-d69ffb5b48701d8f33cdfa2570a4ea1d5eb9de4d.tar.gz
qemu-d69ffb5b48701d8f33cdfa2570a4ea1d5eb9de4d.tar.bz2
qemu-d69ffb5b48701d8f33cdfa2570a4ea1d5eb9de4d.zip
arm: stellaris: exit on external reset request
Add GPIO in for the stellaris board which calls qemu_system_reset_request() on reset request. Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/stellaris.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 82a4ad5694..0114e0a7f8 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),