2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * This is a somewhat generic property method for labelling the dimm slots on 2N/A * uni-socket x86/x64 platforms. This method assumes a direct linear 2N/A * correlation between the dimm topo node instance number and the dimm slot 2N/A * label number. It takes the following two arguments: 2N/A * format: a string containing a printf-like format with a single %d token 2N/A * which this method computes 2N/A * offset: a numeric offset that we'll number the dimms from. This is to 2N/A * allow for the fact that some systems number the dimm slots 2N/A * from zero and others start from one (like the Ultra 20) 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This is a somewhat generic property method for labelling the dimm slots on 2N/A * multi-socket x86/x64 platforms. It takes the following two arguments: 2N/A * format: a string containing a printf-like format with a two %d tokens 2N/A * for the cpu and dimm slot label numbers, which this method 2N/A * i.e.: CPU %d DIMM %d 2N/A * offset: a numeric offset that we'll number the dimms from. This is to 2N/A * allow for the fact that some systems number the dimm slots 2N/A * from zero while others may start from one 2N/A * order: "reverse" or "forward" - sets the direction of the correlation 2N/A * between dimm topo node instance number and DIMM slot number 2N/A * dimms_per_chip: the number of DIMM slots per chip 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This method assumes a correspondence between the dimm topo node instance 2N/A * number and the dimm slot label number, but unlike simple_chip_label_mp, the 2N/A * slot numbers aren't reused between CPU's. This method assumes there 2N/A * are 4 DIMM slots per chip. It takes the following two arguments: 2N/A * format: a string containing a printf-like format with a single %d token 2N/A * which this method computes 2N/A * offset: a numeric offset that we'll number the dimms from. This is to 2N/A * allow for the fact that some systems number the dimm slots 2N/A * from zero and others may start from one 2N/A * order: "reverse" or "forward" - sets the direction of the correlation 2N/A * between dimm topo node instance number and DIMM slot number 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This is a somewhat generic property method for labelling the CPU sockets on 2N/A * x86/x64 platforms. This method assumes a correspondence between 2N/A * the chip topo node instance number and the CPU socket label number. It takes 2N/A * the following two arguments: 2N/A * format: a string containing a printf-like format with a single %d token 2N/A * which this method computes 2N/A * offset: a numeric offset that we'll number the CPU's from. This is to 2N/A * allow for the fact that some systems number the CPU sockets 2N/A * from zero and others start from one (like the X4X00-M2 systems) 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This is a somewhat generic property method for labelling the CPU sockets on 2N/A * x86/x64 platforms. This method assumes a correspondence between 2N/A * the chip topo node instance number and the CPU socket label number. It takes 2N/A * the following argument: 2N/A * format: a string containing a printf-like format with a single %d token 2N/A * which this method computes 2N/A * offset: a numeric offset that we'll number the CPU's from. This is to 2N/A * allow for the fact that some systems number the CPU sockets 2N/A * from zero and others start from one (like the X8450 systems) 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This is a custom property method for generating the CPU slot label for the 2N/A * Galaxy 4E/4F platforms. 2N/A * format: a string containing a printf-like format with a single %c token 2N/A * which this method computes 2N/A * G4 HT node ID to FRU label translation. The g4map array 2N/A * is indexed by (number of coherent nodes) / 2 - 1. 2N/A * The value for a given number of nodes is a char array 2N/A * indexed by node ID. 2N/A "ADEH",
/* 4 nodes */ 2N/A "ABDEFH",
/* 6 nodes */ 2N/A "ACBDEFGH" /* 8 nodes */ 2N/A /* topo errno already set */ 2N/A * The chip-properties property will not exist if this platform has 2N/A * AMD family 0x10 modules. In that case we don't want to treat it as a 2N/A * fatal error as that will cause calls like topo_prop_getprops to fail 2N/A * to return any properties on this node. Therefore, if the topo errno 2N/A * is set to ETOPO_PROP_NOENT, then we'll just set an empty label 2N/A * and return 0. If the topo errno is set to anything else we'll 2N/A /* topo errno already set */ 2N/A /* HT nodes must number 0 .. num_nodes - 1 */ 2N/A /* htid is already range-checked */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * Utility function used by a4fplus_chip_label to determine the number of chips 2N/A * (as opposed to processors) that are installed in the system by counting 2N/A * the unique chipids. 2N/A * This is a custom property method for generating the CPU slot label for the 2N/A * Andromeda Fplus platforms. 2N/A * format: a string containing a printf-like format with a single %d token 2N/A * which this method computes 2N/A /* topo errno already set */ 2N/A * Normally we'd figure out the total number of chip nodes by looking 2N/A * at the CoherentNodes property. However, due to the lack of a memory 2N/A * controller driver for family 0x10, this property wont exist on the 2N/A * chip nodes on A4Fplus. 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This is a somewhat generic property method for labelling the chip-select 2N/A * nodes on multi-socket AMD family 0x10 platforms. This is necessary because 2N/A * these platforms are not supported by the current AMD memory controller driver 2N/A * and therefore we're not able to discover the memory topology on AMD family 2N/A * 0x10 systems. As a result, instead of enumerating the installed dimms and 2N/A * their ranks, the chip enumerator generically enumerates all of the possible 2N/A * chip-selects beneath each dram channel. 2N/A * When we diagnose a dimm fault, the FRU fmri will be for the chip-select node, 2N/A * so we need to attach FRU labels to the chip-select nodes. 2N/A * format: a string containing a printf-like format with a two %d tokens 2N/A * for the cpu and dimm slot label numbers, which this method 2N/A * i.e.: CPU %d DIMM %d 2N/A * offset: a numeric offset that we'll number the dimms from. This is to 2N/A * allow for the fact that some systems may number the dimm slots 2N/A * from zero while others may start from one 2N/A * This function computes the DIMM slot number using the following formula: 2N/A * slot = cs - (cs % 2) + channel + offset 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A /* topo errno already set */ 2N/A * The 4600/4600M2 have a weird way of labeling the chip nodes, so 2N/A * instead of trying to recompute it, we'll simply look it up and 2N/A * prepend it to our dimm label. 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */ 2N/A * This method is used to compute the labels for DIMM slots on the Galaxy 1F and 2N/A * 2F platforms. It results in following dimm node label assignments: 2N/A * ------------------- ----- 2N/A * chip=0/dimm=0 CPU 1 DIMM A0 2N/A * chip=0/dimm=1 CPU 1 DIMM B0 2N/A * chip=0/dimm=2 CPU 1 DIMM A1 2N/A * chip=0/dimm=3 CPU 1 DIMM B1 2N/A * chip=1/dimm=0 CPU 2 DIMM A0 2N/A * chip=1/dimm=1 CPU 2 DIMM B0 2N/A * chip=1/dimm=2 CPU 2 DIMM A1 2N/A * chip=1/dimm=3 CPU 2 DIMM B1 2N/A /* topo errno already set */ 2N/A /* LINTED: E_SEC_PRINTF_VAR_FMT */ 2N/A /* topo errno already set */