[BACK]Return to prom.h CVS log [TXT][DIR] Up to [local] / sys / arch / mvmeppc / include

Annotation of sys/arch/mvmeppc/include/prom.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: prom.h,v 1.5 2004/01/24 21:10:31 miod Exp $ */
                      2: /*
                      3:  * Copyright (c) 2001 Steve Murphree, Jr.
                      4:  * All rights reserved.
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      9:  * 1. Redistributions of source code must retain the above copyright
                     10:  *    notice, this list of conditions and the following disclaimer.
                     11:  * 2. Redistributions in binary form must reproduce the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer in the
                     13:  *    documentation and/or other materials provided with the distribution.
                     14:  *
                     15:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     16:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     17:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     18:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     19:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     20:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     21:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     22:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     23:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     24:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     25:  */
                     26: #ifndef __MACHINE_PROM_H__
                     27: #define __MACHINE_PROM_H__
                     28:
                     29: #define MVMEPROM_INCHR         0x0000
                     30: #define MVMEPROM_INSTAT                0x0001
                     31: #define MVMEPROM_INLN          0x0002
                     32: #define MVMEPROM_READSTR       0x0003
                     33: #define MVMEPROM_READLN                0x0004
                     34: #define MVMEPROM_CHKBRK                0x0005
                     35: #define MVMEPROM_DSKRD         0x0010
                     36: #define MVMEPROM_DSKWR         0x0011
                     37: #define MVMEPROM_DSKCFIG       0x0012
                     38: #define MVMEPROM_DSKFMT                0x0014
                     39: #define MVMEPROM_DSKCTRL       0x0015
                     40: #define MVMEPROM_NETRD         0x0018
                     41: #define MVMEPROM_NETWR         0x0019
                     42: #define MVMEPROM_NETCFIG       0x001a
                     43: #define MVMEPROM_NETFOPEN      0x001b
                     44: #define MVMEPROM_NETFREAD      0x001c
                     45: #define MVMEPROM_NETCTRL       0x001d
                     46: #define MVMEPROM_OUTCHR                0x0020
                     47: #define MVMEPROM_OUTSTR                0x0021
                     48: #define MVMEPROM_OUTLN         0x0022
                     49: #define MVMEPROM_WRITE         0x0023
                     50: #define MVMEPROM_WRITELN       0x0024
                     51: #define MVMEPROM_WRITDLN       0x0025
                     52: #define MVMEPROM_PCRLF         0x0026
                     53: #define MVMEPROM_ERASLN                0x0027
                     54: #define MVMEPROM_WRITD         0x0028
                     55: #define MVMEPROM_SNDBRK                0x0029
                     56: #define MVMEPROM_DELAY         0x0043
                     57: #define MVMEPROM_RTC_TM                0x0050
                     58: #define MVMEPROM_RTC_DT                0x0051
                     59: #define MVMEPROM_RTC_DSP       0x0052
                     60: #define MVMEPROM_RTC_RD                0x0053
                     61: #define MVMEPROM_REDIR         0x0060
                     62: #define MVMEPROM_REDIR_I       0x0061
                     63: #define MVMEPROM_REDIR_O       0x0062
                     64: #define MVMEPROM_EXIT          0x0063
                     65: #define MVMEPROM_RETURN                MVMEPROM_EXIT
                     66: #define MVMEPROM_BINDEC                0x0064
                     67: #define MVMEPROM_CHANGEV       0x0067
                     68: #define MVMEPROM_STRCMP                0x0068
                     69: #define MVMEPROM_MUL32         0x0069
                     70: #define MVMEPROM_DIV32         0x006a
                     71: #define MVMEPROM_CHKSUM                0x006b
                     72: #define MVMEPROM_BRD_ID                0x0070
                     73: #define MVMEPROM_ENVIRON       0x0071
                     74: #define MVMEPROM_PFLASH                0x0073
                     75: #define MVMEPROM_DIAGFCN       0x0074
                     76: #define MVMEPROM_SIOPEPS       0x0090
                     77: #define MVMEPROM_FORKMPU       0x0100
                     78: #define MVMEPROM_FORKMPUR      0x0101
                     79: #define MVMEPROM_IDELMPU       0x0110
                     80: #define MVMEPROM_IOINQ         0x0120
                     81: #define MVMEPROM_IOINFORM      0x0124
                     82: #define MVMEPROM_IOCONFIG      0x0128
                     83: #define MVMEPROM_IODELETE      0x012c
                     84: #define MVMEPROM_SYMBOLTA      0x0130
                     85: #define MVMEPROM_SYMBOLTD      0x0131
                     86:
                     87: #define NETCTRLCMD_GETETHER    1
                     88: #define ENVIRONCMD_WRITE       1
                     89: #define ENVIRONCMD_READ                2
                     90: #define ENVIRONTYPE_EOL                0
                     91: #define ENVIRONTYPE_START      1
                     92: #define ENVIRONTYPE_DISKBOOT   2
                     93: #define ENVIRONTYPE_ROMBOOT    3
                     94: #define ENVIRONTYPE_NETBOOT    4
                     95: #define ENVIRONTYPE_MEMSIZE    5
                     96:
                     97: #define NETSTATUS_SUCCESS      0x00
                     98: #define NETSTATUS_MISALNG      0x01
                     99: #define NETSTATUS_BUFFLMT      0x02
                    100: #define NETSTATUS_BADLEN       0x03
                    101: #define NETSTATUS_INITABRT     0x04
                    102: #define NETSTATUS_TXABRT       0x05
                    103: #define NETSTATUS_PCIADDRERR   0x06
                    104: #define NETSTATUS_NOPORT       0x07
                    105: #define NETSTATUS_ILLIPL       0x08
                    106: #define NETSTATUS_USERABRT     0x09
                    107: #define NETSTATUS_TIMEOUT      0x0A
                    108: #define NETSTATUS_SYSERR       0x10
                    109: #define NETSTATUS_TXBABBLE     0x11
                    110: #define NETSTATUS_TXCOL                0x12
                    111: #define NETSTATUS_TXSTOPPED    0x13
                    112: #define NETSTATUS_TXUNDERFL    0x14
                    113: #define NETSTATUS_TXLATECOL    0x15
                    114: #define NETSTATUS_TXLOSTCARR   0x16
                    115: #define NETSTATUS_TXLINKFAIL   0x17
                    116: #define NETSTATUS_TXNOCARR     0x18
                    117: #define NETSTATUS_TXTOPHY      0x19
                    118: #define NETSTATUS_RXCRCERR     0x20
                    119: #define NETSTATUS_RXOVERFL     0x21
                    120: #define NETSTATUS_RXFRAMEERR   0x22
                    121: #define NETSTATUS_RXLDFNS      0x23
                    122: #define NETSTATUS_RXFDCOL      0x24
                    123: #define NETSTATUS_RXRUNTFRAME  0x25
                    124: #define NETSTATUS_TXTONORM     0x28
                    125: #define NETSTATUS_TXTOSETUP    0x29
                    126: #define NETSTATUS_SROMERR      0x30
                    127:
                    128: #define NETCTRLCMD_INIT                0
                    129: #define NETCTRLCMD_GETETHER    1
                    130: #define NETCTRLCMD_TX          2
                    131: #define NETCTRLCMD_RX          3
                    132: #define NETCTRLCMD_FLUSH       4
                    133: #define NETCTRLCMD_RESET       5
                    134:
                    135: #define NETCFG_FLAG_RD         0
                    136: #define NETCFG_FLAG_WR         1
                    137: #define NETCFG_FLAG_WRNV       2
                    138:
                    139: #ifndef LOCORE
                    140: extern struct bugenviron bugenviron;
                    141: extern int bugenv_init;
                    142:
                    143: #define BUG_ENV_END            0
                    144: #define BUG_STARTUP_PARAM      1
                    145: struct bug_startup {
                    146:        char s_mode;
                    147:        char s_menu;
                    148:        char s_remotestart;
                    149:        char s_probe;
                    150:        char s_negsysfail;
                    151:        char s_resetscsi;
                    152:        char s_nocfblk;
                    153:        char s_scsisync;
                    154: };
                    155:
                    156: #define BUG_AUTOBOOT_INFO      2
                    157: struct bug_autoboot {
                    158:        char b_enable;
                    159:        char b_poweruponly;
                    160:        char b_clun;
                    161:        char b_dlun;
                    162:        char b_delay;
                    163:        char b_string[22]; /* 0x15 + 0x1 */
                    164: };
                    165:
                    166: #define BUG_ROMBOOT_INFO       3
                    167: struct bug_romboot {
                    168:        char r_enable;
                    169:        char r_poweruponly;
                    170:        char r_bootvme;
                    171:        char r_delay;
                    172:        unsigned r_start;
                    173:        unsigned r_end;
                    174: };
                    175:
                    176: #define BUG_NETBOOT_INFO       4
                    177: struct bug_netboot {
                    178:        char n_enable;
                    179:        char n_poweruponly;
                    180:        char n_clun;
                    181:        char n_dlun;
                    182:        char n_delay;
                    183:        char *n_param;
                    184: };
                    185:
                    186: #define BUG_MEMORY_INFO                5
                    187: struct bug_memory {
                    188:        char m_sizeenable;
                    189:        unsigned m_start;
                    190:        unsigned m_end;
                    191: };
                    192:
                    193: struct bugenviron {
                    194:         struct bug_startup  s;
                    195:         struct bug_autoboot b;
                    196:        struct bug_romboot  r;
                    197:        struct bug_netboot  n;
                    198:         struct bug_memory   m;
                    199: };
                    200:
                    201: #define bug_localmemsize()      (bugenviron.m.m_end - bugenviron.m.m_start)
                    202: #define bug_localmemstart()    (bugenviron.m.m_start)
                    203: #define bug_localmemend()      (bugenviron.m.m_end)
                    204:
                    205: struct mvmeprom_netio {
                    206:        u_char  clun;
                    207:        u_char  dlun;
                    208:        u_short status;
                    209:        void    *addr;
                    210:        u_long  tlen;
                    211:        u_long  offset;
                    212:        u_long  ttime;
                    213:        u_long  tbytes;
                    214:        char    filename[64];
                    215: };
                    216:
                    217: struct mvmeprom_netfopen {
                    218:        u_char  clun;
                    219:        u_char  dlun;
                    220:        u_short status;
                    221:        char    filename[64];
                    222: };
                    223:
                    224: struct mvmeprom_netfread {
                    225:        u_char  clun;
                    226:        u_char  dlun;
                    227:        u_short status;
                    228:        void    *addr;
                    229:        u_short bytes;
                    230:        u_short blk;
                    231:        u_long  timeout;
                    232: };
                    233:
                    234: struct mvmeprom_netctrl {
                    235:        u_char  clun;
                    236:        u_char  dlun;
                    237:        u_short status;
                    238:        u_long  cmd;
                    239:        void    *addr;
                    240:        u_long  len;
                    241:        u_long  flags;
                    242: };
                    243:
                    244: struct mvmeprom_netparam {
                    245:        u_long  ver;
                    246:        void *  nodeaddr;
                    247:        void *  loadaddr;
                    248:        void *  execaddr;
                    249:        u_long  delay;
                    250:        u_long  length;
                    251:        u_long  offset;
                    252:        void *  traceaddr;
                    253:        u_long  client_ip;
                    254:        u_long  server_ip;
                    255:        u_long  subnet;
                    256:        u_long  bcast;
                    257:        u_long  gateway_ip;
                    258:        u_char  rarp_retry;
                    259:        u_char  tftp_retry;
                    260:        u_char  rarp_cntl;
                    261:        u_char  update_cntl;
                    262:        char    filename[64];
                    263:        char    args[64];
                    264: };
                    265:
                    266: struct mvmeprom_netcfg {
                    267:        u_char  clun;
                    268:        u_char  dlun;
                    269:        u_short status;
                    270:        struct mvmeprom_netparam *netparam;
                    271:        u_long  flag;
                    272: };
                    273:
                    274: struct prom_environ_hdr {
                    275:        u_char  type;
                    276:        u_char  len;
                    277: };
                    278:
                    279: struct mvmeprom_brdid {
                    280:        u_long  eye_catcher;            /* "BDID" */
                    281:        u_char  rev;
                    282:        u_char  month;
                    283:        u_char  day;
                    284:        u_char  year;
                    285:        u_short size;                   /* BID packet length */
                    286:        u_short rsv1;
                    287:        u_short model;                  /* e.g. 1603, 1604 */
                    288:        u_short suffix;                 /* e.g. AT */
                    289:        u_long  options;                /* Board options */
                    290:        u_short ctrlun;                 /* boot clun */
                    291:        u_short devlun;                 /* boot dlun */
                    292:        u_short devtype;                /* boot device type */
                    293:        u_short devnum;                 /* boot device number */
                    294:        u_long  opt2;                   /* reserved */
                    295:        u_char  version[4];
                    296:        /* the folowing are CNFG values */
                    297:        u_char  board_serial[12];       /* SBC serial number */
                    298:        u_char  board_id[16];           /* SBC id */
                    299:        u_char  pwa_id[16];             /* printed wiring assembly id */
                    300:        u_char  old_speed[4];           /* old cpu speed field */
                    301:        u_char  etheraddr[6];           /* mac address, all zero if no ether */
                    302:        u_char  fill[2];
                    303:        u_char  scsi_id[2];             /* local SCSI id */
                    304:        u_char  speed[3];               /* cpu speed */
                    305:        u_char  bus_speed[3];           /* pci bus speed */
                    306:        u_char  sys_serial[16];         /* system serial (user)*/
                    307:        u_char  sys_id[31];             /* system id (user)*/
                    308:        u_char  license_id[9];          /* license ID (for AIX)*/
                    309: };
                    310:
                    311: struct mvmeprom_time {
                    312:         u_char year_BCD;
                    313:         u_char month_BCD;
                    314:         u_char day_BCD;
                    315:         u_char wday_BCD;
                    316:         u_char hour_BCD;
                    317:         u_char min_BCD;
                    318:         u_char sec_BCD;
                    319:         u_char cal_BCD;
                    320: };
                    321:
                    322: struct mvmeprom_dskio {
                    323:        u_char  ctrl_lun;
                    324:        u_char  dev_lun;
                    325:        u_short status;
                    326:        void    *pbuffer;
                    327:        u_long  blk_num;
                    328:        u_short blk_cnt;
                    329:        u_char  flag;
                    330: #define BUG_FILE_MARK  0x80
                    331: #define IGNORE_FILENUM 0x02
                    332: #define END_OF_FILE    0x01
                    333:        u_char  addr_mod;
                    334: };
                    335: #define MVMEPROM_BLOCK_SIZE    256
                    336:
                    337: struct mvmeprom_args {
                    338:         u_int  dev_lun;
                    339:         u_int  ctrl_lun;
                    340:         u_int  flags;
                    341:         u_int  ctrl_addr;
                    342:         u_int  entry;
                    343:         u_int  conf_blk;
                    344:         char   *arg_start;
                    345:         char   *arg_end;
                    346:        char    *nbarg_start;
                    347:        char    *nbarg_end;
                    348:        u_int   cputyp;
                    349: };
                    350:
                    351: #endif
                    352:
                    353: #define MVMEPROM_REG_CTRLLUN   "3"
                    354: #define MVMEPROM_REG_DEVLUN    "4"
                    355: #define MVMEPROM_REG_SCSUPP    "5"
                    356: #define MVMEPROM_REG_CTRLADDR  "6"
                    357: #define MVMEPROM_REG_ENTRY     "7"
                    358: #define MVMEPROM_REG_IPA       "8"
                    359: #define MVMEPROM_REG_ARGSTART  "9"
                    360: #define MVMEPROM_REG_ARGEND    "10"
                    361: #define MVMEPROM_REG_NBARGSTART        "11"
                    362: #define MVMEPROM_REG_NBARGEND  "12"
                    363:
                    364: #ifndef RB_NOSYM
                    365: #define RB_NOSYM 0x4000
                    366: #endif
                    367: #endif /* __MACHINE_PROM_H__ */

CVSweb