1/*	$NetBSD: sboot.h,v 1.6 2007/03/04 06:00:24 christos 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
35extern void *end;
36
37
38/* console */
39void puts(char *);
40void putchar(int);
41char cngetc(void);
42char *ngets(char *, int);
43void consinit(void);
44
45/* sboot */
46void callrom(void);
47void do_cmd(char *, char *);
48
49/* le */
50#define LANCE_ADDR 0xfffe0778
51#define ERAM_ADDR  0xfffe0774
52#define LANCE_REG_ADDR 0xfffe1800
53void le_end(void);
54void le_init(void);
55int le_get(u_char *, size_t, u_long);
56int le_put(u_char *, size_t);
57
58/* etherfun */
59#define READ 0
60#define ACKN 1
61void do_rev_arp(void);
62int get_rev_arp(void);
63int rev_arp(void);
64void do_send_tftp(int);
65int do_get_file(void);
66void tftp_file(char *, u_long);
67
68/* clock */
69u_long time(void);
70
71/* checksum */
72u_long oc_cksum (void *, u_long, u_long);
73
74/* start */
75void go(int, void *, void *);
76
77#define CONS_ZS_ADDR (0xfffe3002)
78#define CLOCK_ADDR (0xfffe07f8)
79#define LOAD_ADDR 0x8000
80
81unsigned char myea[6];                /* my ether addr */
82unsigned char myip[4];
83unsigned char servip[4];
84unsigned char servea[6];
85u_short myport;
86u_short servport;
87unsigned char reboot;
88