mcamd_patounum.c revision 4156fc34b973159b0334e05ae5ec19344487bdc0
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * CDDL HEADER START
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * The contents of this file are subject to the terms of the
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * Common Development and Distribution License (the "License").
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * You may not use this file except in compliance with the License.
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * See the License for the specific language governing permissions
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * and limitations under the License.
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * When distributing Covered Code, include this CDDL HEADER in each
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * If applicable, add the following below this CDDL HEADER, with the
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * fields enclosed by brackets "[]" replaced with your own identifying
c3cfed0d6cd9f537aa998096a43b80e98d99c6c4Kay Sievers * information: Portions Copyright [yyyy] [name of copyright owner]
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * CDDL HEADER END
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * Use is subject to license terms.
0bb91b50100e4633a0e68135854e606653055748Kay Sievers#pragma ident "%Z%%M% %I% %E% SMI"
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * Given a physical address and an optional syndrome, determine the
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * name of the memory module that contains it.
0bb91b50100e4633a0e68135854e606653055748Kay Sievers ((val) & (((2ULL << (high)) - 1) & ~((1ULL << (low)) - 1)))
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * iaddr_gen generates a "normalized" DRAM controller input address
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * from a system address (physical address) if it falls within the
d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3dKay Sievers * mapped range for this memory controller. Normalisation is
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * performed by subtracting the node base address from the system address,
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * allowing from hoisting, and excising any bits being used in node
0bb91b50100e4633a0e68135854e606653055748Kay Sievers * interleaving.
0bb91b50100e4633a0e68135854e606653055748Kay Sieversiaddr_gen(struct mcamd_hdl *hdl, mcamd_node_t *mc, uint64_t pa,
0bb91b50100e4633a0e68135854e606653055748Kay Sievers uint64_t mcnum, base, lim, dramaddr, ilen, ilsel, top, holesz;
NULL)) {
(int)mcnum);
if (ilen != 0) {
int pailsel;
int match = 0;
NULL)) {
if (csbe) {
return (match);
static mcamd_node_t *
NULL)) {
return (NULL);
return (NULL);
return (NULL);
return (cs);
int offsetdimm;
NULL)) {
for (i = 0; i < MC_UNUM_NDIMM; i++) {
switch (which) {
case CSDIMM1:
case CSDIMM2:
if (!incloff) {
int ndimm;
NULL)) {
if (ndimm == 0) {
return (CSDIMM1);
&check) == 0)
return (CSDIMM1);
return (CSDIMM2);
int which;
int Ilog;
if (IntlvEn) {
switch (IntlvEn) {
(int)mcnum);
NULL) ||
NULL)) {
(int)mcnum);
int which;
#ifdef DEBUG
int bkdgres;
syndtype)) < 0)
#ifdef DEBUG
if (bkdgres != 0) {