xref: /illumos-gate/usr/src/uts/intel/io/mc-amd/mcamd_dimmcfg_impl.h (revision e4b86885570d77af552e9cf94f142f4d744fb8c8)
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 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _MCAMD_DIMMCFG_IMPL_H
28 #define	_MCAMD_DIMMCFG_IMPL_H
29 
30 #include <sys/types.h>
31 #include <sys/x86_archext.h>
32 #include <sys/mc_amd.h>
33 #include <mcamd_dimmcfg.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Defines for csl_chan
41  */
42 #define	CH_A	0
43 #define	CH_B	1
44 
45 /*
46  * Line structure for the tables.  We include up to 2 chip-selects per
47  * line - the consumer must use the first in 64-bit mode and both in
48  * 128-bit mode.
49  */
50 struct mcdcfg_csmapline {
51 	uint32_t csm_pkg;	/* applicable package types */
52 	uint8_t	csm_basereg;	/* csbase register number; implies mask */
53 	uint8_t csm_dimmcfg;	/* bitmask of DIMM_{N,R4,S4} which apply */
54 	uint8_t	csm_ldimm;	/* Logical DIMM number */
55 	const struct mcdcfg_csl csm_cs[MC_CHIP_DIMMPERCS];
56 };
57 
58 /*
59  * Defines for use with csm_pkg - pre-NPT packages
60  */
61 #define	SKT_754		X86_SOCKET_754
62 #define	SKT_939		X86_SOCKET_939
63 #define	SKT_940		X86_SOCKET_940
64 #define	SKT_ALL		(X86_SOCKET_754 | X86_SOCKET_939 | X86_SOCKET_940)
65 
66 /*
67  * Defines for use with csm_pkg - NPT packages
68  */
69 #define	F1207		X86_SOCKET_F1207
70 #define	AM2		X86_SOCKET_AM2
71 #define	S1g1		X86_SOCKET_S1g1
72 #define	SKT_NPT		(X86_SOCKET_S1g1 | X86_SOCKET_AM2 | X86_SOCKET_F1207)
73 #define	AM2F1207	(X86_SOCKET_AM2 | X86_SOCKET_F1207)
74 #define	AM2S1g1		(X86_SOCKET_AM2 | X86_SOCKET_S1g1)
75 
76 /*
77  * Defines for use with csm_dimmcfg
78  */
79 #define	DCFG_N		0x1	/* Normal */
80 #define	DCFG_R4		0x2	/* Four-rank registered DIMM */
81 #define	DCFG_S4		0x4	/* four-rank SO-DIMM (NPT only) */
82 #define	DCFG_ALL	(DCFG_N | DCFG_R4)
83 #define	DCFG_ALLNPT	(DCFG_N | DCFG_R4 | DCFG_S4)
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* _MCAMD_DIMMCFG_IMPL_H */
90