Reset the system when 1 is written to SWRESET register Signed-off-by: Dmitry Zhurikhin <z...@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