xref: /illumos-gate/usr/src/lib/libprtdiag/inc/display_sun4u.h (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
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 #include <pdevinfo_sun4u.h>
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Define the memory decode bits for easier reading.  These are from
38  * the Sunfire Programmer's Manual.
39  */
40 #define	MEM_SIZE_64M   0x4
41 #define	MEM_SIZE_256M  0xb
42 #define	MEM_SIZE_1G    0xf
43 #define	MEM_SIZE_2G    0x2
44 
45 #define	MEM_SPEED_50ns 0x0
46 #define	MEM_SPEED_60ns 0x3
47 #define	MEM_SPEED_70ns 0x2
48 #define	MEM_SPEED_80ns 0x1
49 
50 /*
51  * If a QLC card is present in the system, the following values are needed
52  * to decode what type of a QLC card it is.
53  */
54 #define	AMBER_SUBSYSTEM_ID	0x4082
55 #define	CRYSTAL_SUBSYSTEM_ID	0x4083
56 
57 #define	AMBER_CARD_NAME		"Amber"
58 #define	CRYSTAL_CARD_NAME	"Crystal+"
59 
60 #define	MAX_QLC_MODEL_LEN	10
61 
62 /*
63  * Define strings in this structure as arrays instead of pointers so
64  * that copying is easier.
65  */
66 struct io_card {
67 	int  display;		    /* Should we display this card? */
68 	int  node_id;		    /* Node ID */
69 	int  board;		    /* Board number */
70 	char bus_type[MAXSTRLEN];   /* Type of bus this IO card is on */
71 	int  schizo_portid;	    /* portid of the Schizo for this card */
72 	char pci_bus;		    /* PCI bus A or B */
73 	int  slot;		    /* Slot number */
74 	char slot_str[MAXSTRLEN];   /* Slot description string */
75 	int  freq;		    /* Frequency (in MHz) */
76 	char status[MAXSTRLEN];	    /* Card status */
77 	char name[MAXSTRLEN];	    /* Card name */
78 	char model[MAXSTRLEN];	    /* Card model */
79 	int  dev_no;		    /* device number */
80 	int  func_no;		    /* function number */
81 	char notes[MAXSTRLEN];	    /* notes */
82 	struct io_card *next;
83 };
84 
85 /* used to determine whether slot (int) or slot_str(char*) should be used */
86 #define	PCI_SLOT_IS_STRING	(-99)
87 
88 int display(Sys_tree *, Prom_node *, struct system_kstat_data *, int);
89 
90 #ifdef	__cplusplus
91 }
92 #endif
93 
94 #endif	/* _DISPLAY_SUN4U_H */
95