xref: /illumos-gate/usr/src/lib/fm/topo/modules/common/hostbridge/hostbridge.h (revision d4bc0535efa2c2219e9f83246a5f371dc7f94273)
10eb822a1Scindi /*
20eb822a1Scindi  * CDDL HEADER START
30eb822a1Scindi  *
40eb822a1Scindi  * The contents of this file are subject to the terms of the
50eb822a1Scindi  * Common Development and Distribution License (the "License").
60eb822a1Scindi  * You may not use this file except in compliance with the License.
70eb822a1Scindi  *
80eb822a1Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90eb822a1Scindi  * or http://www.opensolaris.org/os/licensing.
100eb822a1Scindi  * See the License for the specific language governing permissions
110eb822a1Scindi  * and limitations under the License.
120eb822a1Scindi  *
130eb822a1Scindi  * When distributing Covered Code, include this CDDL HEADER in each
140eb822a1Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150eb822a1Scindi  * If applicable, add the following below this CDDL HEADER, with the
160eb822a1Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
170eb822a1Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
180eb822a1Scindi  *
190eb822a1Scindi  * CDDL HEADER END
200eb822a1Scindi  */
210eb822a1Scindi 
220eb822a1Scindi /*
23*d4bc0535SKrishna Elango  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240eb822a1Scindi  * Use is subject to license terms.
250eb822a1Scindi  */
260eb822a1Scindi 
270eb822a1Scindi #ifndef _HOSTBRIDGE_H
280eb822a1Scindi #define	_HOSTBRIDGE_H
290eb822a1Scindi 
300eb822a1Scindi #include <libdevinfo.h>
310eb822a1Scindi 
320eb822a1Scindi #ifdef __cplusplus
330eb822a1Scindi extern "C" {
340eb822a1Scindi #endif
350eb822a1Scindi 
360eb822a1Scindi #define	HB_ENUMR_VERS	1
370eb822a1Scindi 
380eb822a1Scindi #define	MAX_HBS	255
390eb822a1Scindi 
400eb822a1Scindi /*
410eb822a1Scindi  * Solaris Drivers for hostbridge ASICs.
420eb822a1Scindi  */
430eb822a1Scindi #define	SCHIZO		"pcisch"
440eb822a1Scindi #define	PSYCHO		"pcipsy"
450eb822a1Scindi #define	NPE		"npe"
46*d4bc0535SKrishna Elango #define	PCIEB		"pcieb"
470eb822a1Scindi #define	PCI_PCI		"pci_pci"
480eb822a1Scindi #define	PCI		"pci"
490eb822a1Scindi #define	PX		"px"
500eb822a1Scindi 
510eb822a1Scindi /*
520eb822a1Scindi  * These #defines are special values of bus and root complex instance
530eb822a1Scindi  * numbers, used in calls to did_create().  They're here because it's
540eb822a1Scindi  * the hostbridge enumerator that generally establishes the did_t values
550eb822a1Scindi  * at the top level.
560eb822a1Scindi  */
570eb822a1Scindi #define	TRUST_BDF	(-1)	/* Believe the bus value in the reg property */
580eb822a1Scindi #define	NO_RC		(-2)	/* Not a pci-express bus, so no root complex */
590eb822a1Scindi 
600eb822a1Scindi /*
610eb822a1Scindi  * PCI-express bridges to PCI, root complex instance is set to
620eb822a1Scindi  * (instance of the PCI-express side root complex - TO_PCI)
630eb822a1Scindi  */
640eb822a1Scindi #define	TO_PCI		(1000)
650eb822a1Scindi 
660eb822a1Scindi extern tnode_t *pcihostbridge_declare(topo_mod_t *, tnode_t *, di_node_t,
670eb822a1Scindi     topo_instance_t);
680eb822a1Scindi extern tnode_t *pciexhostbridge_declare(topo_mod_t *, tnode_t *, di_node_t,
690eb822a1Scindi     topo_instance_t);
700eb822a1Scindi extern tnode_t *pciexrc_declare(topo_mod_t *, tnode_t *, di_node_t,
710eb822a1Scindi     topo_instance_t);
720eb822a1Scindi 
730eb822a1Scindi #ifdef __cplusplus
740eb822a1Scindi }
750eb822a1Scindi #endif
760eb822a1Scindi 
770eb822a1Scindi #endif /* _HOSTBRIDGE_H */
78