Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips Add support for the QEMU MIPS "mipssim" sim...



details:   https://anonhg.NetBSD.org/src/rev/1f2b8fb6361a
branches:  trunk
changeset: 980212:1f2b8fb6361a
user:      simonb <simonb%NetBSD.org@localhost>
date:      Wed Jan 27 05:24:16 2021 +0000

description:
Add support for the QEMU MIPS "mipssim" simulator.
TODO- mipsnet network driver (root on md(4) only for now).

diffstat:

 sys/arch/evbmips/conf/MIPSSIM             |  128 +++++++++++
 sys/arch/evbmips/conf/MIPSSIM64           |   13 +
 sys/arch/evbmips/conf/files.mipssim       |   31 ++
 sys/arch/evbmips/conf/std.mipssim         |   15 +
 sys/arch/evbmips/mipssim/autoconf.c       |   70 ++++++
 sys/arch/evbmips/mipssim/autoconf.h       |   45 ++++
 sys/arch/evbmips/mipssim/com_mainbus.c    |   97 ++++++++
 sys/arch/evbmips/mipssim/if_mipsnetreg.h  |   54 ++++
 sys/arch/evbmips/mipssim/machdep.c        |  331 ++++++++++++++++++++++++++++++
 sys/arch/evbmips/mipssim/mainbus.c        |  101 +++++++++
 sys/arch/evbmips/mipssim/mipssim_bus_io.c |   56 +++++
 sys/arch/evbmips/mipssim/mipssim_intr.c   |  164 ++++++++++++++
 sys/arch/evbmips/mipssim/mipssimreg.h     |   49 ++++
 sys/arch/evbmips/mipssim/mipssimvar.h     |   47 ++++
 14 files changed, 1201 insertions(+), 0 deletions(-)

diffs (truncated from 1257 to 300 lines):

diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/conf/MIPSSIM
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/MIPSSIM     Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,128 @@
+# $NetBSD: MIPSSIM,v 1.1 2021/01/27 05:24:16 simonb Exp $
+#
+# Kernel config for the QEMU MIPS "mipssim" simulator
+
+include        "arch/evbmips/conf/std.mipssim"
+
+#ident                 "GENERIC-$Revision: 1.1 $"
+
+maxusers       32
+
+options        MIPS32
+options        MIPS32R2
+options        NOFPU           # No FPU
+options        FPEMUL          # emulate FPU insn
+options        HZ=512          # for profiling
+
+#options       LOCKDEBUG
+options        SOSEND_COUNTERS
+options        INET_CSUM_COUNTERS
+options        TCP_CSUM_COUNTERS
+options        UDP_CSUM_COUNTERS
+options        TCP_OUTPUT_COUNTERS
+
+#options       NTP             # network time protocol
+
+# Debugging options
+options        DIAGNOSTIC      # extra kernel sanity checking
+options        DEBUG           # extra kernel debugging support
+options        DDB             # kernel dynamic debugger
+options        DDB_HISTORY_SIZE=100 # enable history editing in DDB
+makeoptions    DEBUG="-g"      # compile full symbol table
+makeoptions    COPY_SYMTAB=1   # size for embedded symbol table
+
+pseudo-device  md                              # memory disk device
+options        MEMORY_DISK_HOOKS
+options        MEMORY_DISK_IS_ROOT             # Force root on ram-disk
+options        MEMORY_DISK_ROOT_SIZE=32768     # size of memory disk, in blocks
+
+# Compatibility options
+include         "conf/compat_netbsd50.config"
+#options       EXEC_ECOFF      # exec ECOFF binaries
+#options       COMPAT_ULTRIX   # binary compatibility with Ultrix
+
+# File systems
+file-system    FFS             # Berkeley Fast Filesystem
+#file-system   MFS             # memory-based filesystem
+#file-system   EXT2FS          # second extended file system (linux)
+file-system    NFS             # Sun NFS-compatible filesystem client
+#file-system   KERNFS          # kernel data-structure filesystem
+#file-system   NULLFS          # NULL layered filesystem
+#file-system   OVERLAY         # overlay file system
+#file-system   FDESC           # user file descriptor filesystem
+#file-system   UMAPFS          # uid/gid remapping filesystem
+#file-system   LFS             # Log-based filesystem (still experimental)
+#file-system   PROCFS          # /proc
+#file-system   CD9660          # ISO 9660 + Rock Ridge file system
+#file-system   UNION           # union file system
+#file-system   MSDOSFS         # MS-DOS FAT filesystem(s).
+#file-system   CODA            # Coda File System; also needs vcoda (below)
+file-system    PTYFS           # /dev/pts/N support
+
+# File system options
+#options       NFSSERVER       # Sun NFS-compatible filesystem server
+#options       QUOTA           # legacy UFS quotas
+#options       QUOTA2          # new, in-filesystem UFS quotas
+#options       DISKLABEL_EI    # disklabel Endian Independent support
+#options       FFS_EI          # FFS Endian Independent support
+#options       WAPBL           # File system journaling support
+#options       EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+                               # immutable) behave as system flags.
+
+# Alternate buffer queue strategies for better responsiveness under high
+# disk I/O load.
+#options       BUFQ_READPRIO
+#options       BUFQ_PRIOCSCAN
+
+# Networking options
+#options       GATEWAY         # IP packet forwarding
+options        INET            # Internet protocols
+#options       INET6           # IPV6
+#options       IPSEC           # IP security
+#options       IPSEC_DEBUG     # debug for IP security
+#options       MROUTING        # packet forwarding of multicast packets
+#options       NETATALK        # AppleTalk (over Ethernet) protocol
+#options       PIM             # Protocol Independent Multicast
+#options       PPP_BSDCOMP     # BSD-Compress compression support for PPP
+#options       PPP_DEFLATE     # Deflate compression support for PPP
+#options       PPP_FILTER      # Active filter support for PPP (requires bpf)
+
+# JIT compiler for bpfilter
+#options       SLJIT
+#options       BPFJIT
+
+# These options enable verbose messages for several subsystems.
+# Warning, these may compile large string tables into the kernel!
+#options       MIIVERBOSE      # verbose PHY autoconfig messages
+
+options        NFS_BOOT_DHCP
+
+config         netbsd          root on ? type ?
+
+mainbus0       at root
+cpu*           at mainbus?
+com*           at mainbus?
+# mipsnet*     at mainbus?
+# options      MIPSSIM_ETH_MACADDR="ba:bb:1e:01:23:45"
+
+# Network pseudo-devices
+pseudo-device  bpfilter                        # Berkeley packet filter
+#pseudo-device         carp                            # Common Address Redundancy Protocol
+pseudo-device  loop                            # network loopback
+#pseudo-device ppp                             # Point-to-Point Protocol
+#pseudo-device sl                              # Serial Line IP
+#pseudo-device tun                             # network tunneling over tty
+#pseudo-device gre                             # generic L3 over IP tunnel
+#pseudo-device ipip                            # RFC 2003 IP Encapsulation
+#pseudo-device gif                             # RFC1933 tunnel
+#pseudo-device faith                           # IPv[46] tcp relay translation
+# Miscellaneous pseudo-devices
+pseudo-device  pty                             # pseudo-terminals
+#pseudo-device sequencer                       # MIDI sequencer
+
+# A pseudo device needed for Coda              # also needs CODA (above)
+#pseudo-device vcoda                           # coda minicache <-> venus comm.
+pseudo-device  clockctl                        # user control of clock subsystem
+pseudo-device  ksyms                           # /dev/ksyms
+
+include "dev/veriexec.config"
diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/conf/MIPSSIM64
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/MIPSSIM64   Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: MIPSSIM64,v 1.1 2021/01/27 05:24:16 simonb Exp $
+#
+include "arch/evbmips/conf/MIPSSIM"
+
+makeoptions    LP64="yes"
+
+no options     MIPS32
+no options     MIPS32R2
+
+options        MIPS64
+options        MIPS64R2
+options        EXEC_ELF64
+options        COMPAT_NETBSD32
diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/conf/files.mipssim
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/files.mipssim       Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,31 @@
+# $NetBSD: files.mipssim,v 1.1 2021/01/27 05:24:16 simonb Exp $
+
+file   arch/evbmips/mipssim/autoconf.c
+file   arch/evbmips/mipssim/machdep.c
+file   arch/evbmips/mipssim/mipssim_intr.c
+file   arch/evbmips/mipssim/mipssim_bus_io.c
+
+file   arch/evbmips/evbmips/interrupt.c
+
+file   arch/mips/mips/mips3_clock.c
+file   arch/mips/mips/mips3_clockintr.c
+
+# System bus
+device mainbus {}
+attach mainbus at root
+file   arch/evbmips/mipssim/mainbus.c          mainbus
+
+device cpu
+attach cpu at mainbus
+file   arch/evbmips/evbmips/cpu.c              cpu
+
+attach com at mainbus with com_mainbus
+file   arch/evbmips/mipssim/com_mainbus.c      com_mainbus
+
+device mipsnet: ether, ifnet, arp, mii
+attach mipsnet at mainbus
+file   arch/evbmips/mipssim/if_mipsnet.c       mipsnet
+defparam opt_mipsnet.h                         MIPSSIM_ETH_MACADDR
+
+# Memory Disk
+file   dev/md_root.c                           memory_disk_hooks
diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/conf/std.mipssim
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/std.mipssim Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: std.mipssim,v 1.1 2021/01/27 05:24:16 simonb Exp $
+
+machine        evbmips mips
+include        "conf/std"      # MI standard options
+
+options MIPS3_ENABLE_CLOCK_INTR
+options        EVBMIPS_CLOCKSUBR
+
+options        EXEC_ELF32      # exec ELF32 binaries
+options        EXEC_SCRIPT     # exec #! scripts
+
+makeoptions    DEFTEXTADDR="0x80010000"
+makeoptions    BOARDTYPE="mipssim"
+
+include        "arch/evbmips/conf/files.mipssim"
diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/mipssim/autoconf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/mipssim/autoconf.c       Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,70 @@
+/* $NetBSD: autoconf.c,v 1.1 2021/01/27 05:24:16 simonb Exp $ */
+
+/*-
+ * Copyright (c) 2001,2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe and Simon Burge.
+ *
+ * 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.
+ *
+ * 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/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2021/01/27 05:24:16 simonb Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/bus.h>
+
+/*
+ * Configure all devices on system
+ */     
+void
+cpu_configure(void)
+{
+
+       intr_init();
+
+       /* Kick off autoconfiguration. */
+       (void)splhigh();
+       if (config_rootfound("mainbus", NULL) == NULL)
+               panic("no mainbus found");
+
+       spl0();
+}
+
+void
+cpu_rootconf(void)
+{
+
+       rootconf();
+}
+
+void
+device_register(device_t dev, void *aux)
+{
+
+       /* nothing to do here */
+}
diff -r a08be35fb6c6 -r 1f2b8fb6361a sys/arch/evbmips/mipssim/autoconf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/mipssim/autoconf.h       Wed Jan 27 05:24:16 2021 +0000
@@ -0,0 +1,45 @@
+/* $NetBSD: autoconf.h,v 1.1 2021/01/27 05:24:16 simonb Exp $ */
+
+/*
+ * Copyright 2002 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Simon Burge 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



Home | Main Index | Thread Index | Old Index