Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2005 03:18:53 GMT
From:      John-Mark Gurney <jmg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 71359 for review
Message-ID:  <200502200318.j1K3Irr2086210@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=71359

Change 71359 by jmg@jmg_carbon on 2005/02/20 03:18:12

	add code to reset the cpu on the TS-7200 board...
	
	Submitted by:	cognet
	Obtained from:	NetBSD

Affected files ...

.. //depot/projects/arm/src/sys/arm/ep93xx/ep93xx.c#2 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/ep93xx/ep93xx.c#2 (text+ko) ====

@@ -67,6 +67,8 @@
 #include <arm/ep93xx/ep93xxreg.h> 
 #include <arm/ep93xx/ep93xxvar.h> 
 
+#include <arm/ep93xx/tsarmreg.h> /* XXX */
+
 /* Software copy of the IRQs we have enabled. */
 __volatile u_int32_t vic1_intr_enabled;
 __volatile u_int32_t vic2_intr_enabled;
@@ -180,7 +182,28 @@
 void
 cpu_reset(void)
 {
-	while(1);
+	/*
+	 * Make really really sure that all interrupts are disabled,
+	 * and poke the Internal Bus and Peripheral Bus reset lines.
+	 */
+	(void) disable_interrupts(I32_bit|F32_bit);
+	{
+	 	u_int32_t feed, ctrl;
+		
+		feed = TS7XXX_IO16_VBASE + TS7XXX_WDOGFEED;
+		ctrl = TS7XXX_IO16_VBASE + TS7XXX_WDOGCTRL;
+		
+		__asm __volatile (
+	    	    "mov r0, #0x5\n"
+		    "mov r1, #0x1\n"
+    		    "strh r0, [%0]\n"
+		    "strh r1, [%1]\n"
+		    :
+		    : "r" (feed), "r" (ctrl)
+		    : "r0", "r1"
+    		    );
+    	}
+	while (1);
 }
 
 static struct resource *



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502200318.j1K3Irr2086210>