Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arc - NEC RISCstation 2250 (RD-94) PCI bus support,
details: https://anonhg.NetBSD.org/src/rev/ebd7bb8e8f6f
branches: trunk
changeset: 487555:ebd7bb8e8f6f
user: soda <soda%NetBSD.org@localhost>
date: Fri Jun 09 05:41:56 2000 +0000
description:
- NEC RISCstation 2250 (RD-94) PCI bus support,
contributed by Shuichiro URATA <ur%a-r.org@localhost>.
- Experimental coding for NEC RISCserver 2200 and RISCstation 2200.
(doesn't really work)
diffstat:
sys/arch/arc/arc/arc_trap.c | 5 +-
sys/arch/arc/arc/arcbios.c | 6 +-
sys/arch/arc/arc/arctype.h | 15 +-
sys/arch/arc/arc/clock.c | 8 +-
sys/arch/arc/arc/clock_mc.c | 6 +-
sys/arch/arc/arc/machdep.c | 417 ++++++++++++++++++++++++------------
sys/arch/arc/arc/mainbus.c | 15 +-
sys/arch/arc/dev/lpt_lbus.c | 4 +-
sys/arch/arc/dev/pccons.c | 59 ++--
sys/arch/arc/include/isa_machdep.h | 10 +-
sys/arch/arc/include/pio.h | 4 +-
sys/arch/arc/isa/isabus.c | 22 +-
sys/arch/arc/isa/isapnp_machdep.c | 13 +-
sys/arch/arc/pci/pciide_machdep.c | 70 ++++++
sys/arch/arc/pica/picabus.c | 18 +-
15 files changed, 463 insertions(+), 209 deletions(-)
diffs (truncated from 1180 to 300 lines):
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/arc_trap.c
--- a/sys/arch/arc/arc/arc_trap.c Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/arc_trap.c Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arc_trap.c,v 1.12 2000/04/15 22:01:14 soda Exp $ */
+/* $NetBSD: arc_trap.c,v 1.13 2000/06/09 05:41:56 soda Exp $ */
/* $OpenBSD: trap.c,v 1.22 1999/05/24 23:08:59 jason Exp $ */
/*
@@ -133,7 +133,10 @@
out32(R4030_SYS_EXT_IMASK,
cpu_int_mask & (~MIPS_INT_MASK_4 >> 10));
break;
+ case NEC_R94:
+ case NEC_RAx94:
case NEC_RD94:
+ case NEC_R96:
out32(RD94_SYS_EXT_IMASK,
cpu_int_mask & (~MIPS_INT_MASK_3 >> 10));
break;
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/arcbios.c
--- a/sys/arch/arc/arc/arcbios.c Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/arcbios.c Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arcbios.c,v 1.5 2000/03/06 21:36:06 thorpej Exp $ */
+/* $NetBSD: arcbios.c,v 1.6 2000/06/09 05:41:56 soda Exp $ */
/* $OpenBSD: arcbios.c,v 1.3 1998/06/06 06:33:33 mickey Exp $ */
/*-
@@ -61,8 +61,10 @@
} sys_types[] = {
#ifdef arc
{ NULL, "PICA-61", ACER_PICA_61 },
- { NULL, "NEC-R94", ACER_PICA_61 },
+ { NULL, "NEC-R94", NEC_R94 },
+ { NULL, "NEC-RA'94", NEC_RAx94 },
{ NULL, "NEC-RD94", NEC_RD94 },
+ { NULL, "NEC-R96", NEC_R96 },
{ NULL, "DESKTECH-TYNE", DESKSTATION_TYNE },
{ NULL, "DESKTECH-ARCStation I", DESKSTATION_RPC44 },
{ NULL, "Microsoft-Jazz", MAGNUM },
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/arctype.h
--- a/sys/arch/arc/arc/arctype.h Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/arctype.h Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arctype.h,v 1.6 2000/03/03 12:50:19 soda Exp $ */
+/* $NetBSD: arctype.h,v 1.7 2000/06/09 05:41:57 soda Exp $ */
/* $OpenBSD: archtype.h,v 1.6 1999/01/27 04:46:04 imp Exp $ */
/*
@@ -38,11 +38,14 @@
#define ARC_CLASS 0x00 /* Arch class ARC */
#define ACER_PICA_61 0x01 /* Acer Labs Pica 61 */
#define MAGNUM 0x02 /* Mips MAGNUM R4000 */
-#define NEC_RD94 0x04 /* NEC RISCstation 2250, etc. */
-#define DESKSTATION_RPC44 0x05 /* Deskstation xxx */
-#define DESKSTATION_TYNE 0x06 /* Deskstation xxx */
-#define NKK_AQUARIUS 0x07 /* NKK R4{67}00 PC */
-#define SNI_RM200 0x08 /* Siemens Nixdorf RM200 */
+#define NEC_R94 0x03 /* NEC RISCstation 2200 EISA */
+#define NEC_RAx94 0x04 /* NEC RISCstation 2200 PCI */
+#define NEC_RD94 0x05 /* NEC RISCstation 2250 */
+#define NEC_R96 0x06 /* NEC RISCserver 2200 */
+#define DESKSTATION_RPC44 0x07 /* Deskstation xxx */
+#define DESKSTATION_TYNE 0x08 /* Deskstation xxx */
+#define NKK_AQUARIUS 0x09 /* NKK R4{67}00 PC */
+#define SNI_RM200 0x0a /* Siemens Nixdorf RM200 */
#if 0 /* XXX */
#define SGI_CLASS 0x10 /* Silicon Graphics Class */
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/clock.c
--- a/sys/arch/arc/arc/clock.c Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/clock.c Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.11 2000/03/03 12:50:19 soda Exp $ */
+/* $NetBSD: clock.c,v 1.12 2000/06/09 05:41:57 soda Exp $ */
/* $OpenBSD: clock.c,v 1.6 1998/10/15 21:30:15 imp Exp $ */
/*
@@ -100,7 +100,10 @@
case ACER_PICA_61:
case MAGNUM:
+ case NEC_R94:
+ case NEC_RAx94:
case NEC_RD94:
+ case NEC_R96:
/* make sure that we're looking for this type of device. */
if (!BUS_MATCHNAME(ca, "dallas_rtc"))
return (0);
@@ -145,7 +148,10 @@
case ACER_PICA_61:
case ALGOR_P4032:
+ case NEC_R94:
+ case NEC_RAx94:
case NEC_RD94:
+ case NEC_R96:
BUS_INTR_ESTABLISH((struct confargs *)aux,
(intr_handler_t)hardclock, self);
break;
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/clock_mc.c
--- a/sys/arch/arc/arc/clock_mc.c Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/clock_mc.c Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock_mc.c,v 1.7 2000/03/03 12:50:19 soda Exp $ */
+/* $NetBSD: clock_mc.c,v 1.8 2000/06/09 05:41:57 soda Exp $ */
/* $OpenBSD: clock_mc.c,v 1.9 1998/03/16 09:38:26 pefo Exp $ */
/* NetBSD: clock_mc.c,v 1.2 1995/06/28 04:30:30 cgd Exp */
@@ -65,6 +65,7 @@
#include <arc/isa/timerreg.h>
extern int cpu_int_mask;
+extern struct arc_bus_space arc_bus_io; /* XXX */
void mcclock_attach __P((struct device *parent,
struct device *self, void *aux));
@@ -134,7 +135,10 @@
mc146818_write(csc, MC_REGB, MC_REGB_BINARY | MC_REGB_24HR);
break;
+ case NEC_R94:
+ case NEC_RAx94:
case NEC_RD94:
+ case NEC_R96:
csc->sc_init = mcclock_init_rd94;
csc->sc_data = &mcclockdata_rd94;
mc146818_write(csc, MC_REGB, MC_REGB_BINARY | MC_REGB_24HR);
diff -r 3de0f72a22de -r ebd7bb8e8f6f sys/arch/arc/arc/machdep.c
--- a/sys/arch/arc/arc/machdep.c Fri Jun 09 05:38:13 2000 +0000
+++ b/sys/arch/arc/arc/machdep.c Fri Jun 09 05:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.36 2000/05/26 21:19:28 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.37 2000/06/09 05:41:58 soda Exp $ */
/* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */
/*
@@ -98,12 +98,27 @@
#include <arc/arc/arctype.h>
#include <arc/arc/arcbios.h>
+#include <arc/arc/wired_map.h>
#include <arc/pica/pica.h>
#include <arc/pica/rd94.h>
#include <arc/dti/desktech.h>
#include <arc/algor/algor.h>
#include "pc.h"
+
+#include "vga_isa.h"
+#if NVGA_ISA > 0
+#include <dev/ic/mc6845reg.h>
+#include <dev/ic/pcdisplayvar.h>
+#include <dev/isa/vga_isavar.h>
+#endif
+
+#include "pckbd.h"
+#if NPCKBC > 0
+#include <dev/ic/i8042reg.h>
+#include <dev/ic/pckbcvar.h>
+#endif
+
#include "com.h"
#if NCOM > 0
#include <sys/termios.h>
@@ -111,8 +126,12 @@
#include <dev/ic/comvar.h>
#endif
+#ifndef COMCONSOLE
+#define COMCONSOLE 0
+#endif
+
#ifndef COM_FREQ_MAGNUM
-#if 0
+#if 1
#define COM_FREQ_MAGNUM 4233600 /* 4.2336MHz - ARC? */
#else
#define COM_FREQ_MAGNUM 8192000 /* 8.192 MHz - NEC RISCstation M402 */
@@ -152,12 +171,14 @@
int physmem; /* max supported memory, changes to actual */
int cputype; /* Mother board type */
int ncpu = 1; /* At least one cpu in the system */
+vaddr_t kseg2iobufsize = 0; /* to reserve PTEs for KSEG2 I/O space */
struct arc_bus_space arc_bus_io;/* Bus tag for bus.h macros */
struct arc_bus_space arc_bus_mem;/* Bus tag for bus.h macros */
struct arc_bus_space pica_bus; /* picabus for com.c/com_lbus.c */
int com_freq = COM_FREQ; /* unusual clock frequency of dev/ic/com.c */
int com_console_address; /* Well, ain't it just plain stupid... */
bus_space_tag_t comconstag = &arc_bus_io; /* com console bus */
+int com_console = COMCONSOLE;
struct arc_bus_space *arc_bus_com = &arc_bus_io; /* com bus */
char **environment; /* On some arches, pointer to environment */
char eth_hw_addr[6]; /* HW ether addr not stored elsewhere */
@@ -177,7 +198,8 @@
extern void machine_ConfigCache __P((void));
static void tlb_init_pica __P((void));
-static void tlb_init_nec_rd94 __P((void));
+static void tlb_init_nec_eisa __P((void));
+static void tlb_init_nec_pci __P((void));
static void tlb_init_tyne __P((void));
static int get_simm_size __P((int *, int));
static char *getenv __P((char *env));
@@ -239,6 +261,8 @@
&mem_cluster_cnt);
}
+ arc_init_wired_map();
+
/*
* Get config register now as mapped from BIOS since we are
* going to demap these addresses later. We want as may TLB
@@ -257,9 +281,15 @@
com_freq = COM_FREQ_MAGNUM;
break;
}
- pica_bus.bus_base = 0;
- arc_bus_io.bus_base = PICA_V_ISA_IO;
- arc_bus_mem.bus_base = PICA_V_ISA_MEM;
+
+ arc_bus_space_init(&pica_bus, "picabus",
+ R4030_P_LOCAL_IO_BASE, R4030_V_LOCAL_IO_BASE,
+ R4030_V_LOCAL_IO_BASE, R4030_S_LOCAL_IO_BASE);
+ arc_bus_space_init(&arc_bus_io, "picaisaio",
+ PICA_P_ISA_IO, PICA_V_ISA_IO, 0, PICA_S_ISA_IO);
+ arc_bus_space_init(&arc_bus_mem, "picaisamem",
+ PICA_P_ISA_MEM, PICA_V_ISA_MEM, 0, PICA_S_ISA_MEM);
+
arc_bus_com = &pica_bus;
comconstag = &pica_bus;
com_console_address = PICA_SYS_COM1;
@@ -275,11 +305,66 @@
splvec.splstatclock = MIPS_INT_MASK_SPL5;
break;
+ case NEC_R94:
+ case NEC_RAx94:
case NEC_RD94:
- strcpy(cpu_model, "NEC RD94");
- pica_bus.bus_base = 0;
- arc_bus_io.bus_base = RD94_V_PCI_IO;
- arc_bus_mem.bus_base = RD94_V_PCI_MEM;
+ case NEC_R96:
+ switch (cputype) {
+ case NEC_R94:
+ strcpy(cpu_model, "NEC-R94");
+ break;
+ case NEC_RAx94:
+ strcpy(cpu_model, "NEC-RA'94");
+ break;
+ case NEC_RD94:
+ strcpy(cpu_model, "NEC-RD94");
+ break;
+ case NEC_R96:
+ strcpy(cpu_model, "NEC-R96");
+ break;
+ }
+
+ arc_bus_space_init(&pica_bus, "picabus",
+ RD94_P_LOCAL_IO_BASE, RD94_V_LOCAL_IO_BASE,
+ RD94_V_LOCAL_IO_BASE, RD94_S_LOCAL_IO_BASE);
+
+ switch (cputype) {
+ /* EISA machines */
+ case NEC_R94:
+ case NEC_R96:
+ /* XXX - not really confirmed */
+ arc_bus_space_init(&arc_bus_io, "rd94pciio",
+ RD94_P_PCI_IO, RD94_V_PCI_IO, 0, RD94_S_PCI_IO);
+ arc_bus_space_init(&arc_bus_mem, "rd94pcimem",
+ RD94_P_PCI_MEM, RD94_V_PCI_MEM, 0, RD94_S_PCI_MEM);
+ break;
+
+ /* PCI machines */
+ case NEC_RAx94: /* XXX - not really confirmed */
+ case NEC_RD94:
+ arc_bus_space_init(&arc_bus_io, "rd94pciio",
+ RD94_P_PCI_IO, RD94_V_PCI_IO, 0, RD94_S_PCI_IO);
+ arc_bus_space_init(&arc_bus_mem, "rd94pcimem",
+ RD94_P_PCI_MEM, RD94_V_PCI_MEM, 0, RD94_S_PCI_MEM);
+ /*
+ * By default, reserve 32MB in KSEG2 for PCI memory space.
+ * Since kseg2iobufsize/NBPG*4 bytes are used for Sysmap,
+ * this consumes 32KB physical memory.
+ *
+ * If a kernel with "options DIAGNOSTIC" panics with
+ * the message "pmap_enter: kva too big", you have to
+ * increase this value by a option like below:
+ * options KSEG2IOBUFSIZE=0x1b000000 # 432MB consumes 432KB
+ * If you met this symptom, please report it to
+ * port-arc-maintainer%netbsd.org@localhost.
+ *
+ * kseg2iobufsize will be refered from pmap_bootstrap().
+ */
+ kseg2iobufsize = 0x02000000;
+ /* 32MB: consumes 32KB for PTEs */
+ break;
+ }
Home |
Main Index |
Thread Index |
Old Index