/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SGSBBC_PRIV_H
#define _SYS_SGSBBC_PRIV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Private structures used by the Serengeti SBBC Driver
*
* The Serengeti SBBC driver handles communication between the
* System Controller Software (ScApp) and Solaris via SBBC
* registers and IOSRAM.
*
* This header file contains necessary definitions to enable
* such communication.
*
* Register offsets and definitions can be found in
* Serengeti Architecture Programmer's Reference
* Revision 1.3 11/16/1999
* Section 2.5 to 2.8
*/
#include <sys/dditypes.h>
/*
* SBBC Interrupt registers
*/
/*
* Different interrupts
*/
/*
* EPLD Interrupt Register Offset for communication with the SC
*/
/*
* register numbers for mapping in OBP reg properties
*/
/*
*/
/*
* Register Offsets
*/
/*
* Port Interrupt Enable Register
*
* Field Bits Reset Type Description
* State
* Resvd <31:8> 0 R Reserved
* PINT1_EN <7:4> 0 RW Enables for each of the 4 PCI
* interrupt lines for Port Interrupt
* Generation register 1. Bit 7
* corresponds to PCI Interrupt D,
* bit 4 corresponds to PCI Interrupt A.
* PINT0_EN <3:0> 0 RW Same as above, but for register 0.
*/
#ifdef DEBUG
extern uint_t sgsbbc_debug;
#define SGSBBC_DBG_MBOX \
#define SGSBBC_DBG_INTR \
#define SGSBBC_DBG_EVENT \
#else /* DEBUG */
#define SGSBBC_DBG_ALL
#define SGSBBC_DBG_MBOX
#define SGSBBC_DBG_INTR
#define SGSBBC_DBG_EVENT
#endif /* DEBUG */
typedef struct sbbc_intrs {
int registered;
} sbbc_intrs_t;
struct sbbc_epld_regs {
};
/*
* device soft state
*/
typedef struct sbbc_softstate {
/*
* Tunnel Info.
*/
void *sram;
/*
* SBBC Register Info.
*/
/*
* device map handles for register mapping
*/
/*
* SBBC Interrupts
*/
/*
* misc.
*/
int sbbc_instance;
/* sbbc iosram state */
/*
* Structure used for tunnel switch
*/
typedef struct {
/*
* Routines for mapping and unmapping SBBC internal registers
*/
extern int sbbc_map_regs(sbbc_softstate_t *);
/*
* Interrupt related routines
*/
extern int sbbc_add_intr(sbbc_softstate_t *);
extern void sbbc_enable_intr(sbbc_softstate_t *);
extern void sbbc_disable_intr(sbbc_softstate_t *);
extern int sbbc_send_intr(sbbc_softstate_t *, int);
extern uint_t sbbc_intr_handler();
extern sbbc_softstate_t *sbbc_get_soft_state(int);
/*
* To protect master_chosen
*/
extern kmutex_t chosen_lock;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SGSBBC_PRIV_H */