/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_OPL_CFG_H
#define _SYS_OPL_CFG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Hardware Descriptor.
*/
#include <sys/opl_hwdesc.h>
/*
* CPU device portid:
*
* 1 0 0 0 0 0 0 0 0 0 0
* 0 9 8 7 6 5 4 3 2 1 0
* ---------------------------------------
* | 1 | LSB ID | CHIP | CORE | CPU |
* ---------------------------------------
*/
\
/*
* Dummy address space for a chip.
*/
\
/*
* pseudo-mc portid:
*
* 1 0 0 0 0 0 0 0 0 0 0
* 0 9 8 7 6 5 4 3 2 1 0
* -------------------------------------
* | 0 | 1 | LSB ID | 0 |
* -------------------------------------
*/
/*
* Dummy address space for a pseudo memory node
*/
\
(1ULL << 33))
/*
* Defines used by the Jupiter bus-specific library (lfc_jupiter.so).
* This library gets loaded into the user-level fcode interpreter
* and provides bus-specific methods that are used by the Oberon
* and the CMU-channel fcode drivers.
*/
/*
*
* IO port id:
*
* 1 0 0 0 0 0 0 0 0 0 0
* 0 9 8 7 6 5 4 3 2 1 0
* ---------------------------------------
* | 0 0 | LSB ID | IO CHAN | LEAF |
* ---------------------------------------
*/
#if defined(_KERNEL)
/*
* We store the pointers to the following device nodes in this structure:
* "pseudo-mc"
* "cmp"
* "pci"
*
* These nodes represent the different branches we create in the device
* tree for each board during probe. We store them so that when a board
* is unprobed, we can easily locate the branches and destroy them.
*/
typedef struct {
char *cfg_cmuch_probe_str;
void *cfg_hwd;
/*
* Prototypes for the callback functions used in the DDI functions
* used to perform device tree operations.
*
* init functions are used to find device nodes that are created
* by Solaris during boot.
*
* create functions are used to initialize device nodes during DR.
*/
/*
* The following probe structure carries all the information required
* at various points during probe. This structure serves two purposes:
*
* 1. It allows us to streamline functions and have them accept just
* a single argument.
*
* 2. It allows us to pass information to the DDI callbacks. DDI
* callbacks are allowed only one argument. It also allows
* us to return information from those callbacks.
*
* The probe structure carries a snapshot of the hardware descriptor
* taken at the beginning of a probe.
*/
typedef struct {
int pr_board;
int pr_cpu_chip;
int pr_core;
int pr_cpu;
int pr_channel;
int pr_channel_status;
int pr_leaf;
int pr_leaf_status;
int pr_hold;
unsigned pr_cpu_impl;
} opl_probe_t;
typedef struct {
} opl_addr_t;
typedef struct {
} opl_range_t;
typedef struct {
int mc_bank;
/*
* Convenience macros for DDI property operations. The functions that
* DDI provides for getting and updating properties are not symmetric
* either in their names or in the number of arguments. These macros
* hide the gory details and provide a symmetric way to get and
* set properties.
*/
( \
)
ddi_prop_free((void *)data)
if (ret != DDI_PROP_SUCCESS) { \
return (DDI_WALK_ERROR); \
}
/*
* Node names for the different nodes supported in OPL.
*/
typedef struct {
char *fc_service;
} opl_fc_ops_t;
/*
* Functions used by drmach
*/
extern int opl_probe_sb(int, unsigned *);
extern int opl_unprobe_sb(int);
hwd_domain_info_t **, hwd_sb_t **);
extern void opl_hold_devtree(void);
extern void opl_release_devtree(void);
extern int opl_init_cfg();
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_OPL_CFG_H */