/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Given a unum including an offset calculate the associated system
* address. This may be different to when the original PA to unum
* calculation took place if interleave etc has changed.
*/
#include <mcamd_api.h>
#include <mcamd_err.h>
/*
* The submitted unum must have the MC and DIMM numbers and an offset.
* Any cs info it has will not be used - we will reconstruct cs info.
* This is because cs is not in the topology used for diagnosis.
*/
int
{
"invalid\n");
}
/*
* Search current config for a MC number matching the chip in the
* unum.
*/
if (!mcamd_get_numprops(hdl,
NULL)) {
"failed to lookup num, dramhole for MC 0x%p\n", mc);
}
break;
}
}
/*
* Search DIMMs of this MC. We can match against the
* first dimm in the unum - if there is more than one they all
* share the same chip-selects anyway and the pa we will resolve
* to is not finer grained than the 128-bits of a dimm pair.
*/
"failed to lookup num for dimm 0xx%p\n",
dimm);
}
break;
}
"no match for dimm %d cs %d on MC %d\n",
}
"mc 0x%p dimm 0x%p; resolving offset 0x%llx\n",
return (-1); /* errno already set */
}
"mc_offset_to_pa succeeded and returned pa=0x%llx: %\n",
*pa);
/*
* If this MC has a dram address hole just below 4GB then we must
* hoist all address from the hole start upwards by the hole size
*/
if (holesz != 0) {
"above dram hole of size 0x%llx to get pa=0x%llx",
}
return (0);
}