1 /* $NetBSD: prom.h,v 1.16 2005/12/24 20:07:19 perry Exp $ */
4 * Copyright (c) 1995 Theo de Raadt
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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.
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.
28 #define MVMEPROM_INCHR 0x00
29 #define MVMEPROM_INSTAT 0x01
30 #define MVMEPROM_INLN 0x02
31 #define MVMEPROM_READSTR 0x03
32 #define MVMEPROM_READLN 0x04
33 #define MVMEPROM_OUTCHR 0x20
34 #define MVMEPROM_OUTSTR 0x21
35 #define MVMEPROM_DSKRD 0x10
36 #define MVMEPROM_DSKWR 0x11
37 #define MVMEPROM_DSKCFIG 0x12
38 #define MVMEPROM_DSKFMT 0x14
39 #define MVMEPROM_DSKCTRL 0x15
40 #define MVMEPROM_NETCTRL 0x1d
41 #define MVMEPROM_OUTSTRCRLF 0x22
42 #define MVMEPROM_WRITE 0x23
43 #define MVMEPROM_WRITELN 0x24
44 #define MVMEPROM_DELAY 0x43
45 #define MVMEPROM_RTC_RD 0x53
46 #define MVMEPROM_EXIT 0x63
47 #define MVMEPROM_GETBRDID 0x70
48 #define MVMEPROM_ENVIRON 0x71
50 #define NETCTRLCMD_GETETHER 1
52 #define ENVIRONCMD_WRITE 1
53 #define ENVIRONCMD_READ 2
54 #define ENVIRONTYPE_EOL 0
55 #define ENVIRONTYPE_START 1
56 #define ENVIRONTYPE_DISKBOOT 2
57 #define ENVIRONTYPE_ROMBOOT 3
58 #define ENVIRONTYPE_NETBOOT 4
59 #define ENVIRONTYPE_MEMSIZE 5
72 struct prom_environ_hdr
{
77 struct mvmeprom_brdid
{
97 * XXX: I have seen no documentation for these!
99 * The following (appears to) exist only on the MVME162 and
100 * upwards. We should figure out what the other fields are.
110 struct mvmeprom_time
{
121 struct mvmeprom_dskio
{
129 #define BUG_FILE_MARK 0x80
130 #define IGNORE_FILENUM 0x02
131 #define END_OF_FILE 0x01
134 #define MVMEPROM_BLOCK_SIZE 256
136 struct mvmeprom_args
{
152 #define MVMEPROM_CALL(x) \
153 __asm volatile ("trap #15; .short " __STRING(x))
154 #define MVMEPROM_NOARG() \
155 __asm volatile ("clrl %sp@-")
156 #define MVMEPROM_ARG1(arg) \
157 __asm volatile ("movel %0, %%sp@-"::"d" (arg))
158 #define MVMEPROM_ARG2(arg) \
159 __asm volatile ("movel %0, %%sp@-"::"d" (arg))
160 #define MVMEPROM_GETRES(ret) \
161 __asm volatile ("movel %%sp@+,%0": "=d" (ret):)
162 #define MVMEPROM_GETSR(ret) \
163 __asm volatile ("movew %%sr,%0": "=d" (ret):)
164 #define MVMEPROM_RETURN(ret) \
165 MVMEPROM_GETRES(ret); \
166 return (ret); /* return a value (int) */
167 /* return a byte, ret must be int */
168 #define MVMEPROM_RETURN_BYTE(ret) \
169 MVMEPROM_GETRES(ret); \
170 return(int)((((unsigned int)(ret)) >> 24) & 0xff);
171 #define MVMEPROM_STATRET(ret) \
172 MVMEPROM_GETSR(ret); \
173 return ((ret & 0x4) == 0); /* return a 'status' in the Z flag */
175 #define MVMEPROM_REG_DEVLUN %d0
176 #define MVMEPROM_REG_CTRLLUN %d1
177 #define MVMEPROM_REG_FLAGS %d4
178 #define MVMEPROM_REG_CTRLADDR %a0
179 #define MVMEPROM_REG_ENTRY %a1
180 #define MVMEPROM_REG_CONFBLK %a2
181 #define MVMEPROM_REG_NBARGSTART %a3
182 #define MVMEPROM_REG_NBARGEND %a4
183 #define MVMEPROM_REG_ARGSTART %a5
184 #define MVMEPROM_REG_ARGEND %a6
186 #define MVMEPROM_ARGS_DEVLUN 0x00
187 #define MVMEPROM_ARGS_CTRLLUN 0x04
188 #define MVMEPROM_ARGS_FLAGS 0x08
189 #define MVMEPROM_ARGS_CTRLADDR 0x0c
190 #define MVMEPROM_ARGS_ENTRY 0x10
191 #define MVMEPROM_ARGS_CONFBLK 0x14
192 #define MVMEPROM_ARGS_NBARGSTART 0x18
193 #define MVMEPROM_ARGS_NBARGEND 0x1c
194 #define MVMEPROM_ARGS_ARGSTART 0x20
195 #define MVMEPROM_ARGS_ARGEND 0x24
196 #define MVMEPROM_ARGS_CPUTYP 0x28
197 #define MVMEPROM_ARGS_MAX 0x2c
201 #define RB_NOSYM 0x400
204 #define RB_SBOOT 0x800