Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Add support for the IBM 403GCX cpu. Enabled with "o...
details: https://anonhg.NetBSD.org/src/rev/41920db536da
branches: trunk
changeset: 544093:41920db536da
user: hannken <hannken%NetBSD.org@localhost>
date: Tue Mar 11 10:40:15 2003 +0000
description:
Add support for the IBM 403GCX cpu. Enabled with "options PPC_IBM403".
- different set of device control registers.
- non-standard access to the time base.
- 16 byte cache lines.
Approved by: Eduardo Horvath <eeh%netbsd.org@localhost>
diffstat:
sys/arch/evbppc/include/dcr.h | 47 --------------
sys/arch/evbppc/walnut/autoconf.c | 5 +-
sys/arch/evbppc/walnut/machdep.c | 4 +-
sys/arch/evbppc/walnut/walnut_start.S | 4 +-
sys/arch/powerpc/conf/files.powerpc | 4 +-
sys/arch/powerpc/ibm4xx/4xx_trap_subr.S | 4 +-
sys/arch/powerpc/ibm4xx/clock.c | 31 ++++++--
sys/arch/powerpc/ibm4xx/cpu.c | 4 +-
sys/arch/powerpc/ibm4xx/dev/ecc_plb.c | 4 +-
sys/arch/powerpc/ibm4xx/intr.c | 28 +++++--
sys/arch/powerpc/ibm4xx/pmap.c | 14 ++--
sys/arch/powerpc/include/cpu.h | 26 ++++++-
sys/arch/powerpc/include/cpu_counter.h | 6 +-
sys/arch/powerpc/include/ibm4xx/bus.h | 4 +-
sys/arch/powerpc/include/ibm4xx/dcr403cgx.h | 96 +++++++++++++++++++++++++++++
sys/arch/powerpc/powerpc/locore_subr.S | 5 +-
16 files changed, 192 insertions(+), 94 deletions(-)
diffs (truncated from 614 to 300 lines):
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/evbppc/include/dcr.h
--- a/sys/arch/evbppc/include/dcr.h Tue Mar 11 09:21:22 2003 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/* $NetBSD: dcr.h,v 1.1 2002/12/09 12:16:01 scw Exp $ */
-
-/*
- * Copyright 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Eduardo Horvath for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_DCR_H_
-#define _MACHINE_DCR_H_
-
-/*
- * XXXSCW: This is 405GP-specific, so should not be in evbppc/include.
- */
-
-#include <powerpc/ibm4xx/dcr405gp.h>
-
-#endif /* _MACHINE_DCR_H_ */
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/evbppc/walnut/autoconf.c
--- a/sys/arch/evbppc/walnut/autoconf.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/evbppc/walnut/autoconf.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.1 2002/12/09 12:16:20 scw Exp $ */
+/* $NetBSD: autoconf.c,v 1.2 2003/03/11 10:40:17 hannken Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -36,10 +36,9 @@
#include <sys/device.h>
#include <sys/systm.h>
+#include <powerpc/ibm4xx/dcr405gp.h>
#include <powerpc/ibm4xx/dev/plbvar.h>
-#include <machine/dcr.h>
-
struct device *booted_device;
int booted_partition;
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/evbppc/walnut/machdep.c
--- a/sys/arch/evbppc/walnut/machdep.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/evbppc/walnut/machdep.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.6 2003/02/24 08:06:42 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.7 2003/03/11 10:40:17 hannken Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -96,9 +96,9 @@
#include <machine/powerpc.h>
#include <machine/trap.h>
#include <machine/walnut.h>
-#include <machine/dcr.h>
#include <powerpc/spr.h>
+#include <powerpc/ibm4xx/dcr405gp.h>
#include <machine/bus.h>
#include <dev/cons.h>
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/evbppc/walnut/walnut_start.S
--- a/sys/arch/evbppc/walnut/walnut_start.S Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/evbppc/walnut/walnut_start.S Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: walnut_start.S,v 1.5 2003/02/24 08:06:43 matt Exp $ */
+/* $NetBSD: walnut_start.S,v 1.6 2003/03/11 10:40:17 hannken Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@@ -83,9 +83,9 @@
#include <machine/psl.h>
#include <machine/trap.h>
#include <machine/asm.h>
-#include <machine/dcr.h>
#include <powerpc/spr.h>
+#include <powerpc/ibm4xx/dcr405gp.h>
#include <powerpc/ibm4xx/pmap.h>
/*
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/conf/files.powerpc
--- a/sys/arch/powerpc/conf/files.powerpc Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/conf/files.powerpc Tue Mar 11 10:40:15 2003 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: files.powerpc,v 1.46 2003/02/26 21:14:32 jklos Exp $
+# $NetBSD: files.powerpc,v 1.47 2003/03/11 10:40:15 hannken Exp $
defflag opt_altivec.h ALTIVEC K_ALTIVEC
defflag opt_openpic.h OPENPIC OPENPIC_SERIAL_MODE
defparam opt_ppcparam.h L2CR_CONFIG L3CR_CONFIG INTSTK SPILLSTK
-defflag opt_ppcarch.h PPC_OEA PPC_MPC8XX PPC_IBM4XX
+defflag opt_ppcarch.h PPC_OEA PPC_MPC8XX PPC_IBM4XX PPC_IBM403
defflag opt_pmap.h PMAPDEBUG PMAPCHECK PMAPCOUNTERS
file arch/powerpc/powerpc/Locore.c
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/ibm4xx/4xx_trap_subr.S
--- a/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: 4xx_trap_subr.S,v 1.2 2002/07/11 01:38:48 simonb Exp $ */
+/* $NetBSD: 4xx_trap_subr.S,v 1.3 2003/03/11 10:40:16 hannken Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -92,7 +92,7 @@
mfesr r31
stmw r30,16+tlbsave(0)
bla s4xx_miss
-_C_LABEL(tlbim4size) = .-_C_LABEL(tlbdmiss4xx)
+_C_LABEL(tlbim4size) = .-_C_LABEL(tlbimiss4xx)
s4xx_miss:
.globl _C_LABEL(pmap_tlbmiss)
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/ibm4xx/clock.c
--- a/sys/arch/powerpc/ibm4xx/clock.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/clock.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.7 2002/08/27 12:23:06 scw Exp $ */
+/* $NetBSD: clock.c,v 1.8 2003/03/11 10:40:16 hannken Exp $ */
/* $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $ */
/*
@@ -37,7 +37,7 @@
#include <sys/systm.h>
#include <sys/properties.h>
-#include <machine/dcr.h>
+#include <machine/cpu.h>
#include <powerpc/spr.h>
@@ -88,7 +88,7 @@
if (!ticks_per_intr)
return;
- asm volatile("mftb %0":"=r"(tick):);
+ tick = mftbl();
mtspr(SPR_TSR, TSR_PIS); /* Clear TSR[PIS] */
/*
* lasttb is used during microtime. Set it to the virtual
@@ -133,7 +133,7 @@
ticks_per_intr = ticks_per_sec / hz;
stathz = profhz = ticks_per_sec / (1 << PERIOD_POWER);
printf("Setting PIT to %ld/%d = %ld\n", ticks_per_sec, hz, ticks_per_intr);
- asm volatile ("mftb %0" : "=r"(lasttb));
+ lasttb = mftbl();
mtspr(SPR_PIT, ticks_per_intr);
/* Enable PIT & FIT(2^17c = 0.655ms) interrupts and auto-reload */
mtspr(SPR_TCR, TCR_PIE | TCR_ARE | TCR_FIE | TCR_PERIOD);
@@ -163,7 +163,7 @@
int msr;
asm volatile ("mfmsr %0; wrteei 0" : "=r"(msr) :);
- asm ("mftb %0" : "=r"(tb));
+ tb = mftbl();
ticks = (tb - lasttb) * ns_per_tick;
*tvp = time;
asm volatile ("mtmsr %0" :: "r"(msr));
@@ -189,9 +189,24 @@
tb += (n * 1000ULL + ns_per_tick - 1) / ns_per_tick;
tbh = tb >> 32;
tbl = tb;
- asm volatile ("1: mftbu %0; cmplw %0,%1; blt 1b; bgt 2f;"
- "mftb %0; cmplw %0,%2; blt 1b; 2:"
- : "=r"(scratch) : "r"(tbh), "r"(tbl));
+ asm volatile (
+#ifdef PPC_IBM403
+ "1: mftbhi %0 \n"
+#else
+ "1: mftbu %0 \n"
+#endif
+ " cmplw %0,%1 \n"
+ " blt 1b \n"
+ " bgt 2f \n"
+#ifdef PPC_IBM403
+ " mftblo %0 \n"
+#else
+ " mftb %0 \n"
+#endif
+ " cmplw %0,%2 \n"
+ " blt 1b \n"
+ "2: \n"
+ : "=r"(scratch) : "r"(tbh), "r"(tbl) : "cr0");
}
/*
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/ibm4xx/cpu.c
--- a/sys/arch/powerpc/ibm4xx/cpu.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/cpu.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.11 2003/02/02 20:43:22 matt Exp $ */
+/* $NetBSD: cpu.c,v 1.12 2003/03/11 10:40:16 hannken Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -200,7 +200,9 @@
curcpu()->ci_ci.icache_line_size = 16;
break;
case PVR_403:
+ curcpu()->ci_ci.dcache_size = 8192;
curcpu()->ci_ci.dcache_line_size = 16;
+ curcpu()->ci_ci.icache_size = 16384;
curcpu()->ci_ci.icache_line_size = 16;
break;
case PVR_405GP:
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
--- a/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ecc_plb.c,v 1.6 2002/10/02 15:52:27 thorpej Exp $ */
+/* $NetBSD: ecc_plb.c,v 1.7 2003/03/11 10:40:16 hannken Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -42,8 +42,8 @@
#include <sys/device.h>
#include <sys/properties.h>
-#include <machine/dcr.h>
#include <machine/cpu.h>
+#include <powerpc/ibm4xx/dcr405gp.h>
#include <powerpc/ibm4xx/dev/plbvar.h>
diff -r 5f50dc6f80c6 -r 41920db536da sys/arch/powerpc/ibm4xx/intr.c
--- a/sys/arch/powerpc/ibm4xx/intr.c Tue Mar 11 09:21:22 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/intr.c Tue Mar 11 10:40:15 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.3 2002/07/11 01:38:48 simonb Exp $ */
+/* $NetBSD: intr.c,v 1.4 2003/03/11 10:40:16 hannken Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -43,10 +43,21 @@
#include <machine/intr.h>
#include <machine/psl.h>
-#include <machine/dcr.h>
#include <powerpc/spr.h>
+#ifdef PPC_IBM403
+#include <powerpc/ibm4xx/dcr403cgx.h>
+#define INTR_STATUS DCR_EXISR
+#define INTR_ACK DCR_EXISR
+#define INTR_ENABLE DCR_EXIER
+#else
+#include <powerpc/ibm4xx/dcr405gp.h>
+#define INTR_STATUS DCR_UIC0_MSR
+#define INTR_ACK DCR_UIC0_SR
+#define INTR_ENABLE DCR_UIC0_ER
+#endif
+
static inline void disable_irq(int irq);
static inline void enable_irq(int irq);
static void intr_calculatemasks(void);
@@ -63,7 +74,6 @@
static struct intrhand *intrhand[ICU_LEN];
-
static inline int
cntlzw(int x)
{
@@ -104,7 +114,7 @@
pcpl = cpl;
asm volatile ("mfmsr %0" : "=r"(msr));
Home |
Main Index |
Thread Index |
Old Index