Reboot Dreamcast under software control
PATCH 1/1 Reboot Dreamcast under software control
In the light of more up to date technical information I have discovered there is a register at physical address 0x005F6890 on the Dreamcast that if written a magic number (0x00007611) will force a reboot under software control.
Presumably a better option than the current catch-all mechanism.
Signed-off by: Adrian McMenamin <[email protected]>
arch/sh/kernel/process.c +5 -0
@@ -97,6 +97,11 @@ void cpu_idle(void)void machine_restart (char * __unused) { + +#ifdef CONFIG_SH_DREAMCAST +/*reboot the Dreamcast under software control*/ +writel (0x00007611 ,0xA05F6890 ); +#endif /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ asmvolatile ("ldc %0, sr\n\t" "mov.l @%1, %0" : :"r" (0x10000000 ),"r" (0x80000001 ));
PATCH 1/1 Reboot Dreamcast under software control
Apologies. I meant to cc: this to the lists first time round and appear to have bcc'ed it instead.
---------- Forwarded message ----------
From: Adrian McMenamin <[email protected]>
Date: 29-Jul-2007 19:04
Subject: [PATCH] Reboot Dreamcast under software control
To: [email protected]
In the light of more up to date technical information I have discovered there is a register at physical address 0x005F6890 on the Dreamcast that if written a magic number (0x00007611) will force a reboot under software control.
Presumably a better option than the current catch-all mechanism.
Signed-off by: Adrian McMenamin <[email protected]>
arch/sh/kernel/process.c +5 -0
@@ -97,6 +97,11 @@ void cpu_idle(void)void machine_restart (char * __unused) { + +#ifdef CONFIG_SH_DREAMCAST +/*reboot the Dreamcast under software control*/ +writel (0x00007611 ,0xA05F6890 ); +#endif /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ asmvolatile ("ldc %0, sr\n\t" "mov.l @%1, %0" : :"r" (0x10000000 ),"r" (0x80000001 ));
Quoted 6 lines · Adrian McMenamin
arch/sh/kernel/process.c +0
-0@@ -97,6 +97,11 @@ void cpu_idle(void)
arch/sh/kernel/process.c void cpu_idle(void) · line 107
Quoted 10 lines
arch/sh/kernel/process.c +5
-0void machine_restart (char * __unused) { + +#ifdef CONFIG_SH_DREAMCAST +/*reboot the Dreamcast under software control*/ +writel (0x00007611 ,0xA05F6890 ); +#endif /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ asmvolatile ("ldc %0, sr\n\t" "mov.l @%1, %0" : :"r" (0x10000000 ),"r" (0x80000001 ));
No, if you want to do this, at least use a function pointer and leave this as the default implementation. The dreamcast presumably only needs this magic write anyways, rather than the SR.BL trick.
Quoted 7 lines · Paul Mundt
Quoted 6 lines · Adrian McMenamin
arch/sh/kernel/process.c +0
-0@@ -97,6 +97,11 @@ void cpu_idle(void)
Quoted 15 lines
arch/sh/kernel/process.c void cpu_idle(void) · line 107
Quoted 10 lines
arch/sh/kernel/process.c +5
-0void machine_restart (char * __unused) { + +#ifdef CONFIG_SH_DREAMCAST +/*reboot the Dreamcast under software control*/ +writel (0x00007611 ,0xA05F6890 ); +#endif /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ asmvolatile ("ldc %0, sr\n\t" "mov.l @%1, %0" : :"r" (0x10000000 ),"r" (0x80000001 ));No, if you want to do this, at least use a function pointer and leave this as the default implementation. The dreamcast presumably only needs this magic write anyways, rather than the SR.BL trick.
Well, when I tested it, it did have a "return" in after the call and it worked - but I took that out as it looked like code bloat to me :)
Explain what you mean by using a function pointer and I'll do that.
Adrian
Quoted 24 lines · Adrian McMenamin
Quoted 7 lines · Paul Mundt
Quoted 6 lines · Adrian McMenamin
arch/sh/kernel/process.c +0
-0@@ -97,6 +97,11 @@ void cpu_idle(void)Quoted 15 lines
arch/sh/kernel/process.c void cpu_idle(void) · line 107
Quoted 10 lines
arch/sh/kernel/process.c +5
-0void machine_restart (char * __unused) { + +#ifdef CONFIG_SH_DREAMCAST +/*reboot the Dreamcast under software control*/ +writel (0x00007611 ,0xA05F6890 ); +#endif /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ asmvolatile ("ldc %0, sr\n\t" "mov.l @%1, %0" : :"r" (0x10000000 ),"r" (0x80000001 ));No, if you want to do this, at least use a function pointer and leave this as the default implementation. The dreamcast presumably only needs this magic write anyways, rather than the SR.BL trick.
Quoted 5 lines
Well, when I tested it, it did have a "return" in after the call and it worked - but I took that out as it looked like code bloat to me :)
Explain what you mean by using a function pointer and I'll do that.
Look at the other implementations that are overloaded by the boards. machine_power_off, the idle loop, etc.