xref: /onnv-gate/usr/src/cmd/picl/plugins/sun4v/piclsbl/piclsbl.h (revision 8025:3b46d92554cb)
16752Sae112802 /*
26752Sae112802  * CDDL HEADER START
36752Sae112802  *
46752Sae112802  * The contents of this file are subject to the terms of the
56752Sae112802  * Common Development and Distribution License (the "License").
66752Sae112802  * You may not use this file except in compliance with the License.
76752Sae112802  *
86752Sae112802  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96752Sae112802  * or http://www.opensolaris.org/os/licensing.
106752Sae112802  * See the License for the specific language governing permissions
116752Sae112802  * and limitations under the License.
126752Sae112802  *
136752Sae112802  * When distributing Covered Code, include this CDDL HEADER in each
146752Sae112802  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156752Sae112802  * If applicable, add the following below this CDDL HEADER, with the
166752Sae112802  * fields enclosed by brackets "[]" replaced with your own identifying
176752Sae112802  * information: Portions Copyright [yyyy] [name of copyright owner]
186752Sae112802  *
196752Sae112802  * CDDL HEADER END
206752Sae112802  */
216752Sae112802 /*
226752Sae112802  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
236752Sae112802  * Use is subject to license terms.
246752Sae112802  */
256752Sae112802 
266752Sae112802 #ifndef	_PICLSBL_H
276752Sae112802 #define	_PICLSBL_H
286752Sae112802 
296752Sae112802 #ifdef	__cplusplus
306752Sae112802 extern "C" {
316752Sae112802 #endif
326752Sae112802 
336752Sae112802 picl_nodehdl_t	root_node;
346752Sae112802 
356752Sae112802 /* lookup struct for ptree callback */
366752Sae112802 typedef struct disk_lookup {
376752Sae112802 	char *path;
386752Sae112802 	picl_nodehdl_t disk;
396752Sae112802 	int result;
406752Sae112802 } disk_lookup_t;
416752Sae112802 
426752Sae112802 #define	DISK_FOUND	0x00
436752Sae112802 #define	DISK_NOT_FOUND	0x01
446752Sae112802 
456752Sae112802 #define	PCPLIB		"libpcp.so"
466752Sae112802 #define	LIB_PCP_PATH	"/usr/platform/sun4v/lib/"
476752Sae112802 #define	LED_CHANNEL	"/devices/virtual-devices@100/led@d:glvc"
486752Sae112802 #define	PCPINIT_TIMEOUT	0x05
496752Sae112802 #define	PCPCOMM_TIMEOUT	0x10
506752Sae112802 
516752Sae112802 #define	NAC_DISK_PREFIX	"HDD"
526752Sae112802 
53*8025SMary.Beale@Sun.COM /* sun4v platforms that do not need to handle SBL events */
54*8025SMary.Beale@Sun.COM #define	ERIE_PLATFORM	"SUNW,Sun-Fire-T1000"
55*8025SMary.Beale@Sun.COM #define	ERIE_PLATFORM2	"SUNW,SPARC-Enterprise-T1000"
56*8025SMary.Beale@Sun.COM 
576752Sae112802 /* message types */
586752Sae112802 #define	PCP_SBL_CONTROL		0x3
596752Sae112802 #define	PCP_SBL_CONTROL_R	0x4
606752Sae112802 
616752Sae112802 /* pcp request structure */
626752Sae112802 typedef struct pcp_sbl_req {
636752Sae112802 	uint32_t sbl_id;
646752Sae112802 	uint32_t sbl_action;
656752Sae112802 } pcp_sbl_req_t;
666752Sae112802 
676752Sae112802 /* sbl_action */
686752Sae112802 #define	PCP_SBL_ENABLE		0x1
696752Sae112802 #define	PCP_SBL_DISABLE		0x2
706752Sae112802 
716752Sae112802 /* pcp response structure */
726752Sae112802 typedef struct pcp_sbl_resp {
736752Sae112802 	uint32_t  status;
746752Sae112802 	uint32_t  sbl_id;
756752Sae112802 	uint32_t  sbl_state;
766752Sae112802 } pcp_sbl_resp_t;
776752Sae112802 
786752Sae112802 /* status */
796752Sae112802 #define	PCP_SBL_OK		0x1
806752Sae112802 #define	PCP_SBL_ERROR		0x2
816752Sae112802 
826752Sae112802 /* sbl_state */
836752Sae112802 #define	SBL_STATE_ON		0x1
846752Sae112802 #define	SBL_STATE_OFF		0x2
856752Sae112802 #define	SBL_STATE_UNKNOWN	0x3
866752Sae112802 
876752Sae112802 #ifdef	__cplusplus
886752Sae112802 }
896752Sae112802 #endif
906752Sae112802 
916752Sae112802 #endif	/* _PICLSBL_H */
92