xref: /titanic_44/usr/src/uts/common/sys/devfm.h (revision 211eb17a9612ace1f2dee156ee66d097e28d9faa)
1e4b86885SCheng Sean Ye /*
2e4b86885SCheng Sean Ye  * CDDL HEADER START
3e4b86885SCheng Sean Ye  *
4e4b86885SCheng Sean Ye  * The contents of this file are subject to the terms of the
5e4b86885SCheng Sean Ye  * Common Development and Distribution License (the "License").
6e4b86885SCheng Sean Ye  * You may not use this file except in compliance with the License.
7e4b86885SCheng Sean Ye  *
8e4b86885SCheng Sean Ye  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e4b86885SCheng Sean Ye  * or http://www.opensolaris.org/os/licensing.
10e4b86885SCheng Sean Ye  * See the License for the specific language governing permissions
11e4b86885SCheng Sean Ye  * and limitations under the License.
12e4b86885SCheng Sean Ye  *
13e4b86885SCheng Sean Ye  * When distributing Covered Code, include this CDDL HEADER in each
14e4b86885SCheng Sean Ye  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e4b86885SCheng Sean Ye  * If applicable, add the following below this CDDL HEADER, with the
16e4b86885SCheng Sean Ye  * fields enclosed by brackets "[]" replaced with your own identifying
17e4b86885SCheng Sean Ye  * information: Portions Copyright [yyyy] [name of copyright owner]
18e4b86885SCheng Sean Ye  *
19e4b86885SCheng Sean Ye  * CDDL HEADER END
20e4b86885SCheng Sean Ye  */
21e4b86885SCheng Sean Ye /*
22074bb90dSTom Pothier  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23e4b86885SCheng Sean Ye  * Use is subject to license terms.
24e4b86885SCheng Sean Ye  */
25e4b86885SCheng Sean Ye 
26e4b86885SCheng Sean Ye #ifndef	_SYS_DEVFM_H
27e4b86885SCheng Sean Ye #define	_SYS_DEVFM_H
28e4b86885SCheng Sean Ye 
29e4b86885SCheng Sean Ye #include <sys/types.h>
30e4b86885SCheng Sean Ye #include <sys/nvpair.h>
31e4b86885SCheng Sean Ye 
32e4b86885SCheng Sean Ye #ifdef	__cplusplus
33e4b86885SCheng Sean Ye extern "C" {
34e4b86885SCheng Sean Ye #endif
35e4b86885SCheng Sean Ye 
36e4b86885SCheng Sean Ye #define	FM_IOC_MAXBUFSZ		32768
37*211eb17aSAdrian Frost #define	FM_IOC_OUT_BUFSZ	32768
38*211eb17aSAdrian Frost #define	FM_IOC_OUT_MAXBUFSZ	524288
39e4b86885SCheng Sean Ye #define	FM_DRV_VERSION		1
40e4b86885SCheng Sean Ye 
41e4b86885SCheng Sean Ye #define	FM_VERSIONS_VERSION	"fm-versions-version"
42e4b86885SCheng Sean Ye #define	FM_PAGE_OP_VERSION	"page-operation-version"
43e4b86885SCheng Sean Ye #define	FM_CPU_OP_VERSION	"cpu-operation-version"
44e4b86885SCheng Sean Ye #define	FM_CPU_INFO_VERSION	"cpu-info-version"
45074bb90dSTom Pothier #define	FM_TOPO_LEGACY_VERSION	"topo-legacy-version"
46e4b86885SCheng Sean Ye 
47e4b86885SCheng Sean Ye /*
48e4b86885SCheng Sean Ye  * FMA driver ioctl interfaces
49e4b86885SCheng Sean Ye  */
50e4b86885SCheng Sean Ye #define	FM_IOC			(0xFA << 16)
51e4b86885SCheng Sean Ye #define	FM_IOC_VERSIONS		(FM_IOC | 1)
52e4b86885SCheng Sean Ye #define	FM_IOC_PAGE_RETIRE	(FM_IOC | 2)
53e4b86885SCheng Sean Ye #define	FM_IOC_PAGE_STATUS	(FM_IOC | 3)
54e4b86885SCheng Sean Ye #define	FM_IOC_PAGE_UNRETIRE	(FM_IOC | 4)
55e4b86885SCheng Sean Ye 
56e4b86885SCheng Sean Ye #if defined(__x86)
57e4b86885SCheng Sean Ye #define	FM_IOC_PHYSCPU_INFO	(FM_IOC | 5)
58e4b86885SCheng Sean Ye #define	FM_IOC_CPU_RETIRE	(FM_IOC | 6)
59e4b86885SCheng Sean Ye #define	FM_IOC_CPU_STATUS	(FM_IOC | 7)
60e4b86885SCheng Sean Ye #define	FM_IOC_CPU_UNRETIRE	(FM_IOC | 8)
61074bb90dSTom Pothier #define	FM_IOC_GENTOPO_LEGACY	(FM_IOC | 9)
62e4b86885SCheng Sean Ye #endif	/* __x86 */
63e4b86885SCheng Sean Ye 
64e4b86885SCheng Sean Ye /*
65e4b86885SCheng Sean Ye  * Types
66e4b86885SCheng Sean Ye  */
67e4b86885SCheng Sean Ye typedef struct fm_ioc_data {
68e4b86885SCheng Sean Ye 	uint32_t	fid_version;	/* interface version */
69e4b86885SCheng Sean Ye 	size_t		fid_insz;	/* size of packed input nvlist */
70e4b86885SCheng Sean Ye 	caddr_t		fid_inbuf;	/* buf containing packed input nvl */
71e4b86885SCheng Sean Ye 	size_t		fid_outsz;	/* size of packed output nvlist */
72e4b86885SCheng Sean Ye 	caddr_t		fid_outbuf;	/* buf containing packed output nvl */
73e4b86885SCheng Sean Ye } fm_ioc_data_t;
74e4b86885SCheng Sean Ye 
75e4b86885SCheng Sean Ye #ifdef _KERNEL
76e4b86885SCheng Sean Ye typedef struct fm_ioc_data32 {
77e4b86885SCheng Sean Ye 	uint32_t	fid_version;	/* interface version */
78e4b86885SCheng Sean Ye 	size32_t	fid_insz;	/* size of packed input nvlist */
79e4b86885SCheng Sean Ye 	caddr32_t	fid_inbuf;	/* buf containing packed input nvl */
80e4b86885SCheng Sean Ye 	size32_t	fid_outsz;	/* size of packed output nvlist */
81e4b86885SCheng Sean Ye 	caddr32_t	fid_outbuf;	/* buf containing packed output nvl */
82e4b86885SCheng Sean Ye } fm_ioc_data32_t;
83e4b86885SCheng Sean Ye #endif	/* _KERNEL */
84e4b86885SCheng Sean Ye 
85e4b86885SCheng Sean Ye /*
86e4b86885SCheng Sean Ye  * Constants
87e4b86885SCheng Sean Ye  */
88e4b86885SCheng Sean Ye #define	FM_PAGE_RETIRE_FMRI		"fmri"
89e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_CPUS		"cpus"
90e4b86885SCheng Sean Ye #define	FM_CPU_RETIRE_CHIP_ID		"chip_id"
918031591dSSrihari Venkatesan #define	FM_PHYSCPU_INFO_NPROCNODES	"procnodes_per_pkg"
928031591dSSrihari Venkatesan #define	FM_PHYSCPU_INFO_PROCNODE_ID	"procnodeid"
93e4b86885SCheng Sean Ye #define	FM_CPU_RETIRE_CORE_ID		"core_id"
94e4b86885SCheng Sean Ye #define	FM_CPU_RETIRE_STRAND_ID		"strand_id"
95e4b86885SCheng Sean Ye #define	FM_CPU_RETIRE_OLDSTATUS		"oldstatus"
96074bb90dSTom Pothier #define	FM_GENTOPO_LEGACY		"gentopolegacy"
97e4b86885SCheng Sean Ye 
98e4b86885SCheng Sean Ye /*
99e4b86885SCheng Sean Ye  * Properties set by FM_PHYSCPU_INFO
100e4b86885SCheng Sean Ye  */
101e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_VENDOR_ID	"vendor_id"
102e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_FAMILY		"family"
103e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_MODEL		"model"
104e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_STEPPING	"stepping"
105074bb90dSTom Pothier 
106074bb90dSTom Pothier /*
107074bb90dSTom Pothier  * When Multi-Chip-Module(MCM) support is added
108074bb90dSTom Pothier  * chip_id should map to the processor package
109074bb90dSTom Pothier  * and not the die in the processor package.
110074bb90dSTom Pothier  * This is for FMA; kernel's perception of
111074bb90dSTom Pothier  * chip_id could differ for MCM.
112074bb90dSTom Pothier  */
113e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_CHIP_ID		"chip_id"
114074bb90dSTom Pothier 
115e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_CORE_ID		"core_id"
116e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_STRAND_ID	"strand_id"
117074bb90dSTom Pothier #define	FM_PHYSCPU_INFO_STRAND_APICID	"strand_initial_apicid"
118074bb90dSTom Pothier #define	FM_PHYSCPU_INFO_SMBIOS_ID	"smbios_id"
119074bb90dSTom Pothier #define	FM_PHYSCPU_INFO_CHIP_ROOTS	"chip_roots"
120e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_CHIP_REV	"chip_rev"
121e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_SOCKET_TYPE	"socket_type"
122e4b86885SCheng Sean Ye #define	FM_PHYSCPU_INFO_CPU_ID		"cpuid"
123e4b86885SCheng Sean Ye 
124e4b86885SCheng Sean Ye #ifdef	__cplusplus
125e4b86885SCheng Sean Ye }
126e4b86885SCheng Sean Ye #endif
127e4b86885SCheng Sean Ye 
128e4b86885SCheng Sean Ye #endif	/* _SYS_DEVFM_H */
129