lkml.org 
[lkml]   [2006]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[-mm patch] AVR32: Don't leave DBE set when resetting CPU
In order to reset the CPU by setting the RES bit in the DC (Development
Control) register, we must ensure that DBE (Debug Enable) is set as
well, or the CPU will just ignore the reset request.

However, if we set both at the same time, DBE will stay set after
reset, and the performance will degrade significantly because
important optimizations like branch prediction will be disabled.

Setting DBE first, and then RES, will reset the CPU without keeping
DBE set after reset.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
arch/avr32/kernel/process.c | 3 ++-
include/asm-avr32/ocd.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.18-rc4-mm3/arch/avr32/kernel/process.c
===================================================================
--- linux-2.6.18-rc4-mm3.orig/arch/avr32/kernel/process.c 2006-08-28 10:26:33.000000000 +0200
+++ linux-2.6.18-rc4-mm3/arch/avr32/kernel/process.c 2006-08-29 14:42:27.000000000 +0200
@@ -46,7 +46,8 @@ void machine_power_off(void)

void machine_restart(char *cmd)
{
- __mtdr(DBGREG_DC, 0x40002000);
+ __mtdr(DBGREG_DC, DC_DBE);
+ __mtdr(DBGREG_DC, DC_RES);
while (1) ;
}

Index: linux-2.6.18-rc4-mm3/include/asm-avr32/ocd.h
===================================================================
--- linux-2.6.18-rc4-mm3.orig/include/asm-avr32/ocd.h 2006-08-29 15:06:41.000000000 +0200
+++ linux-2.6.18-rc4-mm3/include/asm-avr32/ocd.h 2006-08-29 15:10:08.000000000 +0200
@@ -57,6 +57,7 @@
#define DC_RID (1 << 27)
#define DC_ORP (1 << 28)
#define DC_MM (1 << 29)
+#define DC_RES (1 << 30)

/* Fields in the Development Status register */
#define DS_SSS (1 << 0)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-09-13 10:03    [W:0.023 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site