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 1999-2002 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_LOM_EBUSCODES_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_LOM_EBUSCODES_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate /* 33*7c478bd9Sstevel@tonic-gate * This file enumerates the virtual registers exported by the microcontroller. 34*7c478bd9Sstevel@tonic-gate * It cannot be changed without also revising the firwmare. 35*7c478bd9Sstevel@tonic-gate */ 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 38*7c478bd9Sstevel@tonic-gate extern "C" { 39*7c478bd9Sstevel@tonic-gate #endif 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_GENERIC 0x00 /* generic space */ 42*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE1 0x01 /* space 1 - console buffer or */ 43*7c478bd9Sstevel@tonic-gate /* boot script */ 44*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE2 0x02 /* space 2 - supply rail data */ 45*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE3 0x03 /* space 3 - circuit breaker data */ 46*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE4 0x04 /* space 4 - fan data */ 47*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE5 0x05 /* space 5 - temp/otemp sensor data */ 48*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE6 0x06 /* space 6 - phone-home config */ 49*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_PROGRAM 0x07 /* space 7 - send a program */ 50*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_EEPROM 0x08 /* space 8 - eeprom/event-log access */ 51*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_SELFTEST 0x09 /* space 9 - selftest control */ 52*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_LEDS 0x0a /* space 10 - LED name access */ 53*7c478bd9Sstevel@tonic-gate 54*7c478bd9Sstevel@tonic-gate /* 55*7c478bd9Sstevel@tonic-gate * Read only values 56*7c478bd9Sstevel@tonic-gate */ 57*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FW_REV 0x01 /* Firmware Revision */ 58*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CHECK_HI 0x02 /* Firmware checksum high */ 59*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CHECK_LO 0x03 /* Firmware checksum low */ 60*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN1_SPEED 0x04 /* Fan 1 current speed % of max */ 61*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN2_SPEED 0x05 /* Fan 2 current speed % of max */ 62*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN3_SPEED 0x06 /* Fan 3 current speed % of max */ 63*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN4_SPEED 0x07 /* Fan 4 current speed % of max */ 64*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_PSU1_STAT 0x08 /* PSU 1 status */ 65*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_PSU2_STAT 0x09 /* PSU 2 status */ 66*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_PSU3_STAT 0x0a /* PSU 3 status */ 67*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_STATE_CHNG 0x0b /* State change flags */ 68*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_GPIP 0x0c /* General purpose inputs */ 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate /* RESERVED 0x0d */ 71*7c478bd9Sstevel@tonic-gate /* RESERVED 0x0e */ 72*7c478bd9Sstevel@tonic-gate /* RESERVED 0x0f */ 73*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LOG_START_HI 0x10 /* MSB of start of eventlog in eeprom */ 74*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LOG_START_LO 0x11 /* LSB of start of eventlog in eeprom */ 75*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LOG_PTR_HI 0x12 /* MSB of current position in log */ 76*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LOG_PTR_LO 0x13 /* LSB of current position in log */ 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate /* 79*7c478bd9Sstevel@tonic-gate * We currently don't have a virtual register to indicate the end of the log. 80*7c478bd9Sstevel@tonic-gate * We cannot assume the log runs to the end of the EEPROM because the EEPROM 81*7c478bd9Sstevel@tonic-gate * is logically partitioned into a Log portion (first 8K) and then a FRUID 82*7c478bd9Sstevel@tonic-gate * portion (next 8K). For the moment we therefore need to use a hardcoded 83*7c478bd9Sstevel@tonic-gate * value to represent the end of the event log. 84*7c478bd9Sstevel@tonic-gate */ 85*7c478bd9Sstevel@tonic-gate #define EBUS_LOG_END 0x2000 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_EEPROM_SIZE_KB 0x14 /* Size of eeprom in kilobytes */ 88*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_UNREAD_EVENTS 0x15 /* Number of events (un)read by host */ 89*7c478bd9Sstevel@tonic-gate /* RESERVED 0x16 */ 90*7c478bd9Sstevel@tonic-gate /* RESERVED 0x17 */ 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP1 0x18 /* Temperature sensors */ 93*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP2 0x19 94*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP3 0x1A 95*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP4 0x1B 96*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP5 0x1C 97*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP6 0x1D 98*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP7 0x1E 99*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TEMP8 0x1F 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_ALARMNEW 0x20 102*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SUPPLY_LO 0x21 /* 1 bit per voltage line status */ 103*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SUPPLY_HI 0x22 /* whether faulty or not; 1=>faulty */ 104*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CBREAK_STATUS 0x23 105*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_OTEMP_STATUS 0x24 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED1_STATUS 0x25 108*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED2_STATUS 0x26 109*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED3_STATUS 0x27 110*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED4_STATUS 0x28 111*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED5_STATUS 0x29 112*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED6_STATUS 0x2a 113*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED7_STATUS 0x2b 114*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_LED8_STATUS 0x2c 115*7c478bd9Sstevel@tonic-gate /* RESERVED 0x2d */ 116*7c478bd9Sstevel@tonic-gate 117*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CPU_IDENT 0x2e 118*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_EVENT_DETAIL 0x2f 119*7c478bd9Sstevel@tonic-gate 120*7c478bd9Sstevel@tonic-gate /* 121*7c478bd9Sstevel@tonic-gate * Read/write access registers 122*7c478bd9Sstevel@tonic-gate */ 123*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_ALARM 0x30 /* Alarm control/status */ 124*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_WDOG_CTRL 0x31 /* Watchdog control */ 125*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_WDOG_TIME 0x32 /* Watchdog timeout */ 126*7c478bd9Sstevel@tonic-gate 127*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SER_BAUD 0x33 128*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SER_CHARMODE 0x34 129*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SER_FLOWCTL 0x35 130*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SER_MODEMTYPE 0x36 131*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_EEPROM_PAGESEL 0x37 132*7c478bd9Sstevel@tonic-gate 133*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HNAME_LENGTH 0x38 134*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HNAME_CHAR 0x39 135*7c478bd9Sstevel@tonic-gate 136*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CONFIG_MISC 0x3a /* Host specific configuration */ 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TIME0 0x3b 139*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TIME1 0x3c 140*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TIME2 0x3d 141*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_TIME3 0x3e 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_ESCAPE 0x3f /* Escape character, default '#' */ 144*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_EVENT_CNT 0x40 /* Number of unread (via EBus) events */ 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST0 0x41 147*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST1 0x42 148*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST2 0x43 149*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST3 0x44 150*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST4 0x45 151*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST5 0x46 152*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST6 0x47 153*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SELFTEST7 0x48 154*7c478bd9Sstevel@tonic-gate 155*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_ESCAPE_LEN 0x49 156*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_SER_TIMEOUT 0x4a 157*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_EVENT_FILTER 0x4b 158*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_POWERON_DELAY 0x4c 159*7c478bd9Sstevel@tonic-gate 160*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_BOOTMODE 0x4d /* boot-mode for PROM */ 161*7c478bd9Sstevel@tonic-gate 162*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_I2C_HOLDOFF 0x4e /* hold off i2c bus while obp starts */ 163*7c478bd9Sstevel@tonic-gate /* RESERVED 0x4f */ 164*7c478bd9Sstevel@tonic-gate 165*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID1 0x50 /* Model identifier */ 166*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID2 0x51 167*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID3 0x52 168*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID4 0x53 169*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID5 0x54 170*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID6 0x55 171*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID7 0x56 172*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID8 0x57 173*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID9 0x58 174*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID10 0x59 175*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID11 0x5a 176*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_ID12 0x5b 177*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_MODEL_REV 0x5c /* Model Revision */ 178*7c478bd9Sstevel@tonic-gate 179*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CONFIG 0x5d /* Model specific configuration */ 180*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN1_CAL 0x5e /* Fan 1 calibration value */ 181*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN2_CAL 0x5f /* Fan 2 calibration value */ 182*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN3_CAL 0x60 /* Fan 3 calibration value */ 183*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN4_CAL 0x61 /* Fan 4 calibration value */ 184*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN1_LOW 0x62 /* Fan 1 low limit */ 185*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN2_LOW 0x63 /* Fan 2 low limit */ 186*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN3_LOW 0x64 /* Fan 3 low limit */ 187*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_FAN4_LOW 0x65 /* Fan 4 low limit */ 188*7c478bd9Sstevel@tonic-gate 189*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CONFIG2 0x66 /* Model specific configuration */ 190*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CONFIG3 0x67 /* Model specific configuration */ 191*7c478bd9Sstevel@tonic-gate 192*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HOSTID1 0X68 /* Host ID, MSB */ 193*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HOSTID2 0X69 /* Host ID */ 194*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HOSTID3 0X6a /* Host ID */ 195*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_HOSTID4 0X6b /* Host ID */ 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gate /* RESERVED 0x6c */ 198*7c478bd9Sstevel@tonic-gate /* RESERVED 0x6d */ 199*7c478bd9Sstevel@tonic-gate /* RESERVED 0x6e */ 200*7c478bd9Sstevel@tonic-gate /* RESERVED 0x6f */ 201*7c478bd9Sstevel@tonic-gate /* RESERVED 0x70 */ 202*7c478bd9Sstevel@tonic-gate /* RESERVED 0x71 */ 203*7c478bd9Sstevel@tonic-gate /* RESERVED 0x72 */ 204*7c478bd9Sstevel@tonic-gate /* RESERVED 0x73 */ 205*7c478bd9Sstevel@tonic-gate /* RESERVED 0x74 */ 206*7c478bd9Sstevel@tonic-gate /* RESERVED 0x75 */ 207*7c478bd9Sstevel@tonic-gate /* RESERVED 0x76 */ 208*7c478bd9Sstevel@tonic-gate /* RESERVED 0x77 */ 209*7c478bd9Sstevel@tonic-gate /* RESERVED 0x78 */ 210*7c478bd9Sstevel@tonic-gate /* RESERVED 0x79 */ 211*7c478bd9Sstevel@tonic-gate /* RESERVED 0x7a */ 212*7c478bd9Sstevel@tonic-gate 213*7c478bd9Sstevel@tonic-gate /* 214*7c478bd9Sstevel@tonic-gate * Capability bits: 215*7c478bd9Sstevel@tonic-gate * 216*7c478bd9Sstevel@tonic-gate * Register starting from 0x7e and downward are used to describe various 217*7c478bd9Sstevel@tonic-gate * capabilities that the LOM firmware has. A capability is present if the 218*7c478bd9Sstevel@tonic-gate * corresponding bit returns '1'. 219*7c478bd9Sstevel@tonic-gate */ 220*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CAP2 0x7b /* Capabilities - Read only */ 221*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CAP1 0x7c /* Capabilities - Read only */ 222*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CAP0 0x7d /* Capabilities - Read only */ 223*7c478bd9Sstevel@tonic-gate 224*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_PROBE55 0x7e /* Always returns 0x55 */ 225*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_PROBEAA 0x7f /* Always returns 0xaa */ 226*7c478bd9Sstevel@tonic-gate 227*7c478bd9Sstevel@tonic-gate #define EBUS_FIRST_READONLY EBUS_IDX_FW_REV 228*7c478bd9Sstevel@tonic-gate #define EBUS_LAST_READONLY EBUS_IDX_EVENT_DETAIL 229*7c478bd9Sstevel@tonic-gate #define EBUS_FIRST_MODELLOCKED EBUS_IDX_MODEL_ID1 230*7c478bd9Sstevel@tonic-gate #define EBUS_LAST_MODELLOCKED EBUS_IDX_CONFIG3 231*7c478bd9Sstevel@tonic-gate 232*7c478bd9Sstevel@tonic-gate /* 233*7c478bd9Sstevel@tonic-gate * Register for special address spaces 234*7c478bd9Sstevel@tonic-gate */ 235*7c478bd9Sstevel@tonic-gate #define EBUS_IDX1_CONS_BUF_START 0x00 236*7c478bd9Sstevel@tonic-gate #define EBUS_IDX1_CONS_BUF_END 0xff 237*7c478bd9Sstevel@tonic-gate 238*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_ENABLE_MASK1 0x01 239*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_ENABLE_MASK2 0x02 240*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_FATAL_MASK1 0x03 241*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_FATAL_MASK2 0x04 242*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_FINE_TOL 0x05 243*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_GROSS_TOL 0x06 244*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING1 0x10 245*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING2 0x11 246*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING3 0x12 247*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING4 0x13 248*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING5 0x14 249*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING6 0x15 250*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING7 0x16 251*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING8 0x17 252*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING9 0x18 253*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING10 0x19 254*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING11 0x1a 255*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING12 0x1b 256*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING13 0x1c 257*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING14 0x1d 258*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING15 0x1e 259*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_READING16 0x1f 260*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL1 0x20 261*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL2 0x21 262*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL3 0x22 263*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL4 0x23 264*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL5 0x24 265*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL6 0x25 266*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL7 0x26 267*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL8 0x27 268*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL9 0x28 269*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL10 0x29 270*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL11 0x2a 271*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL12 0x2b 272*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL13 0x2c 273*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL14 0x2d 274*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL15 0x2e 275*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_CAL16 0x2f 276*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_NAME_START 0x40 277*7c478bd9Sstevel@tonic-gate #define EBUS_IDX2_SUPPLY_NAME_END 0xff 278*7c478bd9Sstevel@tonic-gate 279*7c478bd9Sstevel@tonic-gate #define EBUS_IDX3_BREAKER_ENABLE_MASK 0x01 280*7c478bd9Sstevel@tonic-gate #define EBUS_IDX3_BREAKER_NAME_START 0x40 281*7c478bd9Sstevel@tonic-gate #define EBUS_IDX3_BREAKER_NAME_END 0xff 282*7c478bd9Sstevel@tonic-gate 283*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_ENABLE_MASK 0x01 284*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_OTEMP_ENABLE_MASK 0x02 285*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_FATAL_MASK 0x03 286*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_OTEMP_FATAL_MASK 0x04 287*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_HYSTERESIS 0x05 288*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_FAN_LINK_MASK 0x06 289*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN1 0x10 /* Temp warning levels */ 290*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN2 0x11 291*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN3 0x12 292*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN4 0x13 293*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN5 0x14 294*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN6 0x15 295*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN7 0x16 296*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_WARN8 0x17 297*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN1 0x18 /* Temp shutdown levels */ 298*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN2 0x19 299*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN3 0x1a 300*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN4 0x1b 301*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN5 0x1c 302*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN6 0x1d 303*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN7 0x1e 304*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_SDOWN8 0x1f 305*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT1 0x20 /* Temp warning levels */ 306*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT2 0x21 307*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT3 0x22 308*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT4 0x23 309*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT5 0x24 310*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT6 0x25 311*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT7 0x26 312*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_CORRECT8 0x27 313*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_NAME_START 0x40 314*7c478bd9Sstevel@tonic-gate #define EBUS_IDX4_TEMP_NAME_END 0xff 315*7c478bd9Sstevel@tonic-gate 316*7c478bd9Sstevel@tonic-gate #define EBUS_IDX5_FAN_ENABLE_CONFIG 0x01 317*7c478bd9Sstevel@tonic-gate #define EBUS_IDX5_FAN_NAME_START 0x40 318*7c478bd9Sstevel@tonic-gate #define EBUS_IDX5_FAN_NAME_END 0xff 319*7c478bd9Sstevel@tonic-gate 320*7c478bd9Sstevel@tonic-gate #define EBUS_IDX10_LED_NAME_START 0x40 321*7c478bd9Sstevel@tonic-gate #define EBUS_IDX10_LED_NAME_END 0xff 322*7c478bd9Sstevel@tonic-gate 323*7c478bd9Sstevel@tonic-gate /* 324*7c478bd9Sstevel@tonic-gate * This arrangement for CPU signatures allows only one CPU to generate a 325*7c478bd9Sstevel@tonic-gate * CPU Signature at a time. Since the signature won't fit into one byte 326*7c478bd9Sstevel@tonic-gate * it is recommended to datafill the MSB, LSB, STATE, SUBSTATE first, and 327*7c478bd9Sstevel@tonic-gate * then write the ID. A one byte ID limits the number of CPUs to 255. 328*7c478bd9Sstevel@tonic-gate * CPU 255 is handled specially; it denotes that the signature applies to 329*7c478bd9Sstevel@tonic-gate * "all", or rather "any" CPU ID. 330*7c478bd9Sstevel@tonic-gate */ 331*7c478bd9Sstevel@tonic-gate 332*7c478bd9Sstevel@tonic-gate #define EBUS_ANY_CPU_ID 255 333*7c478bd9Sstevel@tonic-gate 334*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_CPU_ID 0x01 /* CPU with signature pending */ 335*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_CPU_SIG_MSB 0x02 /* MSB of sig */ 336*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_CPU_SIG_LSB 0x03 /* LSB of sig */ 337*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_CPU_STATE 0x04 /* state of sig */ 338*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_CPU_SUBSTATE 0x05 /* sub-state of sig */ 339*7c478bd9Sstevel@tonic-gate 340*7c478bd9Sstevel@tonic-gate /* 341*7c478bd9Sstevel@tonic-gate * OBP-defined reset reasons. Solaris never generates these. 342*7c478bd9Sstevel@tonic-gate */ 343*7c478bd9Sstevel@tonic-gate #define EBUS_IDX11_HOST_RESET_REASON 0x07 344*7c478bd9Sstevel@tonic-gate #define RESET_REASON_HOST 0x01 /* host reset itself */ 345*7c478bd9Sstevel@tonic-gate #define RESET_REASON_LOM 0x02 /* lom CLI or SSP request */ 346*7c478bd9Sstevel@tonic-gate #define RESET_REASON_ASR 0x04 /* watchdog or cpusig timeout */ 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate /* 349*7c478bd9Sstevel@tonic-gate * I2C Transfers can be done using the BSC as a proxy. We transfer data at 350*7c478bd9Sstevel@tonic-gate * the conceptual level of struct i2c_transfer defined by the i2c services 351*7c478bd9Sstevel@tonic-gate * framework in Solaris. 352*7c478bd9Sstevel@tonic-gate */ 353*7c478bd9Sstevel@tonic-gate 354*7c478bd9Sstevel@tonic-gate /* 355*7c478bd9Sstevel@tonic-gate * TRANSFER_TYPE mirrors the i2c_transfer.i2c_flags used in Solaris i2c 356*7c478bd9Sstevel@tonic-gate * services framework. 357*7c478bd9Sstevel@tonic-gate */ 358*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_WR 0x01 /* write */ 359*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_RD 0x02 /* read */ 360*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_WR_RD 0x04 /* write then read */ 361*7c478bd9Sstevel@tonic-gate 362*7c478bd9Sstevel@tonic-gate /* 363*7c478bd9Sstevel@tonic-gate * RESULT mirrors the i2c_transfer.i2c_result used the Solaris i2c services 364*7c478bd9Sstevel@tonic-gate * framework. 365*7c478bd9Sstevel@tonic-gate */ 366*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_SUCCESS 0x00 367*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_FAILURE 0xFF 368*7c478bd9Sstevel@tonic-gate #define EBUS_I2C_INCOMPLETE 0xFE 369*7c478bd9Sstevel@tonic-gate 370*7c478bd9Sstevel@tonic-gate 371*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_MAX_TRANSFER_SZ 0x01 372*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_BUS_ADDRESS 0x02 373*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_CLIENT_ADDRESS 0x03 374*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_WR_RD_BOUNDARY 0x04 375*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_TRANSFER_TYPE 0x05 376*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_RESIDUAL_DATA 0x06 377*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_DATA_INOUT 0x07 378*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_RESULT 0x08 379*7c478bd9Sstevel@tonic-gate 380*7c478bd9Sstevel@tonic-gate #define EBUS_IDX12_TRANSACTION_LOCK 0x09 /* 1=> lock out i2c devices */ 381*7c478bd9Sstevel@tonic-gate /* so multi i2c transactions */ 382*7c478bd9Sstevel@tonic-gate /* can complete atomically */ 383*7c478bd9Sstevel@tonic-gate 384*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCSR 0x01 385*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_RSVD 0x00 386*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_READ 0x02 387*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_PRGMODE_ON 0x03 388*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_ERASE 0x04 389*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_PROGRAM 0x05 390*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_PRSVD 0x06 391*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_PRGMODE_OFF 0x07 392*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCR_PROGOFF_JUMPTOADDR 0x08 393*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_SUCCESS 0x00 394*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_PROGRAM_FAIL 0x01 395*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_ERASE_FAIL 0x02 396*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_INVALID_AREA 0x03 397*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_INCORRECT_CSUM 0x04 398*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_INCORRECT_COUNT 0x05 399*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_INVALID_OPERATION 0x06 400*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_STATUS_MASK 0x7f 401*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSR_PROG_MODE 0x80 402*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_DATA 0x02 403*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCSM0 0x03 /* MSB of checksum data */ 404*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PCSM1 0x04 405*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PADR0 0x05 /* MSB of addr */ 406*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PADR1 0x06 407*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PADR2 0x07 408*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PADR3 0x08 409*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSIZ0 0x09 /* MSB of size */ 410*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSIZ1 0x0a 411*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSIZ2 0x0b 412*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PSIZ3 0x0c 413*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PAGE0 0x0d /* MSB of ROM page size */ 414*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PAGE1 0x0e 415*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PAGE2 0x0f 416*7c478bd9Sstevel@tonic-gate #define EBUS_PROGRAM_PAGE3 0x10 417*7c478bd9Sstevel@tonic-gate 418*7c478bd9Sstevel@tonic-gate /* 419*7c478bd9Sstevel@tonic-gate * Command register and codes 420*7c478bd9Sstevel@tonic-gate */ 421*7c478bd9Sstevel@tonic-gate 422*7c478bd9Sstevel@tonic-gate #define EBUS_IDX_CMD_RES 0x00 /* Command/Result register */ 423*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_CODE_CHK 'C' /* Recheck alarm conditions */ 424*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_CODE_CLR 'E' /* Clear event log */ 425*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_UNLOCK1 'M' /* Model Unlock step 1 */ 426*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_UNLOCK2 'u' /* Model Unlock step 2 */ 427*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_POWERINGOFF 'P' /* host sends before powering off */ 428*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_RESETTING 'R' /* host sends before resetting self */ 429*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_CONLOG_ON 'F' 430*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_CONLOG_OFF 'D' 431*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_INTERRUPTS_ON 'i' 432*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_INTERRUPTS_OFF 'I' 433*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_DOG_PAT 'W' /* Host pats it's watchdog */ 434*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_PROG_START 'z' 435*7c478bd9Sstevel@tonic-gate 436*7c478bd9Sstevel@tonic-gate 437*7c478bd9Sstevel@tonic-gate /* 438*7c478bd9Sstevel@tonic-gate * space 11 - CPU signatures and OBP reset information. 439*7c478bd9Sstevel@tonic-gate */ 440*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_CPUSIG 0x0b 441*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE_I2C 0x0c /* space 12 - I2C transfers */ 442*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE13 0x0d 443*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE14 0x0e 444*7c478bd9Sstevel@tonic-gate #define EBUS_CMD_SPACE15 0x0f 445*7c478bd9Sstevel@tonic-gate 446*7c478bd9Sstevel@tonic-gate #define EBUS_MAX_ADDRESS_SPACES 64 /* as defined by the protocol elsewhere */ 447*7c478bd9Sstevel@tonic-gate 448*7c478bd9Sstevel@tonic-gate /* 449*7c478bd9Sstevel@tonic-gate * Number of unread events flag 450*7c478bd9Sstevel@tonic-gate */ 451*7c478bd9Sstevel@tonic-gate #define EBUS_EVENT_CNT_CLEAR 0x80 /* Event log cleared since last read */ 452*7c478bd9Sstevel@tonic-gate 453*7c478bd9Sstevel@tonic-gate /* 454*7c478bd9Sstevel@tonic-gate * Prom boot mode parameters 455*7c478bd9Sstevel@tonic-gate */ 456*7c478bd9Sstevel@tonic-gate #define EBUS_BOOTMODE_FORCE_CONSOLE 0x01 457*7c478bd9Sstevel@tonic-gate #define EBUS_BOOTMODE_FORCE_NOBOOT 0x02 458*7c478bd9Sstevel@tonic-gate #define EBUS_BOOTMODE_RESET_DEFAULT 0x04 459*7c478bd9Sstevel@tonic-gate #define EBUS_BOOTMODE_FULLDIAG 0x08 460*7c478bd9Sstevel@tonic-gate #define EBUS_BOOTMODE_SKIPDIAG 0x10 461*7c478bd9Sstevel@tonic-gate 462*7c478bd9Sstevel@tonic-gate /* 463*7c478bd9Sstevel@tonic-gate * Configuration register 464*7c478bd9Sstevel@tonic-gate */ 465*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_NFAN_DEC(n) (((n)>>5)&0x7) /* Extract no. of fans */ 466*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_NFAN_ENC(n) (((n)&0x7)<<5) /* Insert no. of fans */ 467*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_NPSU_DEC(n) (((n)>>3)&0x3) /* Extract no. of PSUs */ 468*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_NPSU_ENC(n) (((n)&0x3)<<3) /* Insert no. of PSUs */ 469*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_TTY_CON 0x04 /* Set if TTY/LOM switchable */ 470*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_STEADY_LED 0x02 /* Set to stop LED flashing */ 471*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_USER_LOG 0x01 /* log user operations */ 472*7c478bd9Sstevel@tonic-gate 473*7c478bd9Sstevel@tonic-gate /* 474*7c478bd9Sstevel@tonic-gate * Configuration register 2 475*7c478bd9Sstevel@tonic-gate */ 476*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG2_NTEMP_DEC(n) (((n)>>4)&0xf) 477*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG2_NTEMP_ENC(n) (((n)&0xf)<<4) 478*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG2_NSUPPLY_DEC(n) ((n)&0xf) 479*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG2_NSUPPLY_ENC(n) ((n)&0xf) 480*7c478bd9Sstevel@tonic-gate 481*7c478bd9Sstevel@tonic-gate /* 482*7c478bd9Sstevel@tonic-gate * Configuration register 3 483*7c478bd9Sstevel@tonic-gate */ 484*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG3_NOTEMP_DEC(n) (((n)>>4)&0xf) 485*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG3_NOTEMP_ENC(n) (((n)&0xf)<<4) 486*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG3_NBREAKERS_DEC(n) ((n)&0xf) 487*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG3_NBREAKERS_ENC(n) ((n)&0xf) 488*7c478bd9Sstevel@tonic-gate 489*7c478bd9Sstevel@tonic-gate /* 490*7c478bd9Sstevel@tonic-gate * Miscellaneous host configuration register 491*7c478bd9Sstevel@tonic-gate */ 492*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_PSUIPFAILEVENTS 0x80 493*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_DELAYED_STARTUP 0x40 494*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_RANDOM_DELAY 0x20 495*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_DECLINE_STARTUP 0x10 496*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_ALARM0_ENABLED 0x08 497*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_PHONEHOME_ENABLED 0x04 498*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_SECURITY_ENABLED 0x02 499*7c478bd9Sstevel@tonic-gate #define EBUS_CONFIG_MISC_AUTO_CONSOLE 0x01 500*7c478bd9Sstevel@tonic-gate 501*7c478bd9Sstevel@tonic-gate /* 502*7c478bd9Sstevel@tonic-gate * Alarm control/status register 503*7c478bd9Sstevel@tonic-gate */ 504*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_LED_DEC(n) (((n)>>4)&0xf) /* Extract LED Hz */ 505*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_LED_ENC(n) (((n)&0xf)<<4) /* Insert LED Hz */ 506*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_NOEVENTS 0x08 /* No serial event reports */ 507*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_ENABLE3 0x04 /* Alarm 3 enable */ 508*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_ENABLE2 0x02 /* Alarm 2 enable */ 509*7c478bd9Sstevel@tonic-gate #define EBUS_ALARM_ENABLE1 0x01 /* Alarm 1 enable */ 510*7c478bd9Sstevel@tonic-gate 511*7c478bd9Sstevel@tonic-gate /* 512*7c478bd9Sstevel@tonic-gate * General Channel Watchdog control 513*7c478bd9Sstevel@tonic-gate */ 514*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_BREAK_DISABLE 0x10 /* Set if wdog disabled if break seen */ 515*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_AL3_FANPSU 0x08 /* Set if fan/PSU errors set AL3 */ 516*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_AL3_WDOG 0x04 /* Set if wdog timeouts set AL3 */ 517*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_RST 0x02 /* Reset host on expiry */ 518*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_ENABLE 0x01 /* Enable host WDOG */ 519*7c478bd9Sstevel@tonic-gate 520*7c478bd9Sstevel@tonic-gate /* 521*7c478bd9Sstevel@tonic-gate * Watchdog channel non-blocking byte 522*7c478bd9Sstevel@tonic-gate * Top nibble command, bottom nibble data 523*7c478bd9Sstevel@tonic-gate */ 524*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_NB_PAT 0x00 525*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_NB_PAT_SEQ_MASK 0x0F /* Sequence number */ 526*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_NB_CFG 0x10 527*7c478bd9Sstevel@tonic-gate #define EBUS_WDOG_NB_CFG_ENB 0x01 /* enable/disable wdog */ 528*7c478bd9Sstevel@tonic-gate 529*7c478bd9Sstevel@tonic-gate /* 530*7c478bd9Sstevel@tonic-gate * PSU status 531*7c478bd9Sstevel@tonic-gate */ 532*7c478bd9Sstevel@tonic-gate #define EBUS_PSU_INPUTA 0x01 /* Input A OK */ 533*7c478bd9Sstevel@tonic-gate #define EBUS_PSU_INPUTB 0x02 /* Input B OK */ 534*7c478bd9Sstevel@tonic-gate #define EBUS_PSU_OUTPUT 0x04 /* Output OK */ 535*7c478bd9Sstevel@tonic-gate #define EBUS_PSU_PRESENT 0x08 /* PSU is present */ 536*7c478bd9Sstevel@tonic-gate #define EBUS_PSU_STANDBY 0x10 /* PSU is in standby */ 537*7c478bd9Sstevel@tonic-gate 538*7c478bd9Sstevel@tonic-gate /* 539*7c478bd9Sstevel@tonic-gate * State change flags 540*7c478bd9Sstevel@tonic-gate */ 541*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_TEMPERATURE 0x80 /* a temperature was exceeded */ 542*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_RAIL 0x40 /* a supply rail failed */ 543*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_EVENT 0x20 /* An event has been logged */ 544*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_CB 0x10 /* A circuit breaker failed */ 545*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_GP 0x08 /* A GP input has changed */ 546*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_PSU 0x04 /* A PSU state has changed */ 547*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_FAN 0x02 /* A fan speed has changed */ 548*7c478bd9Sstevel@tonic-gate 549*7c478bd9Sstevel@tonic-gate 550*7c478bd9Sstevel@tonic-gate /* 551*7c478bd9Sstevel@tonic-gate * Bit-0 is overloaded. It is used by the BSC to notify of a status change 552*7c478bd9Sstevel@tonic-gate * The detail field will then be one of EBUS_DETAIL_XXXX. Otherwise, it's used 553*7c478bd9Sstevel@tonic-gate * to indicate that an Alarm state has changed. The detail field would then 554*7c478bd9Sstevel@tonic-gate * be the alarm number. 555*7c478bd9Sstevel@tonic-gate */ 556*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_ALARM 0x01 /* An alarm state has changed */ 557*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_NOTIFY 0x01 /* BSC state changes */ 558*7c478bd9Sstevel@tonic-gate 559*7c478bd9Sstevel@tonic-gate /* 560*7c478bd9Sstevel@tonic-gate * State Notify detail values 561*7c478bd9Sstevel@tonic-gate */ 562*7c478bd9Sstevel@tonic-gate #define EBUS_DETAIL_FLASH 0xff /* CSSP going to program BSC */ 563*7c478bd9Sstevel@tonic-gate #define EBUS_DETAIL_RESET 0xfe /* BSC has been reset */ 564*7c478bd9Sstevel@tonic-gate 565*7c478bd9Sstevel@tonic-gate #define EBUS_STATE_MASK 0xff /* All state changes */ 566*7c478bd9Sstevel@tonic-gate 567*7c478bd9Sstevel@tonic-gate /* 568*7c478bd9Sstevel@tonic-gate * Alarm config bytes for register $20 569*7c478bd9Sstevel@tonic-gate */ 570*7c478bd9Sstevel@tonic-gate #define ALARM_0 0x01 571*7c478bd9Sstevel@tonic-gate #define ALARM_0_ENABLE 0x02 572*7c478bd9Sstevel@tonic-gate 573*7c478bd9Sstevel@tonic-gate /* 574*7c478bd9Sstevel@tonic-gate * Phone home configuration information 575*7c478bd9Sstevel@tonic-gate */ 576*7c478bd9Sstevel@tonic-gate #define PHONEHOME_CONFIG_REG 0x01 577*7c478bd9Sstevel@tonic-gate #define PHONEHOME_SCRIPT_START_REG 0x02 578*7c478bd9Sstevel@tonic-gate 579*7c478bd9Sstevel@tonic-gate #define PHONEHOME_CONFIG_ON_UNXPOWEROFF 0x01 580*7c478bd9Sstevel@tonic-gate #define PHONEHOME_CONFIG_ON_WATCHDOGTRG 0x02 581*7c478bd9Sstevel@tonic-gate #define PHONEHOME_CONFIG_ON_DEMAND 0x04 582*7c478bd9Sstevel@tonic-gate 583*7c478bd9Sstevel@tonic-gate /* 584*7c478bd9Sstevel@tonic-gate * CPU type ident codes. This determines the programming mode. 585*7c478bd9Sstevel@tonic-gate */ 586*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_UNKNOWN 0x80 587*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8_3434 0x81 588*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8_3436 0x82 589*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8_3437 0x83 590*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8_3437SF 0x84 591*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8S_2148 0x85 592*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8S_2148A 0x86 593*7c478bd9Sstevel@tonic-gate #define CPU_IDENT_H8S_BSC 0x87 594*7c478bd9Sstevel@tonic-gate 595*7c478bd9Sstevel@tonic-gate /* 596*7c478bd9Sstevel@tonic-gate * Capability codes 597*7c478bd9Sstevel@tonic-gate */ 598*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_ASYNC_DOG 0x01 /* EBUS_CMD_DOGPAT implemented */ 599*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_SYNC_EVENTS 0x02 /* event report at command end */ 600*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_NEW_EVENTLOG_SPACE 0x04 /* new implementation of space8 */ 601*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_NEW_SELFTESTS 0x08 /* new implementation of tests */ 602*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_NEW_PROGRAMMING 0x10 /* new flash programming scheme */ 603*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_LED_INFORMATION 0x20 /* new LED modelling scheme */ 604*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_CPU_SIG 0x40 /* understands CPU signatures */ 605*7c478bd9Sstevel@tonic-gate #define EBUS_CAP0_I2C_PROXY 0x80 /* implements i2c proxy service */ 606*7c478bd9Sstevel@tonic-gate #define EBUS_CAP1_H8_SETS_IDX_TIME 0x01 /* H8 writes IDX_TIME values */ 607*7c478bd9Sstevel@tonic-gate #define EBUS_CAP1_SPACE1_IS_BOOTSCRIPT 0x02 /* SPACE1 used for Boot Script */ 608*7c478bd9Sstevel@tonic-gate #define EBUS_CAP1_FRUID_OFFSET 0x04 /* i2c reads are already offset */ 609*7c478bd9Sstevel@tonic-gate 610*7c478bd9Sstevel@tonic-gate /* Error codes as returned via the EBUS interface */ 611*7c478bd9Sstevel@tonic-gate 612*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NONE 0 /* no error occured */ 613*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOREAD 1 /* this register cannot be read */ 614*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOWRITE 2 /* this register cannot be written */ 615*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_PROTO_CMD 3 /* command sent unexpected */ 616*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_PROTO_DATA 4 /* data sent unexpected */ 617*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_INVALID_BIT 5 /* invalid bit was set in data passed */ 618*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_VALUE_BAD 6 /* data passed was plain bad */ 619*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOX_SPECCMD 7 /* no such special command exists */ 620*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOTUNLOCKED 8 /* need model-lock unlocked to do this */ 621*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_TIMEOUT 9 /* too long between cmd and data */ 622*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_DEVICEFAIL 10 /* Some device (e.g. eeprom) didn't work */ 623*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_STALEDATA 11 /* Data has changed - host must reread */ 624*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOX_DEVICE 12 /* Device doesn't exist */ 625*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_RESETNEEDED 13 /* host must reset the LOM */ 626*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_PROTO_PARAM 14 /* incorrect parameter count for command */ 627*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_PROTO_SEQ 15 /* Sequence number from host incorrect */ 628*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_IN_PROG_MODE 16 /* not supported in programming mode */ 629*7c478bd9Sstevel@tonic-gate #define EBUS_ERROR_NOT_PROG_MODE 17 /* must be in prog mode first */ 630*7c478bd9Sstevel@tonic-gate 631*7c478bd9Sstevel@tonic-gate /* Magic values for specific registers. */ 632*7c478bd9Sstevel@tonic-gate #define LOM_TEMP_MAX_VALUE 0x7c 633*7c478bd9Sstevel@tonic-gate #define LOM_TEMP_STATE_INACCESSIBLE 0x7d /* can't tell - i2c faulted */ 634*7c478bd9Sstevel@tonic-gate #define LOM_TEMP_STATE_STANDBY 0x7e /* standby mode */ 635*7c478bd9Sstevel@tonic-gate #define LOM_TEMP_STATE_NOT_PRESENT 0x7f /* not fitted/present */ 636*7c478bd9Sstevel@tonic-gate 637*7c478bd9Sstevel@tonic-gate #define LOM_FAN_MAX_SPEED 0xfb /* protects folllowing special cases */ 638*7c478bd9Sstevel@tonic-gate #define LOM_FAN_RECOUNT 0xfc /* last access failed */ 639*7c478bd9Sstevel@tonic-gate #define LOM_FAN_NOACCESS 0xfd /* can't tell - i2c/lm80 faulted */ 640*7c478bd9Sstevel@tonic-gate #define LOM_FAN_STANDBY 0xfe /* standby mode */ 641*7c478bd9Sstevel@tonic-gate #define LOM_FAN_NOT_PRESENT 0xff /* no fan fitted */ 642*7c478bd9Sstevel@tonic-gate 643*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 644*7c478bd9Sstevel@tonic-gate } 645*7c478bd9Sstevel@tonic-gate #endif 646*7c478bd9Sstevel@tonic-gate 647*7c478bd9Sstevel@tonic-gate #endif /* _SYS_LOM_EBUSCODES_H */ 648