xref: /titanic_50/usr/src/uts/sun4u/sys/sbd_ioctl.h (revision 694c35faa87b858ecdadfe4fc592615f4eefbb07)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SBD_IOCTL_H
27 #define	_SBD_IOCTL_H
28 
29 #ifndef	_ASM
30 #include <sys/types.h>
31 #include <sys/obpdefs.h>
32 #include <sys/processor.h>
33 #include <sys/param.h>
34 #endif
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #ifndef	_ASM
41 typedef enum {
42 	SBD_COMP_NONE,
43 	SBD_COMP_CPU,
44 	SBD_COMP_MEM,
45 	SBD_COMP_IO,
46 	SBD_COMP_CMP,
47 	SBD_COMP_UNKNOWN
48 } sbd_comp_type_t;
49 
50 typedef enum {
51 	SBD_STAT_NONE = 0,
52 	SBD_STAT_EMPTY,
53 	SBD_STAT_DISCONNECTED,
54 	SBD_STAT_CONNECTED,
55 	SBD_STAT_UNCONFIGURED,
56 	SBD_STAT_CONFIGURED
57 } sbd_state_t;
58 
59 typedef enum {
60 	SBD_COND_UNKNOWN = 0,
61 	SBD_COND_OK,
62 	SBD_COND_FAILING,
63 	SBD_COND_FAILED,
64 	SBD_COND_UNUSABLE
65 } sbd_cond_t;
66 
67 typedef	int	sbd_busy_t;
68 
69 #define	SBD_MAX_UNSAFE		16
70 #define	SBD_TYPE_LEN		12
71 #define	SBD_NULL_UNIT		-1
72 
73 typedef struct {
74 	sbd_comp_type_t	c_type;
75 	int		c_unit;
76 	char		c_name[OBP_MAXPROPNAME];
77 } sbd_comp_id_t;
78 
79 typedef struct {
80 	sbd_comp_id_t	c_id;
81 	sbd_state_t	c_ostate;
82 	sbd_cond_t	c_cond;
83 	sbd_busy_t	c_busy;
84 	uint_t		c_sflags;
85 	time_t		c_time;
86 } sbd_cm_stat_t;
87 
88 #define	ci_type		c_id.c_type
89 #define	ci_unit		c_id.c_unit
90 #define	ci_name		c_id.c_name
91 
92 typedef struct {
93 	sbd_cm_stat_t	cs_cm;
94 	int		cs_isbootproc;
95 	processorid_t	cs_cpuid;
96 	int		cs_speed;
97 	int		cs_ecache;
98 } sbd_cpu_stat_t;
99 
100 #define	cs_type		cs_cm.ci_type
101 #define	cs_unit		cs_cm.ci_unit
102 #define	cs_name		cs_cm.ci_name
103 #define	cs_ostate	cs_cm.c_ostate
104 #define	cs_cond		cs_cm.c_cond
105 #define	cs_busy		cs_cm.c_busy
106 #define	cs_suspend	cs_cm.c_sflags
107 #define	cs_time		cs_cm.c_time
108 
109 typedef struct {
110 	sbd_cm_stat_t	ms_cm;
111 	int		ms_interleave;
112 	pfn_t		ms_basepfn;
113 	pgcnt_t		ms_totpages;
114 	pgcnt_t		ms_detpages;
115 	pgcnt_t		ms_pageslost;
116 	pgcnt_t		ms_managed_pages;
117 	pgcnt_t		ms_noreloc_pages;
118 	pgcnt_t		ms_noreloc_first;
119 	pgcnt_t		ms_noreloc_last;
120 	int		ms_cage_enabled;
121 	int		ms_peer_is_target;	/* else peer is source */
122 	char		ms_peer_ap_id[MAXPATHLEN];	/* board's AP name */
123 } sbd_mem_stat_t;
124 
125 #define	ms_type		ms_cm.ci_type
126 #define	ms_unit		ms_cm.ci_unit
127 #define	ms_name		ms_cm.ci_name
128 #define	ms_ostate	ms_cm.c_ostate
129 #define	ms_cond		ms_cm.c_cond
130 #define	ms_busy		ms_cm.c_busy
131 #define	ms_suspend	ms_cm.c_sflags
132 #define	ms_time		ms_cm.c_time
133 
134 typedef struct {
135 	sbd_cm_stat_t	is_cm;
136 	int		is_referenced;
137 	int		is_unsafe_count;
138 	int		is_unsafe_list[SBD_MAX_UNSAFE];
139 	char		is_pathname[MAXPATHLEN];
140 } sbd_io_stat_t;
141 
142 #define	is_type		is_cm.ci_type
143 #define	is_unit		is_cm.ci_unit
144 #define	is_name		is_cm.ci_name
145 #define	is_ostate	is_cm.c_ostate
146 #define	is_cond		is_cm.c_cond
147 #define	is_busy		is_cm.c_busy
148 #define	is_suspend	is_cm.c_sflags
149 #define	is_time		is_cm.c_time
150 
151 /* This constant must be the max of the max cores on all platforms */
152 
153 #define	SBD_MAX_CORES_PER_CMP	8
154 
155 typedef struct {
156 	sbd_cm_stat_t	ps_cm;
157 	processorid_t	ps_cpuid[SBD_MAX_CORES_PER_CMP];
158 	int		ps_ncores;
159 	int		ps_speed;
160 	int		ps_ecache;
161 } sbd_cmp_stat_t;
162 
163 #define	ps_type		ps_cm.ci_type
164 #define	ps_unit		ps_cm.ci_unit
165 #define	ps_name		ps_cm.ci_name
166 #define	ps_ostate	ps_cm.c_ostate
167 #define	ps_cond		ps_cm.c_cond
168 #define	ps_busy		ps_cm.c_busy
169 #define	ps_suspend	ps_cm.c_sflags
170 #define	ps_time		ps_cm.c_time
171 
172 typedef union {
173 	sbd_cm_stat_t	d_cm;
174 	sbd_cpu_stat_t	d_cpu;
175 	sbd_mem_stat_t	d_mem;
176 	sbd_io_stat_t	d_io;
177 	sbd_cmp_stat_t	d_cmp;
178 } sbd_dev_stat_t;
179 
180 #define	ds_type		d_cm.ci_type
181 #define	ds_unit		d_cm.ci_unit
182 #define	ds_name		d_cm.ci_name
183 #define	ds_ostate	d_cm.c_ostate
184 #define	ds_cond		d_cm.c_cond
185 #define	ds_busy		d_cm.c_busy
186 #define	ds_suspend	d_cm.c_sflags
187 #define	ds_time		d_cm.c_time
188 
189 #define	SBD_MAX_INFO	64
190 
191 typedef struct {
192 	int		s_board;
193 	char		s_type[SBD_TYPE_LEN];
194 	char		s_info[SBD_MAX_INFO];
195 	sbd_state_t	s_rstate;
196 	sbd_state_t	s_ostate;
197 	sbd_cond_t	s_cond;
198 	sbd_busy_t	s_busy;
199 	time_t		s_time;
200 	uint_t		s_power:1;
201 	uint_t		s_assigned:1;
202 	uint_t		s_platopts;
203 	int		s_nstat;
204 	sbd_dev_stat_t	s_stat[1];
205 } sbd_stat_t;
206 
207 typedef struct {
208 	sbd_comp_id_t	c_id;
209 	uint_t		c_flags;
210 	int		c_len;
211 	caddr_t		c_opts;
212 } sbd_cm_cmd_t;
213 
214 typedef struct {
215 	sbd_cm_cmd_t	g_cm;
216 	int		g_ncm;
217 } sbd_getncm_cmd_t;
218 
219 typedef struct {
220 	sbd_cm_cmd_t	s_cm;
221 	int		s_nbytes;
222 	caddr_t		s_statp;
223 } sbd_stat_cmd_t;
224 
225 typedef union {
226 	sbd_cm_cmd_t		cmd_cm;
227 	sbd_getncm_cmd_t	cmd_getncm;
228 	sbd_stat_cmd_t		cmd_stat;
229 } sbd_cmd_t;
230 
231 typedef struct {
232 	int		e_code;
233 	char		e_rsc[MAXPATHLEN];
234 } sbd_error_t;
235 
236 typedef struct {
237 	sbd_cmd_t	i_cmd;
238 	sbd_error_t	i_err;
239 } sbd_ioctl_arg_t;
240 
241 typedef struct {
242 	int		t_base;
243 	int		t_bnd;
244 	char		**t_text;
245 } sbd_etab_t;
246 
247 #define	i_flags		i_cmd.cmd_cm.c_flags
248 #define	i_len		i_cmd.cmd_cm.c_len
249 #define	i_opts		i_cmd.cmd_cm.c_opts
250 #define	ic_type		i_cmd.cmd_cm.ci_type
251 #define	ic_name		i_cmd.cmd_cm.ci_name
252 #define	ic_unit		i_cmd.cmd_cm.ci_unit
253 #define	ie_code		i_err.e_code
254 #define	ie_rsc		i_err.e_rsc
255 
256 #define	_SBD_IOC		(('D' << 16) | ('R' << 8))
257 
258 #define	SBD_CMD_ASSIGN		(_SBD_IOC | 0x01)
259 #define	SBD_CMD_UNASSIGN	(_SBD_IOC | 0x02)
260 #define	SBD_CMD_POWERON		(_SBD_IOC | 0x03)
261 #define	SBD_CMD_POWEROFF	(_SBD_IOC | 0x04)
262 #define	SBD_CMD_TEST		(_SBD_IOC | 0x05)
263 #define	SBD_CMD_CONNECT		(_SBD_IOC | 0x06)
264 #define	SBD_CMD_CONFIGURE	(_SBD_IOC | 0x07)
265 #define	SBD_CMD_UNCONFIGURE	(_SBD_IOC | 0x08)
266 #define	SBD_CMD_DISCONNECT	(_SBD_IOC | 0x09)
267 #define	SBD_CMD_STATUS		(_SBD_IOC | 0x0a)
268 #define	SBD_CMD_GETNCM		(_SBD_IOC | 0x0b)
269 #define	SBD_CMD_PASSTHRU	(_SBD_IOC | 0x0c)
270 
271 #define	SBD_CHECK_SUSPEND(cmd, c_sflags) \
272 		(((c_sflags) >> (((cmd) & 0xf) - 1)) & 0x01)
273 
274 #define	SBD_SET_SUSPEND(cmd, c_sflags) \
275 		((c_sflags) |= (0x01 << (((cmd) & 0xf) - 1)))
276 
277 #define	SBD_CHECK_PLATOPTS(cmd, c_platopts) \
278 		(((c_platopts) >> (((cmd) & 0xf) - 1)) & 0x01)
279 
280 #define	SBD_SET_PLATOPTS(cmd, c_platopts) \
281 		((c_platopts) &= ~(0x01 << (((cmd) & 0xf) - 1)))
282 
283 #define	SBD_FLAG_FORCE		0x1
284 #define	SBD_FLAG_ALLCMP		0x2
285 #define	SBD_FLAG_QUIESCE_OKAY	0x4
286 
287 #if defined(_SYSCALL32)
288 
289 typedef struct {
290 	int32_t		c_type;
291 	int32_t		c_unit;
292 	char		c_name[OBP_MAXPROPNAME];
293 } sbd_comp_id32_t;
294 
295 typedef struct {
296 	sbd_comp_id32_t	c_id;
297 	int32_t		c_ostate;
298 	int32_t		c_cond;
299 	int32_t		c_busy;
300 	uint32_t	c_sflags;
301 	time32_t	c_time;
302 } sbd_cm_stat32_t;
303 
304 typedef struct {
305 	sbd_cm_stat32_t	cs_cm;
306 	int32_t		cs_isbootproc;
307 	int32_t		cs_cpuid;
308 	int32_t		cs_speed;
309 	int32_t		cs_ecache;
310 } sbd_cpu_stat32_t;
311 
312 typedef struct {
313 	sbd_cm_stat32_t	ms_cm;
314 	int32_t		ms_interleave;
315 	uint32_t	ms_basepfn;
316 	uint32_t	ms_totpages;
317 	uint32_t	ms_detpages;
318 	int32_t		ms_pageslost;
319 	uint32_t	ms_managed_pages;
320 	uint32_t	ms_noreloc_pages;
321 	uint32_t	ms_noreloc_first;
322 	uint32_t	ms_noreloc_last;
323 	int32_t		ms_cage_enabled;
324 	int32_t		ms_peer_is_target;
325 	char		ms_peer_ap_id[MAXPATHLEN];
326 } sbd_mem_stat32_t;
327 
328 typedef struct {
329 	sbd_cm_stat32_t	is_cm;
330 	int32_t		is_referenced;
331 	int32_t		is_unsafe_count;
332 	int32_t		is_unsafe_list[SBD_MAX_UNSAFE];
333 	char		is_pathname[MAXPATHLEN];
334 } sbd_io_stat32_t;
335 
336 typedef struct {
337 	sbd_cm_stat32_t	ps_cm;
338 	int32_t		ps_cpuid[SBD_MAX_CORES_PER_CMP];
339 	int32_t		ps_ncores;
340 	int32_t		ps_speed;
341 	int32_t		ps_ecache;
342 } sbd_cmp_stat32_t;
343 
344 typedef union {
345 	sbd_cm_stat32_t		d_cm;
346 	sbd_cpu_stat32_t	d_cpu;
347 	sbd_mem_stat32_t	d_mem;
348 	sbd_io_stat32_t		d_io;
349 	sbd_cmp_stat32_t	d_cmp;
350 } sbd_dev_stat32_t;
351 
352 typedef struct {
353 	int32_t			s_board;
354 	char			s_type[SBD_TYPE_LEN];
355 	char			s_info[SBD_MAX_INFO];
356 	int32_t			s_rstate;
357 	int32_t			s_ostate;
358 	int32_t			s_cond;
359 	int32_t			s_busy;
360 	time32_t		s_time;
361 	uint32_t		s_power:1;
362 	uint32_t		s_assigned:1;
363 	uint32_t		s_platopts;
364 	int32_t			s_nstat;
365 	sbd_dev_stat32_t	s_stat[1];
366 } sbd_stat32_t;
367 
368 typedef struct {
369 	int32_t			e_code;
370 	char			e_rsc[MAXPATHLEN];
371 } sbd_error32_t;
372 
373 typedef struct {
374 	sbd_comp_id32_t		c_id;
375 	uint32_t		c_flags;
376 	int32_t			c_len;
377 	caddr32_t		c_opts;
378 } sbd_cm_cmd32_t;
379 
380 typedef struct {
381 	sbd_cm_cmd32_t	g_cm;
382 	int32_t		g_ncm;
383 } sbd_getncm_cmd32_t;
384 
385 typedef struct {
386 	sbd_cm_cmd32_t	s_cm;
387 	int32_t		s_nbytes;
388 	caddr32_t	s_statp;
389 } sbd_stat_cmd32_t;
390 
391 typedef union {
392 	sbd_cm_cmd32_t		cmd_cm;
393 	sbd_getncm_cmd32_t	cmd_getncm;
394 	sbd_stat_cmd32_t	cmd_stat;
395 } sbd_cmd32_t;
396 
397 typedef struct {
398 	sbd_cmd32_t		i_cmd;
399 	sbd_error32_t		i_err;
400 } sbd_ioctl_arg32_t;
401 
402 typedef struct {
403 	int32_t			t_base;
404 	int32_t			t_bnd;
405 	char			**t_text;
406 } sbd_etab32_t;
407 
408 #endif	/* _SYSCALL32 */
409 #endif	/* _ASM */
410 
411 /* Common error codes */
412 
413 #define	ESBD_NOERROR		0	/* no error */
414 #define	ESBD_INTERNAL		1	/* Internal error */
415 #define	ESBD_NOMEM		2	/* Insufficient memory */
416 #define	ESBD_PROTO		3	/* Protocol error */
417 #define	ESBD_BUSY		4	/* Device busy */
418 #define	ESBD_NODEV		5	/* No such device */
419 #define	ESBD_ALREADY		6	/* Operation already in progress */
420 #define	ESBD_IO			7	/* I/O error */
421 #define	ESBD_FAULT		8	/* Bad address */
422 #define	ESBD_EMPTY_BD		9	/* No device(s) on board */
423 #define	ESBD_INVAL		10	/* Invalid argument */
424 #define	ESBD_STATE		11	/* Invalid state transition */
425 #define	ESBD_FATAL_STATE	12	/* Device in fatal state */
426 #define	ESBD_OUTSTANDING	13	/* Outstanding error */
427 #define	ESBD_SUSPEND		14	/* Device failed to suspend */
428 #define	ESBD_RESUME		15	/* Device failed to resume */
429 #define	ESBD_UTHREAD		16	/* Cannot stop user thread */
430 #define	ESBD_RTTHREAD		17	/* Cannot quiesce realtime thread */
431 #define	ESBD_KTHREAD		18	/* Cannot stop kernel thread  */
432 #define	ESBD_OFFLINE		19	/* Failed to off-line */
433 #define	ESBD_ONLINE		20	/* Failed to on-line */
434 #define	ESBD_CPUSTART		21	/* Failed to start CPU */
435 #define	ESBD_CPUSTOP		22	/* Failed to stop CPU */
436 #define	ESBD_INVAL_COMP		23	/* Invalid component type */
437 #define	ESBD_KCAGE_OFF		24	/* Kernel cage is disabled */
438 #define	ESBD_NO_TARGET		25	/* No available memory target */
439 #define	ESBD_HW_PROGRAM		26	/* Hardware programming error */
440 #define	ESBD_MEM_NOTVIABLE	27	/* VM viability test failed */
441 #define	ESBD_MEM_REFUSED	28	/* Memory operation refused */
442 #define	ESBD_MEM_NONRELOC	29	/* Non-relocatable pages in span */
443 #define	ESBD_MEM_CANCELLED	30	/* Memory operation cancelled */
444 #define	ESBD_MEMFAIL		31	/* Memory operation failed */
445 #define	ESBD_MEMONLINE		32	/* Can't unconfig cpu if mem online */
446 #define	ESBD_QUIESCE_REQD	33
447 	/* Operator confirmation for quiesce is required */
448 #define	ESBD_MEMINTLV		34
449 	/* Memory is interleaved across boards */
450 #define	ESBD_CPUONLINE		35
451 	/* Can't config memory if not all cpus are online */
452 #define	ESBD_UNSAFE		36	/* Unsafe driver present */
453 #define	ESBD_INVAL_OPT		37	/* option invalid */
454 
455 /* Starcat error codes */
456 
457 #define	ESTC_NONE		1000	/* No error */
458 #define	ESTC_GETPROP		1001	/* Cannot read property value */
459 #define	ESTC_BNUM		1002	/* Invalid board number */
460 #define	ESTC_CONFIGBUSY		1003
461 	/* Cannot proceed; Board is configured or busy */
462 #define	ESTC_PROBE		1004	/* Solaris failed to probe */
463 #define	ESTC_DEPROBE		1005	/* Solaris failed to deprobe */
464 #define	ESTC_MOVESIGB		1006	/* Firmware move-cpu0 failed */
465 #define	ESTC_SUPPORT		1007	/* Operation not supported */
466 #define	ESTC_DRVFAIL		1008	/* Device driver failure */
467 #define	ESTC_UNKPTCMD		1012	/* Unrecognized platform command */
468 #define	ESTC_NOTID		1013
469 	/* drmach parameter is not a valid ID */
470 #define	ESTC_INAPPROP		1014
471 	/* drmach parameter is inappropriate for operation */
472 #define	ESTC_INTERNAL		1015	/* Unexpected internal condition */
473 #define	ESTC_MBXRQST		1016
474 	/* Mailbox framework failure: outgoing */
475 #define	ESTC_MBXRPLY		1017
476 	/* Mailbox framework failure: incoming */
477 #define	ESTC_NOACL		1018	/* Board is not in domain ACL */
478 #define	ESTC_NOT_ASSIGNED	1019	/* Board is not assigned to domain */
479 #define	ESTC_NOT_ACTIVE		1020	/* Board is not active */
480 #define	ESTC_EMPTY_SLOT		1021	/* Slot is empty */
481 #define	ESTC_POWER_OFF		1022	/* Board is powered off */
482 #define	ESTC_TEST_IN_PROGRESS	1023	/* Board is already being tested */
483 #define	ESTC_TESTING_BUSY	1024
484 	/* Wait: All SC test resources are in use */
485 #define	ESTC_TEST_REQUIRED	1025	/* Board requires test prior to use */
486 #define	ESTC_TEST_ABORTED	1026	/* Board test has been aborted */
487 #define	ESTC_MBOX_UNKNOWN	1027
488 	/* Unknown error type received from SC */
489 #define	ESTC_TEST_STATUS_UNKNOWN	1028
490 	/* Test completed with unknown status */
491 #define	ESTC_TEST_RESULT_UNKNOWN	1029
492 	/* Unknown test result returned by SC */
493 #define	ESTC_TEST_FAILED	1030
494 	/* SMS hpost reported error, see POST log for details */
495 #define	ESTC_UNAVAILABLE	1031	/* Slot is unavailable to the domain */
496 #define	ESTC_NZ_LPA		1032	/* Nonzero LPA not yet supported */
497 #define	ESTC_IOSWITCH		1033
498 	/* Cannot unconfigure I/O board: tunnel switch failed */
499 #define	ESTC_IOCAGE_NO_CPU_AVAIL	1034
500 	/* No CPU available for I/O cage test. */
501 #define	ESTC_SMS_ERR_RECOVERABLE	1035
502 	/* SMS reported recoverable error: check SMS status and Retry */
503 #define	ESTC_SMS_ERR_UNRECOVERABLE	1036
504 	/* SMS reported unrecoverable error: Board is Unusable */
505 #define	ESTC_NWSWITCH		1037
506 	/* Cannot unconfigure I/O board: network switch failed */
507 
508 /* Starfire error codes */
509 
510 #define	ESTF_NONE		2000	/* No error */
511 #define	ESTF_GETPROP		2001	/* Cannot read property value */
512 #define	ESTF_GETPROPLEN		2002	/* Cannot determine property length */
513 #define	ESTF_BNUM		2003	/* Invalid board number */
514 #define	ESTF_CONFIGBUSY		2004
515 	/* Cannot proceed; Board is configured or busy */
516 #define	ESTF_NOCPUID		2005	/* No CPU specified for connect */
517 #define	ESTF_PROBE		2006	/* Firmware probe failed */
518 #define	ESTF_DEPROBE		2007	/* Firmware deprobe failed */
519 #define	ESTF_MOVESIGB		2008	/* Firmware move-cpu0 failed */
520 #define	ESTF_JUGGLE		2009	/* Cannot move SIGB assignment */
521 #define	ESTF_HASSIGB		2010
522 	/* Cannot disconnect CPU; SIGB is currently assigned */
523 #define	ESTF_SUPPORT		2011	/* Operation not supported */
524 #define	ESTF_DRVFAIL		2012	/* Device driver failure */
525 #define	ESTF_SETCPUVAL		2013
526 	/* Must specify a CPU on the given board */
527 #define	ESTF_NODEV		2014	/* No such device */
528 #define	ESTF_INTERBOARD		2015
529 	/* Memory configured with inter-board interleaving */
530 #define	ESTF_UNKPTCMD		2016	/* Unrecognized platform command */
531 #define	ESTF_NOTID		2017	/* drmach parameter is not a valid ID */
532 #define	ESTF_INAPPROP		2018
533 	/* drmach parameter is inappropriate for operation */
534 #define	ESTF_INTERNAL		2019	/* Unexpected internal condition */
535 
536 /* Daktari error codes */
537 
538 #define	EDAK_NONE		3000	/* no error */
539 #define	EDAK_INTERNAL		3001	/* Internal error */
540 #define	EDAK_NOFRUINFO		3002	/* Didn't receive fru info */
541 #define	EDAK_NONDR_BOARD	3003
542 	/* DR is not supported on this board type */
543 #define	EDAK_POWERON		3004	/* Power on request failed */
544 #define	EDAK_POWEROK		3005	/* Failed to power on */
545 #define	EDAK_INTERRUPTED	3006	/* Operation interrupted */
546 #define	EDAK_BOARDINIT		3007	/* Board initialization failed */
547 #define	EDAK_CPUINIT		3008	/* CPU intialization failed */
548 #define	EDAK_MEMFAIL		3009	/* Memory operation failed */
549 
550 /* Serengeti error codes */
551 
552 #define	ESGT_NONE		4000	/* no error */
553 #define	ESGT_INTERNAL		4001	/* Internal error */
554 #define	ESGT_INVAL		4002	/* Invalid argument */
555 #define	ESGT_MEMFAIL		4003	/* Memory operation failed */
556 #define	ESGT_PROBE		4004	/* Board probe failed */
557 #define	ESGT_DEPROBE		4005	/* Board deprobe failed */
558 #define	ESGT_JUGGLE_BOOTPROC	4006	/* Failed to juggle bootproc */
559 #define	ESGT_NOT_CPUTYPE	4007	/* Not a cpu device */
560 #define	ESGT_NO_DEV_TYPE	4008	/* Cannot find device type */
561 #define	ESGT_BAD_PORTID		4009	/* Bad port id */
562 #define	ESGT_RESUME		4010	/* Failed to resume device */
563 #define	ESGT_SUSPEND		4011	/* Failed to suspend device */
564 #define	ESGT_KTHREAD		4012	/* failed to stop kernel thd */
565 #define	ESGT_UNSAFE		4013	/* unsafe */
566 #define	ESGT_RTTHREAD		4014	/* real time threads */
567 #define	ESGT_UTHREAD		4015	/* failed to stop user thd */
568 #define	ESGT_PROM_ATTACH	4016	/* prom failed attach board */
569 #define	ESGT_PROM_DETACH	4017	/* prom failed detach board */
570 #define	ESGT_SC_ERR		4018	/* sc return a failure */
571 #define	ESGT_GET_BOARD_STAT	4019	/* Failed to obtain board information */
572 #define	ESGT_WAKEUPCPU		4020	/* Failed to wake up cpu */
573 #define	ESGT_STOPCPU		4021	/* Failed to stop cpu */
574 /* Serengeti SC return codes */
575 #define	ESGT_HW_FAIL		4022	/* Hardware Failure */
576 #define	ESGT_BD_ACCESS		4023	/* Board access denied */
577 #define	ESGT_STALE_CMP		4024	/* Stale components */
578 #define	ESGT_STALE_OBJ		4025	/* Stale objects */
579 #define	ESGT_NO_SEPROM_SPACE	4026	/* No SEPROM space */
580 #define	ESGT_NOT_SUPP		4027	/* Operation not supported */
581 #define	ESGT_NO_MEM		4028	/* No Memory */
582 
583 /* OPL error codes */
584 
585 #define	EOPL_GETPROP		5001	/* Cannot read property value */
586 #define	EOPL_BNUM		5002	/* Invalid board number */
587 #define	EOPL_CONFIGBUSY		5003
588 	/* Cannot proceed; Board is configured or busy */
589 #define	EOPL_PROBE		5004	/* Firmware probe failed */
590 #define	EOPL_DEPROBE		5005	/* Firmware deprobe failed */
591 #define	EOPL_SUPPORT		5006	/* Operation not supported */
592 #define	EOPL_DRVFAIL		5007	/* Device driver failure */
593 #define	EOPL_UNKPTCMD		5008	/* Unrecognized platform command */
594 #define	EOPL_NOTID		5009	/* drmach parameter is not a valid ID */
595 #define	EOPL_INAPPROP		5010
596 	/* drmach parameter is inappropriate for operation */
597 #define	EOPL_INTERNAL		5011	/* Unexpected internal condition */
598 #define	EOPL_FINDDEVICE		5012	/* Firmware cannot find node. */
599 #define	EOPL_MC_SETUP		5013	/* Cannot setup memory node */
600 #define	EOPL_CPU_STATE		5014	/* Invalid CPU/core state */
601 #define	EOPL_MC_OPL		5015	/* Cannot find mc-opl interface */
602 #define	EOPL_SCF_FMEM		5016	/* Cannot find scf_fmem interface */
603 #define	EOPL_FMEM_SETUP		5017	/* Error setting up FMEM buffer */
604 #define	EOPL_SCF_FMEM_START	5018	/* scf_fmem_start error */
605 #define	EOPL_FMEM_ERROR		5019	/* FMEM error */
606 #define	EOPL_SCF_FMEM_CANCEL	5020	/* scf_fmem_cancel error */
607 #define	EOPL_FMEM_XC_TIMEOUT	5021	/* xcall timeout */
608 #define	EOPL_FMEM_COPY_TIMEOUT	5022	/* DR parellel copy timeout */
609 #define	EOPL_FMEM_SCF_BUSY	5023	/* SCF busy */
610 #define	EOPL_FMEM_RETRY_OUT	5024	/* SCF IO Retry Error */
611 #define	EOPL_FMEM_TIMEOUT	5025	/* FMEM command timeout */
612 #define	EOPL_FMEM_HW_ERROR	5026	/* Hardware error */
613 #define	EOPL_FMEM_TERMINATE	5027	/* FMEM operation Terminated */
614 #define	EOPL_FMEM_COPY_ERROR	5028	/* Memory copy error */
615 #define	EOPL_FMEM_SCF_ERR	5029	/* SCF error */
616 #define	EOPL_MIXED_CPU		5030
617 	/* Cannot add SPARC64-VI to domain booted with all SPARC64-VII CPUs */
618 #define	EOPL_FMEM_SCF_OFFLINE	5031	/* SCF OFFLINE */
619 
620 #ifdef	__cplusplus
621 }
622 #endif
623 
624 #endif	/* _SBD_IOCTL_H */
625