summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorbriggs <briggs@NetBSD.org>2001-08-30 02:08:42 +0000
committerbriggs <briggs@NetBSD.org>2001-08-30 02:08:42 +0000
commitf05abdee3c6c7fa05ba3db25f24418ae5e936cb0 (patch)
treef6b76a007e70012d9239de585a38d2c64faee959 /sys
parent33ebc9435e259c9112c8819af139cf1295f099d5 (diff)
- Change default time frequency to 100MHz from 66MHz.
- Support the serial mode interrupts (with a kernel configuration option) on the Sandpoint X3. - Initialize cpu_timebase. - Enable tulip driver.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sandpoint/conf/GENERIC14
-rw-r--r--sys/arch/sandpoint/include/intr.h26
-rw-r--r--sys/arch/sandpoint/include/openpicreg.h70
-rw-r--r--sys/arch/sandpoint/isa/isa_machdep.c3
-rw-r--r--sys/arch/sandpoint/pci/pci_machdep.c11
-rw-r--r--sys/arch/sandpoint/sandpoint/autoconf.c3
-rw-r--r--sys/arch/sandpoint/sandpoint/extintr.c13
-rw-r--r--sys/arch/sandpoint/sandpoint/locore.S31
-rw-r--r--sys/arch/sandpoint/sandpoint/machdep.c8
9 files changed, 129 insertions, 50 deletions
diff --git a/sys/arch/sandpoint/conf/GENERIC b/sys/arch/sandpoint/conf/GENERIC
index 3d08162e682..7a99de7b653 100644
--- a/sys/arch/sandpoint/conf/GENERIC
+++ b/sys/arch/sandpoint/conf/GENERIC
@@ -1,11 +1,11 @@
-# $NetBSD: GENERIC,v 1.10 2001/08/26 02:47:37 matt Exp $
+# $NetBSD: GENERIC,v 1.11 2001/08/30 02:08:42 briggs Exp $
#
# GENERIC for Motorola Sandpoint
#
include "arch/sandpoint/conf/std.sandpoint"
-#ident "GENERIC-$Revision: 1.10 $"
+#ident "GENERIC-$Revision: 1.11 $"
maxusers 32
@@ -22,7 +22,10 @@ options TRAP_PANICWAIT
options DDB
#options DDB_HISTORY_SIZE=100 # Enable history editing in DDB
options KTRACE
-options NEWPMAP
+#options NEWPMAP
+#options PMAPCHECK
+#options PMAPDEBUG
+options OPENPIC_SERIAL_MODE
options COMPAT_43
options COMPAT_09
@@ -99,6 +102,11 @@ vga* at pci? dev ? function ?
ex* at pci? dev ? function ? # 3Com 90x[B]
sip* at pci? dev ? function ? # SiS 900 Ethernet
+options TLP_MATCH_21040
+options TLP_MATCH_21041
+options TLP_MATCH_21140
+options TLP_MATCH_21142
+tlp* at pci? dev ? function ? # DEC Tulip and similar
ukphy* at mii? phy ? # generic unknown PHYs
exphy* at mii? phy ? # 3Com internal PHYs
diff --git a/sys/arch/sandpoint/include/intr.h b/sys/arch/sandpoint/include/intr.h
index 820d6ec1a5d..d78f2ff3a19 100644
--- a/sys/arch/sandpoint/include/intr.h
+++ b/sys/arch/sandpoint/include/intr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.2 2001/04/13 23:30:04 thorpej Exp $ */
+/* $NetBSD: intr.h,v 1.3 2001/08/30 02:08:43 briggs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -188,27 +188,9 @@ set_sint(pending)
/*
* Motorola SandPoint PPC eval board interrupt list
*/
-#define SANDPOINT_INTR_PCI0 0
-#define SANDPOINT_INTR_IDE0 SANDPOINT_INTR_PCI0
-#define SANDPOINT_INTR_PCI1 1
-#define SANDPOINT_INTR_IDE1 SANDPOINT_INTR_PCI1
-#define SANDPOINT_INTR_ISA SANDPOINT_INTR_PCI1
-#define SANDPOINT_INTR_PCI2 2
-#define SANDPOINT_INTR_PCI3 3
-#define SANDPOINT_INTR_SERCON 4 /* Not used on Unity X4 */
-#define SANDPOINT_INTR_I2C 5
-#define SANDPOINT_INTR_DMA0 6
-#define SANDPOINT_INTR_DMA1 7
-#define SANDPOINT_INTR_I2O 8
-#define SANDPOINT_INTR_TIMER0 9
-#define SANDPOINT_INTR_TIMER1 10
-#define SANDPOINT_INTR_TIMER2 11
-#define SANDPOINT_INTR_TIMER3 12
-
-#define OPENPIC_MAX_EXTERNAL_INT 4
-
-#define ICU_LEN 13
-#define ICU_MASK 0x00001fff
+#define ICU_LEN 25
+#define ICU_MASK 0x01ffffff
+
#define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN)
#define SINT_ISA 0x10000000
diff --git a/sys/arch/sandpoint/include/openpicreg.h b/sys/arch/sandpoint/include/openpicreg.h
index 6309623e01b..5c9e5cdd289 100644
--- a/sys/arch/sandpoint/include/openpicreg.h
+++ b/sys/arch/sandpoint/include/openpicreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: openpicreg.h,v 1.2 2001/02/05 19:22:24 briggs Exp $ */
+/* $NetBSD: openpicreg.h,v 1.3 2001/08/30 02:08:43 briggs Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -45,16 +45,74 @@
* * The last interrupts are at 0x01120 + (irq - 9) * 0x20
*/
+#include "opt_openpic.h"
+
+#if defined(OPENPIC_SERIAL_MODE)
+#define SANDPOINT_INTR_SIOINT 0
+#define SANDPOINT_INTR_ISA SANDPOINT_INTR_SIOINT
+#define SANDPOINT_INTR_SIOINT2 1 /* unknown... */
+#define SANDPOINT_INTR_PCI0 2
+#define SANDPOINT_INTR_PCI1 3
+#define SANDPOINT_INTR_PCI2 4
+#define SANDPOINT_INTR_PCI3 5
+#define SANDPOINT_INTR_WINBOND_A 6
+#define SANDPOINT_INTR_WINBOND_B 7
+#define SANDPOINT_INTR_WINBOND_C 8
+#define SANDPOINT_INTR_IDE0 SANDPOINT_INTR_WINBOND_C
+#define SANDPOINT_INTR_WINBOND_D 9
+#define SANDPOINT_INTR_IDE1 SANDPOINT_INTR_WINBOND_D
+#define SANDPOINT_INTR_RESERVED_10 10
+#define SANDPOINT_INTR_RESERVED_11 11
+#define SANDPOINT_INTR_RESERVED_12 12
+#define SANDPOINT_INTR_RESERVED_13 13
+#define SANDPOINT_INTR_RESERVED_14 14
+#define SANDPOINT_INTR_RESERVED_15 15
+#define SANDPOINT_INTR_SERCON 16 /* Not often used */
+#define SANDPOINT_INTR_I2C 17
+#define SANDPOINT_INTR_DMA0 18
+#define SANDPOINT_INTR_DMA1 19
+#define SANDPOINT_INTR_I2O 20
+#define SANDPOINT_INTR_TIMER0 21
+#define SANDPOINT_INTR_TIMER1 22
+#define SANDPOINT_INTR_TIMER2 23
+#define SANDPOINT_INTR_TIMER3 24
+
+#define OPENPIC_MAX_EXTERNAL_INT 15
+
+#else
+
+#define SANDPOINT_INTR_PCI0 0
+#define SANDPOINT_INTR_IDE0 SANDPOINT_INTR_PCI0
+#define SANDPOINT_INTR_PCI1 1
+#define SANDPOINT_INTR_IDE1 SANDPOINT_INTR_PCI1
+#define SANDPOINT_INTR_ISA SANDPOINT_INTR_PCI1
+#define SANDPOINT_INTR_PCI2 2
+#define SANDPOINT_INTR_PCI3 3
+#define SANDPOINT_INTR_SERCON 4 /* Not often used */
+#define SANDPOINT_INTR_I2C 5
+#define SANDPOINT_INTR_DMA0 6
+#define SANDPOINT_INTR_DMA1 7
+#define SANDPOINT_INTR_I2O 8
+#define SANDPOINT_INTR_TIMER0 9
+#define SANDPOINT_INTR_TIMER1 10
+#define SANDPOINT_INTR_TIMER2 11
+#define SANDPOINT_INTR_TIMER3 12
+
+#define OPENPIC_MAX_EXTERNAL_INT 4
+#endif
+
/* interrupt vector/priority reg */
#define OPENPIC_SRC_VECTOR(irq) \
- ((irq <= 4) ? (0x10200 + (irq) * 0x20) \
- : ((irq <= 7) ? (0x11000 + ((irq) - 4) * 0x20) \
- : ((irq == 8) ? 0x110C0 \
- : (0x01120 + ((irq) - 9) * 0x40))))
+ ((irq <= OPENPIC_MAX_EXTERNAL_INT) ? (0x10200 + (irq) * 0x20) \
+ : ((irq <= OPENPIC_MAX_EXTERNAL_INT + 3) ? \
+ (0x11000 + ((irq) - OPENPIC_MAX_EXTERNAL_INT) * 0x20) \
+ : ((irq == OPENPIC_MAX_EXTERNAL_INT + 4) ? 0x110C0 \
+ : (0x01120 + \
+ ((irq) - (OPENPIC_MAX_EXTERNAL_INT + 5)) * 0x40))))
#define OPENPIC_INIT_SRC(irq) \
(((OPENPIC_IMASK | (8 << OPENPIC_PRIORITY_SHIFT)) | \
- (((irq) <= 4) ? \
+ (((irq) <= OPENPIC_MAX_EXTERNAL_INT) ? \
(OPENPIC_POLARITY_NEGATIVE | OPENPIC_SENSE_LEVEL) : 0)) \
| (irq))
diff --git a/sys/arch/sandpoint/isa/isa_machdep.c b/sys/arch/sandpoint/isa/isa_machdep.c
index de4b6f979ba..8fe4f3d44ed 100644
--- a/sys/arch/sandpoint/isa/isa_machdep.c
+++ b/sys/arch/sandpoint/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.c,v 1.3 2001/02/08 20:27:25 briggs Exp $ */
+/* $NetBSD: isa_machdep.c,v 1.4 2001/08/30 02:08:44 briggs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -83,6 +83,7 @@
#include <machine/pio.h>
#include <machine/intr.h>
+#include <machine/openpicreg.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
diff --git a/sys/arch/sandpoint/pci/pci_machdep.c b/sys/arch/sandpoint/pci/pci_machdep.c
index b1c20801b2a..6328e654af6 100644
--- a/sys/arch/sandpoint/pci/pci_machdep.c
+++ b/sys/arch/sandpoint/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.c,v 1.5 2001/08/20 12:20:06 wiz Exp $ */
+/* $NetBSD: pci_machdep.c,v 1.6 2001/08/30 02:08:44 briggs Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -41,6 +41,7 @@
* using `options PCI_CONF_MODE=N', where `N' is the configuration mode
* as defined section 3.6.4.1, `Generating Configuration Cycles'.
*/
+#include "opt_openpic.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -228,7 +229,11 @@ pci_intr_map(pa, ihp)
* interrupt, but subtract off the lowest dev (13) to get
* the IRQ.
*/
+#if defined(OPENPIC_SERIAL_MODE)
+ line -= 11;
+#else
line -= 13;
+#endif
*ihp = line;
return 0;
@@ -270,8 +275,10 @@ pci_intr_establish(pc, ih, level, func, arg)
int level, (*func) __P((void *));
void *arg;
{
- if (ih < 0 || ih >= 4)
+#if 0
+ if (ih < SANDPOINT_INTR_PCI0 || ih > SANDPOINT_INTR_PCI3)
panic("pci_intr_establish: bogus handle 0x%x\n", ih);
+#endif
/*
* ih is the value assigned in pci_intr_map(), above.
diff --git a/sys/arch/sandpoint/sandpoint/autoconf.c b/sys/arch/sandpoint/sandpoint/autoconf.c
index 67a90923052..dedaf534ca0 100644
--- a/sys/arch/sandpoint/sandpoint/autoconf.c
+++ b/sys/arch/sandpoint/sandpoint/autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.4 2001/08/26 02:47:38 matt Exp $ */
+/* $NetBSD: autoconf.c,v 1.5 2001/08/30 02:08:44 briggs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -56,7 +56,6 @@
#include <sys/device.h>
#include <powerpc/mpc6xx/pte.h>
-#include <machine/intr.h>
struct device *booted_device;
int booted_partition;
diff --git a/sys/arch/sandpoint/sandpoint/extintr.c b/sys/arch/sandpoint/sandpoint/extintr.c
index 99e62c9e00f..51e8c207e73 100644
--- a/sys/arch/sandpoint/sandpoint/extintr.c
+++ b/sys/arch/sandpoint/sandpoint/extintr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extintr.c,v 1.2 2001/02/05 19:22:25 briggs Exp $ */
+/* $NetBSD: extintr.c,v 1.3 2001/08/30 02:08:45 briggs Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -39,6 +39,9 @@
*
* @(#)isa.c 7.2 (Berkeley) 5/12/91
*/
+
+#include "opt_openpic.h"
+
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
@@ -445,6 +448,14 @@ openpic_init(unsigned char *base)
x |= OPENPIC_CONFIG_8259_PASSTHRU_DISABLE;
openpic_write(OPENPIC_CONFIG, x);
+#ifdef OPENPIC_SERIAL_MODE
+ x = openpic_read(OPENPIC_ICR);
+ x &= ~OPENPIC_ICR_SERIAL_RATIO_MASK;
+ x |= 4 << OPENPIC_ICR_SERIAL_RATIO_SHIFT;
+ x |= OPENPIC_ICR_SERIAL_MODE;
+ openpic_write(OPENPIC_ICR, x);
+#endif
+
/* send all interrupts to cpu 0 */
for (irq = 0; irq < ICU_LEN; irq++)
openpic_write(OPENPIC_IDEST(irq), 1 << 0);
diff --git a/sys/arch/sandpoint/sandpoint/locore.S b/sys/arch/sandpoint/sandpoint/locore.S
index ce07154f7ae..e6a093874c1 100644
--- a/sys/arch/sandpoint/sandpoint/locore.S
+++ b/sys/arch/sandpoint/sandpoint/locore.S
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.3 2001/06/24 20:43:36 briggs Exp $ */
+/* $NetBSD: locore.S,v 1.4 2001/08/30 02:08:45 briggs Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@@ -36,6 +36,7 @@
#include "fs_kernfs.h"
#include "opt_ipkdb.h"
#include "opt_multiprocessor.h"
+#include "opt_openpic.h"
#include "assym.h"
#include <sys/syscall.h>
@@ -69,19 +70,29 @@ GLOBAL(proc0paddr)
.long 0 /* proc0 p_addr */
GLOBAL(intrnames)
- .asciz "clock", "irq1", "irq2", "irq3"
- .asciz "irq4", "irq5", "irq6", "irq7"
- .asciz "irq8", "irq9", "irq10", "irq11"
- .asciz "irq12", "irq13", "irq14", "irq15"
- .asciz "irq16", "irq17", "irq18", "irq19"
- .asciz "irq20", "irq21", "irq22", "irq23"
- .asciz "irq24", "irq25", "irq26", "irq27"
- .asciz "irq28", "softnet", "softclock", "softserial"
+#if defined(OPENPIC_SERIAL_MODE)
+ .asciz "sioint", "unknown", "pci0", "pci1"
+ .asciz "pci2", "pci3", "winbondA", "winbondB"
+ .asciz "winbondC", "winbondD", "rsvd10", "rsvd11"
+ .asciz "rsvd12", "rsvd13", "rsvd14", "rsvd15"
+ .asciz "sercon", "i2c", "dma0", "dma1"
+ .asciz "i2o", "timer0", "timer1", "timer2"
+ .asciz "timer3"
+#else
+ .asciz "pci0", "pci1", "pci2", "pci3"
+ .asciz "sercon", "i2c", "dma0", "dma1"
+ .asciz "i2o", "timer0", "timer1", "timer2"
+ .asciz "timer3", "unused0", "unused1", "unused2"
+ .asciz "unused3", "unused4", "unused5", "unused6"
+ .asciz "unused7", "unused8", "unused9", "unused10"
+ .asciz "unused11"
+#endif
+
GLOBAL(eintrnames)
.align 4
GLOBAL(intrcnt)
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ .long 0,0,0,0,0,0,0,0,0
GLOBAL(eintrcnt)
/*
diff --git a/sys/arch/sandpoint/sandpoint/machdep.c b/sys/arch/sandpoint/sandpoint/machdep.c
index a8e27080798..b5a483aa36c 100644
--- a/sys/arch/sandpoint/sandpoint/machdep.c
+++ b/sys/arch/sandpoint/sandpoint/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.14 2001/08/26 02:47:38 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.15 2001/08/30 02:08:45 briggs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -199,8 +199,10 @@ initppc(startkernel, endkernel, args, btinfo)
{ /* XXX AKB */
extern u_long ticks_per_sec, ns_per_tick;
- ticks_per_sec = 66000000; /* 66 MHz */
- ticks_per_sec /= 4; /* 4 cycles per DEC tick on 603 */
+ ticks_per_sec = 100000000; /* 100 MHz */
+ /* ticks_per_sec = 66000000; * 66 MHz */
+ ticks_per_sec /= 4; /* 4 cycles per DEC tick */
+ cpu_timebase = ticks_per_sec;
ns_per_tick = 1000000000 / ticks_per_sec;
}