xref: /titanic_41/usr/src/uts/intel/io/mc-amd/mcamd_dimmcfg.h (revision e4b86885570d77af552e9cf94f142f4d744fb8c8)
1*e4b86885SCheng Sean Ye /*
2*e4b86885SCheng Sean Ye  * CDDL HEADER START
3*e4b86885SCheng Sean Ye  *
4*e4b86885SCheng Sean Ye  * The contents of this file are subject to the terms of the
5*e4b86885SCheng Sean Ye  * Common Development and Distribution License (the "License").
6*e4b86885SCheng Sean Ye  * You may not use this file except in compliance with the License.
7*e4b86885SCheng Sean Ye  *
8*e4b86885SCheng Sean Ye  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*e4b86885SCheng Sean Ye  * or http://www.opensolaris.org/os/licensing.
10*e4b86885SCheng Sean Ye  * See the License for the specific language governing permissions
11*e4b86885SCheng Sean Ye  * and limitations under the License.
12*e4b86885SCheng Sean Ye  *
13*e4b86885SCheng Sean Ye  * When distributing Covered Code, include this CDDL HEADER in each
14*e4b86885SCheng Sean Ye  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*e4b86885SCheng Sean Ye  * If applicable, add the following below this CDDL HEADER, with the
16*e4b86885SCheng Sean Ye  * fields enclosed by brackets "[]" replaced with your own identifying
17*e4b86885SCheng Sean Ye  * information: Portions Copyright [yyyy] [name of copyright owner]
18*e4b86885SCheng Sean Ye  *
19*e4b86885SCheng Sean Ye  * CDDL HEADER END
20*e4b86885SCheng Sean Ye  */
21*e4b86885SCheng Sean Ye 
22*e4b86885SCheng Sean Ye /*
23*e4b86885SCheng Sean Ye  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*e4b86885SCheng Sean Ye  * Use is subject to license terms.
25*e4b86885SCheng Sean Ye  */
26*e4b86885SCheng Sean Ye 
27*e4b86885SCheng Sean Ye #ifndef _MCAMD_DIMMCFG_H
28*e4b86885SCheng Sean Ye #define	_MCAMD_DIMMCFG_H
29*e4b86885SCheng Sean Ye 
30*e4b86885SCheng Sean Ye #include <sys/types.h>
31*e4b86885SCheng Sean Ye #include <sys/mc_amd.h>
32*e4b86885SCheng Sean Ye 
33*e4b86885SCheng Sean Ye #ifdef __cplusplus
34*e4b86885SCheng Sean Ye extern "C" {
35*e4b86885SCheng Sean Ye #endif
36*e4b86885SCheng Sean Ye 
37*e4b86885SCheng Sean Ye typedef struct mcdcfg_csl mcdcfg_csl_t;
38*e4b86885SCheng Sean Ye typedef struct mcdcfg_rslt mcdcfg_rslt_t;
39*e4b86885SCheng Sean Ye 
40*e4b86885SCheng Sean Ye /*
41*e4b86885SCheng Sean Ye  * Chip-select line representation.
42*e4b86885SCheng Sean Ye  */
43*e4b86885SCheng Sean Ye struct mcdcfg_csl {
44*e4b86885SCheng Sean Ye 	uint8_t	csl_chan;	/* 0 = A, 1 = B */
45*e4b86885SCheng Sean Ye 	uint8_t	csl_slot;	/* dimm slot on channel, 0/1/2/3 (pair #) */
46*e4b86885SCheng Sean Ye 	uint8_t	csl_rank;	/* dimm rank in slot, 0/1/2/3 */
47*e4b86885SCheng Sean Ye };
48*e4b86885SCheng Sean Ye 
49*e4b86885SCheng Sean Ye /*
50*e4b86885SCheng Sean Ye  * Results structure for mdcfg_lookup
51*e4b86885SCheng Sean Ye  */
52*e4b86885SCheng Sean Ye struct mcdcfg_rslt {
53*e4b86885SCheng Sean Ye 	int	ldimm;			/* logical DIMM number */
54*e4b86885SCheng Sean Ye 	int	ndimm;			/* # of associated physical dimms */
55*e4b86885SCheng Sean Ye 	struct {
56*e4b86885SCheng Sean Ye 		int	toponum;		/* dimm instance in topology */
57*e4b86885SCheng Sean Ye 		const mcdcfg_csl_t *cslp;	/* chip-select parameters */
58*e4b86885SCheng Sean Ye 	} dimm[MC_CHIP_DIMMPERCS];	/* ndimm entries are valid */
59*e4b86885SCheng Sean Ye };
60*e4b86885SCheng Sean Ye 
61*e4b86885SCheng Sean Ye /*
62*e4b86885SCheng Sean Ye  * Chip-select line name maximum string length
63*e4b86885SCheng Sean Ye  */
64*e4b86885SCheng Sean Ye #define	MCDCFG_CSNAMELEN 32
65*e4b86885SCheng Sean Ye 
66*e4b86885SCheng Sean Ye extern int mcdcfg_lookup(uint32_t, int, int, int, uint32_t, int, int,
67*e4b86885SCheng Sean Ye     mcdcfg_rslt_t *);
68*e4b86885SCheng Sean Ye extern void mcdcfg_csname(uint32_t, const mcdcfg_csl_t *, char *, int);
69*e4b86885SCheng Sean Ye 
70*e4b86885SCheng Sean Ye 
71*e4b86885SCheng Sean Ye #ifdef __cplusplus
72*e4b86885SCheng Sean Ye }
73*e4b86885SCheng Sean Ye #endif
74*e4b86885SCheng Sean Ye 
75*e4b86885SCheng Sean Ye #endif /* _MCAMD_DIMMCFG_H */
76