Annotation of sys/arch/mvme68k/include/prom.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: prom.h,v 1.11 2003/06/02 05:09:14 deraadt Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 1995 Theo de Raadt
! 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: #ifndef _MACHINE_PROM_H_
! 28: #define _MACHINE_PROM_H_
! 29:
! 30: #define MVMEPROM_INCHR 0x00
! 31: #define MVMEPROM_INSTAT 0x01
! 32: #define MVMEPROM_INLN 0x02
! 33: #define MVMEPROM_READSTR 0x03
! 34: #define MVMEPROM_READLN 0x04
! 35: #define MVMEPROM_OUTCHR 0x20
! 36: #define MVMEPROM_OUTSTR 0x21
! 37: #define MVMEPROM_DSKRD 0x10
! 38: #define MVMEPROM_DSKWR 0x11
! 39: #define MVMEPROM_DSKCFIG 0x12
! 40: #define MVMEPROM_DSKFMT 0x14
! 41: #define MVMEPROM_DSKCTRL 0x15
! 42: #define MVMEPROM_NETCTRL 0x1d
! 43: #define MVMEPROM_OUTSTRCRLF 0x22
! 44: #define MVMEPROM_WRITE 0x23
! 45: #define MVMEPROM_WRITELN 0x24
! 46: #define MVMEPROM_DELAY 0x43
! 47: #define MVMEPROM_RTC_RD 0x53
! 48: #define MVMEPROM_EXIT 0x63
! 49: #define MVMEPROM_GETBRDID 0x70
! 50: #define MVMEPROM_ENVIRON 0x71
! 51:
! 52: #define NETCTRLCMD_GETETHER 1
! 53:
! 54: #define ENVIRONCMD_WRITE 1
! 55: #define ENVIRONCMD_READ 2
! 56: #define ENVIRONTYPE_EOL 0
! 57: #define ENVIRONTYPE_START 1
! 58: #define ENVIRONTYPE_DISKBOOT 2
! 59: #define ENVIRONTYPE_ROMBOOT 3
! 60: #define ENVIRONTYPE_NETBOOT 4
! 61: #define ENVIRONTYPE_MEMSIZE 5
! 62:
! 63: #ifndef _LOCORE
! 64: struct prom_netctrl {
! 65: u_char dev;
! 66: u_char ctrl;
! 67: u_short status;
! 68: u_long cmd;
! 69: u_long addr;
! 70: u_long len;
! 71: u_long flags;
! 72: };
! 73:
! 74: struct prom_environ_hdr {
! 75: u_char type;
! 76: u_char len;
! 77: };
! 78:
! 79: struct mvmeprom_brdid {
! 80: u_long eye_catcher;
! 81: u_char rev;
! 82: u_char month;
! 83: u_char day;
! 84: u_char year;
! 85: u_short size;
! 86: u_short rsv1;
! 87: u_short model;
! 88: u_short suffix;
! 89: u_short options;
! 90: u_char family;
! 91: u_char cpu;
! 92: u_short ctrlun;
! 93: u_short devlun;
! 94: u_short devtype;
! 95: u_short devnum;
! 96: u_long bug;
! 97:
! 98: /*
! 99: * XXX: I have seen no documentation for these!
! 100: *
! 101: * The following (appears to) exist only on the MVME162 and
! 102: * upwards. We should figure out what the other fields are.
! 103: */
! 104: u_char xx1[16];
! 105: u_char xx2[4];
! 106: u_char longname[12];
! 107: u_char xx3[16];
! 108: u_char speed[4];
! 109: u_char xx4[12];
! 110: };
! 111:
! 112: struct mvmeprom_time {
! 113: u_char year_BCD;
! 114: u_char month_BCD;
! 115: u_char day_BCD;
! 116: u_char wday_BCD;
! 117: u_char hour_BCD;
! 118: u_char min_BCD;
! 119: u_char sec_BCD;
! 120: u_char cal_BCD;
! 121: };
! 122:
! 123: struct mvmeprom_dskio {
! 124: u_char ctrl_lun;
! 125: u_char dev_lun;
! 126: u_short status;
! 127: void *pbuffer;
! 128: u_long blk_num;
! 129: u_short blk_cnt;
! 130: u_char flag;
! 131: #define BUG_FILE_MARK 0x80
! 132: #define IGNORE_FILENUM 0x02
! 133: #define END_OF_FILE 0x01
! 134: u_char addr_mod;
! 135: };
! 136: #define MVMEPROM_BLOCK_SIZE 256
! 137:
! 138: struct mvmeprom_args {
! 139: u_int dev_lun;
! 140: u_int ctrl_lun;
! 141: u_int flags;
! 142: u_int ctrl_addr;
! 143: u_int entry;
! 144: u_int conf_blk;
! 145: char *arg_start;
! 146: char *arg_end;
! 147: char *nbarg_start;
! 148: char *nbarg_end;
! 149: u_int cputyp;
! 150: };
! 151:
! 152: #endif
! 153:
! 154: #define MVMEPROM_CALL(x) \
! 155: __asm__ __volatile__ (__CONCAT("trap #15; .short ", __STRING(x)) )
! 156: #define MVMEPROM_NOARG() \
! 157: __asm__ __volatile__ ("clrl sp@-")
! 158: #define MVMEPROM_ARG1(arg) \
! 159: __asm__ __volatile__ ("movel %0, sp@-"::"d" (arg))
! 160: #define MVMEPROM_ARG2(arg) \
! 161: __asm__ __volatile__ ("movel %0, sp@-"::"d" (arg))
! 162: #define MVMEPROM_GETRES(ret) \
! 163: __asm__ __volatile__ ("movel sp@+,%0": "=d" (ret):)
! 164: #define MVMEPROM_RETURN(ret) \
! 165: MVMEPROM_GETRES(ret); \
! 166: return (ret); /* return a value (int) */
! 167: #define MVMEPROM_RETURN_BYTE(ret) \
! 168: MVMEPROM_GETRES(ret); \
! 169: return((ret >> 24) & 0xff); /* return a byte, ret must be int */
! 170: #define MVMEPROM_STATRET(ret) \
! 171: MVMEPROM_GETRES(ret); \
! 172: return (!(ret & 0x4)); /* return a 'status' */
! 173:
! 174: #define MVMEPROM_REG_DEVLUN "d0"
! 175: #define MVMEPROM_REG_CTRLLUN "d1"
! 176: #define MVMEPROM_REG_FLAGS "d4"
! 177: #define MVMEPROM_REG_CTRLADDR "a0"
! 178: #define MVMEPROM_REG_ENTRY "a1"
! 179: #define MVMEPROM_REG_CONFBLK "a2"
! 180: #define MVMEPROM_REG_NBARGSTART "a3"
! 181: #define MVMEPROM_REG_NBARGEND "a4"
! 182: #define MVMEPROM_REG_ARGSTART "a5"
! 183: #define MVMEPROM_REG_ARGEND "a6"
! 184:
! 185: #ifndef RB_NOSYM
! 186: #define RB_NOSYM 0x4000
! 187: #endif
! 188:
! 189: #endif /* _MACHINE_PROM_H_ */
CVSweb