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.
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.
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]
21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
25 #pragma ident "%Z%%M% %I% %E% SMI"
27 #include <sys/types.h>
29 #include <mcamd_api.h>
31 static struct mcproptostr
{
32 mcamd_propcode_t code
;
38 { MCAMD_PROP_NUM
, MCAMD_PROPSTR_NUM
},
39 { MCAMD_PROP_SIZE
, MCAMD_PROPSTR_SIZE
},
40 { MCAMD_PROP_BASE_ADDR
, MCAMD_PROPSTR_BASE_ADDR
},
42 * Memory controller properties
44 { MCAMD_PROP_REV
, MCAMD_PROPSTR_REV
},
45 { MCAMD_PROP_LIM_ADDR
, MCAMD_PROPSTR_LIM_ADDR
},
46 { MCAMD_PROP_ILEN
, MCAMD_PROPSTR_ILEN
},
47 { MCAMD_PROP_ILSEL
, MCAMD_PROPSTR_ILSEL
},
48 { MCAMD_PROP_CSINTLVFCTR
, MCAMD_PROPSTR_CSINTLVFCTR
},
49 { MCAMD_PROP_ACCESS_WIDTH
, MCAMD_PROPSTR_ACCESS_WIDTH
},
50 { MCAMD_PROP_CSBANKMAPREG
, MCAMD_PROPSTR_CSBANKMAPREG
},
51 { MCAMD_PROP_BANKSWZL
, MCAMD_PROPSTR_BANKSWZL
},
52 { MCAMD_PROP_DRAMHOLE_SIZE
, MCAMD_PROPSTR_DRAMHOLE_SIZE
},
53 { MCAMD_PROP_MOD64MUX
, MCAMD_PROPSTR_MOD64MUX
},
54 { MCAMD_PROP_SPARECS
, MCAMD_PROPSTR_SPARECS
},
55 { MCAMD_PROP_BADCS
, MCAMD_PROPSTR_BADCS
},
57 * Chip-select properties
59 { MCAMD_PROP_MASK
, MCAMD_PROPSTR_MASK
},
60 { MCAMD_PROP_CSBE
, MCAMD_PROPSTR_CSBE
},
61 { MCAMD_PROP_SPARE
, MCAMD_PROPSTR_SPARE
},
62 { MCAMD_PROP_TESTFAIL
, MCAMD_PROPSTR_TESTFAIL
},
63 { MCAMD_PROP_CSDIMM1
, MCAMD_PROPSTR_CSDIMM1
},
64 { MCAMD_PROP_CSDIMM2
, MCAMD_PROPSTR_CSDIMM2
},
65 { MCAMD_PROP_DIMMRANK
, MCAMD_PROPSTR_DIMMRANK
},
68 static const int _nprop
= sizeof (_propstrings
) /
69 sizeof (struct mcproptostr
);
72 mcamd_get_propname(mcamd_propcode_t code
)
76 for (i
= 0; i
< _nprop
; i
++) {
77 if (_propstrings
[i
].code
== code
)
78 return (_propstrings
[i
].name
);