1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 1991-2003 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_OBPDEFS_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_OBPDEFS_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate #define OBP_PSEUDO_ROMVEC_VERSION 5555 37*7c478bd9Sstevel@tonic-gate 38*7c478bd9Sstevel@tonic-gate typedef int ihandle_t; 39*7c478bd9Sstevel@tonic-gate typedef int phandle_t; 40*7c478bd9Sstevel@tonic-gate typedef phandle_t dnode_t; 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate /* 43*7c478bd9Sstevel@tonic-gate * Device type matching 44*7c478bd9Sstevel@tonic-gate */ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate #define OBP_NONODE ((dnode_t)0) 47*7c478bd9Sstevel@tonic-gate #define OBP_BADNODE ((dnode_t)-1) 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gate /* 50*7c478bd9Sstevel@tonic-gate * Property Defines 51*7c478bd9Sstevel@tonic-gate */ 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate #define OBP_NAME "name" 54*7c478bd9Sstevel@tonic-gate #define OBP_REG "reg" 55*7c478bd9Sstevel@tonic-gate #define OBP_INTR "intr" 56*7c478bd9Sstevel@tonic-gate #define OBP_RANGES "ranges" 57*7c478bd9Sstevel@tonic-gate #define OBP_INTERRUPTS "interrupts" 58*7c478bd9Sstevel@tonic-gate #define OBP_COMPATIBLE "compatible" 59*7c478bd9Sstevel@tonic-gate #define OBP_STATUS "status" 60*7c478bd9Sstevel@tonic-gate #define OBP_BOARDNUM "board#" 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate #define OBP_MAC_ADDR "mac-address" 63*7c478bd9Sstevel@tonic-gate #define OBP_STDINPATH "stdin-path" 64*7c478bd9Sstevel@tonic-gate #define OBP_STDOUTPATH "stdout-path" 65*7c478bd9Sstevel@tonic-gate #define OBP_IDPROM "idprom" 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate #define OBP_DEVICETYPE "device_type" 68*7c478bd9Sstevel@tonic-gate #define OBP_DISPLAY "display" 69*7c478bd9Sstevel@tonic-gate #define OBP_NETWORK "network" 70*7c478bd9Sstevel@tonic-gate #define OBP_BYTE "byte" 71*7c478bd9Sstevel@tonic-gate #define OBP_BLOCK "block" 72*7c478bd9Sstevel@tonic-gate #define OBP_SERIAL "serial" 73*7c478bd9Sstevel@tonic-gate #define OBP_HIERARCHICAL "hierarchical" 74*7c478bd9Sstevel@tonic-gate #define OBP_IPI "ipi3" 75*7c478bd9Sstevel@tonic-gate #define OBP_CPU "cpu" 76*7c478bd9Sstevel@tonic-gate #define OBP_ADDRESS "address" 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate /* 79*7c478bd9Sstevel@tonic-gate * OBP status values defines 80*7c478bd9Sstevel@tonic-gate */ 81*7c478bd9Sstevel@tonic-gate #define OBP_ST_OKAY "okay" 82*7c478bd9Sstevel@tonic-gate #define OBP_ST_DISABLED "disabled" 83*7c478bd9Sstevel@tonic-gate #define OBP_ST_FAIL "fail" 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate /* 86*7c478bd9Sstevel@tonic-gate * Max size of a path component and a property name (not value) 87*7c478bd9Sstevel@tonic-gate * These are standard definitions. 88*7c478bd9Sstevel@tonic-gate */ 89*7c478bd9Sstevel@tonic-gate #define OBP_MAXDRVNAME 32 /* defined in P1275 */ 90*7c478bd9Sstevel@tonic-gate #define OBP_MAXPROPNAME 32 /* defined in P1275 */ 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate /* 93*7c478bd9Sstevel@tonic-gate * NB: Max pathname length is a platform-dependent parameter. 94*7c478bd9Sstevel@tonic-gate * Also note that this parameter is used to define the crpconfig 95*7c478bd9Sstevel@tonic-gate * structure in cpr.h. The cprconfig structure is currently 96*7c478bd9Sstevel@tonic-gate * consumed by other consolidations. Care should be take before 97*7c478bd9Sstevel@tonic-gate * changing this parameter value. 98*7c478bd9Sstevel@tonic-gate */ 99*7c478bd9Sstevel@tonic-gate #define OBP_MAXPATHLEN 256 /* Platform dependent */ 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate /* 102*7c478bd9Sstevel@tonic-gate * Every OBP node must have a `/' followed by at least 2 chars, 103*7c478bd9Sstevel@tonic-gate * so we can deduce the maxdepth of any OBP tree to be 104*7c478bd9Sstevel@tonic-gate * OBP_MAXPATHNAME/3. This is a good first swag. 105*7c478bd9Sstevel@tonic-gate */ 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate #define OBP_STACKDEPTH (OBP_MAXPATHLEN/3) 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate #define ROMVEC_BLKSIZE 512 /* XXX */ 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate /* 112*7c478bd9Sstevel@tonic-gate * OBP Module mailbox messages for MP's 113*7c478bd9Sstevel@tonic-gate * 114*7c478bd9Sstevel@tonic-gate * 00..7F : power-on self test 115*7c478bd9Sstevel@tonic-gate * 116*7c478bd9Sstevel@tonic-gate * 80..8F : active in boot prom (at the "ok" prompt) 117*7c478bd9Sstevel@tonic-gate * 118*7c478bd9Sstevel@tonic-gate * 90..EF : idle in boot prom 119*7c478bd9Sstevel@tonic-gate * 120*7c478bd9Sstevel@tonic-gate * F0 : active in application 121*7c478bd9Sstevel@tonic-gate * 122*7c478bd9Sstevel@tonic-gate * F1..FA : reserved for future use 123*7c478bd9Sstevel@tonic-gate * 124*7c478bd9Sstevel@tonic-gate * FB : One processor exited to the PROM via op_exit(), 125*7c478bd9Sstevel@tonic-gate * call to prom_stopcpu() requested. 126*7c478bd9Sstevel@tonic-gate * 127*7c478bd9Sstevel@tonic-gate * FC : One processor entered the PROM via op_enter(), 128*7c478bd9Sstevel@tonic-gate * call to prom_idlecpu() requested. 129*7c478bd9Sstevel@tonic-gate * 130*7c478bd9Sstevel@tonic-gate * FD : One processor hit a BREAKPOINT, 131*7c478bd9Sstevel@tonic-gate * call to prom_idlecpu() requested. 132*7c478bd9Sstevel@tonic-gate * 133*7c478bd9Sstevel@tonic-gate * FE : One processor got a WATCHDOG RESET 134*7c478bd9Sstevel@tonic-gate * call to prom_stopcpu() requested. 135*7c478bd9Sstevel@tonic-gate * 136*7c478bd9Sstevel@tonic-gate * FF : This processor not available. 137*7c478bd9Sstevel@tonic-gate * 138*7c478bd9Sstevel@tonic-gate */ 139*7c478bd9Sstevel@tonic-gate 140*7c478bd9Sstevel@tonic-gate #define OBP_MB_IDLE_LOW ((unsigned char)(0x90)) 141*7c478bd9Sstevel@tonic-gate #define OBP_MB_IDLE_HIGH ((unsigned char)(0xef)) 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate #define OBP_MB_IS_IDLE(s) (((s) >= OBP_MB_IDLE_LOW) && \ 144*7c478bd9Sstevel@tonic-gate ((s) <= OBP_MB_IDLE_HIGH)) 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate #define OBP_MB_ACTIVE ((unsigned char)(0xf0)) 147*7c478bd9Sstevel@tonic-gate #define OBP_MB_EXIT_STOP ((unsigned char)(0xfb)) 148*7c478bd9Sstevel@tonic-gate #define OBP_MB_ENTER_IDLE ((unsigned char)(0xfc)) 149*7c478bd9Sstevel@tonic-gate #define OBP_MB_BRKPT_IDLE ((unsigned char)(0xfd)) 150*7c478bd9Sstevel@tonic-gate #define OBP_MB_WATCHDOG_STOP ((unsigned char)(0xfe)) 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate /* 153*7c478bd9Sstevel@tonic-gate * The possible values for "*romp->v_insource" and "*romp->v_outsink" are 154*7c478bd9Sstevel@tonic-gate * listed below. These may be extended in the future. Your program should 155*7c478bd9Sstevel@tonic-gate * cope with this gracefully (e.g. by continuing to vector through the ROM 156*7c478bd9Sstevel@tonic-gate * I/O routines if these are set in a way you don't understand). 157*7c478bd9Sstevel@tonic-gate */ 158*7c478bd9Sstevel@tonic-gate #define INKEYB 0 /* Input from parallel keyboard. */ 159*7c478bd9Sstevel@tonic-gate #define INUARTA 1 /* Input or output to Uart A. */ 160*7c478bd9Sstevel@tonic-gate #define INUARTB 2 /* Input or output to Uart B. */ 161*7c478bd9Sstevel@tonic-gate #define INUARTC 3 /* Input or output to Uart C. */ 162*7c478bd9Sstevel@tonic-gate #define INUARTD 4 /* Input or output to Uart D. */ 163*7c478bd9Sstevel@tonic-gate #define OUTSCREEN 0 /* Output to frame buffer. */ 164*7c478bd9Sstevel@tonic-gate #define OUTUARTA 1 /* Input or output to Uart A. */ 165*7c478bd9Sstevel@tonic-gate #define OUTUARTB 2 /* Input or output to Uart B. */ 166*7c478bd9Sstevel@tonic-gate #define OUTUARTC 3 /* Input or output to Uart C. */ 167*7c478bd9Sstevel@tonic-gate #define OUTUARTD 4 /* Input or output to Uart D. */ 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gate /* 170*7c478bd9Sstevel@tonic-gate * Structure set up by the boot command to pass arguments to the booted 171*7c478bd9Sstevel@tonic-gate * program. 172*7c478bd9Sstevel@tonic-gate */ 173*7c478bd9Sstevel@tonic-gate struct bootparam { 174*7c478bd9Sstevel@tonic-gate char *bp_argv[8]; /* String arguments. */ 175*7c478bd9Sstevel@tonic-gate char bp_strings[100]; /* String table for string arguments. */ 176*7c478bd9Sstevel@tonic-gate char bp_dev[2]; /* Device name. */ 177*7c478bd9Sstevel@tonic-gate int bp_ctlr; /* Controller Number. */ 178*7c478bd9Sstevel@tonic-gate int bp_unit; /* Unit Number. */ 179*7c478bd9Sstevel@tonic-gate int bp_part; /* Partition/file Number. */ 180*7c478bd9Sstevel@tonic-gate char *bp_name; /* File name. Points into "bp_strings" */ 181*7c478bd9Sstevel@tonic-gate struct boottab *bp_boottab; /* Points to table entry for device */ 182*7c478bd9Sstevel@tonic-gate }; 183*7c478bd9Sstevel@tonic-gate 184*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 185*7c478bd9Sstevel@tonic-gate } 186*7c478bd9Sstevel@tonic-gate #endif 187*7c478bd9Sstevel@tonic-gate 188*7c478bd9Sstevel@tonic-gate #endif /* _SYS_OBPDEFS_H */ 189