Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/arch/cesfic Initial import of the known working ker...



details:   https://anonhg.NetBSD.org/src/rev/6cf8295442f0
branches:  nathanw_sa
changeset: 504669:6cf8295442f0
user:      drochner <drochner%NetBSD.org@localhost>
date:      Mon May 14 18:22:59 2001 +0000

description:
Initial import of the known working kernel bits for the NetBSD/cesfic
port. cesfic is a VME board with one or two mc68040 processors. See
the README file for details.
The port is working well with a.out userland, there are some problems
with ELF still, like applications running out of memory where it is not
expected. Some parts, in particular the pmap (which was taken from hp300
four years ago), need updating, but this is easier done within the NetBSD
CVS tree.

diffstat:

 sys/arch/cesfic/README                   |   27 +++++
 sys/arch/cesfic/cesfic/clk_dp8570a.c     |    7 +
 sys/arch/cesfic/cesfic/clock.c           |   99 +++++++++++++++++++++
 sys/arch/cesfic/cesfic/dp8570a.h         |   25 +++++
 sys/arch/cesfic/cesfic/eeprom.c          |  142 +++++++++++++++++++++++++++++++
 sys/arch/cesfic/cesfic/isr.h             |   77 ++++++++++++++++
 sys/arch/cesfic/cesfic/procfs_machdep.c  |   19 ++++
 sys/arch/cesfic/cesfic/sic6351.c         |   78 +++++++++++++++++
 sys/arch/cesfic/cesfic/vectors.s         |  138 ++++++++++++++++++++++++++++++
 sys/arch/cesfic/dev/zsvar.h              |   16 +++
 sys/arch/cesfic/include/ansi.h           |    3 +
 sys/arch/cesfic/include/aout_machdep.h   |    3 +
 sys/arch/cesfic/include/asm.h            |    3 +
 sys/arch/cesfic/include/autoconf.h       |    9 +
 sys/arch/cesfic/include/bswap.h          |    3 +
 sys/arch/cesfic/include/cdefs.h          |    3 +
 sys/arch/cesfic/include/db_machdep.h     |    3 +
 sys/arch/cesfic/include/disklabel.h      |   46 ++++++++++
 sys/arch/cesfic/include/elf_machdep.h    |    8 +
 sys/arch/cesfic/include/endian.h         |    3 +
 sys/arch/cesfic/include/endian_machdep.h |    3 +
 sys/arch/cesfic/include/float.h          |    3 +
 sys/arch/cesfic/include/frame.h          |    3 +
 sys/arch/cesfic/include/ieee.h           |    3 +
 sys/arch/cesfic/include/ieeefp.h         |    3 +
 sys/arch/cesfic/include/int_const.h      |    3 +
 sys/arch/cesfic/include/int_fmtio.h      |    3 +
 sys/arch/cesfic/include/int_limits.h     |    3 +
 sys/arch/cesfic/include/int_mwgwtypes.h  |    3 +
 sys/arch/cesfic/include/int_types.h      |    3 +
 sys/arch/cesfic/include/limits.h         |    3 +
 sys/arch/cesfic/include/lock.h           |    3 +
 sys/arch/cesfic/include/math.h           |    3 +
 sys/arch/cesfic/include/pcb.h            |    3 +
 sys/arch/cesfic/include/profile.h        |    3 +
 sys/arch/cesfic/include/psl.h            |    3 +
 sys/arch/cesfic/include/ptrace.h         |    3 +
 sys/arch/cesfic/include/reg.h            |    3 +
 sys/arch/cesfic/include/setjmp.h         |    3 +
 sys/arch/cesfic/include/signal.h         |    3 +
 sys/arch/cesfic/include/stdarg.h         |    3 +
 sys/arch/cesfic/include/svr4_machdep.h   |    3 +
 sys/arch/cesfic/include/trap.h           |    3 +
 sys/arch/cesfic/include/types.h          |    3 +
 sys/arch/cesfic/include/varargs.h        |    3 +
 sys/arch/cesfic/include/z8530var.h       |   20 ++++
 46 files changed, 807 insertions(+), 0 deletions(-)

diffs (truncated from 991 to 300 lines):

diff -r 50e04939484a -r 6cf8295442f0 sys/arch/cesfic/README
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/cesfic/README    Mon May 14 18:22:59 2001 +0000
@@ -0,0 +1,27 @@
+$NetBSD: README,v 1.1.8.2 2001/05/14 18:22:59 drochner Exp $
+
+This is a port of NetBSD to the FIC8234 VME processor board, made by the
+swiss company CES (Geneve). These boards are (or have been) popular in
+high energy physics data acquisition (think of CERN!). See
+http://www.ces.ch/Products/CPUs/FIC8234/FIC8234.html
+for some technical data.
+
+The highlights:
+- MC68040 processor at 25 MHz (optional dual-processor)
+- 8 or 32 MByte RAM
+- 2 serial ports on Z85c30
+- 79c900 (ILACC) ethernet
+- 53c710 SCSI
+
+The port is quite rudimentary at the moment. The kernel is started out of
+a running OS-9 system. SCSI support is not present yet, so it only works
+diskless with NFS (or ramdisk - not tested) root.
+It is good enough for multiuser, self-hosting etc. however.
+
+To start it:
+- make OS image by "objcopy --output-target=binary netbsd <imagename>"
+- load image to physical address 0x20100000 (RAM start + 1M)
+- jump to 0x20100400
+
+For questions and contributions, contact Matthias Drochner
+(drochner%netbsd.org@localhost).
diff -r 50e04939484a -r 6cf8295442f0 sys/arch/cesfic/cesfic/clk_dp8570a.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/cesfic/cesfic/clk_dp8570a.c      Mon May 14 18:22:59 2001 +0000
@@ -0,0 +1,7 @@
+/* $NetBSD: clk_dp8570a.c,v 1.1.8.2 2001/05/14 18:23:00 drochner Exp $ */
+
+/*
+ * tbd. For now we boot from a running OS-9 system, so
+ * the clock is already initialized.
+ * The interrupt vector is hardwired.
+ */
diff -r 50e04939484a -r 6cf8295442f0 sys/arch/cesfic/cesfic/clock.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/cesfic/cesfic/clock.c    Mon May 14 18:22:59 2001 +0000
@@ -0,0 +1,99 @@
+/* $NetBSD: clock.c,v 1.1.8.2 2001/05/14 18:23:00 drochner Exp $ */
+
+/*
+ * Copyright (c) 1997, 1999
+ *     Matthias Drochner.  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.
+ *
+ * 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/kernel.h>
+
+#include <machine/autoconf.h>
+
+char *clockbase;
+
+extern void sic_enable_int(int, int, int, int, int);
+void
+cpu_initclocks()
+{
+       mainbus_map(0x5a000000, 0x1000, 0, (void **)&clockbase);
+       sic_enable_int(25, 0, 1, 6, 0);
+}
+
+#if 0
+void readrtc()
+{
+}
+#endif
+
+void
+microtime(tvp)
+       struct timeval *tvp;
+{
+       static struct timeval lasttime;
+       int s = splhigh();
+
+       /* make sure it's monotonic */
+       if (timercmp(&time, &lasttime, <))
+               *tvp = lasttime;
+       else
+               *tvp = lasttime = time;
+       splx(s);
+}
+
+/*
+ * Initialize the time of day register, based on the time base which is, e.g.
+ * from a filesystem.
+ */
+void
+inittodr(base)
+       time_t base;
+{
+
+       time.tv_sec = base; /* XXX NFS server time - OK for diskless systems */
+}
+
+/*
+ * Restore the time of day hardware after a time change.
+ */
+void
+resettodr()
+{
+}
+
+void
+setstatclockrate(newhz)
+       int newhz;
+{
+}
+
+void otherclock __P((int));
+
+void
+otherclock(sr)
+       int sr;
+{
+       printf("otherclock(%x)\n", sr);
+}
diff -r 50e04939484a -r 6cf8295442f0 sys/arch/cesfic/cesfic/dp8570a.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/cesfic/cesfic/dp8570a.h  Mon May 14 18:22:59 2001 +0000
@@ -0,0 +1,25 @@
+/* $NetBSD: dp8570a.h,v 1.1.8.2 2001/05/14 18:23:01 drochner Exp $ */
+
+struct dp8570reg {
+       u_int8_t msr;
+       union {
+               struct {
+                       u_int8_t t0cr, t1cr;
+                       u_int8_t pfr;
+                       u_int8_t irr;
+               } r0;
+               struct {
+                       u_int8_t rtmr;
+                       u_int8_t omr;
+                       u_int8_t icr0, icr1;
+               } r1;
+       } rx;
+       u_int8_t s100c, sc, minc, hc, dmc, mc, yc, jc, j100c, dwc;
+       u_int8_t t0l, t0m, t1l, t1m;
+       struct {
+               u_int8_t s, min, h, dm, m, dw;
+       } comp;
+       struct {
+               u_int8_t s, min, h, dm, m;
+       } sav;
+};
diff -r 50e04939484a -r 6cf8295442f0 sys/arch/cesfic/cesfic/eeprom.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/cesfic/cesfic/eeprom.c   Mon May 14 18:22:59 2001 +0000
@@ -0,0 +1,142 @@
+/* $NetBSD: eeprom.c,v 1.1.8.2 2001/05/14 18:23:01 drochner Exp $ */
+
+/*
+ * Copyright (c) 1997, 1999
+ *     Matthias Drochner.  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.
+ *
+ * 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/kernel.h>
+
+#include <machine/autoconf.h>
+
+/* Physical EEPROM */
+#define EEPROMBASE 0x5a800000
+#define EEPROMSIZE 0x2000
+#define EEPROMEND (EEPROMBASE + 4*EEPROMSIZE)
+
+/* Part of EEPROM used for system parameters: last 256 bytes */
+#define EEPSIZE 256
+#define EEPSTART (EEPROMEND - 4*EEPSIZE)
+
+struct MemRange {
+        unsigned short Start;
+        unsigned short End;
+        unsigned short Attr;
+};
+
+#define MAX_EXP 2
+#define MAX_CACHE 3
+
+struct uEEPROMDATA {
+        unsigned long uSignature;
+        unsigned char uMemA;
+        unsigned char uMemB;
+        unsigned char uEtherAddr[6];
+        unsigned short uEthNFM;
+        unsigned short uBusNFM;
+        unsigned long uInternet;
+        unsigned long uInterbroad;
+        unsigned long uIntermask;
+        struct MemRange uMemList[2][MAX_EXP];
+        struct MemRange uCacheList[2][MAX_CACHE];
+};
+
+typedef unsigned short CHECKSUM;
+
+struct EEPROMData {
+        struct uEEPROMDATA u;
+        char pad[EEPSIZE - sizeof(struct uEEPROMDATA) - sizeof(CHECKSUM)];
+        CHECKSUM CheckSum;
+};
+
+#define Signature       u.uSignature
+#define MemA            u.uMemA
+#define MemB            u.uMemB
+#define EtherAddr       u.uEtherAddr
+#define EthNFM          u.uEthNFM
+#define BusNFM          u.uBusNFM
+#define Internet        u.uInternet
+#define Interbroad      u.uInterbroad
+#define Intermask       u.uIntermask
+#define MemList         u.uMemList
+#define CacheList       u.uCacheList
+
+#define SIGNATURE (('D'<<24) + ('a'<<16) + ('t'<<8) + 'a')
+
+static CHECKSUM CheckSum(CHECKSUM *);
+static int GetEEPROMData(struct EEPROMData *);
+
+static CHECKSUM
+CheckSum(data)
+        CHECKSUM *data;
+{
+       CHECKSUM c;
+       int i;
+       c = -1;
+       for (i = 0; i < (EEPSIZE / sizeof(CHECKSUM) - 1); i++)
+               c -= data[i];
+       return (c);
+}
+
+static int
+GetEEPROMData(data)
+        struct EEPROMData *data;
+{
+       unsigned char *eep;
+       int i;
+
+       mainbus_map(EEPSTART, 4*EEPSIZE, 0, (void *)&eep);
+
+       for (i = 0; i < EEPSIZE; i++)
+               ((char *)data)[i] = eep[4*i + 3];
+       if (data->Signature != SIGNATURE)
+               return (1);
+       if (CheckSum((void *)data) != data->CheckSum)
+               return (2);
+
+       return (0);
+}
+



Home | Main Index | Thread Index | Old Index