This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Rattler - fix problem with reset command
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: 11 Dec 2003 08:18:24 -0700
- Subject: Rattler - fix problem with reset command
- Organization: MLB Associates
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: hal/powerpc/arch/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/arch/current/ChangeLog,v
retrieving revision 1.58
diff -u -5 -p -r1.58 ChangeLog
--- hal/powerpc/arch/current/ChangeLog 8 Dec 2003 15:34:56 -0000 1.58
+++ hal/powerpc/arch/current/ChangeLog 11 Dec 2003 15:14:33 -0000
@@ -1,5 +1,10 @@
+2003-12-11 Gary Thomas <gary@mlbassoc.com>
+
+ * include/hal_intr.h: Add macros to manipulate machine check enable
+ bit in the MSR.
+
2003-12-08 Gary Thomas <gary@mlbassoc.com>
* src/hal_misc.c (cyg_hal_exception_handler): Only declare __mem_fault_handler
if GDB stubs are included (and it will be used).
Index: hal/powerpc/arch/current/include/hal_intr.h
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/arch/current/include/hal_intr.h,v
retrieving revision 1.19
diff -u -5 -p -r1.19 hal_intr.h
--- hal/powerpc/arch/current/include/hal_intr.h 5 Dec 2003 09:56:59 -0000 1.19
+++ hal/powerpc/arch/current/include/hal_intr.h 11 Dec 2003 15:14:10 -0000
@@ -228,10 +228,45 @@ typedef cyg_uint32 CYG_INTERRUPT_STATE;
"and %0,%0,%1;" \
: "=&r"(_old_), "=r" (tmp)); \
CYG_MACRO_END
//--------------------------------------------------------------------------
+// Machine check manipulation
+#define HAL_DISABLE_MACHINE_CHECK(_old_) \
+ CYG_MACRO_START \
+ cyg_uint32 tmp1, tmp2; \
+ asm volatile ( \
+ "mfmsr %0;" \
+ "mr %2,%0;" \
+ "li %1,0;" \
+ "rlwimi %2,%1,0,19,19;" \
+ "mtmsr %2;" \
+ : "=r"(_old_), "=r" (tmp1), "=r" (tmp2)); \
+ CYG_MACRO_END
+
+#define HAL_ENABLE_MACHINE_CHECK() \
+ CYG_MACRO_START \
+ cyg_uint32 tmp1, tmp2; \
+ asm volatile ( \
+ "mfmsr %0;" \
+ "lis %1,%1,0x0001;" \
+ "rlwimi %0,%1,0,19,19;" \
+ "mtmsr %0;" \
+ : "=r" (tmp1), "=r" (tmp2)); \
+ CYG_MACRO_END
+
+#define HAL_QUERY_MACHINE_CHECK(_old_) \
+ CYG_MACRO_START \
+ cyg_uint32 tmp; \
+ asm volatile ( \
+ "mfmsr %0;" \
+ "lis %1,0x0001;" \
+ "and %0,%0,%1;" \
+ : "=&r"(_old_), "=r" (tmp)); \
+ CYG_MACRO_END
+
+//--------------------------------------------------------------------------
// Vector translation.
#ifndef HAL_TRANSLATE_VECTOR
// Basic PowerPC configuration only has two vectors; decrementer and
// external. Isr tables/chaining use same vector decoder.
Index: hal/powerpc/rattler/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/rattler/current/ChangeLog,v
retrieving revision 1.8
diff -u -5 -p -r1.8 ChangeLog
--- hal/powerpc/rattler/current/ChangeLog 7 Nov 2003 17:34:08 -0000 1.8
+++ hal/powerpc/rattler/current/ChangeLog 11 Dec 2003 15:15:26 -0000
@@ -1,5 +1,11 @@
+2003-12-11 Gary Thomas <gary@mlbassoc.com>
+
+ * src/hal_aux.c (_rattler_reset): Machine check needs to be disabled
+ for checkstop to happen. Interestingly enough, this fact seems to
+ differ from version to version of the 82xx chips.
+
2003-11-07 Gary Thomas <gary@mlbassoc.com>
* src/hal_aux.c (_rattler_leds): New function. Also set up I/O bits
properly to support LEDs.
Index: hal/powerpc/rattler/current/src/hal_aux.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/rattler/current/src/hal_aux.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 hal_aux.c
--- hal/powerpc/rattler/current/src/hal_aux.c 7 Nov 2003 17:34:08 -0000 1.5
+++ hal/powerpc/rattler/current/src/hal_aux.c 11 Dec 2003 15:05:07 -0000
@@ -412,10 +412,11 @@ _rattler_reset(void)
{
unsigned long hid0, int_state;
// Need interrupts off to force checkstop
HAL_DISABLE_INTERRUPTS(int_state);
+ HAL_DISABLE_MACHINE_CHECK(int_state);
IMM->clocks_rmr |= 0x01; // Checkstop Reset Enable
// Force a checkstop by turning on parity which is not implemented
CYGARC_MFSPR(CYGARC_REG_HID0, hid0);
hid0 |= 0x30000000;
CYGARC_MTSPR(CYGARC_REG_HID0, hid0);