Home | History | Annotate | Line # | Download | only in sboot
      1 /*	$NetBSD: sboot.h,v 1.7 2011/02/02 17:53:41 chuck Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Charles D. Cranor and Seth Widoff
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  */
     27 
     28 /*
     29  * sboot.h: stuff for MVME147's serial line boot
     30  */
     31 
     32 #include <lib/libkern/libkern.h>
     33 #include <lib/libsa/stand.h>
     34 
     35 extern void *end;
     36 
     37 
     38 /* console */
     39 void puts(char *);
     40 void putchar(int);
     41 char cngetc(void);
     42 char *ngets(char *, int);
     43 void consinit(void);
     44 
     45 /* sboot */
     46 void callrom(void);
     47 void do_cmd(char *, char *);
     48 
     49 /* le */
     50 #define LANCE_ADDR 0xfffe0778
     51 #define ERAM_ADDR  0xfffe0774
     52 #define LANCE_REG_ADDR 0xfffe1800
     53 void le_end(void);
     54 void le_init(void);
     55 int le_get(u_char *, size_t, u_long);
     56 int le_put(u_char *, size_t);
     57 
     58 /* etherfun */
     59 #define READ 0
     60 #define ACKN 1
     61 void do_rev_arp(void);
     62 int get_rev_arp(void);
     63 int rev_arp(void);
     64 void do_send_tftp(int);
     65 int do_get_file(void);
     66 void tftp_file(char *, u_long);
     67 
     68 /* clock */
     69 u_long time(void);
     70 
     71 /* checksum */
     72 u_long oc_cksum (void *, u_long, u_long);
     73 
     74 /* start */
     75 void go(int, void *, void *);
     76 
     77 #define CONS_ZS_ADDR (0xfffe3002)
     78 #define CLOCK_ADDR (0xfffe07f8)
     79 #define LOAD_ADDR 0x8000
     80 
     81 unsigned char myea[6];                /* my ether addr */
     82 unsigned char myip[4];
     83 unsigned char servip[4];
     84 unsigned char servea[6];
     85 u_short myport;
     86 u_short servport;
     87 unsigned char reboot;
     88