xref: /illumos-gate/usr/src/lib/libprtdiag/inc/display_sun4u.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1999-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_DISPLAY_SUN4U_H
28 #define	_DISPLAY_SUN4U_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <pdevinfo_sun4u.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Define the memory decode bits for easier reading.  These are from
40  * the Sunfire Programmer's Manual.
41  */
42 #define	MEM_SIZE_64M   0x4
43 #define	MEM_SIZE_256M  0xb
44 #define	MEM_SIZE_1G    0xf
45 #define	MEM_SIZE_2G    0x2
46 
47 #define	MEM_SPEED_50ns 0x0
48 #define	MEM_SPEED_60ns 0x3
49 #define	MEM_SPEED_70ns 0x2
50 #define	MEM_SPEED_80ns 0x1
51 
52 /*
53  * If a QLC card is present in the system, the following values are needed
54  * to decode what type of a QLC card it is.
55  */
56 #define	AMBER_SUBSYSTEM_ID	0x4082
57 #define	CRYSTAL_SUBSYSTEM_ID	0x4083
58 
59 #define	AMBER_CARD_NAME		"Amber"
60 #define	CRYSTAL_CARD_NAME	"Crystal+"
61 
62 #define	MAX_QLC_MODEL_LEN	10
63 
64 /*
65  * Define strings in this structure as arrays instead of pointers so
66  * that copying is easier.
67  */
68 struct io_card {
69 	int  display;		    /* Should we display this card? */
70 	int  node_id;		    /* Node ID */
71 	int  board;		    /* Board number */
72 	char bus_type[MAXSTRLEN];   /* Type of bus this IO card is on */
73 	int  schizo_portid;	    /* portid of the Schizo for this card */
74 	char pci_bus;		    /* PCI bus A or B */
75 	int  slot;		    /* Slot number */
76 	char slot_str[MAXSTRLEN];   /* Slot description string */
77 	int  freq;		    /* Frequency (in MHz) */
78 	char status[MAXSTRLEN];	    /* Card status */
79 	char name[MAXSTRLEN];	    /* Card name */
80 	char model[MAXSTRLEN];	    /* Card model */
81 	int  dev_no;		    /* device number */
82 	int  func_no;		    /* function number */
83 	char notes[MAXSTRLEN];	    /* notes */
84 	struct io_card *next;
85 };
86 
87 /* used to determine whether slot (int) or slot_str(char*) should be used */
88 #define	PCI_SLOT_IS_STRING	(-99)
89 
90 int display(Sys_tree *, Prom_node *, struct system_kstat_data *, int);
91 
92 #ifdef	__cplusplus
93 }
94 #endif
95 
96 #endif	/* _DISPLAY_SUN4U_H */
97