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
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.
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]
23 * Copyright (c) 1999-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
40 #include <sys/param.h>
42 #include <sys/types.h>
43 #include <sys/utsname.h>
44 #include <sys/openpromio.h>
51 #include "pdevinfo_sun4u.h"
52 #include "display_sun4u.h"
53 #include "libprtdiag.h"
55 #if !defined(TEXT_DOMAIN)
56 #define TEXT_DOMAIN "SYS_TEST"
61 disp_prom_version(Prom_node
*flashprom
)
64 char *vers
; /* OBP version */
68 version
= find_prop(flashprom
, "version");
70 vers
= (char *)get_prop_val(version
);
73 log_printf(" %s ", vers
, 0);
76 * POST string follows the NULL terminated OBP
77 * version string. Do not attempt to print POST
78 * string unless node size is larger than the
79 * length of the OBP version string.
81 if ((strlen(vers
) + 1) < version
->size
) {
82 temp
= vers
+ strlen(vers
) + 1;
83 log_printf("%s", temp
, 0);
92 platform_disp_prom_version(Sys_tree
*tree
)
97 bnode
= tree
->bd_list
;
99 /* Display Prom revision header */
100 log_printf(dgettext(TEXT_DOMAIN
, "System PROM "
102 log_printf("----------------------\n", 0);
104 if ((pnode
= find_device(bnode
, 0x1F, SBUS_NAME
)) == NULL
) {
105 pnode
= find_pci_bus(bnode
->nodes
, 0x1F, 1);
109 * in case of platforms with multiple flashproms, find and
110 * display all proms with a "version"(OBP) property. bug 4187301
112 for (pnode
= dev_find_node(pnode
, "flashprom"); pnode
!= NULL
;
113 pnode
= dev_next_node(pnode
, "flashprom")) {
114 if (find_prop(pnode
, "version") != NULL
) {
115 disp_prom_version(pnode
);
121 get_pci_class_code_reg(Prom_node
*card_node
)
126 * Get the class-code of this node and return it
127 * if it exists. Otherwise return (-1).
129 value
= get_prop_val(find_prop(card_node
, "class-code"));
131 return (*(int *)value
);