xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.h (revision 2983dda76a6d296fdb560c88114fe41caad1b84f)
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	_PICLSBL_H
27 #define	_PICLSBL_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 picl_nodehdl_t	root_node;
34 
35 /* lookup struct for ptree callback */
36 typedef struct disk_lookup {
37 	char *path;
38 	picl_nodehdl_t disk;
39 	int result;
40 } disk_lookup_t;
41 
42 #define	DISK_FOUND	0x00
43 #define	DISK_NOT_FOUND	0x01
44 
45 #define	PCPLIB		"libpcp.so"
46 #define	LIB_PCP_PATH	"/usr/platform/sun4v/lib/"
47 #define	LED_CHANNEL	"/devices/virtual-devices@100/led@d:glvc"
48 #define	PCPINIT_TIMEOUT	0x05
49 #define	PCPCOMM_TIMEOUT	0x10
50 
51 #define	NAC_DISK_PREFIX	"HDD"
52 
53 /* sun4v platforms that do not need to handle SBL events */
54 #define	ERIE_PLATFORM	"SUNW,Sun-Fire-T1000"
55 #define	ERIE_PLATFORM2	"SUNW,SPARC-Enterprise-T1000"
56 
57 /* message types */
58 #define	PCP_SBL_CONTROL		0x3
59 #define	PCP_SBL_CONTROL_R	0x4
60 
61 /* pcp request structure */
62 typedef struct pcp_sbl_req {
63 	uint32_t sbl_id;
64 	uint32_t sbl_action;
65 } pcp_sbl_req_t;
66 
67 /* sbl_action */
68 #define	PCP_SBL_ENABLE		0x1
69 #define	PCP_SBL_DISABLE		0x2
70 
71 /* pcp response structure */
72 typedef struct pcp_sbl_resp {
73 	uint32_t  status;
74 	uint32_t  sbl_id;
75 	uint32_t  sbl_state;
76 } pcp_sbl_resp_t;
77 
78 /* status */
79 #define	PCP_SBL_OK		0x1
80 #define	PCP_SBL_ERROR		0x2
81 
82 /* sbl_state */
83 #define	SBL_STATE_ON		0x1
84 #define	SBL_STATE_OFF		0x2
85 #define	SBL_STATE_UNKNOWN	0x3
86 
87 #ifdef	__cplusplus
88 }
89 #endif
90 
91 #endif	/* _PICLSBL_H */
92