diff options
Diffstat (limited to 'sys/arch/mvme88k/stand/openbsd/sboot')
18 files changed, 2261 insertions, 0 deletions
diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/Makefile b/sys/arch/mvme88k/stand/openbsd/sboot/Makefile new file mode 100644 index 00000000000..95b897d90c2 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/Makefile @@ -0,0 +1,39 @@ +# $Id: Makefile,v 1.1 1997/03/03 19:31:10 rahnds Exp $ + +S= ${.CURDIR}/../../../.. +INCL?= -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} +COPTS?= ${DEFS} ${INCL} + +.include "${S}/arch/${MACHINE}/stand/libsa/Makefile.inc" + +SRCS= sboot.c clock.c etherfun.c if_le.c + +OBJS= ${SRCS:S/.c/.o/g} +CLEANFILES+=XBUG.o XSRT0.o oc_cksum.o sboot.tmp rboot.tmp srec sboot rboot +MDEC_DIR?=/usr/mdec + +all: sboot rboot + +sboot.tmp: XSRT0.o oc_cksum.o ${OBJS} ${LIBSA} + ld -N -s -static -T 0x4000 XSRT0.o ${OBJS} oc_cksum.o -o sboot.tmp ${LIBSA} + +rboot.tmp: XBUG.o XSRT0.o oc_cksum.o ${OBJS} ${LIBSA} + ld -N -s -static -Ttext 0xffa00000 -Tdata 0x4000 XBUG.o XSRT0.o \ + ${OBJS} oc_cksum.o -o rboot.tmp ${LIBSA} + +srec: srec.c + ${CC} ${.CURDIR}/srec.c -o srec + +sboot: sboot.tmp srec + dd ibs=32 skip=1 if=sboot.tmp | ${.OBJDIR}/srec 4 0x4000 sboot > sboot + +rboot: rboot.tmp srec + dd ibs=32 skip=1 if=rboot.tmp | ${.OBJDIR}/srec 4 0x4000 rboot > rboot + +install: + install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + sboot ${DESTDIR}${MDEC_DIR}/sboot + install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + rboot ${DESTDIR}${MDEC_DIR}/rboot + +.include <bsd.prog.mk> diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/XBUG.S b/sys/arch/mvme88k/stand/openbsd/sboot/XBUG.S new file mode 100644 index 00000000000..288f1427b21 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/XBUG.S @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1995 Theo de Raadt + * + * 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 under OpenBSD by + * Theo de Raadt for Willowglen Singapore. + * 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. + */ + +/* + * Theo sez: I wrote a bootrom for the MVME147 *years* ago. To write + * this ROM I copied a few chunks from the old bootrom, like this piece: + * + * "watch this, the moto bastard struck here, shouldn't have hired people + * from intel I tried to tell them... + * "BOOT" + * offset from baseaddr to entry point. + * offset from baseaddr to first word after checksum + * garbage + * checksum made with CS command + * No need to change any of this unless you try to take our names out + * of there. Ie. don't touch." + */ + + .text +bootlabel: .ascii "BOOT" + .long bootstart-0xffa00000 | for rom install + .long bootlabelend - bootlabel + .asciz "VME147 rboot Copyright (c) 1995 Theo de Raadt" + .align 2 +bootstart: jmp bssclr + .word 0x229c | XXX bitching cksum! +bootlabelend: + .word 0 + + | clear bss and the kernel location +bssclr: movl #_edata,a0 + movl #_end - _edata,d0 +1: clrb a0@+ + subql #1,d0 + bpl 1b + + | rip the data segment from ROM into ram.. + movl #_etext,a2 | start of data + movl #0x4000,a1 | shovel address + movl #_edata - _etext,d0 +1: movb a2@+,a1@+ + subql #1,d0 + bpl 1b + + bra start diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/XSRT0.S b/sys/arch/mvme88k/stand/openbsd/sboot/XSRT0.S new file mode 100644 index 00000000000..805528203f2 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/XSRT0.S @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1995 Theo de Raadt + * + * 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 under OpenBSD by + * Theo de Raadt for Willowglen Singapore. + * 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. + * + * Copyright (c) 1995 Charles D. Cranor + * 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 Charles D. Cranor. + * 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. + */ + + | start at 0x4000, load at 0xa000, stack at 0x9ff0. + .text + .globl start +start: movb #0,_reboot + jra Ldoit +restart: movb #1,_reboot | fall through + +Ldoit: movl #0x00006ff0,sp + jsr _main + + .globl ___main +___main: rts diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/clock.c b/sys/arch/mvme88k/stand/openbsd/sboot/clock.c new file mode 100644 index 00000000000..ca2467abb9e --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/clock.c @@ -0,0 +1,122 @@ +/* $Id: clock.c,v 1.1 1997/03/03 19:31:11 rahnds Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1994 Gordon W. Ross + * Copyright (c) 1993 Adam Glass + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory. + * + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)clock.c 8.1 (Berkeley) 6/11/93 + */ + +/* + * Clock driver. + */ + +#include <sys/cdefs.h> +#include "sboot.h" +#include "clockreg.h" + +static struct clockreg *clockreg = (struct clockreg *) CLOCK_ADDR; + +/* + * BCD to decimal and decimal to BCD. + */ +#define FROMBCD(x) (((x) >> 4) * 10 + ((x) & 0xf)) +#define TOBCD(x) (((x) / 10 * 16) + ((x) % 10)) + +#define SECDAY (24 * 60 * 60) +#define SECYR (SECDAY * 365) +#define LEAPYEAR(y) (((y) & 3) == 0) + +/* + * This code is defunct after 2068. + * Will Unix still be here then?? + */ +const short dayyr[12] = + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + +static u_long +chiptotime(sec, min, hour, day, mon, year) + register int sec, min, hour, day, mon, year; +{ + register int days, yr; + + sec = FROMBCD(sec); + min = FROMBCD(min); + hour = FROMBCD(hour); + day = FROMBCD(day); + mon = FROMBCD(mon); + year = FROMBCD(year) + YEAR0; + if (year < 70) + year = 70; + + /* simple sanity checks */ + if (year < 70 || mon < 1 || mon > 12 || day < 1 || day > 31) + return (0); + days = 0; + for (yr = 70; yr < year; yr++) + days += LEAPYEAR(yr) ? 366 : 365; + days += dayyr[mon - 1] + day - 1; + if (LEAPYEAR(yr) && mon > 2) + days++; + /* now have days since Jan 1, 1970; the rest is easy... */ + return (days * SECDAY + hour * 3600 + min * 60 + sec); +} + +/* + * Set up the system's time, given a `reasonable' time value. + */ +u_long +time() +{ + register struct clockreg *cl = clockreg; + int sec, min, hour, day, mon, year; + + cl->cl_csr |= CLK_READ; /* enable read (stop time) */ + sec = cl->cl_sec; + min = cl->cl_min; + hour = cl->cl_hour; + day = cl->cl_mday; + mon = cl->cl_month; + year = cl->cl_year; + cl->cl_csr &= ~CLK_READ;/* time wears on */ + return (chiptotime(sec, min, hour, day, mon, year)); +} diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/clockreg.h b/sys/arch/mvme88k/stand/openbsd/sboot/clockreg.h new file mode 100644 index 00000000000..7fba3d3a9aa --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/clockreg.h @@ -0,0 +1,69 @@ +/* $Id: clockreg.h,v 1.1 1997/03/03 19:31:11 rahnds Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory. + * + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)clockreg.h 8.1 (Berkeley) 6/11/93 + */ + +/* + * Mostek MK48T02 clock. + */ +struct clockreg { + volatile u_char cl_csr; /* control register */ + volatile u_char cl_sec; /* seconds (0..59; BCD) */ + volatile u_char cl_min; /* minutes (0..59; BCD) */ + volatile u_char cl_hour; /* hour (0..23; BCD) */ + volatile u_char cl_wday; /* weekday (1..7) */ + volatile u_char cl_mday; /* day in month (1..31; BCD) */ + volatile u_char cl_month; /* month (1..12; BCD) */ + volatile u_char cl_year; /* year (0..99; BCD) */ +}; + +/* bits in cl_csr */ +#define CLK_WRITE 0x80 /* want to write */ +#define CLK_READ 0x40 /* want to read (freeze clock) */ + +/* + * Sun chose the year `68' as their base count, so that + * cl_year==0 means 1968. + */ +#define YEAR0 68 diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.c b/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.c new file mode 100644 index 00000000000..01987b15f4c --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.c @@ -0,0 +1,215 @@ +/* + * + * Copyright (c) 1995 Charles D. Cranor and Seth Widoff + * 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 Charles D. Cranor + * and Seth Widoff. + * 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. + */ +/* etherfun.c */ + +#include <sys/cdefs.h> +#include "sboot.h" +#include "etherfun.h" + +/* Construct and send a rev arp packet */ +void +do_rev_arp() +{ + int i; + + for (i = 0; i < 6; i++) + eh->ether_dhost[i] = 0xff; + + bcopy(myea, eh->ether_shost, 6); + eh->ether_type = ETYPE_RARP; + + rarp->ar_hrd = 1; /* hardware type is 1 */ + rarp->ar_pro = PTYPE_IP; + rarp->ar_hln = 6; /* length of hardware address is 6 bytes */ + rarp->ar_pln = 4; /* length of ip address is 4 byte */ + rarp->ar_op = OPCODE_RARP; + bcopy(myea, rarp->arp_sha, sizeof(myea)); + bcopy(myea, rarp->arp_tha, sizeof(myea)); + for (i = 0; i < 4; i++) + rarp->arp_spa[i] = rarp->arp_tpa[i] = 0x00; + + le_put(buf, 76); +} + +/* Receive and disassemble the rev_arp reply */ +int +get_rev_arp() +{ + le_get(buf, sizeof(buf), 6); + if (eh->ether_type == ETYPE_RARP && rarp->ar_op == OPCODE_REPLY) { + bcopy(rarp->arp_tpa, myip, sizeof(rarp->arp_tpa)); + bcopy(rarp->arp_spa, servip, sizeof(rarp->arp_spa)); + bcopy(rarp->arp_sha, servea, sizeof(rarp->arp_sha)); + return (1); + } + return (0); +} + +/* Try to get a reply to a rev arp request */ +int +rev_arp() +{ + int tries = 0; + while (tries < 5) { + do_rev_arp(); + if (get_rev_arp()) + return (1); + tries++; + } + return (0); +} + +/* + * Send a tftp read request or acknowledgement + * mesgtype 0 is a read request, 1 is an + * acknowledgement + */ +void +do_send_tftp(mesgtype) + int mesgtype; +{ + u_long res, iptmp, lcv; + char *tot; + + if (mesgtype == 0) { + tot = tftp_r + (sizeof(MSG) - 1); + myport = (u_short) time(); + if (myport < 1000) + myport += 1000; + servport = FTP_PORT; /* to start */ + } else { + tot = (char *) tftp_a + 4; + } + + bcopy(servea, eh->ether_dhost, sizeof(servea)); + bcopy(myea, eh->ether_shost, sizeof(myea)); + eh->ether_type = ETYPE_IP; + + iph->ip_v = IP_VERSION; + iph->ip_hl = IP_HLEN; + iph->ip_tos = 0; /* type of service is 0 */ + iph->ip_id = 0; /* id field is 0 */ + iph->ip_off = IP_DF; + iph->ip_ttl = 3; /* time to live is 3 seconds/hops */ + iph->ip_p = IPP_UDP; + bcopy(myip, iph->ip_src, sizeof(myip)); + bcopy(servip, iph->ip_dst, sizeof(servip)); + iph->ip_sum = 0; + iph->ip_len = tot - (char *) iph; + res = oc_cksum(iph, sizeof(struct ip), 0); + iph->ip_sum = 0xffff & ~res; + udph->uh_sport = myport; + udph->uh_dport = servport; + udph->uh_sum = 0; + + if (mesgtype) { + tftp_a->op_code = FTPOP_ACKN; + tftp_a->block = (u_short) (mesgtype); + } else { + bcopy(myip, &iptmp, sizeof(iptmp)); + bcopy(MSG, tftp_r, (sizeof(MSG) - 1)); + for (lcv = 9; lcv >= 2; lcv--) { + tftp_r[lcv] = "0123456789ABCDEF"[iptmp & 0xF]; + + iptmp = iptmp >> 4; + } + } + + udph->uh_ulen = tot - (char *) udph; + + le_put(buf, tot - buf); +} + +/* Attempt to tftp a file and read it into memory */ +int +do_get_file() +{ + int fail = 0, oldlen; + char *loadat = (char *) LOAD_ADDR; + last_ack = 0; + + do_send_tftp(READ); + while (1) { + if (le_get(buf, sizeof(buf), 5) == 0) { + /* timeout occured */ + if (last_ack) + do_send_tftp(last_ack); + else + do_send_tftp(READ); + + fail++; + if (fail > 5) { + printf("\n"); + return (1); + } + } else { + printf("%x \r", tftp->info.block * 512); + if ((eh->ether_type != ETYPE_IP) || (iph->ip_p != IPP_UDP)) { + fail++; + continue; + } + if (servport == FTP_PORT) + servport = udph->uh_sport; + if (tftp->info.op_code == FTPOP_ERR) { + printf("TFTP: Download error %d: %s\n", + tftp->info.block, tftp->data); + return (1); + } + if (tftp->info.block != last_ack + 1) { + /* we received the wrong block */ + if (tftp->info.block < last_ack + 1) { + /* nack whatever we received */ + do_send_tftp(tftp->info.block); + } else { + /* nack the last confirmed block */ + do_send_tftp(last_ack); + } + fail++; + } else {/* we got the right block */ + fail = 0; + last_ack++; + oldlen = udph->uh_ulen; + do_send_tftp(last_ack); + /* printf("bcopy %x %x %d\n", &tftp->data, + * loadat, oldlen - 12); */ + bcopy(&tftp->data, loadat, oldlen - 12); + loadat += oldlen - 12; + if (oldlen < (8 + 4 + 512)) { + printf("\n"); + return (0); + } + } + } + } + printf("\n"); + return (0); +} diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.h b/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.h new file mode 100644 index 00000000000..64170e05fd9 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/etherfun.h @@ -0,0 +1,124 @@ +/* + * + * Copyright (c) 1995 Charles D. Cranor and Seth Widoff + * 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 Charles D. Cranor + * and Seth Widoff. + * 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. + */ +/* etherfun.h */ + +/* constants */ +/* ether header */ +#define ETYPE_RARP 0x8035 /* ethertype is RARP */ +#define ETYPE_IP 0x800 /* ethertype is IP */ + +/* rev arp */ +#define PTYPE_IP 0x800 /* Protocol type is IP */ +#define OPCODE_RARP 3 /* Optype is REVARP request */ +#define OPCODE_REPLY 4 /* Optype is REVARP reply */ + +/* ip header */ +#define IPP_UDP 17 /* IP Protocol is UDP */ +#define IP_VERSION 4 /* IP version number */ +#define IP_HLEN 5 /* IP header length is a fixed 50 bytes */ +#define N 1536 + +/* tftp header */ +#define FTPOP_ACKN 4 /* Opcode is acknowledge */ +#define FTPOP_ERR 5 /* Opcode is Error */ +#define FTP_PORT 69 /* Standard TFTP port number */ +#define MSG "\0\1xxxxxxxx.mvme68k\0octet\0" /* implicit NULL */ + +/* data structures */ + +struct ether_header { + u_char ether_dhost[6]; + u_char ether_shost[6]; + u_short ether_type; +}; + +struct ether_arp { + u_short ar_hrd; /* format of hardware address */ + u_short ar_pro; /* format of protocol address */ + u_char ar_hln; /* length of hardware address */ + u_char ar_pln; /* length of protocol address */ + u_short ar_op; + u_char arp_sha[6]; /* sender hardware address */ + u_char arp_spa[4]; /* sender protocol address */ + u_char arp_tha[6]; /* target hardware address */ + u_char arp_tpa[4]; /* target protocol address */ +}; + +struct ip { + u_char ip_v:4, /* version */ + ip_hl:4; /* header length */ + u_char ip_tos; /* type of service */ + short ip_len; /* total length */ + u_short ip_id; /* identification */ + short ip_off; /* fragment offset field */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ + u_char ip_src[4]; + u_char ip_dst[4]; /* source and dest address */ +}; + +struct udp { + u_short uh_sport; + u_short uh_dport; + short uh_ulen; + u_short uh_sum; +}; + +struct tftph { + u_short op_code; + u_short block; +}; + +struct tftphr { + struct tftph info; + char data[1]; +}; + +/* globals */ +int last_ack; +char buf[N]; +struct ether_header *eh = (struct ether_header *)buf; +struct ether_arp *rarp = (struct ether_arp *) + (buf + sizeof(struct ether_header)); +struct ip *iph = (struct ip *)(buf + sizeof(struct ether_header)); +struct udp *udph = (struct udp *) + (buf + sizeof(struct ether_header) + sizeof(struct ip)); +char *tftp_r = buf + sizeof(struct ether_header) + sizeof(struct ip) + + sizeof(struct udp); +struct tftph *tftp_a = (struct tftph *)(buf + sizeof(struct ether_header) + + sizeof(struct ip) + sizeof(struct udp)); +struct tftphr *tftp = (struct tftphr *)(buf + sizeof(struct ether_header) + + sizeof(struct ip) + sizeof(struct udp)); diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/if_le.c b/sys/arch/mvme88k/stand/openbsd/sboot/if_le.c new file mode 100644 index 00000000000..7fbcf60f69a --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/if_le.c @@ -0,0 +1,356 @@ +/* $Id: if_le.c,v 1.1 1997/03/03 19:31:11 rahnds Exp $ */ + +/* + * Copyright (c) 1995 Theo de Raadt + * + * 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 under OpenBSD by + * Theo de Raadt for Willowglen Singapore. + * 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. + * + * Copyright (c) 1993 Adam Glass + * 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 Adam Glass. + * 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 Adam Glass ``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 REGENTS 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> +#include "sboot.h" +#include "if_lereg.h" + +struct { + struct lereg1 *sc_r1; /* LANCE registers */ + struct lereg2 *sc_r2; /* RAM */ + int next_rmd; + int next_tmd; +} le_softc; + +void +le_error(str, ler1) + char *str; + struct lereg1 *ler1; +{ + /* ler1->ler1_rap = LE_CSRO done in caller */ + if (ler1->ler1_rdp & LE_C0_BABL) { + printf("le0: been babbling, found by '%s'\n", str); + callrom(); + } + if (ler1->ler1_rdp & LE_C0_CERR) { + ler1->ler1_rdp = LE_C0_CERR; + } + if (ler1->ler1_rdp & LE_C0_MISS) { + ler1->ler1_rdp = LE_C0_MISS; + } + if (ler1->ler1_rdp & LE_C0_MERR) { + printf("le0: memory error in '%s'\n", str); + callrom(); + } +} + +void +le_reset(myea) + u_char *myea; +{ + struct lereg1 *ler1 = le_softc.sc_r1; + struct lereg2 *ler2 = le_softc.sc_r2; + unsigned int a; + int timo = 100000, stat, i; + + ler1->ler1_rap = LE_CSR0; + ler1->ler1_rdp = LE_C0_STOP; /* do nothing until we are finished */ + + bzero(ler2, sizeof(*ler2)); + + ler2->ler2_mode = LE_MODE_NORMAL; + ler2->ler2_padr[0] = myea[1]; + ler2->ler2_padr[1] = myea[0]; + ler2->ler2_padr[2] = myea[3]; + ler2->ler2_padr[3] = myea[2]; + ler2->ler2_padr[4] = myea[5]; + ler2->ler2_padr[5] = myea[4]; + + + ler2->ler2_ladrf0 = 0; + ler2->ler2_ladrf1 = 0; + + a = (u_int) ler2->ler2_rmd; + ler2->ler2_rlen = LE_RLEN | (a >> 16); + ler2->ler2_rdra = a & LE_ADDR_LOW_MASK; + + a = (u_int) ler2->ler2_tmd; + ler2->ler2_tlen = LE_TLEN | (a >> 16); + ler2->ler2_tdra = a & LE_ADDR_LOW_MASK; + + ler1->ler1_rap = LE_CSR1; + a = (u_int) ler2; + ler1->ler1_rdp = a & LE_ADDR_LOW_MASK; + ler1->ler1_rap = LE_CSR2; + ler1->ler1_rdp = a >> 16; + + for (i = 0; i < LERBUF; i++) { + a = (u_int) & ler2->ler2_rbuf[i]; + ler2->ler2_rmd[i].rmd0 = a & LE_ADDR_LOW_MASK; + ler2->ler2_rmd[i].rmd1_bits = LE_R1_OWN; + ler2->ler2_rmd[i].rmd1_hadr = a >> 16; + ler2->ler2_rmd[i].rmd2 = -LEMTU; + ler2->ler2_rmd[i].rmd3 = 0; + } + for (i = 0; i < LETBUF; i++) { + a = (u_int) & ler2->ler2_tbuf[i]; + ler2->ler2_tmd[i].tmd0 = a & LE_ADDR_LOW_MASK; + ler2->ler2_tmd[i].tmd1_bits = 0; + ler2->ler2_tmd[i].tmd1_hadr = a >> 16; + ler2->ler2_tmd[i].tmd2 = 0; + ler2->ler2_tmd[i].tmd3 = 0; + } + + ler1->ler1_rap = LE_CSR3; + ler1->ler1_rdp = LE_C3_BSWP; + + ler1->ler1_rap = LE_CSR0; + ler1->ler1_rdp = LE_C0_INIT; + do { + if (--timo == 0) { + printf("le0: init timeout, stat = 0x%x\n", stat); + break; + } + stat = ler1->ler1_rdp; + } while ((stat & LE_C0_IDON) == 0); + + ler1->ler1_rdp = LE_C0_IDON; + le_softc.next_rmd = 0; + le_softc.next_tmd = 0; + ler1->ler1_rap = LE_CSR0; + ler1->ler1_rdp = LE_C0_STRT; +} + +int +le_poll(pkt, len) + void *pkt; + int len; +{ + struct lereg1 *ler1 = le_softc.sc_r1; + struct lereg2 *ler2 = le_softc.sc_r2; + unsigned int a; + int length; + struct lermd *rmd; + + ler1->ler1_rap = LE_CSR0; + if ((ler1->ler1_rdp & LE_C0_RINT) != 0) + ler1->ler1_rdp = LE_C0_RINT; + rmd = &ler2->ler2_rmd[le_softc.next_rmd]; + if (rmd->rmd1_bits & LE_R1_OWN) { + return (0); + } + if (ler1->ler1_rdp & LE_C0_ERR) + le_error("le_poll", ler1); + if (rmd->rmd1_bits & LE_R1_ERR) { + printf("le0_poll: rmd status 0x%x\n", rmd->rmd1_bits); + length = 0; + goto cleanup; + } + if ((rmd->rmd1_bits & (LE_R1_STP | LE_R1_ENP)) != (LE_R1_STP | LE_R1_ENP)) { + printf("le_poll: chained packet\n"); + callrom(); + } + length = rmd->rmd3; + if (length >= LEMTU) { + length = 0; + printf("csr0 when bad things happen: %x\n", ler1->ler1_rdp); + callrom(); + goto cleanup; + } + if (!length) + goto cleanup; + length -= 4; + if (length > 0) + bcopy((char *) &ler2->ler2_rbuf[le_softc.next_rmd], pkt, length); + +cleanup: + a = (u_int) & ler2->ler2_rbuf[le_softc.next_rmd]; + rmd->rmd0 = a & LE_ADDR_LOW_MASK; + rmd->rmd1_hadr = a >> 16; + rmd->rmd2 = -LEMTU; + le_softc.next_rmd = + (le_softc.next_rmd == (LERBUF - 1)) ? 0 : (le_softc.next_rmd + 1); + rmd->rmd1_bits = LE_R1_OWN; + return length; +} + +int +le_put(pkt, len) + u_char *pkt; + size_t len; +{ + struct lereg1 *ler1 = le_softc.sc_r1; + struct lereg2 *ler2 = le_softc.sc_r2; + struct letmd *tmd; + int timo = 100000, stat, i; + unsigned int a; + + ler1->ler1_rap = LE_CSR0; + if (ler1->ler1_rdp & LE_C0_ERR) + le_error("le_put(way before xmit)", ler1); + tmd = &ler2->ler2_tmd[le_softc.next_tmd]; + while (tmd->tmd1_bits & LE_T1_OWN) { + printf("le0: output buffer busy\n"); + } + bcopy(pkt, (char *) ler2->ler2_tbuf[le_softc.next_tmd], len); + if (len < 64) + tmd->tmd2 = -64; + else + tmd->tmd2 = -len; + tmd->tmd3 = 0; + if (ler1->ler1_rdp & LE_C0_ERR) + le_error("le_put(before xmit)", ler1); + tmd->tmd1_bits = LE_T1_STP | LE_T1_ENP | LE_T1_OWN; + a = (u_int) & ler2->ler2_tbuf[le_softc.next_tmd]; + tmd->tmd0 = a & LE_ADDR_LOW_MASK; + tmd->tmd1_hadr = a >> 16; + ler1->ler1_rdp = LE_C0_TDMD; + if (ler1->ler1_rdp & LE_C0_ERR) + le_error("le_put(after xmit)", ler1); + do { + if (--timo == 0) { + printf("le0: transmit timeout, stat = 0x%x\n", + stat); + if (ler1->ler1_rdp & LE_C0_ERR) + le_error("le_put(timeout)", ler1); + break; + } + stat = ler1->ler1_rdp; + } while ((stat & LE_C0_TINT) == 0); + ler1->ler1_rdp = LE_C0_TINT; + if (ler1->ler1_rdp & LE_C0_ERR) { + if ((ler1->ler1_rdp & (LE_C0_BABL | LE_C0_CERR | LE_C0_MISS | LE_C0_MERR)) != + LE_C0_CERR) + printf("le_put: xmit error, buf %d\n", le_softc.next_tmd); + le_error("le_put(xmit error)", ler1); + } + le_softc.next_tmd = 0; +/* (le_softc.next_tmd == (LETBUF - 1)) ? 0 : le_softc.next_tmd + 1;*/ + if (tmd->tmd1_bits & LE_T1_ERR) { + printf("le0: transmit error, error = 0x%x\n", + tmd->tmd3); + return -1; + } + return len; +} + +int +le_get(pkt, len, timeout) + u_char *pkt; + size_t len; + u_long timeout; +{ + int cc; + int now, then; + int stopat = time() + timeout; + then = 0; + + cc = 0; + while ((now = time()) < stopat && !cc) { + cc = le_poll(pkt, len); + if (then != now) { +#ifdef LE_DEBUG + printf("%d \r", stopat - now); +#endif + then = now; + } + if (cc && (pkt[0] != myea[0] || pkt[1] != myea[1] || + pkt[2] != myea[2] || pkt[3] != myea[3] || + pkt[4] != myea[4] || pkt[5] != myea[5])) { + cc = 0; /* ignore broadcast / multicast */ +#ifdef LE_DEBUG + printf("reject (%d sec left)\n", stopat - now); +#endif + } + } +#ifdef LE_DEBUG + printf("\n"); +#endif + return cc; +} + +void +le_init() +{ + caddr_t addr; + int *ea = (int *) LANCE_ADDR; + u_long *eram = (u_long *) ERAM_ADDR; + u_long e = *ea; + if ((e & 0x2fffff00) == 0x2fffff00) { + printf("ERROR: ethernet address not set! Use LSAD.\n"); + callrom(); + } + myea[0] = 0x08; + myea[1] = 0x00; + myea[2] = 0x3e; + e = e >> 8; + myea[5] = e & 0xff; + e = e >> 8; + myea[4] = e & 0xff; + e = e >> 8; + myea[3] = e; + printf("le0: ethernet address: %x:%x:%x:%x:%x:%x\n", + myea[0], myea[1], myea[2], myea[3], myea[4], myea[5]); + bzero(&le_softc, sizeof(le_softc)); + le_softc.sc_r1 = (struct lereg1 *) LANCE_REG_ADDR; + le_softc.sc_r2 = (struct lereg2 *) (*eram - (1024 * 1024)); + le_reset(myea); +} + +void +le_end() +{ + struct lereg1 *ler1 = le_softc.sc_r1; + + ler1->ler1_rap = LE_CSR0; + ler1->ler1_rdp = LE_C0_STOP; +} diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/if_lereg.h b/sys/arch/mvme88k/stand/openbsd/sboot/if_lereg.h new file mode 100644 index 00000000000..d45f428bb80 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/if_lereg.h @@ -0,0 +1,176 @@ +/* $Id: if_lereg.h,v 1.1 1997/03/03 19:31:11 rahnds Exp $ */ + +/*- + * Copyright (c) 1982, 1992, 1993 + * The Regents of the University of California. 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 the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)if_lereg.h 8.2 (Berkeley) 10/30/93 + */ + +#define LEMTU 1518 +#define LEMINSIZE 60 /* should be 64 if mode DTCR is set */ +#define LERBUF 8 +#define LERBUFLOG2 3 +#define LE_RLEN (LERBUFLOG2 << 13) +#define LETBUF 1 +#define LETBUFLOG2 0 +#define LE_TLEN (LETBUFLOG2 << 13) + +/* Local Area Network Controller for Ethernet (LANCE) registers */ +struct lereg1 { + volatile u_short ler1_rdp; /* register data port */ + volatile u_short ler1_rap; /* register address port */ +}; + +/* register addresses */ +#define LE_CSR0 0 /* Control and status register */ +#define LE_CSR1 1 /* low address of init block */ +#define LE_CSR2 2 /* high address of init block */ +#define LE_CSR3 3 /* Bus master and control */ + +/* Control and status register 0 (csr0) */ +#define LE_C0_ERR 0x8000 /* error summary */ +#define LE_C0_BABL 0x4000 /* transmitter timeout error */ +#define LE_C0_CERR 0x2000 /* collision */ +#define LE_C0_MISS 0x1000 /* missed a packet */ +#define LE_C0_MERR 0x0800 /* memory error */ +#define LE_C0_RINT 0x0400 /* receiver interrupt */ +#define LE_C0_TINT 0x0200 /* transmitter interrupt */ +#define LE_C0_IDON 0x0100 /* initalization done */ +#define LE_C0_INTR 0x0080 /* interrupt condition */ +#define LE_C0_INEA 0x0040 /* interrupt enable */ +#define LE_C0_RXON 0x0020 /* receiver on */ +#define LE_C0_TXON 0x0010 /* transmitter on */ +#define LE_C0_TDMD 0x0008 /* transmit demand */ +#define LE_C0_STOP 0x0004 /* disable all external activity */ +#define LE_C0_STRT 0x0002 /* enable external activity */ +#define LE_C0_INIT 0x0001 /* begin initalization */ + +#define LE_C0_BITS \ + "\20\20ERR\17BABL\16CERR\15MISS\14MERR\13RINT\ +\12TINT\11IDON\10INTR\07INEA\06RXON\05TXON\04TDMD\03STOP\02STRT\01INIT" + +/* Control and status register 3 (csr3) */ +#define LE_C3_BSWP 0x4 /* byte swap */ +#define LE_C3_ACON 0x2 /* ALE control, eh? */ +#define LE_C3_BCON 0x1 /* byte control */ +/* + * Current size is 13,758 bytes with 8 x 1518 receive buffers and + * 1 x 1518 transmit buffer. + */ +struct lereg2 { + /* initialization block */ + volatile u_short ler2_mode; /* mode */ + volatile u_char ler2_padr[6]; /* physical address */ +#ifdef new_code + volatile u_short ler2_ladrf[4]; /* logical address filter */ +#else + volatile u_long ler2_ladrf0; /* logical address filter */ + volatile u_long ler2_ladrf1; /* logical address filter */ +#endif + volatile u_short ler2_rdra; /* receive descriptor addr */ + volatile u_short ler2_rlen; /* rda high and ring size */ + volatile u_short ler2_tdra; /* transmit descriptor addr */ + volatile u_short ler2_tlen; /* tda high and ring size */ + /* receive message descriptors. bits/hadr are byte order dependent. */ + struct lermd { + volatile u_short rmd0; /* low address of packet */ + volatile u_char rmd1_bits; /* descriptor bits */ + volatile u_char rmd1_hadr; /* high address of packet */ + volatile short rmd2; /* buffer byte count */ + volatile u_short rmd3; /* message byte count */ + } ler2_rmd[LERBUF]; + /* transmit message descriptors */ + struct letmd { + volatile u_short tmd0; /* low address of packet */ + volatile u_char tmd1_bits; /* descriptor bits */ + volatile u_char tmd1_hadr; /* high address of packet */ + volatile short tmd2; /* buffer byte count */ + volatile u_short tmd3; /* transmit error bits */ + } ler2_tmd[LETBUF]; + volatile char ler2_rbuf[LERBUF][LEMTU]; + volatile char ler2_tbuf[LETBUF][LEMTU]; +}; + +/* Initialzation block (mode) */ +#define LE_MODE_PROM 0x8000 /* promiscuous mode */ +/* 0x7f80 reserved, must be zero */ +#define LE_MODE_INTL 0x0040 /* internal loopback */ +#define LE_MODE_DRTY 0x0020 /* disable retry */ +#define LE_MODE_COLL 0x0010 /* force a collision */ +#define LE_MODE_DTCR 0x0008 /* disable transmit CRC */ +#define LE_MODE_LOOP 0x0004 /* loopback mode */ +#define LE_MODE_DTX 0x0002 /* disable transmitter */ +#define LE_MODE_DRX 0x0001 /* disable receiver */ +#define LE_MODE_NORMAL 0 /* none of the above */ + + +/* Receive message descriptor 1 (rmd1_bits) */ +#define LE_R1_OWN 0x80 /* LANCE owns the packet */ +#define LE_R1_ERR 0x40 /* error summary */ +#define LE_R1_FRAM 0x20 /* framing error */ +#define LE_R1_OFLO 0x10 /* overflow error */ +#define LE_R1_CRC 0x08 /* CRC error */ +#define LE_R1_BUFF 0x04 /* buffer error */ +#define LE_R1_STP 0x02 /* start of packet */ +#define LE_R1_ENP 0x01 /* end of packet */ + +#define LE_R1_BITS \ + "\20\10OWN\7ERR\6FRAM\5OFLO\4CRC\3BUFF\2STP\1ENP" + +/* Transmit message descriptor 1 (tmd1_bits) */ +#define LE_T1_OWN 0x80 /* LANCE owns the packet */ +#define LE_T1_ERR 0x40 /* error summary */ +#define LE_T1_MORE 0x10 /* multiple collisions */ +#define LE_T1_ONE 0x08 /* single collision */ +#define LE_T1_DEF 0x04 /* defferred transmit */ +#define LE_T1_STP 0x02 /* start of packet */ +#define LE_T1_ENP 0x01 /* end of packet */ + +#define LE_T1_BITS \ + "\20\10OWN\7ERR\6RES\5MORE\4ONE\3DEF\2STP\1ENP" + +/* Transmit message descriptor 3 (tmd3) */ +#define LE_T3_BUFF 0x8000 /* buffer error */ +#define LE_T3_UFLO 0x4000 /* underflow error */ +#define LE_T3_LCOL 0x1000 /* late collision */ +#define LE_T3_LCAR 0x0800 /* loss of carrier */ +#define LE_T3_RTRY 0x0400 /* retry error */ +#define LE_T3_TDR_MASK 0x03ff /* time domain reflectometry counter */ + +#define LE_XMD2_ONES 0xf000 + +#define LE_T3_BITS \ + "\20\20BUFF\17UFLO\16RES\15LCOL\14LCAR\13RTRY" + + +#define LE_ADDR_LOW_MASK (0xffff) + diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/oc_cksum.S b/sys/arch/mvme88k/stand/openbsd/sboot/oc_cksum.S new file mode 100644 index 00000000000..8f0ffe61791 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/oc_cksum.S @@ -0,0 +1,187 @@ +| $Id: oc_cksum.S,v 1.1 1997/03/03 19:31:11 rahnds Exp $ + +| Copyright (c) 1988 Regents of the University of California. +| 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 the University of +| California, Berkeley and its contributors. +| 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. +| +| @(#)oc_cksum.s 7.2 (Berkeley) 11/3/90 +| +| +| oc_cksum: ones complement 16 bit checksum for MC68020. +| +| oc_cksum (buffer, count, strtval) +| +| Do a 16 bit ones complement sum of 'count' bytes from 'buffer'. +| 'strtval' is the starting value of the sum (usually zero). +| +| It simplifies life in in_cksum if strtval can be >= 2^16. +| This routine will work as long as strtval is < 2^31. +| +| Performance +| ----------- +| This routine is intended for MC 68020s but should also work +| for 68030s. It (deliberately) does not worry about the alignment +| of the buffer so will only work on a 68010 if the buffer is +| aligned on an even address. (Also, a routine written to use +| 68010 "loop mode" would almost certainly be faster than this +| code on a 68010). +| +| We do not worry about alignment because this routine is frequently +| called with small counts: 20 bytes for IP header checksums and 40 +| bytes for TCP ack checksums. For these small counts, testing for +| bad alignment adds ~10% to the per-call cost. Since, by the nature +| of the kernel allocator, the data we are called with is almost +| always longword aligned, there is no benefit to this added cost +| and we are better off letting the loop take a big performance hit +| in the rare cases where we are handed an unaligned buffer. +| +| Loop unrolling constants of 2, 4, 8, 16, 32 and 64 times were +| tested on random data on four different types of processors (see +| list below -- 64 was the largest unrolling because anything more +| overflows the 68020 Icache). On all the processors, the +| throughput asymptote was located between 8 and 16 (closer to 8). +| However, 16 was substantially better than 8 for small counts. +| (It is clear why this happens for a count of 40: unroll-8 pays a +| loop branch cost and unroll-16 does not. But the tests also showed +| that 16 was better than 8 for a count of 20. It is not obvious to +| me why.) So, since 16 was good for both large and small counts, +| the loop below is unrolled 16 times. +| +| The processors tested and their average time to checksum 1024 bytes +| of random data were: +| Sun 3/50 (15MHz) 190 us/KB +| Sun 3/180 (16.6MHz) 175 us/KB +| Sun 3/60 (20MHz) 134 us/KB +| Sun 3/280 (25MHz) 95 us/KB +| +| The cost of calling this routine was typically 10% of the per- +| kilobyte cost. E.g., checksumming zero bytes on a 3/60 cost 9us +| and each additional byte cost 125ns. With the high fixed cost, +| it would clearly be a gain to "inline" this routine -- the +| subroutine call adds 400% overhead to an IP header checksum. +| However, in absolute terms, inlining would only gain 10us per +| packet -- a 1% effect for a 1ms ethernet packet. This is not +| enough gain to be worth the effort. + +#include <machine/asm.h> + + .text + + .text; .even; .globl _oc_cksum; _oc_cksum: + movl sp@(4),a0 | get buffer ptr + movl sp@(8),d1 | get byte count + movl sp@(12),d0 | get starting value + movl d2,sp@- | free a reg + + | test for possible 1, 2 or 3 bytes of excess at end + | of buffer. The usual case is no excess (the usual + | case is header checksums) so we give that the faster + | 'not taken' leg of the compare. (We do the excess + | first because we are about the trash the low order + | bits of the count in d1.) + + btst #0,d1 + jne L5 | if one or three bytes excess + btst #1,d1 + jne L7 | if two bytes excess +L1: + movl d1,d2 + lsrl #6,d1 | make cnt into # of 64 byte chunks + andl #0x3c,d2 | then find fractions of a chunk + negl d2 + andb #0xf,cc | clear X + jmp pc@(L3-.-2:b,d2) +L2: + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 + movl a0@+,d2 + addxl d2,d0 +L3: + dbra d1,L2 | (NB- dbra does not affect X) + + movl d0,d1 | fold 32 bit sum to 16 bits + swap d1 | (NB- swap does not affect X) + addxw d1,d0 + jcc L4 + addw #1,d0 +L4: + andl #0xffff,d0 + movl sp@+,d2 + rts + +L5: | deal with 1 or 3 excess bytes at the end of the buffer. + btst #1,d1 + jeq L6 | if 1 excess + + | 3 bytes excess + clrl d2 + movw a0@(-3,d1:l),d2 | add in last full word then drop + addl d2,d0 | through to pick up last byte + +L6: | 1 byte excess + clrl d2 + movb a0@(-1,d1:l),d2 + lsll #8,d2 + addl d2,d0 + jra L1 + +L7: | 2 bytes excess + clrl d2 + movw a0@(-2,d1:l),d2 + addl d2,d0 + jra L1 diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/rboot b/sys/arch/mvme88k/stand/openbsd/sboot/rboot new file mode 100644 index 00000000000..e3a83b1327e --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/rboot @@ -0,0 +1,204 @@ +S00A0000000072626F6F74CF +S32500004000424F4F540000003C00000044564D453134372072626F6F7420436F70797269671F +S325000040206874202863292031393935205468656F2064652052616164740000004EF9FFA047 +S325000040400046229C0000207C000040207000421853806A00FFFA247CFFA01908227C00005C +S325000040604000700012DA53806A00FFFA6000000213FC00000000463C600813FC00010000FD +S32500004080463C2E7C00006FF04EB9FFA000B84E750A73626F6F743A204D564D4531343720F2 +S325000040A0626F6F7473747261702070726F6772616D0A003E3E3E20004E56FF802F0A61FF64 +S325000040C0FFFFFFCE1D7C0030FF80487AFFC461FF0000159E584F45EEFF80487AFFD761FFDE +S325000040E00000158E2F0A61FF000013F82F0A610001CA504F584F60E24E714E5600004E4F86 +S3250000410000634E5E4E754D7920697020616464726573732069733A2025642E25642E2564B5 +S325000041202E25640A0053657276657220697020616464726573732069733A2025642E2564AC +S325000041402E25642E25640A004661696C65642E0A0065786974696E6720746F20524F4D0A51 +S3250000416000446F776E6C6F6164204661696C65640A00446F776E6C6F61642077617320616E +S325000041802073756363657373210A00636C69656E7420495020616464726573732025642EC0 +S325000041A025642E25642E25640A0073657276657220495020616464726573732025642E25A6 +S325000041C0642E25642E25640A005245564152503A204661696C65642E0A00726563656976D8 +S325000041E06564207365636F6E6461727920626F6F742070726F6772616D2E0A0062736400AB +S3250000420076616C696420636F6D6D616E64730A0061202D2073656E64206120524152500AB4 +S325000042200062202D20626F6F74207468652073797374656D0A0071202D2065786974207499 +S325000042406F20524F4D0A0066202D206674702074686520626F6F742066696C650A0067202E +S325000042602D20657865637574652074686520626F6F742066696C650A0068202D2068656CEB +S32500004280700A0069202D20696E6974204C414E434520656E657420636869700A0073626FB3 +S325000042A06F743A2025733A20556E6B6E6F776E20636F6D6D616E640A00004E5600002F0BF2 +S325000042C02F0A246E000810120C000067670001F26E2E0C000062670000F86E180C000061BA +S325000042E067364A00670001EC0C00003F67000192600001D40C000066670000AE600001C853 +S325000043000C000069670001B26D0001760C00007167000084600001B061FF0000054C4A8030 +S325000043206766428010390000465F2F00428010390000465E2F00428010390000465D2F0010 +S32500004340428010390000465C2F00487AFDBA45F9FFA0166E4E92428010390000463B2F0006 +S32500004360428010390000463A2F0042801039000046392F0042801039000046382F00487A4A +S32500004380FDA54E926000014C487AFDBE61FF000012E06000013E487AFDB961FF000012D2BE +S325000043A06100FD586000012C61FF000007127201B280660E487AFDAB61FF000012B4600032 +S325000043C00112487AFDAE61FF000012A66000010461FF00000F8061FF0000048E4A80660EBB +S325000043E0487AFDE761FF00001288600000E6428010390000465F2F00428010390000465E43 +S325000044002F00428010390000465D2F00428010390000465C2F00487AFD7347F9FFA0166E19 +S325000044204E93428010390000463B2F00428010390000463A2F0042801039000046392F0067 +S3250000444042801039000046382F00487AFD5E4E93DEFC002861FF000006667201B2806608BF +S32500004460487AFCFF4E93606A487AFD7061FF00001200584F524A4A12664645FAFD80604086 +S32500004480487AFD7E45F9FFA0166E4E92487AFD824E92487AFD8D4E92487AFD9C4E92487A4E +S325000044A0FDA74E92487AFDB84E92487AFDCD4E92487AFDD14E92601A61FF00000E9860124D +S325000044C02F0A613C600C2F0A487AFDD361FF000011A0246EFFF8266EFFFC4E5E4E756A7552 +S325000044E06D70696E6720746F20626F6F742070726F6772616D20617420307825782E0A001A +S325000045004E56000048E7003C246E00083A7C70002F0D487AFFCA61FF0000115642804281B3 +S32500004520264A2F0A61FF0000108ED5C0284A4ED54CEE3C00FFF04E5E4E7500000000001FB1 +S32500004540003B005A0078009700B500D400F301110130014E4E56000048E73F30266E0008C5 +S325000045602C2E000C2A2E0010282E0014262E0018242E001C200BE880244045F20C00200ABF +S32500004580720F2E0BC287244147F20A002006E880244045F20C00200A720FC286244145F2A6 +S325000045A00A002C0A2005E880244045F20C00200A720FC285244145F20A002A0A2004E88029 +S325000045C0244045F20C00200A720FC284244145F20A00280A2003E880244045F20C00200A09 +S325000045E0720FC283244145F20A00260A2002E880720FC282244045F20C00200A244145F25D +S325000046000A44240A7E45BE826D027446200353807E0BBE80650A200453807E1EBE80640487 +S325000046204280607293C97046B4806F1C307C016E223C0000016DE8C007826604D3C8600290 +S32500004640D3C15280B4806EEE41FAFEF030703A00D1C443F098FFE8C0078266087E02BE839C +S325000046606C02524943F19A0020092200E98192802401E9829481EF822005E7809085EB8074 +S32500004680D085E9802042D1C02006E980908641F00C002008D08B4CEE0CFCFFE04E5E4E756E +S325000046A04E56000048E73E0020790000400010100000004010801C2800011A280002182851 +S325000046C000031628000514280006122800071010020000BF108042A71F41000342A71F4204 +S325000046E0000342A71F43000342A71F44000342A71F45000342A71F4600036100FE584CEE82 +S32500004700007CFFEC4E5E4E754E5600002F0A428020790000400411BC00FF08005280720524 +S32500004720B2806CEC487800062239000040045C812F0148790000465445F9FFA015D04E927A +S32500004740207900004004317C8035000C20790000400830BC0001317C08000002117C0006F0 +S325000047600004207900004008117C00040005207900004008317C0003000648780006223900 +S325000047800000400850812F014879000046544E92487800067212D2B9000040082F01487981 +S325000047A0000046544E924280DEFC0024207900004008423008184230080E52807203B28045 +S325000047C06CEA4878004C48790000402861FF00000910246EFFFC4E5E4E754E5600002F0AF6 +S325000047E0487800064878060048790000402861FF00000A6E207900004004504F584F0C688F +S325000048008035000C66562079000040080C680004000666484878000448790000465C721857 +S32500004820D2882F0145F9FFA015D04E9248780004487900004638720ED2B9000040082F01C0 +S325000048404E924878000648790000463022390000400850812F014E92700160024280246ECA +S32500004860FFFC4E5E4E754E5600002F0242826100FE986100FF664A8067047001600A52828E +S325000048807204B2826CE84280242EFFFC4E5E4E75000178787878787878782E6D766D6536BC +S325000048A0386B006F6374657400003031323334353637383941424344454600004E56FFFCEF +S325000048C048E73038242E0008663228790000401447EC001961FFFFFFFDCA33C0000046406A +S325000048E00C7903E7000046406208067903E80000464033FC00450000462C60082679000076 +S325000049004018584B487800062F390000400448790000463045F9FFA015D04E924878000685 +S325000049202639000040045C832F034879000046544E92207900004004317C0800000C20794B +S325000049400000400C7604EFD0300420790000400C7605EFD0310420790000400C42280001F4 +S3250000496020790000400C42680004317C40000006117C0003000820790000400C117C001190 +S32500004980000948780004760CD6B90000400C2F0348790000465C4E92DEFC00202EBC00008E +S325000049A000047610D6B90000400C2F034879000046384E9220790000400C4268000A384B1F +S325000049C098F90000400E314C000242A7487800142F0861FF00000A5C20790000400C46404E +S325000049E03140000A20790000401030B90000464031790000462C000242680006DEFC00181E +S32500004A004A82671020790000401830BC000431420002605448780004486EFFFC487900000D +S32500004A20465C45F9FFA015D04E92487800192F3900004014487AFE5A4E927209DEFC001830 +S32500004A4043FAFE68207900004014700FC0AEFFFC11B108001800202EFFFCE8882D40FFFCD5 +S32500004A6053817601B68165DC207900004010384B98F900004012314C000497FC00004028A2 +S32500004A802F0B48790000402861FF000006544CEE1C0CFFE84E5E4E750A002578200D005413 +S32500004AA04654503A20446F776E6C6F6164206572726F722025643A2025730A004E560000E1 +S32500004AC048E73C304282283C0000700042B90000462842A76100FDE6584F428348780005D6 +S32500004AE04878060048790000402861FF00000772504F584F4A8066304AB900004628670862 +S32500004B002F3900004628600242A76100FDB0584F52827A05BA826CC4487AFF7E61FF00005B +S32500004B200B5070016000010020790000401C3628000220037A09EBA02F00487AFF5E61FF0E +S32500004B4000000B2E207900004004504F0C680800000C667820790000400C0C280011000901 +S32500004B60666A0C7900450000462C660C20790000401033D00000462C20790000401C0C5002 +S32500004B800005661E2A0858852F054280302800022F00487AFF0B61FF00000AD6700160001B +S32500004BA0008620790000401C4280302800022239000046285281B28067186F042F00600603 +S32500004BC02F39000046286100FCF4584F52826000FF0C4282203900004628528023C0000082 +S32500004BE04628207900004010366800042F006100FCCC45EBFFF42F0A2F042A390000401C10 +S32500004C0058852F0561FF000009CAD88A504F504FB7FC0000020B6E00FEC4487AFE7C61FF1E +S32500004C2000000A4E42804CEE0C3CFFE84E5E4E756C65303A206265656E20626162626C690B +S32500004C406E672C20666F756E6420627920272573270A006C65303A206D656D6F727920658D +S32500004C6072726F7220696E20272573270A004E5600002F0A2F02242E0008246E000C30121A +S32500004C800800000E67142F02487AFFA661FF000009E061FFFFFFF466504F30120800000DEE +S32500004CA0670434BC200030120800000C670434BC100030120800000B67122F02487AFF955D +S32500004CC061FF000009AC61FFFFFFF432242EFFF8246EFFFC4E5E4E756C65303A20696E6955 +S32500004CE0742074696D656F75742C2073746174203D20307825780A004E56000048E73C3CF4 +S32500004D00246E0008287900004644267900004648283C000186A0426C000238BC00044878A8 +S32500004D2035BE2F0B61FF000008E64253176A0001000217520003176A00030004176A000262 +S32500004D400005176A00050006176A0004000742AB000842AB000C7418D48B2002424048402B +S32500004D600040600037400012374200107458D48B2002424048403740001637420014397C55 +S32500004D8000010002388B397C00020002200B42404840388091C8504F4BF08A00200DEB804C +S32500004DA09088E78090884BF30A60240D2208E7813782181817BC0080181A20024240484051 +S32500004DC01780181B37BCFA12181C4273181E52487A07BA886CC291C8327C2FD04BF08A008F +S32500004DE0200DEB809088E78090884BF10A00200D240BD4802208E781378218584233185AE6 +S32500004E002002424048401780185B4273185C4273185E52484A886FC4397C0003000238BCB5 +S32500004E200004426C000238BC00015384660E2F03487AFEA661FF00000838600C30144283CB +S32500004E4036000803000867E238BC010042B90000464C42B900004650426C000238BC000201 +S32500004E604CEE3C3CFFE04E5E4E756C655F706F6C6C006C65305F706F6C6C3A20726D642071 +S32500004E8073746174757320307825780A006C655F706F6C6C3A20636861696E6564207061FB +S32500004EA0636B65740A0063737230207768656E20626164207468696E6773206861707065CF +S32500004EC06E3A2025780A00004E56000048E72038267900004644287900004648426B00022B +S32500004EE030130800000A670436BC040020390000464C45F40E18102A00026C0642806000DC +S32500004F0000F630136C0C2F0B487AFF606100FD60504F102A0002080000066718102A00021D +S32500004F2042A71F400003487AFF4A61FF0000074242826078102A0002020000030C00000380 +S32500004F406712487AFF4961FF0000072661FFFFFFF1AC584F302A0006428234000C820000B3 +S32500004F6005ED6F1A428230133F004267487AFF3861FF000006FC61FFFFFFF182602E4A823B +S32500004F80672A59824A826F242F022F2E000820790000464C43F08A002009EB809088E780AF +S32500004FA0908848740A6061FF0000062820790000464C43F08A002009EB809088E78090880C +S32500004FC049F40A60200C34804240484015400003357CFA12000441F90000464C428072071A +S32500004FE0B290670820390000464C52802080157C0080000220024CEE1C04FFF04E5E4E75B0 +S325000050006C655F70757428776179206265666F726520786D697429006C65303A206F757437 +S325000050207075742062756666657220627573790A006C655F707574286265666F72652078CE +S325000050406D697429006C655F70757428616674657220786D697429006C65303A2074726167 +S325000050606E736D69742074696D656F75742C2073746174203D20307825780A006C655F7064 +S3250000508075742874696D656F757429006C655F7075743A20786D6974206572726F722C208E +S325000050A06275662025640A006C655F70757428786D6974206572726F7229006C65303A20B9 +S325000050C07472616E736D6974206572726F722C206572726F72203D20307825780A004E5628 +S325000050E0000048E73838282E000C247900004644287900004648263C000186A0426A00021C +S3250000510030126C0C2F0A487AFEF86100FB62504F20390000465047F40E58600C487AFEFACB +S3250000512061FF0000054C584F102B00026DEE2F0420790000465043F08A002009EB809088AE +S32500005140E7809088D080068000002FD0487408002F2E000861FF0000047A504F584F723FF7 +S32500005160B2846508377CFFC0000460083004444037400004426B000630126C0C2F0A487A0D +S32500005180FEB16100FAEA504F177C0083000220790000465043F08A002009EB809088E7805F +S325000051A09088D080068000002FD0D08C3680424048401740000334BC000830126C0C2F0A9B +S325000051C0487AFE836100FAA8504F538366202F02487AFE8661FF000004983012504F6C1AAE +S325000051E02F0A487AFE986100FA86504F600C3012428234000802000967D034BC0200301274 +S325000052006C2A3012024078000C40200067122F3900004650487AFE7661FF00000454504F86 +S325000052202F0A487AFE846100FA46504F42B900004650102B000208000006660420046014CD +S32500005240302B00063F004267487AFE7161FF0000042070FF4CEE1C1CFFE84E5E4E754E566F +S32500005260000048E73E20246E00082C2E000C242E001061FFFFFFF42C2A00DA8242844283AA +S3250000528061FFFFFFF41E2400BA826F624A83665E2F062F0A6100FC322600504FB484670273 +S325000052A028024A8367DA1212B2390000465466CE122A0001B2390000465566C2122A0002AA +S325000052C0B2390000465666B6122A0003B2390000465766AA122A0004B23900004658669E81 +S325000052E0122A0005B239000046596794609020034CEE047CFFE84E5E4E754552524F523AFB +S325000053002065746865726E65742061646472657373206E6F74207365742120205573652077 +S325000053204C5341442E0A006C65303A2065746865726E657420616464726573733A20257854 +S325000053403A25783A25783A25783A25783A25780A00004E5600002F0A2F022439FFFE077823 +S32500005360200202802FFFFF000C802FFFFF006612487AFF8861FF000002F861FFFFFFED7EB9 +S32500005380584F45F90000465414BC000842390000465513FC003E00004656E08A43F900000B +S325000053A046591282E08A41F9000046581082E08A13C200004657428010112F004280101010 +S325000053C02F002F024878003E42A748780008487AFF5761FF0000029A487800104879000013 +S325000053E0464461FF0000022823FCFFFE1800000046442239FFFE07740681FFF0000023C1A8 +S3250000540000004648DEFC00202E8A6100F8EC242EFFF8246EFFFC4E5E4E754E56000020797F +S32500005420000046444268000230BC00044E5E4E75206F0004222F0008202F000C2F02080150 +S3250000544000006674080100016600008A2401EC8902820000003C4482023C000F4EFB284252 +S325000054602418D1822418D1822418D1822418D1822418D1822418D1822418D1822418D182AE +S325000054802418D1822418D1822418D1822418D1822418D1822418D1822418D1822418D1828E +S325000054A051C9FFBE22004841D1416402524002800000FFFF241F4E75080100016708428297 +S325000054C0343018FDD0824282143018FFE18AD0826000FF7A4282343018FED0826000FF6EE9 +S325000054E04E56000048E73038262E0008264349F9FFA018E261FF000003C2747FC4802F023E +S325000055004E94584F7215B282670000886D20720AB282670000946D087208B2826738602ACE +S32500005520720DB282677C7212B2826740601C7223B28267306D087217B2826756600C724087 +S32500005540B282674E727FB282670416C260A6487800084E94584F487800204E944878000813 +S325000055604E94504FB68B648C534B60884878000A4E942443584FB7CA6300FF7A121A49C1A0 +S325000055802F0161FF0000035E584FB7CA62EE6000FF644878000A61FF0000034A584F60005B +S325000055A0FF4C4878000A4E9442134CEE1C0CFFEC4E5E4E754E560000226E000820494A11DD +S325000055C0670652484A1066FA200890894E5E4E754E560000222E0010226E0008206E000C1E +S325000055E0B1C9631AD3C1D1C1200153814A8067161121200153814A8066F6600A10D920018B +S3250000560053814A8066F64E5E4E7500004E560000206E0008202E000C538072FFB280670C9E +S32500005620421851C8FFFC4240538064F44E5E4E754E56000020790000402410AE000B52B965 +S32500005640000040244E5E4E754E56000023EE000800004024486E00102F2E000C487AFFD28E +S32500005660612420790000402442104E5E4E754E560000486E000C2F2E00084879FFA018E2BC +S3250000568061044E5E4E754E56000048E7303C2A6E0008286E000C266E0010594B600C4A822F +S325000056A0670001782F024E95584F141C49C27625B68266EA95CA141C49C2224241E9FF9E26 +S325000056C07616B6886500013A303B8A064EFB0002003400A200CA013001300130013001307F +S325000056E001300130002E0130013000EE01300130013000AE0130010401300130011A347C20 +S32500005700000160B2584B241B2453161A49C32F032F022F0D61000120504F584F4A82678AB7 +S3250000572091C8603A53817001E3A0C082672A703C4A886702702C2F004E95584F60082F0101 +S325000057404E95584F524A121249C17620B6816DEE307C00016008524A0C1200206EF8121A46 +S3250000576049C166C04A886700FF424878003E6000FF36584B767FC6932F036000FF2A584B97 +S325000057802453141A49C26700FF222F024E95584F141A49C266F46000FF12584B24136C0ABC +S325000057A04878002D4E954482584F4878000A2F022F0D61000082504F584F6000FEEE584B57 +S325000057C02413487800082F022F0D616A504F584F6000FED8584B24134878000A2F022F0DFF +S325000057E06154504F584F6000FEC2584B2413487800102F022F0D613E504F584F6000FEAC82 +S32500005800487800254E95584F4A8A6700FE984878006C4E95584F6000FE8C4CEE3C0CFFE839 +S325000058204E5E4E753031323334353637383961626364656600004E56FFF448E73038286ECD +S325000058400008222E000C242E001045EEFFF441FAFFD44C42100014F008004A8166F447EE44 +S32500005860FFF4162249C32F034E94584FB7CA65F24CEE1C0CFFE04E5E4E757C2F2D5C000074 +S325000058804E5600002F0A7003C0B90000402041FAFFEA1030080049C02F0052B900004020CA +S325000058A045F9FFA018E24E92487800084E92246EFFFC4E5E4E7500004E5600001F3C000088 +S325000058C04E4F0000101F49C04E5E4E754E56000042814E4F000167000004720142804E5E2D +S325000058E04E754E5600002F02242E0008700AB08266064878000D61EA1F024E4F0020242E50 +S32500005900FFFC4E5E4E750000FFFE07F80000402800004036000040360000404A00004052AB +S30D00005920000040520000405255 +S70300004000BB diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/rboot.tmp b/sys/arch/mvme88k/stand/openbsd/sboot/rboot.tmp Binary files differnew file mode 100644 index 00000000000..db9793dc097 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/rboot.tmp diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/sboot b/sys/arch/mvme88k/stand/openbsd/sboot/sboot new file mode 100644 index 00000000000..5d797b7368b --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/sboot @@ -0,0 +1,200 @@ +S00A0000000073626F6F74CE +S3250000400013FC000000005ED4600813FC000100005ED42E7C00006FF04EB9000040484E7554 +S325000040200A73626F6F743A204D564D4531343720626F6F7473747261702070726F67726175 +S325000040406D0A003E3E3E20004E56FF802F0A61FFFFFFFFCE1D7C0030FF80487AFFC461FF55 +S325000040600000159E584F45EEFF80487AFFD761FF0000158E2F0A61FF000013F82F0A610055 +S3250000408001CA504F584F60E24E714E5600004E4F00634E5E4E754D7920697020616464727B +S325000040A06573732069733A2025642E25642E25642E25640A005365727665722069702061B0 +S325000040C06464726573732069733A2025642E25642E25642E25640A004661696C65642E0ACA +S325000040E00065786974696E6720746F20524F4D0A00446F776E6C6F6164204661696C65640A +S325000041000A00446F776E6C6F61642077617320612073756363657373210A00636C69656E1C +S325000041207420495020616464726573732025642E25642E25642E25640A00736572766572D7 +S3250000414020495020616464726573732025642E25642E25642E25640A005245564152503AB8 +S32500004160204661696C65642E0A007265636569766564207365636F6E6461727920626F6F0D +S32500004180742070726F6772616D2E0A006273640076616C696420636F6D6D616E64730A0090 +S325000041A061202D2073656E64206120524152500A0062202D20626F6F7420746865207379B1 +S325000041C07374656D0A0071202D206578697420746F20524F4D0A0066202D206674702074B2 +S325000041E0686520626F6F742066696C650A0067202D20657865637574652074686520626F35 +S325000042006F742066696C650A0068202D2068656C700A0069202D20696E6974204C414E439B +S325000042204520656E657420636869700A0073626F6F743A2025733A20556E6B6E6F776E2016 +S32500004240636F6D6D616E640A00004E5600002F0B2F0A246E000810120C000067670001F2CF +S325000042606E2E0C000062670000F86E180C00006167364A00670001EC0C00003F670001925C +S32500004280600001D40C000066670000AE600001C80C000069670001B26D0001760C00007143 +S325000042A067000084600001B061FF0000054C4A8067664280103900005EF72F00428010391A +S325000042C000005EF62F004280103900005EF52F004280103900005EF42F00487AFDBA45F985 +S325000042E0000055FE4E924280103900005ED32F004280103900005ED22F00428010390000A5 +S325000043005ED12F004280103900005ED02F00487AFDA54E926000014C487AFDBE61FF000003 +S3250000432012E06000013E487AFDB961FF000012D26100FD586000012C61FF000007127201FB +S32500004340B280660E487AFDAB61FF000012B460000112487AFDAE61FF000012A660000104C4 +S3250000436061FF00000F8061FF0000048E4A80660E487AFDE761FF00001288600000E6428070 +S32500004380103900005EF72F004280103900005EF62F004280103900005EF52F004280103924 +S325000043A000005EF42F00487AFD7347F9000055FE4E934280103900005ED32F00428010395A +S325000043C000005ED22F004280103900005ED12F004280103900005ED02F00487AFD5E4E93A9 +S325000043E0DEFC002861FF000006667201B2806608487AFCFF4E93606A487AFD7061FF0000DF +S325000044001200584F524A4A12664645FAFD806040487AFD7E45F9000055FE4E92487AFD82EE +S325000044204E92487AFD8D4E92487AFD9C4E92487AFDA74E92487AFDB84E92487AFDCD4E9226 +S32500004440487AFDD14E92601A61FF00000E9860122F0A613C600C2F0A487AFDD361FF000087 +S3250000446011A0246EFFF8266EFFFC4E5E4E756A756D70696E6720746F20626F6F742070722B +S325000044806F6772616D20617420307825782E0A004E56000048E7003C246E00083A7C70009F +S325000044A02F0D487AFFCA61FF0000115642804281264A2F0A61FF0000108ED5C0284A4ED512 +S325000044C04CEE3C00FFF04E5E4E7500000000001F003B005A0078009700B500D400F30111B1 +S325000044E00130014E4E56000048E73F30266E00082C2E000C2A2E0010282E0014262E0018B4 +S32500004500242E001C200BE880244045F20C00200A720F2E0BC287244147F20A002006E8808A +S32500004520244045F20C00200A720FC286244145F20A002C0A2005E880244045F20C00200AA1 +S32500004540720FC285244145F20A002A0A2004E880244045F20C00200A720FC284244145F2F3 +S325000045600A00280A2003E880244045F20C00200A720FC283244145F20A00260A2002E88077 +S32500004580720FC282244045F20C00200A244145F20A44240A7E45BE826D0274462003538045 +S325000045A07E0BBE80650A200453807E1EBE8064044280607293C97046B4806F1C307C016E06 +S325000045C0223C0000016DE8C007826604D3C86002D3C15280B4806EEE41FAFEF030703A0078 +S325000045E0D1C443F098FFE8C0078266087E02BE836C02524943F19A0020092200E981928058 +S325000046002401E9829481EF822005E7809085EB80D085E9802042D1C02006E980908641F0EB +S325000046200C002008D08B4CEE0CFCFFE04E5E4E754E56000048E73E0020790000589810109B +S325000046400000004010801C2800011A280002182800031628000514280006122800071010D2 +S32500004660020000BF108042A71F41000342A71F42000342A71F43000342A71F44000342A7C4 +S325000046801F45000342A71F4600036100FE584CEE007CFFEC4E5E4E754E5600002F0A4280F6 +S325000046A020790000589C11BC00FF080052807205B2806CEC4878000622390000589C5C81CE +S325000046C02F01487900005EEC45F9000055604E9220790000589C317C8035000C2079000032 +S325000046E058A030BC0001317C08000002117C000600042079000058A0117C000400052079C1 +S32500004700000058A0317C00030006487800062239000058A050812F01487900005EEC4E92E0 +S32500004720487800067212D2B9000058A02F01487900005EEC4E924280DEFC00242079000032 +S3250000474058A0423008184230080E52807203B2806CEA4878004C4879000058C061FF00002D +S325000047600910246EFFFC4E5E4E754E5600002F0A48780006487806004879000058C061FF7C +S3250000478000000A6E20790000589C504F584F0C688035000C66562079000058A00C680004CE +S325000047A00006664848780004487900005EF47218D2882F0145F9000055604E9248780004BD +S325000047C0487900005ED0720ED2B9000058A02F014E9248780006487900005EC822390000C9 +S325000047E058A050812F014E92700160024280246EFFFC4E5E4E754E5600002F02428261004F +S32500004800FE986100FF664A8067047001600A52827204B2826CE84280242EFFFC4E5E4E75D6 +S32500004820000178787878787878782E6D766D6536386B006F637465740000303132333435A7 +S325000048403637383941424344454600004E56FFFC48E73038242E000866322879000058AC12 +S3250000486047EC001961FFFFFFFDCA33C000005ED80C7903E700005ED86208067903E800001F +S325000048805ED833FC004500005EC460082679000058B0584B487800062F390000589C4879B1 +S325000048A000005EC845F9000055604E924878000626390000589C5C832F03487900005EECC4 +S325000048C04E9220790000589C317C0800000C2079000058A47604EFD030042079000058A40D +S325000048E07605EFD031042079000058A4422800012079000058A442680004317C400000060D +S32500004900117C000300082079000058A4117C0011000948780004760CD6B9000058A42F03BA +S32500004920487900005EF44E92DEFC00202EBC000000047610D6B9000058A42F034879000092 +S325000049405ED04E922079000058A44268000A384B98F9000058A6314C000242A748780014AC +S325000049602F0861FF00000A5C2079000058A446403140000A2079000058A830B900005ED8E6 +S32500004980317900005EC4000242680006DEFC00184A8267102079000058B030BC000431425A +S325000049A00002605448780004486EFFFC487900005EF445F9000055604E92487800192F399F +S325000049C0000058AC487AFE5A4E927209DEFC001843FAFE682079000058AC700FC0AEFFFC3E +S325000049E011B108001800202EFFFCE8882D40FFFC53817601B68165DC2079000058A8384BCF +S32500004A0098F9000058AA314C000497FC000058C02F0B4879000058C061FF000006544CEECA +S32500004A201C0CFFE84E5E4E750A002578200D00544654503A20446F776E6C6F616420657257 +S32500004A40726F722025643A2025730A004E56000048E73C304282283C0000700042B9000086 +S32500004A605EC042A76100FDE6584F428348780005487806004879000058C061FF000007723C +S32500004A80504F584F4A8066304AB900005EC067082F3900005EC0600242A76100FDB0584F54 +S32500004AA052827A05BA826CC4487AFF7E61FF00000B507001600001002079000058B4362862 +S32500004AC0000220037A09EBA02F00487AFF5E61FF00000B2E20790000589C504F0C6808000E +S32500004AE0000C66782079000058A40C2800110009666A0C79004500005EC4660C207900001C +S32500004B0058A833D000005EC42079000058B40C500005661E2A0858852F0542803028000281 +S32500004B202F00487AFF0B61FF00000AD67001600000862079000058B44280302800022239C1 +S32500004B4000005EC05281B28067186F042F0060062F3900005EC06100FCF4584F52826000F3 +S32500004B60FF0C4282203900005EC0528023C000005EC02079000058A8366800042F0061004B +S32500004B80FCCC45EBFFF42F0A2F042A39000058B458852F0561FF000009CAD88A504F504F65 +S32500004BA0B7FC0000020B6E00FEC4487AFE7C61FF00000A4E42804CEE0C3CFFE84E5E4E7571 +S32500004BC06C65303A206265656E20626162626C696E672C20666F756E642062792027257347 +S32500004BE0270A006C65303A206D656D6F7279206572726F7220696E20272573270A004E5695 +S32500004C0000002F0A2F02242E0008246E000C30120800000E67142F02487AFFA661FF000061 +S32500004C2009E061FFFFFFF466504F30120800000D670434BC200030120800000C670434BCAB +S32500004C40100030120800000B67122F02487AFF9561FF000009AC61FFFFFFF432242EFFF807 +S32500004C60246EFFFC4E5E4E756C65303A20696E69742074696D656F75742C207374617420D4 +S32500004C803D20307825780A004E56000048E73C3C246E0008287900005EDC267900005EE0C5 +S32500004CA0283C000186A0426C000238BC0004487835BE2F0B61FF000008E64253176A000169 +S32500004CC0000217520003176A00030004176A00020005176A00050006176A0004000742AB4B +S32500004CE0000842AB000C7418D48B2002424048400040600037400012374200107458D48BB9 +S32500004D002002424048403740001637420014397C00010002388B397C00020002200B424066 +S32500004D204840388091C8504F4BF08A00200DEB809088E78090884BF30A60240D2208E781D6 +S32500004D403782181817BC0080181A2002424048401780181B37BCFA12181C4273181E524831 +S32500004D607A07BA886CC291C8327C2FD04BF08A00200DEB809088E78090884BF10A00200DCF +S32500004D80240BD4802208E781378218584233185A2002424048401780185B4273185C4273D4 +S32500004DA0185E52484A886FC4397C0003000238BC0004426C000238BC00015384660E2F0304 +S32500004DC0487AFEA661FF00000838600C3014428336000803000867E238BC010042B90000D0 +S32500004DE05EE442B900005EE8426C000238BC00024CEE3C3CFFE04E5E4E756C655F706F6C09 +S32500004E006C006C65305F706F6C6C3A20726D642073746174757320307825780A006C655F09 +S32500004E20706F6C6C3A20636861696E6564207061636B65740A0063737230207768656E2083 +S32500004E40626164207468696E67732068617070656E3A2025780A00004E56000048E72038B0 +S32500004E60267900005EDC287900005EE0426B000230130800000A670436BC040020390000B6 +S32500004E805EE445F40E18102A00026C064280600000F630136C0C2F0B487AFF606100FD60D1 +S32500004EA0504F102A0002080000066718102A000242A71F400003487AFF4A61FF0000074249 +S32500004EC042826078102A0002020000030C0000036712487AFF4961FF0000072661FFFFFF72 +S32500004EE0F1AC584F302A0006428234000C82000005ED6F1A428230133F004267487AFF381F +S32500004F0061FF000006FC61FFFFFFF182602E4A82672A59824A826F242F022F2E0008207904 +S32500004F2000005EE443F08A002009EB809088E780908848740A6061FF0000062820790000F4 +S32500004F405EE443F08A002009EB809088E780908849F40A60200C3480424048401540000338 +S32500004F60357CFA12000441F900005EE442807207B2906708203900005EE452802080157C64 +S32500004F800080000220024CEE1C04FFF04E5E4E756C655F70757428776179206265666F727F +S32500004FA06520786D697429006C65303A206F75747075742062756666657220627573790AE8 +S32500004FC0006C655F707574286265666F726520786D697429006C655F70757428616674654B +S32500004FE07220786D697429006C65303A207472616E736D69742074696D656F75742C20737B +S32500005000746174203D20307825780A006C655F7075742874696D656F757429006C655F70F4 +S3250000502075743A20786D6974206572726F722C206275662025640A006C655F7075742878B6 +S325000050406D6974206572726F7229006C65303A207472616E736D6974206572726F722C202A +S325000050606572726F72203D20307825780A004E56000048E73838282E000C247900005EDCB8 +S32500005080287900005EE0263C000186A0426A000230126C0C2F0A487AFEF86100FB62504FEC +S325000050A0203900005EE847F40E58600C487AFEFA61FF0000054C584F102B00026DEE2F0461 +S325000050C0207900005EE843F08A002009EB809088E7809088D080068000002FD0487408006A +S325000050E02F2E000861FF0000047A504F584F723FB2846508377CFFC0000460083004444037 +S3250000510037400004426B000630126C0C2F0A487AFEB16100FAEA504F177C00830002207962 +S3250000512000005EE843F08A002009EB809088E7809088D080068000002FD0D08C36804240D2 +S3250000514048401740000334BC000830126C0C2F0A487AFE836100FAA8504F538366202F020A +S32500005160487AFE8661FF000004983012504F6C1A2F0A487AFE986100FA86504F600C3012C1 +S32500005180428234000802000967D034BC020030126C2A3012024078000C40200067122F39B4 +S325000051A000005EE8487AFE7661FF00000454504F2F0A487AFE846100FA46504F42B900005E +S325000051C05EE8102B000208000006660420046014302B00063F004267487AFE7161FF00005C +S325000051E0042070FF4CEE1C1CFFE84E5E4E754E56000048E73E20246E00082C2E000C242ECB +S32500005200001061FFFFFFF42C2A00DA824284428361FFFFFFF41E2400BA826F624A83665EB7 +S325000052202F062F0A6100FC322600504FB484670228024A8367DA1212B23900005EEC66CE40 +S32500005240122A0001B23900005EED66C2122A0002B23900005EEE66B6122A0003B2390000F2 +S325000052605EEF66AA122A0004B23900005EF0669E122A0005B23900005EF1679460902003C5 +S325000052804CEE047CFFE84E5E4E754552524F523A2065746865726E65742061646472657322 +S325000052A073206E6F7420736574212020557365204C5341442E0A006C65303A20657468658D +S325000052C0726E657420616464726573733A2025783A25783A25783A25783A25783A25780AD5 +S325000052E000004E5600002F0A2F022439FFFE0778200202802FFFFF000C802FFFFF006612BF +S32500005300487AFF8861FF000002F861FFFFFFED7E584F45F900005EEC14BC00084239000099 +S325000053205EED13FC003E00005EEEE08A43F900005EF11282E08A41F900005EF01082E08A0C +S3250000534013C200005EEF428010112F00428010102F002F024878003E42A748780008487A60 +S32500005360FF5761FF0000029A48780010487900005EDC61FF0000022823FCFFFE180000004C +S325000053805EDC2239FFFE07740681FFF0000023C100005EE0DEFC00202E8A6100F8EC242E19 +S325000053A0FFF8246EFFFC4E5E4E754E560000207900005EDC4268000230BC00044E5E4E7572 +S325000053C0206F0004222F0008202F000C2F02080100006674080100016600008A2401EC89D8 +S325000053E002820000003C4482023C000F4EFB28422418D1822418D1822418D1822418D182E5 +S325000054002418D1822418D1822418D1822418D1822418D1822418D1822418D1822418D1820E +S325000054202418D1822418D1822418D1822418D18251C9FFBE22004841D1416402524002801C +S325000054400000FFFF241F4E750801000167084282343018FDD0824282143018FFE18AD0825E +S325000054606000FF7A4282343018FED0826000FF6E4E56000048E73038262E0008264349F9AE +S325000054800000587261FF000003C2747FC4802F024E94584F7215B282670000886D20720A73 +S325000054A0B282670000946D087208B2826738602A720DB282677C7212B2826740601C722365 +S325000054C0B28267306D087217B2826756600C7240B282674E727FB282670416C260A64878D7 +S325000054E000084E94584F487800204E94487800084E94504FB68B648C534B60884878000A89 +S325000055004E942443584FB7CA6300FF7A121A49C12F0161FF0000035E584FB7CA62EE600039 +S32500005520FF644878000A61FF0000034A584F6000FF4C4878000A4E9442134CEE1C0CFFECEB +S325000055404E5E4E754E560000226E000820494A11670652484A1066FA200890894E5E4E7565 +S325000055604E560000222E0010226E0008206E000CB1C9631AD3C1D1C1200153814A80671696 +S325000055801121200153814A8066F6600A10D9200153814A8066F64E5E4E7500004E56000037 +S325000055A0206E0008202E000C538072FFB280670C421851C8FFFC4240538064F44E5E4E7582 +S325000055C04E5600002079000058BC10AE000B52B9000058BC4E5E4E754E56000023EE000860 +S325000055E0000058BC486E00102F2E000C487AFFD261242079000058BC42104E5E4E754E5638 +S325000056000000486E000C2F2E000848790000587261044E5E4E754E56000048E7303C2A6E27 +S325000056200008286E000C266E0010594B600C4A82670001782F024E95584F141C49C27625C9 +S32500005640B68266EA95CA141C49C2224241E9FF9E7616B6886500013A303B8A064EFB000247 +S32500005660003400A200CA0130013001300130013001300130002E0130013000EE013001304D +S32500005680013000AE0130010401300130011A347C000160B2584B241B2453161A49C32F03E8 +S325000056A02F022F0D61000120504F584F4A82678A91C8603A53817001E3A0C082672A703CB8 +S325000056C04A886702702C2F004E95584F60082F014E95584F524A121249C17620B6816DEE20 +S325000056E0307C00016008524A0C1200206EF8121A49C166C04A886700FF424878003E60001B +S32500005700FF36584B767FC6932F036000FF2A584B2453141A49C26700FF222F024E95584F0C +S32500005720141A49C266F46000FF12584B24136C0A4878002D4E954482584F4878000A2F02D7 +S325000057402F0D61000082504F584F6000FEEE584B2413487800082F022F0D616A504F584F72 +S325000057606000FED8584B24134878000A2F022F0D6154504F584F6000FEC2584B2413487827 +S3250000578000102F022F0D613E504F584F6000FEAC487800254E95584F4A8A6700FE98487897 +S325000057A0006C4E95584F6000FE8C4CEE3C0CFFE84E5E4E753031323334353637383961625B +S325000057C06364656600004E56FFF448E73038286E0008222E000C242E001045EEFFF441FA46 +S325000057E0FFD44C42100014F008004A8166F447EEFFF4162249C32F034E94584FB7CA65F202 +S325000058004CEE1C0CFFE04E5E4E757C2F2D5C00004E5600002F0A7003C0B9000058B841FA8A +S32500005820FFEA1030080049C02F0052B9000058B845F9000058724E92487800084E92246EBC +S32500005840FFFC4E5E4E7500004E5600001F3C00004E4F0000101F49C04E5E4E754E560000F1 +S3250000586042814E4F000167000004720142804E5E4E754E5600002F02242E0008700AB082D7 +S3250000588066064878000D61EA1F024E4F0020242EFFFC4E5E4E750000FFFE07F8000058C0D0 +S31D000058A0000058CE000058CE000058E2000058EA000058EA000058EA9E +S70300004000BB diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/sboot.c b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.c new file mode 100644 index 00000000000..5b0f06b1a7e --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.c @@ -0,0 +1,173 @@ +/* + * Copyright (c) 1995 Theo de Raadt + * + * 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 under OpenBSD by + * Theo de Raadt for Willowglen Singapore. + * 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. + * + * Copyright (c) 1995 Charles D. Cranor and Seth Widoff + * 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 Charles D. Cranor + * and Seth Widoff. + * 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/cdefs.h> +#include "sboot.h" + +void +main() +{ + char buf[128]; + + buf[0] = '0'; + printf("\nsboot: MVME147 bootstrap program\n"); + while (1) { + printf(">>> "); + gets(buf); + do_cmd(buf); + } + /* not reached */ +} + +/* + * exit to rom + */ +void +callrom() +{ + asm("trap #15; .word 0x0063"); +} + +/* + * do_cmd: do a command + */ +void +do_cmd(buf) + char *buf; +{ + switch (*buf) { + case '\0': + break; + case 'a': + if (rev_arp()) { + printf("My ip address is: %d.%d.%d.%d\n", myip[0], + myip[1], myip[2], myip[3]); + printf("Server ip address is: %d.%d.%d.%d\n", servip[0], + servip[1], servip[2], servip[3]); + } else { + printf("Failed.\n"); + } + break; + case 'q': + printf("exiting to ROM\n"); + callrom(); + break; + case 'f': + if (do_get_file() == 1) { + printf("Download Failed\n"); + } else { + printf("Download was a success!\n"); + } + break; + case 'b': + le_init(); + if (rev_arp()) { + printf("client IP address %d.%d.%d.%d\n", myip[0], + myip[1], myip[2], myip[3]); + printf("server IP address %d.%d.%d.%d\n", servip[0], + servip[1], servip[2], servip[3]); + } else { + printf("REVARP: Failed.\n"); + return; + } + if (do_get_file() == 1) { + printf("Download Failed\n"); + return; + } else { + printf("received secondary boot program.\n"); + } + if (*++buf == '\0') + buf = "bsd"; + go(buf); + break; + case 'h': + case '?': + printf("valid commands\n"); + printf("a - send a RARP\n"); + printf("b - boot the system\n"); + printf("q - exit to ROM\n"); + printf("f - ftp the boot file\n"); + printf("g - execute the boot file\n"); + printf("h - help\n"); + printf("i - init LANCE enet chip\n"); + break; + case 'i': + le_init(); + break; + case 'g': + go(buf); + break; + default: + printf("sboot: %s: Unknown command\n", buf); + } +} + +go(buf) + char *buf; +{ + void (*entry)() = (void (*))LOAD_ADDR; + + printf("jumping to boot program at 0x%x.\n", entry); + + asm("clrl d0; clrl d1"); /* XXX network device */ + asm("movl %0, a3" : : "a" (buf) : "a3"); + asm("movl %0, a4" : : "a" (buf + strlen(buf)) : "a4"); + asm("jmp %0@" : : "a" (entry)); +} diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/sboot.h b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.h new file mode 100644 index 00000000000..146e0b8cce4 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1995 Charles D. Cranor and Seth Widoff + * 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 Charles D. Cranor + * and Seth Widoff. + * 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. + */ + +/* + * sboot.h: stuff for MVME147's serial line boot + */ + +typedef unsigned short u_short; +typedef unsigned long u_long; +typedef unsigned char u_char; +typedef unsigned int u_int; +typedef u_long size_t; +typedef char *caddr_t; +extern caddr_t end; + +#define NULL ((char *)0) + +void bcopy __P((const void *, void *, size_t)); /* libc_sa */ +void *memset __P((void *, int, size_t)); /* libc_sa */ +int printf __P((const char *, ...)); /* libc_sa */ + +/* console */ +void puts __P((char *)); +void putchar __P((char)); +char cngetc __P((void)); +void ngets __P((char *, int)); + +/* sboot */ +void callrom __P((void)); +void do_cmd __P((char *)); + +/* le */ +#define LANCE_ADDR 0xfffe0778 +#define ERAM_ADDR 0xfffe0774 +#define LANCE_REG_ADDR 0xfffe1800 +void le_end __P((void)); +void le_init __P((void)); +int le_get __P((u_char *, size_t, u_long)); +int le_put __P((u_char *, size_t)); + +/* etherfun */ +#define READ 0 +#define ACKN 1 +void do_rev_arp __P((void)); +int get_rev_arp __P((void)); +int rev_arp __P((void)); +void do_send_tftp __P((int)); +int do_get_file __P((void)); +void tftp_file __P((char *, u_long)); + +/* clock */ +u_long time __P((void)); + +/* checksum */ +u_long oc_cksum __P((void *, u_long, u_long)); + +#define CONS_ZS_ADDR (0xfffe3002) +#define CLOCK_ADDR (0xfffe07f8) +#define LOAD_ADDR 0x7000 + +unsigned char myea[6]; /* my ether addr */ +unsigned char myip[4]; +unsigned char servip[4]; +unsigned char servea[6]; +u_short myport; +u_short servport; +unsigned char reboot; diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/sboot.tmp b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.tmp Binary files differnew file mode 100644 index 00000000000..a55acd6ea70 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/sboot.tmp diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/srec b/sys/arch/mvme88k/stand/openbsd/sboot/srec Binary files differnew file mode 100644 index 00000000000..a60b3c76852 --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/srec diff --git a/sys/arch/mvme88k/stand/openbsd/sboot/srec.c b/sys/arch/mvme88k/stand/openbsd/sboot/srec.c new file mode 100644 index 00000000000..164fb4b458c --- /dev/null +++ b/sys/arch/mvme88k/stand/openbsd/sboot/srec.c @@ -0,0 +1,157 @@ +/* + * Public domain, believed to be by Mike Price. + * + * convert binary file to Srecord format + * XXX srec generates improper checksums for 4-byte dumps + */ +#include <stdio.h> +#include <ctype.h> + +int get32(); +void put32(); +void sput(); +void put(); +int checksum(); + +int mask; +int size; + +main(argc, argv) + int argc; + char *argv[]; +{ + char buf[32]; + int cc; + int base; + int addr; + char *name; + + if (argc != 4) { + fprintf(stderr, "usage: %s {size} {hex_addr} {name}\n", argv[0]); + fprintf(stderr, "Size = 2, 3, or 4 byte address\n"); + exit(1); + } + sscanf(argv[1], "%x", &size); + mask = (1 << (size * 8)) - 1; + if (!mask) + mask = (-1); + sscanf(argv[2], "%x", &base); + name = argv[3]; + + if (size == 2) + printf("S0%02X%04X", 2 + strlen(name) + 1, 0); + if (size == 3) + printf("S0%02X%06X", 3 + strlen(name) + 1, 0); + if (size == 4) + printf("S0%02X%08X", 4 + strlen(name) + 1, 0); + sput(name); + printf("%02X\n", checksum(0, name, strlen(name), size)); + + addr = base; + for (;;) { + cc = get32(buf); + if (cc > 0) { + put32(cc, addr, buf, size, mask); + addr += cc; + } else + break; + } + + buf[0] = base >> 8; + buf[1] = base; + printf("S%d%02X", 11 - size, 2 + 1); + switch (size) { + case 2: + printf("%04X", base & mask); + break; + case 3: + printf("%06X", base & mask); + break; + case 4: + printf("%08X", base & mask); + break; + } + + /* + * kludge -> don't know why you have to add the +1 = works + * for size =3 at least + */ + printf("%02X\n", checksum(base, (char *) 0, 0, size) + 1); + exit (0); +} + +int +get32(buf) + char buf[]; +{ + char *cp = buf; + int i; + int c; + + for (i = 0; i < 32; ++i) { + if ((c = getchar()) != EOF) + *cp++ = c; + else + break; + } + return (cp - buf); +} + +void +put32(len, addr, buf, size, mask) + int len; + int addr; + char buf[]; + int size, mask; +{ + char *cp = buf; + int i; + + if (size == 2) + printf("S1%02X%04X", 2 + len + 1, addr & mask); + if (size == 3) + printf("S2%02X%06X", 3 + len + 1, addr & mask); + if (size == 4) + printf("S3%02X%08X", 4 + len + 1, addr & mask); + for (i = 0; i < len; ++i) + put(*cp++); + printf("%02X\n", checksum(addr, buf, len, size)); +} + +void +sput(s) + char *s; +{ + while (*s != '\0') + put(*s++); +} + +void +put(c) + int c; +{ + printf("%02X", c & 0xff); +} + +int +checksum(addr, buf, len, size) + int addr; + char buf[]; + int len; + int size; +{ + char *cp = buf; + int sum = 0xff - 1 - size - (len & 0xff); + int i; + + if (size == 4) + sum -= (addr >> 24) & 0xff; + if (size >= 3) + sum -= (addr >> 16) & 0xff; + sum -= (addr >> 8) & 0xff; + sum -= addr & 0xff; + for (i = 0; i < len; ++i) { + sum -= *cp++ & 0xff; + } + return (sum & 0xff); +} |