17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
57aec1d6eScindi  * Common Development and Distribution License (the "License").
67aec1d6eScindi  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  */
217aec1d6eScindi 
227aec1d6eScindi /*
23*d4bc0535SKrishna Elango  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247aec1d6eScindi  * Use is subject to license terms.
257aec1d6eScindi  */
267aec1d6eScindi 
277aec1d6eScindi #ifndef _HOSTBRIDGE_H
287aec1d6eScindi #define	_HOSTBRIDGE_H
297aec1d6eScindi 
307aec1d6eScindi #include <libdevinfo.h>
317aec1d6eScindi 
327aec1d6eScindi #ifdef __cplusplus
337aec1d6eScindi extern "C" {
347aec1d6eScindi #endif
357aec1d6eScindi 
367aec1d6eScindi #define	HB_ENUMR_VERS	1
377aec1d6eScindi 
387aec1d6eScindi #define	MAX_HBS	255
397aec1d6eScindi 
407aec1d6eScindi /*
417aec1d6eScindi  * Solaris Drivers for hostbridge ASICs.
427aec1d6eScindi  */
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"
507aec1d6eScindi 
517aec1d6eScindi /*
527aec1d6eScindi  * These #defines are special values of bus and root complex instance
537aec1d6eScindi  * numbers, used in calls to did_create().  They're here because it's
547aec1d6eScindi  * the hostbridge enumerator that generally establishes the did_t values
557aec1d6eScindi  * at the top level.
567aec1d6eScindi  */
577aec1d6eScindi #define	TRUST_BDF	(-1)	/* Believe the bus value in the reg property */
587aec1d6eScindi #define	NO_RC		(-2)	/* Not a pci-express bus, so no root complex */
597aec1d6eScindi 
607aec1d6eScindi /*
617aec1d6eScindi  * PCI-express bridges to PCI, root complex instance is set to
627aec1d6eScindi  * (instance of the PCI-express side root complex - TO_PCI)
637aec1d6eScindi  */
647aec1d6eScindi #define	TO_PCI		(1000)
657aec1d6eScindi 
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);
727aec1d6eScindi 
737aec1d6eScindi #ifdef __cplusplus
747aec1d6eScindi }
757aec1d6eScindi #endif
767aec1d6eScindi 
777aec1d6eScindi #endif /* _HOSTBRIDGE_H */
78