4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_LOM_PRIV_H
28 #define _SYS_LOM_PRIV_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Project private LOMlite definitions.
34 * The definitions here are not used by the end user.
43 #include <sys/cpu_sgnblk_defs.h>
48 * Data structures which are passed to the driver via the LOMIOCPROG ioctl.
50 * The userland utility constructs an image which begins with a
51 * lom_prog_data_t structure and is followed by platform specific data
52 * the contents of which are identified by the 'platmagic' value.
63 /* Platform specific */
73 * header.magic value - this is chosen because it never occurs on the old
80 * Top two bytes assigned to specific lom implementations/platform
81 * Bottom two bytes assigned by the implementations/platform.
83 * 0x4c56 "LV" - bscv and derivatives.
84 * 0x4c564c4f "LVLO" - firmware downloader.
85 * 0x4c56494d "LVIM" - firmware image.
86 * 0x5347 "SG" - serengeti based lom.
90 #define PROG_PLAT_BSCV_LOADER 0x4c564c4f
91 #define PROG_PLAT_BSCV_IMAGE 0x4c56494d
92 #define PROG_PLAT_SG_IMAGE 0x5347494d
94 /* defn for top byte of 16bit event code */
95 #define EVENT_SUBSYS_NONE 0x00
96 #define EVENT_SUBSYS_ALARM 0x01
97 #define EVENT_SUBSYS_TEMP 0x02
98 #define EVENT_SUBSYS_OVERTEMP 0x03
99 #define EVENT_SUBSYS_FAN 0x04
100 #define EVENT_SUBSYS_SUPPLY 0x05
101 #define EVENT_SUBSYS_BREAKER 0x06
102 #define EVENT_SUBSYS_PSU 0x07
103 #define EVENT_SUBSYS_USER 0x08
104 #define EVENT_SUBSYS_PHONEHOME 0x09
105 #define EVENT_SUBSYS_LOM 0x0a
106 #define EVENT_SUBSYS_HOST 0x0b
107 #define EVENT_SUBSYS_EVENTLOG 0x0c
108 #define EVENT_SUBSYS_EXTRA 0x0d /* reserved for future use */
109 #define EVENT_SUBSYS_LED 0x0e
111 #define EVENT_MASK_SHUTDOWN_REQD 0x20
112 #define EVENT_MASK_FAULT 0x40
113 #define EVENT_MASK_FATAL 0x80
116 #define EVENT_NONE 0x00
117 #define EVENT_STATE_ON 0x01
118 #define EVENT_STATE_OFF 0x02
119 #define EVENT_STATE_CHANGE 0x03
120 #define EVENT_POWER_ON 0x04
121 #define EVENT_POWER_OFF 0x05
122 #define EVENT_UNEXPECTED_POWER_OFF 0x06
123 #define EVENT_UNEXPECTED_RESET 0x07
124 #define EVENT_BOOTED 0x08
125 #define EVENT_WATCHDOG_ON 0x09
126 #define EVENT_WATCHDOG_OFF 0x0a
127 #define EVENT_WATCHDOG_TRIGGER 0x0b
128 #define EVENT_FAILED 0x0c
129 #define EVENT_RECOVERED 0x0d
130 #define EVENT_RESET 0x0e
131 #define EVENT_ABORT 0x0f
132 #define EVENT_CONSOLE_SELECT 0x10
133 #define EVENT_TIME_REFERENCE 0x11
134 #define EVENT_SCRIPT_FAILURE 0x12
135 #define EVENT_MODEM_ACCESS_FAIL 0x13
136 #define EVENT_MODEM_DIAL_FAIL 0x14
137 #define EVENT_BAD_CHECKSUM 0x15
138 #define EVENT_USER_ADDED 0x16
139 #define EVENT_USER_REMOVED 0x17
140 #define EVENT_USER_PERMSCHANGED 0x18
141 #define EVENT_USER_LOGIN 0x19
142 #define EVENT_USER_PASSWORD_CHANGE 0x1a
143 #define EVENT_USER_LOGINFAIL 0x1b
144 #define EVENT_USER_LOGOUT 0x1c
145 #define EVENT_FLASH_DOWNLOAD 0x1d
146 #define EVENT_DATA_LOST 0x1e
147 #define EVENT_DEVICE_BUSY 0x1f
148 #define EVENT_FAULT_LED 0x20
149 #define EVENT_OVERHEAT 0x21
150 #define EVENT_SEVERE_OVERHEAT 0x22
151 #define EVENT_NO_OVERHEAT 0x23
152 #define EVENT_SCC_STATUS 0x24
154 #define EVENT_DEVICE_INACCESSIBLE 0x25
155 #define EVENT_HOSTNAME_CHANGE 0x26
156 #define EVENT_CPUSIG_TIMEOUT 0x27
157 #define EVENT_BOOTMODE_CHANGE 0x28
158 #define EVENT_WATCHDOG_CHANGE_POLICY 0x29
159 #define EVENT_WATCHDOG_CHANGE_TIMEOUT 0x2a
162 * Event "detail" information - bscv only
164 #define LOM_RESET_DETAIL_BYUSER 1
165 #define LOM_RESET_DETAIL_REPROGRAMMING 2
167 #define LOM_WDOGTRIGGER_DETAIL_HARD 0
168 #define LOM_WDOGTRIGGER_DETAIL_SOFT 1
170 #define LOM_UNEXPECTEDRESET_MASK_BADTRAP 0x80
171 #define EBUS_BOOTMODE_FORCE_CONSOLE 0x01
174 * Event log filtering
176 #define EVENT_LEVEL_USER 4
177 #define EVENT_LEVEL_NOTICE 3
178 #define EVENT_LEVEL_FAULT 2
179 #define EVENT_LEVEL_FATAL 1
193 #define EVENT_DECODE_SUBSYS(evcode) ((evcode) & 0x1f)
194 #define EVENT_DECODE_FAULT(evcode) ((evcode) & (EVENT_MASK_FAULT| \
196 EVENT_MASK_SHUTDOWN_REQD))
198 /* Magic numbers for reading values from conf files */
199 #define LOM_TEMP_PROP_NOT_SET 0x80000000 /* Use current setting */
200 #define LOM_TEMP_PROP_MIN 40 /* Minimum temp settable */
201 #define LOM_TEMP_PROP_MAX 120 /* Maximum temp settable */
203 #define LOM_SERIAL_TOUT_DEFAULT 0 /* Default value */
204 #define LOM_SERIAL_TOUT_MIN 5 /* Minimum timeout period */
205 #define LOM_SERIAL_TOUT_MAX 0xff /* Maximum timeout period */
208 /* Inter Driver Interface */
210 #define SUNW_KERN_BSCV_MODULENAME "bscv"
211 #define SUNW_KERN_BSCV_IDI_FN "bscv_idi_set"
225 sig_state_t sig_info
;
232 * Enable the watchdog. This must be done before patting is done.
237 * wdog_timeout_s seconds before watchdog expires; minimum
238 * value is 1, maximum value is 127. The dog must be patted
241 uint_t wdog_timeout_s
;
244 * reset_system_on_timeout false means the microcontroller will only
245 * log the fact that the watchdog expired, rather than actually
246 * resetting the host.
248 uint8_t reset_system_on_timeout
;
252 struct bscv_idi_info
{
253 enum bscv_idi_type type
;
258 void bscv_idi_set(struct bscv_idi_info info
);
266 #endif /* _SYS_LOM_PRIV_H */