qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry Zhurikhin" <zhur@ispras.ru>
To: Maksim Kozlov <m.kozlov@samsung.com>
Cc: Igor Mitsyanko <i.mitsyanko@samsung.com>,
	Evgeny Voevodin <e.voevodin@samsung.com>,
	qemu-devel@nongnu.org, Dmitry Zhurikhin <zhur@ispras.ru>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Dmitry Solodkiy <d.solodkiy@samsung.com>
Subject: [Qemu-devel] [PATCH] Support system reset in Exynos4210
Date: Wed,  4 Apr 2012 14:08:53 +0400	[thread overview]
Message-ID: <1333534133-9917-1-git-send-email-zhur@ispras.ru> (raw)

Reset the system when 1 is written to SWRESET register

Signed-off-by: Dmitry Zhurikhin <zhur@ispras.ru>
---
 hw/exynos4210_pmu.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/exynos4210_pmu.c b/hw/exynos4210_pmu.c
index c12d750..edf6e34 100644
--- a/hw/exynos4210_pmu.c
+++ b/hw/exynos4210_pmu.c
@@ -25,6 +25,7 @@
  */
 
 #include "sysbus.h"
+#include "sysemu.h"
 
 #ifndef DEBUG_PMU
 #define DEBUG_PMU           0
@@ -422,6 +423,16 @@ static void exynos4210_pmu_write(void *opaque, target_phys_addr_t offset,
         if (reg_p->offset == offset) {
             PRINT_DEBUG_EXTEND("%s <0x%04x> <- 0x%04x\n", reg_p->name,
                     (uint32_t)offset, (uint32_t)val);
+            switch (offset) {
+            case SWRESET:
+                if (val & 1) {
+                    qemu_system_reset_request();
+                }
+                break;
+            default:
+                /* Nothing */
+                break;
+            }
             s->reg[i] = val;
             return;
         }
-- 
1.7.4.1

             reply	other threads:[~2012-04-04 10:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 10:08 Dmitry Zhurikhin [this message]
2012-04-04 11:55 ` [Qemu-devel] [PATCH] Support system reset in Exynos4210 Maksim Kozlov
2012-04-04 12:35   ` Dmitry Zhurikhin
2012-04-04 16:16     ` Maksim Kozlov
2012-04-04 17:37       ` Dmitry Zhurikhin

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=1333534133-9917-1-git-send-email-zhur@ispras.ru \
    --to=zhur@ispras.ru \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=i.mitsyanko@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=m.kozlov@samsung.com \
    --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).