xref: /titanic_51/usr/src/uts/intel/sys/mc.h (revision 20c794b39650d115e17a15983b6b82e46238cf45)
17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
58a40a695Sgavinm  * Common Development and Distribution License (the "License").
68a40a695Sgavinm  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  *
21*20c794b3Sgavinm  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
227aec1d6eScindi  * Use is subject to license terms.
237aec1d6eScindi  */
247aec1d6eScindi 
257aec1d6eScindi #ifndef _SYS_MC_H
267aec1d6eScindi #define	_SYS_MC_H
277aec1d6eScindi 
287aec1d6eScindi #pragma ident	"%Z%%M%	%I%	%E% SMI"
297aec1d6eScindi 
307aec1d6eScindi /*
317aec1d6eScindi  * Public interfaces exposed by the memory controller driver
327aec1d6eScindi  */
337aec1d6eScindi 
347aec1d6eScindi #include <sys/cpuvar.h>
357aec1d6eScindi 
367aec1d6eScindi #ifdef __cplusplus
377aec1d6eScindi extern "C" {
387aec1d6eScindi #endif
397aec1d6eScindi 
407aec1d6eScindi #define	MC_UNUM_NAMLEN		192
418a40a695Sgavinm #define	MC_UNUM_NDIMM		2
427aec1d6eScindi 
437aec1d6eScindi typedef struct mc_unum {
44*20c794b3Sgavinm 	int unum_board;			/* system board */
45*20c794b3Sgavinm 	int unum_chip;			/* chip/socket */
46*20c794b3Sgavinm 	int unum_mc;			/* memory-controller or branch */
47*20c794b3Sgavinm 	int unum_chan;			/* DRAM channel */
48*20c794b3Sgavinm 	int unum_cs;			/* chip-select */
49*20c794b3Sgavinm 	int unum_rank;			/* rank */
50*20c794b3Sgavinm 	uint64_t unum_offset;		/* row, column, bank-select etc */
517aec1d6eScindi 	int unum_dimms[MC_UNUM_NDIMM];
527aec1d6eScindi } mc_unum_t;
537aec1d6eScindi 
548a40a695Sgavinm /*
558a40a695Sgavinm  * Invalid marker used in some numeric properties
568a40a695Sgavinm  */
578a40a695Sgavinm #define	MC_INVALNUM		((uint32_t)-1)
588a40a695Sgavinm 
598a40a695Sgavinm /*
608a40a695Sgavinm  * /dev/mc/mc* ioctl cmds
618a40a695Sgavinm  */
627aec1d6eScindi #define	MC_IOC			(0x4d43 << 16)
637aec1d6eScindi #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
647aec1d6eScindi #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
658a40a695Sgavinm #define	MC_IOC_ONLINESPARE_EN	(MC_IOC | 4)
667aec1d6eScindi 
677aec1d6eScindi /*
687aec1d6eScindi  * Prior to requesting a copy of the snapshot, consumers are advised to request
697aec1d6eScindi  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
707aec1d6eScindi  * containing the snapshot size as well as the snapshot generation number.  Note
717aec1d6eScindi  * that, due to the potentially dynamic nature of the system, the snapshot may
727aec1d6eScindi  * change at any time.  As such, the information in the mc_snapshot_info_t may
737aec1d6eScindi  * be out of date by the time it is used.  The generation number is used to
747aec1d6eScindi  * track snapshot changes.  That is, the generation number will be updated each
757aec1d6eScindi  * time the source data for the snapshot is updated.  The consumer should not
767aec1d6eScindi  * attach any meaning to the magnitude of a generation number change, and pay
777aec1d6eScindi  * attention only to the fact that the number has changed.
787aec1d6eScindi  */
797aec1d6eScindi typedef struct mc_snapshot_info {
807aec1d6eScindi 	uint32_t mcs_size;	/* snapshot size */
817aec1d6eScindi 	uint_t mcs_gen;		/* snapshot generation number */
827aec1d6eScindi } mc_snapshot_info_t;
837aec1d6eScindi 
847aec1d6eScindi #ifdef __cplusplus
857aec1d6eScindi }
867aec1d6eScindi #endif
877aec1d6eScindi 
887aec1d6eScindi #endif /* _SYS_MC_H */
89