xref: /titanic_50/usr/src/common/mc/mc-amd/mcamd_misc.c (revision 0e42dee69ed771bf604dd1789fca9d77b5bbe302)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  *
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #pragma ident	"%Z%%M%	%I%	%E% SMI"
27 
28 #include <sys/types.h>
29 
30 #include <mcamd_api.h>
31 
32 static const char *const _mcamd_proplist[] = {
33 	MCAMD_PROPSTR_NUM,
34 	MCAMD_PROPSTR_BASE_ADDR,
35 	MCAMD_PROPSTR_LIM_ADDR,
36 	MCAMD_PROPSTR_MASK,
37 	MCAMD_PROPSTR_DRAM_ILEN,
38 	MCAMD_PROPSTR_DRAM_ILSEL,
39 	MCAMD_PROPSTR_DRAM_HOLE,
40 	MCAMD_PROPSTR_DRAM_CONFIG,
41 	MCAMD_PROPSTR_ACCESS_WIDTH,
42 	MCAMD_PROPSTR_LODIMM,
43 	MCAMD_PROPSTR_UPDIMM,
44 	MCAMD_PROPSTR_CSBANKMAP,
45 	MCAMD_PROPSTR_SIZE,
46 	MCAMD_PROPSTR_CSBANK_INTLV,
47 	MCAMD_PROPSTR_CS0,
48 	MCAMD_PROPSTR_CS1,
49 	MCAMD_PROPSTR_CS2,
50 	MCAMD_PROPSTR_CS3,
51 	MCAMD_PROPSTR_REV,
52 	MCAMD_PROPSTR_DISABLED_CS,
53 };
54 
55 static const int _mcamd_nprop = sizeof (_mcamd_proplist) /
56     sizeof (_mcamd_proplist[0]);
57 
58 const char *
59 mcamd_get_propname(uint_t code)
60 {
61 	if (code < _mcamd_nprop)
62 		return (_mcamd_proplist[code]);
63 	else
64 		return (NULL);
65 }
66