/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <strings.h>
#include <fm/topo_mod.h>
#include <hb_sun4.h>
#include <hostbridge.h>
#include <pcibus.h>
#include <did.h>
#include <util.h>
#include "hb_mdesc.h"
/*
* get_rcs()
* Description:
* Return a list of PX instances in the dev tree.
*/
static busorrc_t *
{
/* Scan for buses, top-level devinfo nodes with the right driver */
if (devtree == DI_NODE_NIL) {
return (NULL);
}
while (pnode != DI_NODE_NIL) {
return (NULL);
}
}
return (rcs);
}
/*
* find_dnode()
* Description:
* Find the dev pointer of a rc given its bus address, ba
*/
static di_node_t
{
busorrc_t *p;
return (p->br_din);
}
}
return (NULL);
}
/*
* hb_tnode_create()
* Description:
* Create a topo node
*/
static tnode_t *
{
int err;
return (NULL);
}
/* Create FMRI */
return (NULL);
}
/* Create and bind node */
return (NULL); /* mod_errno already set */
}
/* Inherit the parent 's FRU and label */
return (node);
}
/*
* platform_pciexhostbridge_declare()
* Description:
* This is a sun4v specific function to create the hostbridge topo node.
*/
tnode_t *
{
HOSTBRIDGE, inst);
return (NULL);
}
/* Make room for children */
return (hbn);
}
/*
* platform_pciexhostbridge_declare()
* Description:
* This is a sun4v specific function to create a root complex topo node,
* but do not enumerate its pci buses.
*/
static tnode_t *
{
int err;
PCIEX_ROOT, inst);
return (NULL);
}
/* Set ASRU to be the dev-scheme asru */
dnpath);
return (NULL);
}
return (NULL);
}
/*
* Set properties of the root complex node pciexrc
*/
/* Add the io and pci property groups */
return (NULL);
}
return (NULL);
}
/* Add the devfs path property */
return (NULL);
}
/* for sun4v, device type is always pciex */
}
/* sun4v rc driver is always "px" */
}
}
/* This is a PCIEX Root Complex */
}
/* Make room for children */
return (rcn);
}
/*
* platform_hb_enum()
* Description:
* This is an entry function to enumerate the sun4v hostbridges. First, it
* reads the hostbridges and their pciexrc root complexes from the PRI or
* MD.
* For the current sun4v platforms, it is assummed that there is only one
* hostbridge. All the pciex root complexes belong to this single hostbridge.
* Given the hostbridge/pciexrc information, this enumerator creates the
* the hostbridge topo node and pciexrc nodes. If the domain owns the
* the root complex, it uses the common hostbridge code to enumerate the
* pcibus. If not, it simply create the hostbridge/pciexrc nodes without the
* fabric.
*/
/*ARGSUSED*/
int
{
int i, j;
int err = 0;
int nhbnode = 0;
return (-1);
}
return (-1);
}
nrcs = 0;
continue;
}
return (0);
}
/* process the hostbridge */
int brd = 0;
continue;
}
continue;
err = -1;
break;
}
}
}
if (err != 0)
break;
/*
* If this hb has a rc in the dev tree, use the common code to
* create a hostbridge node
*/
} else {
/* platformm specific */
}
err = -1;
break;
}
/*
* Create the pciexrc nodes under the hostbridge node
* If a rc exists in the dev tree, use the common code to
* create a pciexrc node and enumerate the fabric.
* Otherwise, only create the pciexrc node.
*/
j);
continue;
}
/* declare a pciexrc and enumerate its pcibus */
} else {
/* only declare the pciexrc */
}
err = -1;
break;
}
nrcnode++;
}
nhbnode++;
}
/* failure: unbind all hb and rc tnodes */
if (err != 0) {
for (i = 0; i < nhbnode; i++)
topo_node_unbind(hbnode[i]);
for (i = 0; i < nrcnode; i++)
topo_node_unbind(rcnode[i]);
}
return (err);
}
/*ARGSUSED*/
int
{
}