Currently the CPU does not get reset when the system_reset command is
invoked. We register a handler in the pxa2xx SoC code, to reset the
CPU as well.

Signed-off-by: Vijay Kumar B. <vijayku...@zilogic.com>
Reviewed-by: Deepak S. <dee...@zilogic.com>
---
 hw/arm/pxa2xx.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 0241e07..08223b7 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -2056,6 +2056,12 @@ static void pxa2xx_reset(void *opaque, int line, int 
level)
     }
 }
 
+static void pxa_reset_cb(void *opaque)
+{
+    PXA2xxState *s = opaque;
+    cpu_reset(CPU(s->cpu));
+}
+
 /* Initialise a PXA270 integrated chip (ARM based core).  */
 PXA2xxState *pxa270_init(MemoryRegion *address_space,
                          unsigned int sdram_size, const char *revision)
@@ -2192,6 +2198,8 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
     /* GPIO1 resets the processor */
     /* The handler can be overridden by board-specific code */
     qdev_connect_gpio_out(s->gpio, 1, s->reset);
+
+    qemu_register_reset(pxa_reset_cb, s);
     return s;
 }
 
-- 
2.1.4


Reply via email to