view usr/src/lib/fm/topo/modules/SUNW,SPARC-Enterprise/ioboard/opl_topo.h @ 3062:46d280f5351d

6396916 verification of dtd file name is wrong 6399876 libtopo does not properly support an alternate root path 6399927 libtopo debug information indicates "no topology file found" when it is unable to parse file. 6421101 fmsim doesn't allow simulated topology to be specified with new libtopo 6422759 fmd memory leaks detected on system experiencing significant pcie fabric errors 6429072 memory leak in iob_tnode_create 6448718 libtopo needs better enum module APIs 6467144 topo_fmri_str2nvl doesn't handle authority or properties 6473916 fmd should return a full populated topo snapshot in fmd_hdl_topology() and fmd_fmri_topology() 6473918 hc scheme plugin is_present routine is broken 6477382 Need public header file for hc scheme component names and properties 6477385 fmtopo -V needs to be more friendly 6477426 fmtopo -d should not be so chatty 6477430 Need ability to load additional libtopo map files 6477442 libtopo should allow alternate platform topo map files 6477446 Remove unused topo methods from enumerator modules 6477453 pcibus and hostbridge interface boundaries are a mess 6477456 hc enumerators must support authority information 6477461 topo_fru_compute and topo_asru_compute should return static props when computation fails 6480930 fmtopo should support a -x option
author cindi
date Sat, 04 Nov 2006 01:18:55 -0800
parents 685e75c0930b
children c202da1d3c1c
line wrap: on
line source

/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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.
 */

#ifndef _OPL_TOPO_H
#define	_OPL_TOPO_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <fm/topo_hc.h>
#include <fm/topo_mod.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	PCI_BUS_VERS	1

/*
 * OPL uses the Jupiter Bus Bindings (see FWARC/2005/076) which specifies
 * the hostbridge port id (the part of the bus address before the comma) as
 *	[10:9] = 00
 * 	[8]    = LSB_ID[4] = 0
 *	[7:4]  = LSB_ID[3:0]
 *	[3]    = IO_Channel#[2] = 0
 *	[2:1]  = IO_Channel#[1:0]
 *	[0]    = PCI Leaf Number (0=leaf-A, 1=leaf-B)
 * where the LSB_ID is the logical system board, the IO_Channel is the
 * hostbridge, and the PCI leaf is the root complex. The definitions
 * allow up to 32 system boards, 8 hostbridges per system board, and
 * two root complexes per hostbridge.
 */

/* Common OPL limits */
#define	OPL_IOB_MAX	32	/* Max 32 IOBs per machine */
#define	OPL_HB_MAX	8	/* Max 8 hostbridges per IOB */
#define	OPL_RC_MAX	2	/* Max 2 root complexes per hostbridge */
#define	OPL_BUS_MAX	4	/* Max PCI-Ex buses under root complex */

/* Macros for manipulating px driver bus address. */
#define	OPL_PX_DRV	"px"			/* Oberon driver name */
#define	OPL_PX_STR2BA(s) strtol(s, NULL, 10)	/* Convert ba string to int */
#define	OPL_PX_LSB(a)	(((a) >> 4) & 0x1f)	/* Extract board from ba */
#define	OPL_PX_HB(a)	(((a) >> 1) & 0x07)	/* Extract hb from ba */
#define	OPL_PX_RC(a)	((a) & 0x01)		/* Extract rc from ba */
#define	OPL_SLOT_NAMES	"slot-names"		/* Slot name property */
#define	OPL_PX_DEVTYPE	"pciex"			/* Oberon is PCI-Ex devtype */
#define	OPL_PX_BDF	"0x08"			/* BDF is always 0/1/0 */

/* Macros for manipulating mc-opl driver bus address. */
#define	OPL_MC_DRV	"mc-opl"		/* Driver name */
#define	OPL_MC_STR2BA(s) strtol(s, NULL, 16)	/* Convert ba string to int */
#define	OPL_MC_LSB(a)	(((a) >> 4) & 0x1f)	/* Extract board from ba */
#define	OPL_PHYSICAL_BD	"physical-board#"	/* Physical board for the mc */

/* Structure listing devices on an ioboard */
typedef struct {
	int count;
	di_node_t rcs[OPL_HB_MAX][OPL_RC_MAX];
} ioboard_contents_t;

/* Shared device tree root node */
int opl_hb_enum(topo_mod_t *mp, const ioboard_contents_t *iob,
    tnode_t *parent, int brd);

#ifdef __cplusplus
}
#endif

#endif /* _OPL_TOPO_H */