libprtdiag.h revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_LIBPRTDIAG_H
#define _SYS_LIBPRTDIAG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/openpromio.h>
#include <sys/cheetahregs.h>
#include "pdevinfo.h"
#include "display.h"
#include "pdevinfo_sun4u.h"
#include "display_sun4u.h"
#ifdef DEBUG
#else
#define D_PRINTF
#endif
/* global data */
#define BUS_TYPE "UPA"
#define MAX_SLOTS_PER_IO_BD 8
int sys_clk; /* System clock freq. (in MHz) */
/*
* Defines for identifying PCI devices
*/
#define PCI_BRIDGE_CLASS 0x6
#define PCI_CLASS_SHIFT 0x10
#define PCI_PCI_BRIDGE_SUBCLASS 0x4
#define PCI_SUBCLASS_SHIFT 0x8
#define PCI_SUBCLASS_MASK 0xFF00
#define PCI_SUBCLASS_OTHER 0x80
/*
* display functions
*/
struct system_kstat_data *kstats);
void resolve_board_types(Sys_tree *);
void display_boardnum(int num);
void display_platform_specific_header(void);
/*
* cpu functions
*/
void display_cpu_devices(Sys_tree *);
void display_cpus(Board_node *);
void display_mid(int mid);
int get_ecache_size(Prom_node *);
/*
* io functions
*/
int get_pci_bus(Prom_node *);
int get_pci_device(Prom_node *);
int get_pci_to_pci_device(Prom_node *);
void free_io_cards(struct io_card *);
char *fmt_manf_id(unsigned int, char *);
int get_sbus_slot(Prom_node *);
void display_io_cards(struct io_card *);
void display_ffb(Board_node *, int);
void display_sbus(Board_node *);
char **slot_name_arr, int num_slots);
int *subclass_code);
char *card_name);
int slot_name_bits);
/*
* kstat functions
*/
struct system_kstat_data *sys_kstat,
/*
* memory functions
*/
/*
* prom functions
*/
void platform_disp_prom_version(Sys_tree *);
void disp_prom_version(Prom_node *);
int get_pci_class_code_reg(Prom_node *);
/*
* libdevinfo functions
*/
int do_devinfo(int, char *, int, int);
/*
* mc-us3 memory functions and structs
*/
typedef struct memory_bank {
int id;
int portid;
char *bank_status;
typedef struct memory_seg {
int id;
int intlv; /* interleave for this segment */
int nbanks; /* number of banks in this segment */
struct memory_seg *next;
} memory_seg_t;
#define NUM_MBANKS_PER_MC 4
void display_us3_banks(void);
int display_us3_failed_banks(int system_failed);
char *bank_status);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_LIBPRTDIAG_H */