From patchwork Wed Apr 4 10:08:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Zhurikhin X-Patchwork-Id: 150706 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BC80EB6FF7 for ; Wed, 4 Apr 2012 20:25:33 +1000 (EST) Received: from localhost ([::1]:43388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFNAE-0004gA-HO for incoming@patchwork.ozlabs.org; Wed, 04 Apr 2012 06:10:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFNA7-0004fa-Jc for qemu-devel@nongnu.org; Wed, 04 Apr 2012 06:10:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFNA5-0004Ck-Am for qemu-devel@nongnu.org; Wed, 04 Apr 2012 06:09:59 -0400 Received: from smtp.ispras.ru ([83.149.198.202]:47761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFNA5-0004Ca-45 for qemu-devel@nongnu.org; Wed, 04 Apr 2012 06:09:57 -0400 Received: from cold (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with SMTP id D7BD75D4034; Wed, 4 Apr 2012 13:43:35 +0400 (MSD) Received: by cold (sSMTP sendmail emulation); Wed, 04 Apr 2012 14:08:53 +0400 From: "Dmitry Zhurikhin" To: Maksim Kozlov Date: Wed, 4 Apr 2012 14:08:53 +0400 Message-Id: <1333534133-9917-1-git-send-email-zhur@ispras.ru> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 83.149.198.202 Cc: Igor Mitsyanko , Evgeny Voevodin , qemu-devel@nongnu.org, Dmitry Zhurikhin , Kyungmin Park , Dmitry Solodkiy Subject: [Qemu-devel] [PATCH] Support system reset in Exynos4210 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reset the system when 1 is written to SWRESET register Signed-off-by: Dmitry Zhurikhin --- 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; }