Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/arch/sun68k Added sources for the sun2 boot blocks ...



details:   https://anonhg.NetBSD.org/src/rev/20f5c93b7478
branches:  nathanw_sa
changeset: 504767:20f5c93b7478
user:      fredette <fredette%NetBSD.org@localhost>
date:      Thu Jun 14 12:57:12 2001 +0000

description:
Added sources for the sun2 boot blocks and other
sun68k-ish code, all of which ought to eventually
be shared with the sun3.

diffstat:

 sys/arch/sun68k/include/disklabel.h       |   57 +++
 sys/arch/sun68k/include/idprom.h          |   98 ++++++
 sys/arch/sun68k/include/intr.h            |   93 ++++++
 sys/arch/sun68k/include/mon.h             |  448 ++++++++++++++++++++++++++++++
 sys/arch/sun68k/stand/README              |   38 ++
 sys/arch/sun68k/stand/bootyy/bootyy.c     |  147 +++++++++
 sys/arch/sun68k/stand/libsa/SRT0.S        |  159 ++++++++++
 sys/arch/sun68k/stand/libsa/clock.c       |   27 +
 sys/arch/sun68k/stand/libsa/dev_disk.c    |  182 ++++++++++++
 sys/arch/sun68k/stand/libsa/dev_disk.h    |    8 +
 sys/arch/sun68k/stand/libsa/devopen.c     |   35 ++
 sys/arch/sun68k/stand/libsa/dvma.h        |   63 ++++
 sys/arch/sun68k/stand/libsa/gets.c        |  116 +++++++
 sys/arch/sun68k/stand/libsa/netif.h       |   17 +
 sys/arch/sun68k/stand/libsa/promcons.c    |   27 +
 sys/arch/sun68k/stand/libsa/saio.h        |  168 +++++++++++
 sys/arch/sun68k/stand/netboot/conf.c      |   23 +
 sys/arch/sun68k/stand/tapeboot/boot.c     |  109 +++++++
 sys/arch/sun68k/stand/tapeboot/dev_tape.c |  205 +++++++++++++
 sys/arch/sun68k/stand/tapeboot/dev_tape.h |    8 +
 sys/arch/sun68k/stand/tapeboot/rawfs.c    |  207 +++++++++++++
 sys/arch/sun68k/stand/tapeboot/rawfs.h    |   15 +
 sys/arch/sun68k/stand/ufsboot/conf.c      |   20 +
 sys/arch/sun68k/sun68k/ctrlsp.S           |   96 ++++++
 24 files changed, 2366 insertions(+), 0 deletions(-)

diffs (truncated from 2462 to 300 lines):

diff -r b84cdd91dcf1 -r 20f5c93b7478 sys/arch/sun68k/include/disklabel.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sun68k/include/disklabel.h       Thu Jun 14 12:57:12 2001 +0000
@@ -0,0 +1,57 @@
+/*     $NetBSD: disklabel.h,v 1.1.8.2 2001/06/14 12:57:12 fredette Exp $       */
+
+/*
+ * Copyright (c) 1994 Christopher G. Demetriou
+ * 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 by Christopher G. Demetriou.
+ * 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.
+ */
+
+#ifndef _MACHINE_DISKLABEL_H_
+#define _MACHINE_DISKLABEL_H_
+
+#define        LABELSECTOR     0                       /* sector containing label */
+#define        LABELOFFSET     64                      /* offset of label in sector */
+#define        MAXPARTITIONS   8                       /* number of partitions */
+#define        RAW_PART        2                       /* raw partition: xx?c */
+
+/*
+ * This holds a copy of the whole label block, saved in here by
+ * readdisklabel() so that writedisklabel() can preserve the
+ * parts of the label block outside of the actual label.
+ * (i.e. Sun label info, bad block table, etc.)
+ */
+struct cpu_disklabel {
+       char    cd_block[512];
+};
+
+#ifdef _KERNEL
+
+struct dkbad;
+int isbad __P((struct dkbad *, int, int, int));
+
+#endif /* _KERNEL */
+#endif /* _MACHINE_DISKLABEL_H_ */
diff -r b84cdd91dcf1 -r 20f5c93b7478 sys/arch/sun68k/include/idprom.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sun68k/include/idprom.h  Thu Jun 14 12:57:12 2001 +0000
@@ -0,0 +1,98 @@
+/*     $NetBSD: idprom.h,v 1.1.8.2 2001/06/14 12:57:12 fredette Exp $  */
+
+/*-
+ * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Adam Glass.
+ *
+ * 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.
+ */
+
+#ifndef        _MACHINE_IDPROM_H
+#define        _MACHINE_IDPROM_H
+
+/*
+ * structure/definitions for the 32 byte id prom found in all suns.
+ */
+
+struct idprom {
+    unsigned char idp_format;
+    unsigned char idp_machtype;
+    unsigned char idp_etheraddr[6];
+    long          idp_date;
+    unsigned char idp_serialnum[3];
+    unsigned char idp_checksum;
+    /* Note: The rest is excluded from the checksum! */
+    unsigned char idp_reserved[16];
+};
+
+#define IDPROM_VERSION 1
+#define IDPROM_SIZE (sizeof(struct idprom))
+#define IDPROM_CKSUM_SIZE 16
+
+/* values for cpu_machine_id */
+
+/* High nibble identifies the architecture. */
+#define IDM_ARCH_MASK  0xf0
+#define IDM_ARCH_SUN2  0x00
+#define IDM_ARCH_SUN3  0x10
+#define IDM_ARCH_SUN4   0x20
+#define IDM_ARCH_SUN3X 0x40
+#define IDM_ARCH_SUN4C 0x50
+#define IDM_ARCH_SUN4M 0x70
+
+/* Low nibble identifies the implementation. */
+#define IDM_IMPL_MASK 0x0f
+
+/* Values of idp_machtype we might see (m68k only). */
+#define SUN2_MACH_120  0x01    /* Sun2 Multibus */
+#define SUN2_MACH_50   0x02    /* Sun2 VME */
+#define SUN3_MACH_160  0x11    /* Carrera */
+#define SUN3_MACH_50   0x12    /* M25 */
+#define SUN3_MACH_260  0x13    /* Sirius */
+#define SUN3_MACH_110  0x14    /* Prism */
+#define SUN3_MACH_60   0x17    /* Sun3F */
+#define SUN3_MACH_E    0x18    /* Sun3E */
+
+#define SUN3X_MACH_470  0x41   /* Pegasus */
+#define SUN3X_MACH_80   0x42   /* Hydra */
+
+#if defined(_KERNEL) || defined(_STANDALONE)
+
+extern struct idprom identity_prom;
+extern u_char cpu_machine_id;
+
+void idprom_etheraddr __P((u_char *));
+void idprom_init __P((void));
+
+#endif /* _KERNEL || _STANDALONE */
+
+#endif /* !_MACHINE_IDPROM_H */
diff -r b84cdd91dcf1 -r 20f5c93b7478 sys/arch/sun68k/include/intr.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sun68k/include/intr.h    Thu Jun 14 12:57:12 2001 +0000
@@ -0,0 +1,93 @@
+/*     $NetBSD: intr.h,v 1.1.8.2 2001/06/14 12:57:12 fredette Exp $    */
+
+/*
+ * Copyright (c) 2001 Matt Fredette.
+ * Copyright (c) 1998 Matt Thomas.
+ * 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. The name of the company nor the names of the authors may be used to
+ *    endorse or promote products derived from this software without specific
+ *    prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
+ */
+
+#ifndef _SUN68K_INTR_H_
+#define _SUN68K_INTR_H_
+
+#include <sys/queue.h>
+
+/*
+ * Interrupt levels.  Right now these correspond to real
+ * hardware levels, but I don't think anything counts on
+ * that (yet?).
+ */
+#define _IPL_SOFT_LEVEL1       1
+#define _IPL_SOFT_LEVEL2       2
+#define _IPL_SOFT_LEVEL3       3
+#define _IPL_SOFT_LEVEL_MIN    1
+#define _IPL_SOFT_LEVEL_MAX    3
+#define IPL_SOFTNET            _IPL_SOFT_LEVEL1
+#define IPL_SOFTCLOCK          _IPL_SOFT_LEVEL1
+#define IPL_SOFTSERIAL         _IPL_SOFT_LEVEL3
+#define        IPL_BIO                 2
+#define        IPL_NET                 3
+#define        IPL_CLOCK               5
+#define        IPL_SERIAL              6
+
+#ifdef _KERNEL
+LIST_HEAD(sh_head, softintr_handler);
+
+struct softintr_head {
+       int shd_ipl;
+       struct sh_head shd_intrs;
+};
+
+struct softintr_handler {
+       struct softintr_head *sh_head;
+       LIST_ENTRY(softintr_handler) sh_link;
+       void (*sh_func)(void *);
+       void *sh_arg;
+       int sh_pending;
+};
+
+extern void softintr_init __P((void));
+extern void *softintr_establish __P((int, void (*)(void *), void *));
+extern void softintr_disestablish __P((void *));
+
+static __inline void
+softintr_schedule(void *arg)
+{
+       struct softintr_handler * const sh = arg;
+       if (sh->sh_pending == 0) {
+               sh->sh_pending = 1;
+               isr_soft_request(sh->sh_head->shd_ipl);
+       }
+}
+
+/* These connect interrupt handlers. */
+typedef int (*isr_func_t) __P((void *));
+extern void isr_add_autovect __P((isr_func_t, void *arg, int level));
+extern void isr_add_vectored __P((isr_func_t, void *arg, int pri, int vec));
+extern void isr_add_custom __P((int, void *));
+
+#endif /* _KERNEL */
+#endif /* _SUN68K_INTR_H */
diff -r b84cdd91dcf1 -r 20f5c93b7478 sys/arch/sun68k/include/mon.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sun68k/include/mon.h     Thu Jun 14 12:57:12 2001 +0000
@@ -0,0 +1,448 @@
+/*     $NetBSD: mon.h,v 1.1.8.2 2001/06/14 12:57:12 fredette Exp $     */
+
+/*-
+ * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Adam Glass.
+ *
+ * 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.



Home | Main Index | Thread Index | Old Index