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