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) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Enumerates the DIMMS in a system. For each DIMM found, the necessary nodes 2N/A * are also constructed. 2N/A/* Forward declaration */ 2N/A "Unable to make nvlist for %s bind: %s.\n",
2N/A "topo_node_bind (%s%d/%s%d) failed: %s\n",
2N/A {
"branch",
"BR%d" },
2N/A {
"dram-channel",
"CH%d" },
2N/A {
"memboard",
"MR%d" },
2N/A {
"memboard",
"MEM%d" },
2N/A * Because mem_tnode_create will fill in a "FRU" value by default, 2N/A * but not an "ASRU" value, we have to compute the desired "FRU" 2N/A * value -before- calling mem_tnode_create, but it's ok to 2N/A * topo_mod_asru_set() the ASRU value after the topo_node is 2N/A /* ASRU will be computed by topo method */ 2N/A return (t - s);
/* next slash */ 2N/A * mem_range_create and mem_inst_create are mutually recursive routines which 2N/A * together create the node hierarchy for one dimm and its siblings. 2N/A * mem_range_create is called when creating the first instance of a given node 2N/A * type as child of a parent instance, because it is then, and only then, 2N/A * that a topo range must be created. It calls mem_inst_create for its first 2N/A * and subsequent instances. The recursion always starts with 2N/A * mem_range_create, so it performs the up-front sanity checks. 2N/A * Note: the list of mem_dimm_map_t's pointed at by dp must be sorted 2N/A * alphabetically by *dm_label. 2N/A return (
1);
/* definitely an error */ 2N/A return (
1);
/* recursed too far */ 2N/A * Skip over NAC elements other than those listed 2N/A * above. These elements will appear 2N/A * in the DIMM's unum, but not in hc: scheme hierarchy. 2N/A continue;
/* child of 1st instance -- already done */ 2N/A pflen) == 0) {
/* child of same parent */ 2N/A * Same nodename as sibling. Don't create 2N/A * new range, or the enumeration will die. 2N/A return (
nerr);
/* finished all children of my parent */ 2N/A return (
nerr);
/* reached end of mem_dimm_map_t list */ 2N/A char nodename[
10];
/* allows up to 10^6 chips in system */ 2N/A l =
3;
/* start with MEM */ 2N/A * The hc-scheme memory enumerator is invoked from within a platform 2N/A * toplogy file. Make sure that the invocation is either 2N/A * 1) a child of the chip enumerator, which will cause the argument "rnode" 2N/A * below to be a chip node, and the dimm structures specific for that chip can 2N/A * then be built from its specific node, or 2N/A * 2) a child of the motherboard enumerator -- for Batoka and similar machines