Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Two changes for XScale:



details:   https://anonhg.NetBSD.org/src/rev/cbfc94a2d4ef
branches:  trunk
changeset: 521134:cbfc94a2d4ef
user:      briggs <briggs%NetBSD.org@localhost>
date:      Thu Jan 24 04:23:18 2002 +0000

description:
Two changes for XScale:
        1) Add defparam XSCALE_CCLKCFG to define a parameter for the
           CCLKCFG register.  Default it to '9' on the IQ80310.
        2) Add a sleep call to the xscale CPU function vector (replacing
           the nullop) which should drop the CPU into "idle" mode when
           cpu_switch finds nothing on the run queues.

diffstat:

 sys/arch/arm/arm/cpufunc.c            |  16 +++++++++++++---
 sys/arch/arm/arm/cpufunc_asm_xscale.S |  14 +++++++++++++-
 sys/arch/arm/conf/files.arm           |   4 +++-
 sys/arch/arm/include/cpufunc.h        |   4 +++-
 sys/arch/evbarm/conf/std.iq80310      |   3 ++-
 5 files changed, 34 insertions(+), 7 deletions(-)

diffs (129 lines):

diff -r add159211c0a -r cbfc94a2d4ef sys/arch/arm/arm/cpufunc.c
--- a/sys/arch/arm/arm/cpufunc.c        Thu Jan 24 04:07:13 2002 +0000
+++ b/sys/arch/arm/arm/cpufunc.c        Thu Jan 24 04:23:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.c,v 1.25 2002/01/23 21:03:07 thorpej Exp $     */
+/*     $NetBSD: cpufunc.c,v 1.26 2002/01/24 04:23:19 briggs Exp $      */
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -47,6 +47,7 @@
 
 #include "opt_compat_netbsd.h"
 #include "opt_cputypes.h"
+#include "opt_cpuoptions.h"
 #include "opt_pmap_debug.h"
 
 #include <sys/types.h>
@@ -627,7 +628,7 @@
        cpufunc_nullop,                 /* flush_brnchtgt_C     */
        (void *)cpufunc_nullop,         /* flush_brnchtgt_E     */
 
-       (void *)cpufunc_nullop,         /* sleep                */
+       xscale_cpu_sleep,               /* sleep                */
 
        /* Soft functions */
 
@@ -695,7 +696,7 @@
        cpufunc_nullop,                 /* flush_brnchtgt_C     */
        (void *)cpufunc_nullop,         /* flush_brnchtgt_E     */
 
-       (void *)cpufunc_nullop,         /* sleep                */
+       xscale_cpu_sleep,               /* sleep                */
 
        /* Soft functions */
 
@@ -887,6 +888,15 @@
                        : "r" (PMNC_P|PMNC_C|PMNC_PMN0_IF|PMNC_PMN1_IF|
                               PMNC_CC_IF));
 
+#ifdef XSCALE_CCLKCFG
+               /*
+                * Crank CCLKCFG to maximum legal value.
+                */
+               __asm __volatile ("mcr p14, 0, %0, c6, c0, 0"
+                       :
+                       : "r" (XSCALE_CCLKCFG));
+#endif
+
                /*
                 * XXX Disable ECC in the Bus Controller Unit; we
                 * don't really support it, yet.  Clear any pending
diff -r add159211c0a -r cbfc94a2d4ef sys/arch/arm/arm/cpufunc_asm_xscale.S
--- a/sys/arch/arm/arm/cpufunc_asm_xscale.S     Thu Jan 24 04:07:13 2002 +0000
+++ b/sys/arch/arm/arm/cpufunc_asm_xscale.S     Thu Jan 24 04:23:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc_asm_xscale.S,v 1.7 2001/11/26 22:26:45 thorpej Exp $   */
+/*     $NetBSD: cpufunc_asm_xscale.S,v 1.8 2002/01/24 04:23:19 briggs Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -515,3 +515,15 @@
        CPWAIT(r0)
 
        mov     pc, lr
+
+/*
+ * xscale_cpusleep
+ *
+ * This is called when there is nothing on any of the run queues.
+ * We go into IDLE mode so that any IRQ or FIQ will awaken us.
+ */
+ENTRY(xscale_cpu_sleep)
+       mov     r0, #0x1
+       mcr     p14, 0, r0, c7, c0, 0
+
+       mov     pc, lr
diff -r add159211c0a -r cbfc94a2d4ef sys/arch/arm/conf/files.arm
--- a/sys/arch/arm/conf/files.arm       Thu Jan 24 04:07:13 2002 +0000
+++ b/sys/arch/arm/conf/files.arm       Thu Jan 24 04:23:18 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.arm,v 1.52 2002/01/17 17:26:04 bjh21 Exp $
+#      $NetBSD: files.arm,v 1.53 2002/01/24 04:23:19 briggs Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflag                                ARM32
@@ -8,6 +8,8 @@
 defflag        opt_cputypes.h          CPU_ARM6 CPU_ARM7 CPU_ARM7TDMI CPU_ARM8
                                CPU_ARM9 CPU_SA110 CPU_SA1100 CPU_SA1110
                                CPU_XSCALE
+defparam opt_cpuoptions.h      XSCALE_CCLKCFG
+
 
 # Floating point emulator
 defflag                                ARMFPE
diff -r add159211c0a -r cbfc94a2d4ef sys/arch/arm/include/cpufunc.h
--- a/sys/arch/arm/include/cpufunc.h    Thu Jan 24 04:07:13 2002 +0000
+++ b/sys/arch/arm/include/cpufunc.h    Thu Jan 24 04:23:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.15 2001/12/20 01:20:23 thorpej Exp $     */
+/*     $NetBSD: cpufunc.h,v 1.16 2002/01/24 04:23:19 briggs Exp $      */
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -311,6 +311,8 @@
 #ifdef CPU_XSCALE
 void   xscale_cpwait           __P((void));
 
+void   xscale_cpu_sleep        __P((int mode));
+
 u_int  xscale_control          __P((u_int clear, u_int bic));
 
 void   xscale_setttb           __P((u_int ttb));
diff -r add159211c0a -r cbfc94a2d4ef sys/arch/evbarm/conf/std.iq80310
--- a/sys/arch/evbarm/conf/std.iq80310  Thu Jan 24 04:07:13 2002 +0000
+++ b/sys/arch/evbarm/conf/std.iq80310  Thu Jan 24 04:23:18 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.iq80310,v 1.9 2001/11/24 00:11:00 thorpej Exp $
+#      $NetBSD: std.iq80310,v 1.10 2002/01/24 04:23:18 briggs Exp $
 #
 # standard NetBSD/evbarm for IQ80310 options
 
@@ -10,6 +10,7 @@
 options        EXEC_ELF32
 options        EXEC_AOUT
 options        EXEC_SCRIPT
+options        XSCALE_CCLKCFG=9
 
 # To support easy transit to ../arch/arm/arm32
 options        ARM32



Home | Main Index | Thread Index | Old Index