Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/sgimips Initial commit. Needs work.



details:   https://anonhg.NetBSD.org/src/rev/f16dd57c0011
branches:  trunk
changeset: 487894:f16dd57c0011
user:      soren <soren%NetBSD.org@localhost>
date:      Wed Jun 14 16:02:38 2000 +0000

description:
Initial commit. Needs work.

diffstat:

 sys/arch/sgimips/sgimips/arcs.c     |   84 +++
 sys/arch/sgimips/sgimips/autoconf.c |   85 +++
 sys/arch/sgimips/sgimips/bus.c      |  911 ++++++++++++++++++++++++++++++++++++
 sys/arch/sgimips/sgimips/clock.c    |   70 ++
 sys/arch/sgimips/sgimips/conf.c     |  227 ++++++++
 sys/arch/sgimips/sgimips/console.c  |  297 +++++++++++
 sys/arch/sgimips/sgimips/cpu.c      |  100 +++
 sys/arch/sgimips/sgimips/disksubr.c |  168 ++++++
 sys/arch/sgimips/sgimips/ip22.c     |   41 +
 sys/arch/sgimips/sgimips/ip27.c     |   37 +
 sys/arch/sgimips/sgimips/ip32.c     |  103 ++++
 sys/arch/sgimips/sgimips/machdep.c  |  587 +++++++++++++++++++++++
 sys/arch/sgimips/sgimips/mainbus.c  |  157 ++++++
 sys/arch/sgimips/sgimips/md_root.c  |   85 +++
 14 files changed, 2952 insertions(+), 0 deletions(-)

diffs (truncated from 3008 to 300 lines):

diff -r 389480a9d024 -r f16dd57c0011 sys/arch/sgimips/sgimips/arcs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/sgimips/arcs.c   Wed Jun 14 16:02:38 2000 +0000
@@ -0,0 +1,84 @@
+/*     $NetBSD: arcs.c,v 1.1 2000/06/14 16:02:38 soren Exp $   */
+
+/*
+ * Copyright (c) 2000 Soren S. Jorvang
+ * All rights reserved.
+ * 
+ * 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.  See http://www.netbsd.org/ for
+ *          information about NetBSD.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
+ */
+
+#include <sys/param.h> 
+#include <sys/systm.h>
+#include <sys/ioctl.h>
+#include <sys/select.h>
+#include <sys/tty.h>
+#include <sys/proc.h>
+#include <sys/user.h>
+#include <sys/file.h>
+#include <sys/uio.h> 
+#include <sys/kernel.h>
+#include <sys/syslog.h>                  
+#include <sys/types.h>
+#include <sys/device.h>
+
+#include <mips/cpuregs.h>
+#include <machine/arcs.h>
+
+extern int db_max_line;
+
+const struct arcs_fv *ARCS;
+
+void arcsinit(void);
+void arcssig(void);
+
+void
+arcsinit(void)
+{
+       struct arcs_spb *spb;
+int i;
+
+       spb = (struct arcs_spb *)MIPS_PHYS_TO_KSEG0(0x00001000);
+       ARCS = spb->FirmwareVector;
+
+       /*
+        * Default textport windows are only 20 lines high.
+        */
+       db_max_line = 20;
+
+       for (i = 0; i < 32; i++) {
+#if 0
+printf("installing sig\n");
+#endif
+       }
+}
+
+void
+arcssig(void)
+{
+       printf("signal\n");
+}
diff -r 389480a9d024 -r f16dd57c0011 sys/arch/sgimips/sgimips/autoconf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/sgimips/autoconf.c       Wed Jun 14 16:02:38 2000 +0000
@@ -0,0 +1,85 @@
+/*     $NetBSD: autoconf.c,v 1.1 2000/06/14 16:02:41 soren Exp $       */
+
+/*
+ * Copyright (c) 2000 Soren S. Jorvang
+ * All rights reserved.
+ * 
+ * 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.  See http://www.netbsd.org/ for
+ *          information about NetBSD.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
+ */
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/buf.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+
+#include <machine/cpu.h>
+
+static void    findroot(struct device **, int *);
+
+void
+cpu_configure()
+{
+       int s;
+
+       s = splhigh();
+
+       if (config_rootfound("mainbus", "mainbus") == NULL)
+               panic("no mainbus found");
+
+       printf("biomask %02x netmask %02x ttymask %02x clockmask %02x\n",
+           biomask >> 8, netmask >> 8, ttymask >> 8, clockmask >> 8);
+
+       _splnone();
+}
+
+void
+cpu_rootconf()
+{
+       struct device *booted_device;
+       int booted_partition;
+
+       findroot(&booted_device, &booted_partition);
+
+       printf("boot device: %s\n",
+               booted_device ? booted_device->dv_xname : "<unknown>");
+
+       setroot(booted_device, booted_partition);
+}
+
+dev_t  bootdev = 0;
+
+static void
+findroot(devpp, partp)
+       struct device **devpp;
+       int *partp;
+{
+       return;
+}
diff -r 389480a9d024 -r f16dd57c0011 sys/arch/sgimips/sgimips/bus.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/sgimips/bus.c    Wed Jun 14 16:02:38 2000 +0000
@@ -0,0 +1,911 @@
+/*     $NetBSD: bus.c,v 1.1 2000/06/14 16:02:42 soren Exp $    */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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 by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 THE FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/endian.h>
+#include <sys/bswap.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/mbuf.h>
+
+#define _SGIMIPS_BUS_DMA_PRIVATE
+#include <machine/bus.h>
+#include <machine/cpu.h>
+
+#include <vm/vm.h>
+#include <vm/vm_kern.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <mips/cpuregs.h>
+#include <mips/locore.h>
+
+static int     _bus_dmamap_load_buffer(bus_dmamap_t, void *, bus_size_t,
+                               struct proc *, int, vaddr_t *, int *, int);
+
+struct sgimips_bus_dma_tag sgimips_default_bus_dma_tag = {
+       _bus_dmamap_create,
+       _bus_dmamap_destroy,
+       _bus_dmamap_load,
+       _bus_dmamap_load_mbuf,
+       _bus_dmamap_load_uio,
+       _bus_dmamap_load_raw,
+       _bus_dmamap_unload,
+       _bus_dmamap_sync,
+       _bus_dmamem_alloc,
+       _bus_dmamem_free,
+       _bus_dmamem_map,
+       _bus_dmamem_unmap,
+       _bus_dmamem_mmap,
+};
+
+u_int8_t
+bus_space_read_1(t, h, o)
+       bus_space_tag_t t;
+       bus_space_handle_t h;
+       bus_size_t o;
+{
+       wbflush(); /* XXX ? */
+
+       switch (t) {
+       case 0:
+               return *(volatile u_int8_t *)(h + o);
+       case 1: /* XXX HPC */
+               return *(volatile u_int8_t *)(h + (o << 2) + 3);
+       case 2: /* mem */
+       case 4: /* I/O */
+               return *(volatile u_int8_t *)(h + (o | 3) - (o & 3));
+       case 3: /* mace devices */
+               return *(volatile u_int8_t *)(h + (o << 8) + 7);
+       default:
+               panic("no bus tag");
+       }
+}
+
+void
+bus_space_write_1(t, h, o, v)
+       bus_space_tag_t t;
+       bus_space_handle_t h;
+       bus_size_t o;
+       u_int8_t v;
+{
+       switch (t) {
+       case 0:
+               *(volatile u_int8_t *)(h + o) = v;
+               break;
+       case 1: /* XXX HPC */
+               *(volatile u_int8_t *)(h + (o << 2) + 3) = v;
+               break;
+       case 2: /* mem */
+       case 4: /* I/O */



Home | Main Index | Thread Index | Old Index