Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Reset the i80200 ICU and PMU to a pristine ...



details:   https://anonhg.NetBSD.org/src/rev/e2e914db4765
branches:  trunk
changeset: 518551:e2e914db4765
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Dec 01 23:06:45 2001 +0000

description:
Reset the i80200 ICU and PMU to a pristine state very early.

diffstat:

 sys/arch/arm/arm/cpufunc.c |  27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 095673498c02 -r e2e914db4765 sys/arch/arm/arm/cpufunc.c
--- a/sys/arch/arm/arm/cpufunc.c        Sat Dec 01 22:44:37 2001 +0000
+++ b/sys/arch/arm/arm/cpufunc.c        Sat Dec 01 23:06:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.c,v 1.21 2001/12/01 14:21:18 bjh21 Exp $       */
+/*     $NetBSD: cpufunc.c,v 1.22 2001/12/01 23:06:45 thorpej Exp $     */
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -871,6 +871,31 @@
 #ifdef CPU_XSCALE
        if (cputype == CPU_ID_I80200) {
                /*
+                * Reset the Interrupt Controller Unit to a pristine
+                * state:
+                *      - all interrupt sources disabled
+                *      - PMU/BCU sterred to IRQ
+                */
+               __asm __volatile("mcr p13, 0, %0, c0, c0, 0"
+                       :
+                       : "r" (0));
+               __asm __volatile("mcr p13, 0, %0, c2, c0, 0"
+                       :
+                       : "r" (0));
+
+               /*
+                * Reset the Performance Monitoring Unit to a
+                * pristine state:
+                *      - CCNT, PMN0, PMN1 reset to 0
+                *      - overflow indications cleared
+                *      - all counters disabled
+                */
+               __asm __volatile("mcr p14, 0, %0, c0, c0, 0"
+                       :
+                       : "r" (PMNC_P|PMNC_C|PMNC_PMN0_IF|PMNC_PMN1_IF|
+                              PMNC_CC_IF));
+
+               /*
                 * XXX Disable ECC in the Bus Controller Unit; we
                 * don't really support it, yet.  Clear any pending
                 * error indications.



Home | Main Index | Thread Index | Old Index