iob_platform.c revision 0eb822a1c0c2bea495647510b75f77f0e57633eb
/*
* 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"
/*
* SUNW,Sun-Fire platform ioboard topology enumerator
*/
#include <string.h>
#include <libdevinfo.h>
#include <fm/topo_mod.h>
#include <did.h>
#include <hostbridge.h>
#include <ioboard.h>
#include <util.h>
/*ARGSUSED*/
int
{
/*
* For E15K, the label is simply IOXX where XX is the
* instance number of the ioboard.
*/
return (0);
nvlist_free(*out);
return (-1);
}
#define IOB_BASEADDR 0x1c
#define BUS_ADDRDIST 0x20
/*ARGSUSED*/
int
{
/*
* An E15K and its successors may have up to 18 I/O boards,
* numbered 0 through 17. Each board has two hostbridges, and
* there are a pair of PCI buses under each hostbridge. We can
* discover the existence of a board by the presence of
* devinfo nodes for those hostbridges. We let the hostbridge
* enumerator actually create nodes for the hostbridges,
* passing them the did_t's for all the hostbridge nodes we
* know indicate that the ioboard exists.
*/
if (devtree == DI_NODE_NIL) {
return (-1);
}
for (i = 0; i < 18; i++) {
}
while (pnode != DI_NODE_NIL) {
did_t *d;
d = split_bus_address(mod,
if (d == NULL) {
continue;
}
}
for (i = 0; i < 18; i++) {
/*
* Make sure we found all the buses and bridges
*/
continue;
== NULL) {
"Creation of tnode for %s%d failed.\n", IOBOARD, i);
continue;
}
iobs[i][0][0]) < 0) {
"Enumeration of %s%d/%s%d failed.\n",
IOBOARD, i, HOSTBRIDGE, 0);
continue;
}
iobs[i][0][0]) < 0) {
"Enumeration of %s%d/%s%d failed.\n",
continue;
}
}
return (0);
}