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.
This commit is contained in:
briggs 2002-01-24 04:23:18 +00:00
parent 6542230523
commit 2341768d92
5 changed files with 34 additions and 7 deletions

View File

@ -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 @@ struct cpu_functions xscale_cpufuncs = {
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 @@ struct cpu_functions xscale_writethrough_cpufuncs = {
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 @@ set_cpufuncs()
: "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

View File

@ -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 @@ ENTRY(xscale_context_switch)
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

View File

@ -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_ARM2 CPU_ARM250 CPU_ARM3
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

View File

@ -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 @@ void sa110_setup __P((char *string));
#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));

View File

@ -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 @@ include "arch/evbarm/conf/files.iq80310"
options EXEC_ELF32
options EXEC_AOUT
options EXEC_SCRIPT
options XSCALE_CCLKCFG=9
# To support easy transit to ../arch/arm/arm32
options ARM32