xref: /titanic_44/usr/src/uts/intel/sys/mc.h (revision 8a40a695ee676a322b094e9afe5375567bfb51e3)
17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
5*8a40a695Sgavinm  * Common Development and Distribution License (the "License").
6*8a40a695Sgavinm  * 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  *
217aec1d6eScindi  * Copyright 2006 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
41*8a40a695Sgavinm #define	MC_UNUM_NDIMM		2
427aec1d6eScindi 
437aec1d6eScindi typedef struct mc_unum {
447aec1d6eScindi 	int unum_board;
457aec1d6eScindi 	int unum_chip;
467aec1d6eScindi 	int unum_mc;
477aec1d6eScindi 	int unum_cs;
48*8a40a695Sgavinm 	int unum_rank;
497aec1d6eScindi 	uint64_t unum_offset;
507aec1d6eScindi 	int unum_dimms[MC_UNUM_NDIMM];
517aec1d6eScindi } mc_unum_t;
527aec1d6eScindi 
53*8a40a695Sgavinm /*
54*8a40a695Sgavinm  * Invalid marker used in some numeric properties
55*8a40a695Sgavinm  */
56*8a40a695Sgavinm #define	MC_INVALNUM		((uint32_t)-1)
57*8a40a695Sgavinm 
587aec1d6eScindi #define	MC_AMD_DEV_OFFSET	24	/* node ID + offset == PCI dev num */
597aec1d6eScindi 
60*8a40a695Sgavinm /*
61*8a40a695Sgavinm  * /dev/mc/mc* ioctl cmds
62*8a40a695Sgavinm  */
637aec1d6eScindi #define	MC_IOC			(0x4d43 << 16)
647aec1d6eScindi #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
657aec1d6eScindi #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
66*8a40a695Sgavinm #define	MC_IOC_ONLINESPARE_EN	(MC_IOC | 4)
677aec1d6eScindi 
687aec1d6eScindi /*
697aec1d6eScindi  * Prior to requesting a copy of the snapshot, consumers are advised to request
707aec1d6eScindi  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
717aec1d6eScindi  * containing the snapshot size as well as the snapshot generation number.  Note
727aec1d6eScindi  * that, due to the potentially dynamic nature of the system, the snapshot may
737aec1d6eScindi  * change at any time.  As such, the information in the mc_snapshot_info_t may
747aec1d6eScindi  * be out of date by the time it is used.  The generation number is used to
757aec1d6eScindi  * track snapshot changes.  That is, the generation number will be updated each
767aec1d6eScindi  * time the source data for the snapshot is updated.  The consumer should not
777aec1d6eScindi  * attach any meaning to the magnitude of a generation number change, and pay
787aec1d6eScindi  * attention only to the fact that the number has changed.
797aec1d6eScindi  */
807aec1d6eScindi typedef struct mc_snapshot_info {
817aec1d6eScindi 	uint32_t mcs_size;	/* snapshot size */
827aec1d6eScindi 	uint_t mcs_gen;		/* snapshot generation number */
837aec1d6eScindi } mc_snapshot_info_t;
847aec1d6eScindi 
857aec1d6eScindi #ifdef __cplusplus
867aec1d6eScindi }
877aec1d6eScindi #endif
887aec1d6eScindi 
897aec1d6eScindi #endif /* _SYS_MC_H */
90