Patchwork PPC: 405: Fix ppc405ep initialization

login
register
mail settings
Submitter Alexander Graf
Date Feb. 21, 2012, 6:41 p.m.
Message ID <1329849702-7665-1-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/142351/
State New
Headers show

Comments

Alexander Graf - Feb. 21, 2012, 6:41 p.m.
When trying to run a ppc405 guest, it segfaults quite quickly, trying to
access timers that weren't initialized. Initialize them properly instead.

Reported-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc405_uc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/ppc405_uc.c b/hw/ppc405_uc.c
index 98079fa..1f4efbf 100644
--- a/hw/ppc405_uc.c
+++ b/hw/ppc405_uc.c
@@ -2483,6 +2483,8 @@  CPUState *ppc405ep_init(MemoryRegion *address_space_mem,
     ppc4xx_pob_init(env);
     /* OBP arbitrer */
     ppc4xx_opba_init(0xef600600);
+    /* Initialize timers */
+    ppc_booke_timers_init(env, sysclk, 0);
     /* Universal interrupt controller */
     irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB);
     irqs[PPCUIC_OUTPUT_INT] =