127 * Called when there is no memory-controller driver to provide topology
128 * information. Generate a maximal memory topology that is appropriate
129 * for the chip revision. The memory-controller node has already been
130 * bound as mcnode, and the parent of that is cnode.
131 *
132 * We create a tree of dram-channel and chip-select nodes below the
133 * memory-controller node. There will be two dram channels and 8 chip-selects
134 * below each, regardless of actual socket type, processor revision and so on.
135 * This is adequate for generic diagnosis up to family 0x10 revision D.
136 */
137 /*ARGSUSED*/
138 static int
139 amd_generic_mc_create(topo_mod_t *mod, uint16_t smbid, tnode_t *cnode,
140 tnode_t *mcnode, int family, int model, nvlist_t *auth)
141 {
142 int chan, cs;
143
144 /*
145 * Elsewhere we have already returned for families less than 0xf.
146 * This "generic" topology is adequate for all of family 0xf and
147 * for revisions A to D of family 0x10 (for the list of models
148 * in each revision, refer to usr/src/uts/i86pc/os/cpuid_subr.c).
149 * We cover all family 0x10 models, till model 9.
150 */
151 if (family > 0x10 || (family == 0x10 && model > 9))
152 return (1);
153
154 if (topo_node_range_create(mod, mcnode, CHAN_NODE_NAME, 0,
155 MAX_CHANNUM) < 0) {
156 whinge(mod, NULL, "amd_generic_mc_create: range create for "
157 "channels failed\n");
158 return (-1);
159 }
160
161 for (chan = 0; chan <= MAX_CHANNUM; chan++) {
162 tnode_t *chnode;
163 nvlist_t *fmri;
164 int err;
165
166 if (mkrsrc(mod, mcnode, CHAN_NODE_NAME, chan, auth,
167 &fmri) != 0) {
168 whinge(mod, NULL, "amd_generic_mc_create: mkrsrc "
169 "failed\n");
170 return (-1);
171 }
|
127 * Called when there is no memory-controller driver to provide topology
128 * information. Generate a maximal memory topology that is appropriate
129 * for the chip revision. The memory-controller node has already been
130 * bound as mcnode, and the parent of that is cnode.
131 *
132 * We create a tree of dram-channel and chip-select nodes below the
133 * memory-controller node. There will be two dram channels and 8 chip-selects
134 * below each, regardless of actual socket type, processor revision and so on.
135 * This is adequate for generic diagnosis up to family 0x10 revision D.
136 */
137 /*ARGSUSED*/
138 static int
139 amd_generic_mc_create(topo_mod_t *mod, uint16_t smbid, tnode_t *cnode,
140 tnode_t *mcnode, int family, int model, nvlist_t *auth)
141 {
142 int chan, cs;
143
144 /*
145 * Elsewhere we have already returned for families less than 0xf.
146 * This "generic" topology is adequate for all of family 0xf and
147 * for revisions A to E of family 0x10 (for the list of models
148 * in each revision, refer to usr/src/uts/i86pc/os/cpuid_subr.c).
149 * We cover all family 0x10 models, till model 10.
150 */
151 if (family > 0x10 || (family == 0x10 && model > 10))
152 return (1);
153
154 if (topo_node_range_create(mod, mcnode, CHAN_NODE_NAME, 0,
155 MAX_CHANNUM) < 0) {
156 whinge(mod, NULL, "amd_generic_mc_create: range create for "
157 "channels failed\n");
158 return (-1);
159 }
160
161 for (chan = 0; chan <= MAX_CHANNUM; chan++) {
162 tnode_t *chnode;
163 nvlist_t *fmri;
164 int err;
165
166 if (mkrsrc(mod, mcnode, CHAN_NODE_NAME, chan, auth,
167 &fmri) != 0) {
168 whinge(mod, NULL, "amd_generic_mc_create: mkrsrc "
169 "failed\n");
170 return (-1);
171 }
|