Skip to contentSkip to conversation

Fix powerpc 604 reset vector

PATCH Applied Tristan Gingold 2 participants 5 messages Apr 27, 2009 – Apr 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix powerpc 604 reset vector

According to 604eUM_book (see 8.3.3 Reset inputs p8-54), the IP bit is set for hreset and the vector is at offset 0x100 from the exception prefix.

No difference in this area between 604 and 604e.

---
 target-ppc/translate_init.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
target-ppc/translate_init.c +2 -2
index 56d8d93..791c73c 100644
@@ -2875,9 +2875,9 @@ static void init_excp_604 (CPUPPCState *env)
     env->excp_vectors[POWERPC_EXCP_PERFM]    = 0x00000F00;
     env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;
     env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;
-    env->excp_prefix = 0x00000000UL;
+    env->excp_prefix = 0xFFF00000UL;
     /* Hardware reset vector */
-    env->hreset_vector = 0xFFFFFFFCUL;
+    env->hreset_vector = 0x00000100UL;
 #endif
 }
 
Signature · 1 line
1.6.2
#1 lore raw
Quoted 4 lines · Tristan Gingold

According to 604eUM_book (see 8.3.3 Reset inputs p8-54), the IP bit is set
for hreset and the vector is at offset 0x100 from the exception prefix.

No difference in this area between 604 and 604e.

This breaks system_reset. Maybe the excp_prefix should be reset to original value on reset?

#2 lore raw
Quoted 8 lines · Blue Swirl
Quoted 4 lines · Tristan Gingold

According to 604eUM_book (see 8.3.3 Reset inputs p8-54), the IP bit is set for hreset and the vector is at offset 0x100 from the exception prefix.

No difference in this area between 604 and 604e.

This breaks system_reset. Maybe the excp_prefix should be reset to original value on reset?

Is system_reset supposed to be a soft reset or an hard reset ?

Maybe the firmware you used doesn't handle soft reset.

#3 lore raw
Quoted 7 lines · Tristan Gingold
Quoted 4 lines · Blue Swirl
Quoted 3 lines · Tristan Gingold

According to 604eUM_book (see 8.3.3 Reset inputs p8-54), the IP bit is set for hreset and the vector is at offset 0x100 from the exception prefix.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

No difference in this area between 604 and 604e.

This breaks system_reset. Maybe the excp_prefix should be reset to original value on reset?

Is system_reset supposed to be a soft reset or an hard reset ?

To be more precise:
helper.c:cpu_ppc_reset set msr EP (=IP) bit without setting excp_prefix.

This is not coherent: if exceptions are enabled without resetting EP bit, a wrong prefix will be used.

Applied
#4 lore raw
In reply to Tristan Gingold
Quoted 4 lines · Tristan Gingold

According to 604eUM_book (see 8.3.3 Reset inputs p8-54), the IP bit is set
for hreset and the vector is at offset 0x100 from the exception prefix.

No difference in this area between 604 and 604e.

Thanks, applied.