03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The contents of this file are subject to the terms of the
e79c98e6c943cb3032f272714ff4ce6137d40394zk * Common Development and Distribution License (the "License").
e79c98e6c943cb3032f272714ff4ce6137d40394zk * You may not use this file except in compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * or http://www.opensolaris.org/os/licensing.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel * information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
e79c98e6c943cb3032f272714ff4ce6137d40394zk * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Daktari Platform specific functions.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * called when :
03831d35f7499c87d51205817c93e9a8d42c4baestevel * machine_type == MTYPE_DAKTARI
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#pragma ident "%Z%%M% %I% %E% SMI"
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <stdio.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <stdlib.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <unistd.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <kstat.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <string.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <assert.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <libintl.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <note.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <sys/openpromio.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <sys/sysmacros.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <sys/daktari.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <pdevinfo.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <display.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <pdevinfo_sun4u.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <display_sun4u.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <libprtdiag.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include <picl.h>
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include "workfile.c"
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#if !defined(TEXT_DOMAIN)
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define TEXT_DOMAIN "SYS_TEST"
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_SLOTS_PER_IO_BD 9
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_DISKS 12
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_FSP_LEDS 2
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_PS 3
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_PS_VOLTAGE_SENSORS 4
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_PS_FAULT_SENSORS 3
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define DAK_MAX_FANS 10
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifndef SCHIZO_COMPAT_PROP
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHIZO_COMPAT_PROP "pci108e,8001"
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define MULTIPLE_BITS_SET(x) ((x)&((x)-1))
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelextern int print_flag;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * these functions will overlay the symbol table of libprtdiag
03831d35f7499c87d51205817c93e9a8d42c4baestevel * at runtime (workgroup server systems only)
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_cpu_devices(Sys_tree *tree);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_cpus(Board_node *board);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_pci(Board_node *board);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_io_cards(struct io_card *list);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_diaginfo(int flag, Prom_node *root, Sys_tree *tree,
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct system_kstat_data *kstats);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_ffb(Board_node *board, int table);
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid display_memoryconf(Sys_tree *tree, struct grp_info *grps);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* local functions */
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int disp_envc_status(void);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_temps(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_keyswitch(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_FSP_LEDS(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_disk(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_fans(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic int dak_env_print_ps(picl_nodehdl_t);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic void dak_display_hw_revisions(Prom_node *root,
03831d35f7499c87d51205817c93e9a8d42c4baestevel Board_node *bnode);
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic void display_schizo_revisions(Board_node *bdlist);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Defining the error_check function in order to return the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * appropriate error code.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*ARGSUSED0*/
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baestevelerror_check(Sys_tree *tree, struct system_kstat_data *kstats)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int exit_code = 0; /* init to all OK */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * silently check for any types of machine errors
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel print_flag = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (disp_fail_parts(tree)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* set exit_code to show failures */
03831d35f7499c87d51205817c93e9a8d42c4baestevel exit_code = 1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel print_flag = 1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (exit_code);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * disp_fail_parts
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Display the failed parts in the system. This function looks for
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the status property in all PROM nodes. On systems where
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the PROM does not support passing diagnostic information
03831d35f7499c87d51205817c93e9a8d42c4baestevel * through the device tree, this routine will be silent.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisp_fail_parts(Sys_tree *tree)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int exit_code = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int system_failed = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel Board_node *bnode = tree->bd_list;
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *pnode;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* go through all of the boards looking for failed units. */
03831d35f7499c87d51205817c93e9a8d42c4baestevel while (bnode != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* find failed chips */
03831d35f7499c87d51205817c93e9a8d42c4baestevel pnode = find_failed_node(bnode->nodes);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((pnode != NULL) && !system_failed) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel system_failed = 1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel exit_code = 1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (print_flag == 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (exit_code);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "Failed Field "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Replaceable Units (FRU) in System:\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("=========================="
e79c98e6c943cb3032f272714ff4ce6137d40394zk "====================\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel while (pnode != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel void *value;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *name; /* node name string */
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *type; /* node type string */
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *board_type = NULL;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel value = get_prop_val(find_prop(pnode, "status"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel name = get_node_name(pnode);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* sanity check of data retrieved from PROM */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((value == NULL) || (name == NULL)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel pnode = next_failed_node(pnode);
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Find the board type of this board */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (bnode->board_type == CPU_BOARD) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel board_type = "CPU";
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel board_type = "IO";
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%s unavailable "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "on %s Board #%d\n"), name, board_type,
e79c98e6c943cb3032f272714ff4ce6137d40394zk bnode->board_num);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\tPROM fault string: %s\n"), value);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\tFailed Field Replaceable Unit is "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Determine whether FRU is CPU module, system
03831d35f7499c87d51205817c93e9a8d42c4baestevel * board, or SBus card.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((name != NULL) && (strstr(name, "sbus"))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "SBus Card %d\n"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk get_sbus_slot(pnode));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else if (((name = get_node_name(pnode->parent)) !=
03831d35f7499c87d51205817c93e9a8d42c4baestevel NULL) && (strstr(name, "pci"))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "PCI Card %d"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk get_pci_device(pnode));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else if (((type = get_node_type(pnode)) != NULL) &&
03831d35f7499c87d51205817c93e9a8d42c4baestevel (strstr(type, "cpu"))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "UltraSPARC "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "module Board %d Module %d\n"), 0,
e79c98e6c943cb3032f272714ff4ce6137d40394zk get_id(pnode));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s board %d\n"), board_type,
e79c98e6c943cb3032f272714ff4ce6137d40394zk bnode->board_num);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel pnode = next_failed_node(pnode);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = bnode->next;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (!system_failed) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "No failures found in System\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("===========================\n\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (system_failed)
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (1);
03831d35f7499c87d51205817c93e9a8d42c4baestevel else
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*ARGSUSED*/
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Display failed units */
03831d35f7499c87d51205817c93e9a8d42c4baestevel (void) disp_fail_parts(tree);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*ARGSUSED*/
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_memoryconf(Sys_tree *tree, struct grp_info *grps)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel Board_node *bnode = tree->bd_list;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "========================= Memory Configuration"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " ===============================\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n Logical Logical"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Logical "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n MC Bank Bank Bank"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " DIMM Interleave Interleaved"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n Brd ID num size "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Status Size "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Factor with"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n---- --- ---- ------ "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "----------- ------ "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "---------- -----------"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel while (bnode != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (get_us3_mem_regs(bnode)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\nFailed to get memory information.\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = bnode->next;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Display what we have found */
03831d35f7499c87d51205817c93e9a8d42c4baestevel display_us3_banks();
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_cpu_devices(Sys_tree *tree)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel Board_node *bnode;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Display the table header for CPUs . Then display the CPU
03831d35f7499c87d51205817c93e9a8d42c4baestevel * frequency, cache size, and processor revision of all cpus.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "========================="
e79c98e6c943cb3032f272714ff4ce6137d40394zk " CPUs "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "==============================================="
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Run E$ CPU CPU \n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Brd CPU MHz MB Impl. Mask \n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "--- ----- ---- ---- ------- ---- \n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Now display all of the cpus on each board */
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = tree->bd_list;
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (bnode == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "CPU Board list was NULL\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel while (bnode != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel display_cpus(bnode);
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = bnode->next;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Display the CPUs present on this board.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_cpus(Board_node *board)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *cpu;
e79c98e6c943cb3032f272714ff4ce6137d40394zk uint_t freq; /* CPU clock frequency */
03831d35f7499c87d51205817c93e9a8d42c4baestevel int ecache_size; /* External cache size */
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *l3_shares;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *mid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *impl;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *mask;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *coreid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char fru_prev = 'X'; /* Valid frus are 'A','B','C','D' */
03831d35f7499c87d51205817c93e9a8d42c4baestevel int mid_prev;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int ecache_size_prev = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char fru_name;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * display the CPUs' operating frequency, cache size, impl. field
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and mask revision.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (cpu = dev_find_type(board->nodes, "cpu"); cpu != NULL;
03831d35f7499c87d51205817c93e9a8d42c4baestevel cpu = dev_next_type(cpu, "cpu")) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel mid = (int *)get_prop_val(find_prop(cpu, "portid"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (mid == NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel mid = (int *)get_prop_val(find_prop(cpu, "cpuid"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel freq = DAK_CLK_FREQ_TO_MHZ(get_cpu_freq(cpu));
03831d35f7499c87d51205817c93e9a8d42c4baestevel ecache_size = get_ecache_size(cpu);
03831d35f7499c87d51205817c93e9a8d42c4baestevel impl = (int *)get_prop_val(find_prop(cpu, "implementation#"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel mask = (int *)get_prop_val(find_prop(cpu, "mask#"));
e79c98e6c943cb3032f272714ff4ce6137d40394zk l3_shares = (int *)get_prop_val(find_prop(cpu,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "l3-cache-sharing"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Do not display a failed CPU node */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((impl == NULL) || (freq == 0) || (node_failed(cpu)))
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Board number */
03831d35f7499c87d51205817c93e9a8d42c4baestevel fru_name = (char)('A' + DAK_GETSLOT(*mid));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (CPU_IMPL_IS_CMP(*impl)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel coreid = (int *)get_prop_val(find_prop(cpu, "reg"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (coreid == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((fru_prev == 'X') ||
e79c98e6c943cb3032f272714ff4ce6137d40394zk ((fru_prev != 'X') &&
e79c98e6c943cb3032f272714ff4ce6137d40394zk (fru_name != fru_prev))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel fru_prev = fru_name;
03831d35f7499c87d51205817c93e9a8d42c4baestevel mid_prev = *mid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel ecache_size_prev = ecache_size;
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Some CMP chips have a split E$,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * so the size for both cores is added
03831d35f7499c87d51205817c93e9a8d42c4baestevel * together to get the total size for
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the chip.
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Still, other CMP chips have E$ (L3)
03831d35f7499c87d51205817c93e9a8d42c4baestevel * which is logically shared, so the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * total size is equal to the core size.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((l3_shares == NULL) ||
e79c98e6c943cb3032f272714ff4ce6137d40394zk ((l3_shares != NULL) &&
e79c98e6c943cb3032f272714ff4ce6137d40394zk MULTIPLE_BITS_SET(*l3_shares))) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel ecache_size += ecache_size_prev;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel ecache_size_prev = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel fru_prev = 'X';
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%2c", fru_name);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* CPU Module ID */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (CPU_IMPL_IS_CMP(*impl)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%3d,%3d", mid_prev, *mid, 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(" %d ", *mid);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Running frequency */
e79c98e6c943cb3032f272714ff4ce6137d40394zk log_printf(" %4u ", freq);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Ecache size */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (ecache_size == 0)
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%3s "),
03831d35f7499c87d51205817c93e9a8d42c4baestevel "N/A");
03831d35f7499c87d51205817c93e9a8d42c4baestevel else
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%4.1f ",
e79c98e6c943cb3032f272714ff4ce6137d40394zk (float)ecache_size / (float)(1<<20));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Implementation */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (impl == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%s "),
03831d35f7499c87d51205817c93e9a8d42c4baestevel "N/A");
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (IS_CHEETAH(*impl))
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%7s", "US-III ", 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel else if (IS_CHEETAH_PLUS(*impl))
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%7s", "US-III+", 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel else if (IS_JAGUAR(*impl))
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%7s", "US-IV ", 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel else if (IS_PANTHER(*impl))
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%7s", "US-IV+ ", 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel else
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-7x", *impl, 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* CPU Mask */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (mask == NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " %3s "),
03831d35f7499c87d51205817c93e9a8d42c4baestevel "N/A");
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " %2d.%d"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel (*mask >> 4) & 0xf, *mask & 0xf);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * display_pci
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Display all the PCI IO cards on this board.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_pci(Board_node *board)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct io_card *card_list = NULL;
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct io_card card;
03831d35f7499c87d51205817c93e9a8d42c4baestevel void *value;
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *pci;
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *card_node;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *slot_name_arr[DAK_MAX_SLOTS_PER_IO_BD] = {NULL};
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel int slot_name_bits;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (board == NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel return;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel memset(&card, 0, sizeof (struct io_card));
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Initialize all the common information */
03831d35f7499c87d51205817c93e9a8d42c4baestevel card.display = TRUE;
03831d35f7499c87d51205817c93e9a8d42c4baestevel card.board = board->board_num;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Search for each pci instance, then find/display all nodes under
03831d35f7499c87d51205817c93e9a8d42c4baestevel * each instance node found.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (pci = dev_find_node_by_compat(board->nodes, SCHIZO_COMPAT_PROP);
e79c98e6c943cb3032f272714ff4ce6137d40394zk pci != NULL;
e79c98e6c943cb3032f272714ff4ce6137d40394zk pci = dev_next_node_by_compat(pci, SCHIZO_COMPAT_PROP)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel (void) snprintf(card.bus_type, MAXSTRLEN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk dgettext(TEXT_DOMAIN, "PCI"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Get slot-name properties from parent node and
03831d35f7499c87d51205817c93e9a8d42c4baestevel * store them in an array.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel value = (char *)get_prop_val(
e79c98e6c943cb3032f272714ff4ce6137d40394zk find_prop(pci, "slot-names"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (value != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* save the 4 byte bitmask */
03831d35f7499c87d51205817c93e9a8d42c4baestevel slot_name_bits = *(int *)value;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* array starts after first int */
03831d35f7499c87d51205817c93e9a8d42c4baestevel slot_name_arr[0] = (char *)value + sizeof (int);
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 1; i < DAK_MAX_SLOTS_PER_IO_BD; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel slot_name_arr[i] = (char *)slot_name_arr[i - 1]
e79c98e6c943cb3032f272714ff4ce6137d40394zk + strlen(slot_name_arr[i - 1]) +1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Search for Children of this node ie. Cards.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Note: any of these cards can be a pci-bridge
03831d35f7499c87d51205817c93e9a8d42c4baestevel * that itself has children. If we find a
03831d35f7499c87d51205817c93e9a8d42c4baestevel * pci-bridge we need to handle it specially.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel card_node = pci->child;
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Generate the list of pci cards on pci instance: pci */
03831d35f7499c87d51205817c93e9a8d42c4baestevel fill_pci_card_list(pci, card_node, &card, &card_list,
e79c98e6c943cb3032f272714ff4ce6137d40394zk slot_name_arr);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } /* end-for */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel display_io_cards(card_list);
03831d35f7499c87d51205817c93e9a8d42c4baestevel free_io_cards(card_list);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Print out all the io cards in the list. Also print the column
03831d35f7499c87d51205817c93e9a8d42c4baestevel * headers if told to do so.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_io_cards(struct io_card *list)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel static int banner = 0; /* Have we printed the column headings? */
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct io_card *p;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (list == NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel return;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (banner == FALSE) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Bus Max\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " IO Port Bus Freq Bus Dev,"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Brd Type ID Side Slot MHz Freq "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Func State Name "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Model\n"
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* ---------Brd IO Port Bus Slot Bus Max Dev Stat */
e79c98e6c943cb3032f272714ff4ce6137d40394zk "---- ---- ---- ---- ---- ---- ---- ----"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " ----- "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "-------------------------------- "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "----------------------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel banner = TRUE;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (p = list; p != NULL; p = p -> next) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "I/O "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-4s ", p->bus_type);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-3d ", p->schizo_portid);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%c ", p->pci_bus);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-1s ", p->slot_str);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-3d ", p->freq);
03831d35f7499c87d51205817c93e9a8d42c4baestevel switch (p->pci_bus) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel case 'A':
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " 66 "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel break;
03831d35f7499c87d51205817c93e9a8d42c4baestevel case 'B':
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " 33 "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel break;
03831d35f7499c87d51205817c93e9a8d42c4baestevel default:
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " - "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel break;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-1d,%-1d ", p->dev_no, p->func_no);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-5s ", p->status);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-32.32s", p->name);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (strlen(p->name) > 32)
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "+ "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel else
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%-22.22s", p->model);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (strlen(p->model) > 22)
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "+"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%s "), p->notes);
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * display_ffb
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * There are no FFB's on a Daktari, however in the generic library,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * the display_ffb() function is implemented so we have to define an
03831d35f7499c87d51205817c93e9a8d42c4baestevel * empty function here.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* ARGSUSED */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_ffb(Board_node *board, int table)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * ----------------------------------------------------------------------------
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* ARGSUSED */
03831d35f7499c87d51205817c93e9a8d42c4baestevelvoid
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_diaginfo(int flag, Prom_node *root, Sys_tree *tree,
03831d35f7499c87d51205817c93e9a8d42c4baestevel struct system_kstat_data *kstats)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* NOTE(ARGUNUSED(kstats)) */
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Now display the last powerfail time and the fatal hardware
03831d35f7499c87d51205817c93e9a8d42c4baestevel * reset information. We do this under a couple of conditions.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * First if the user asks for it. The second is if the user
03831d35f7499c87d51205817c93e9a8d42c4baestevel * told us to do logging, and we found a system failure.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (flag) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * display time of latest powerfail. Not all systems
03831d35f7499c87d51205817c93e9a8d42c4baestevel * have this capability. For those that do not, this
03831d35f7499c87d51205817c93e9a8d42c4baestevel * is just a no-op.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel disp_powerfail(root);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel (void) disp_envc_status();
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* platform_disp_prom_version(tree); */
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_display_hw_revisions(root, tree->bd_list);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * local functions
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * disp_envc_status
03831d35f7499c87d51205817c93e9a8d42c4baestevel *
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This routine displays the environmental status passed up from
03831d35f7499c87d51205817c93e9a8d42c4baestevel * device drivers via the envlibobj.so library.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This is a Daktari specific environmental information display routine.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisp_envc_status()
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int err;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *system = "SYSTEM";
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t system_node, root;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_initialize();
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_initialize failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\nCannot display environmental status\n"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_root(&root);
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = find_child_device(root, system, &system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_node_by_path for the SYSTEM node "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\nCannot display environmental status\n"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "========================= "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Environmental Status "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "========================="
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_temps(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_keyswitch(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_FSP_LEDS(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_disk(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_fans(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel dak_env_print_ps(system_node);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel (void) picl_shutdown();
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_ps(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i, r, fail, err = 0;
8a88157cd7245729dea5d91a5181bb05a80164a8vb int low_warn_flag = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char name[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *ps;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *ps_fail[DAK_MAX_PS_FAULT_SENSORS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *ps_I_sensor[DAK_MAX_PS_VOLTAGE_SENSORS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t volts[DAK_MAX_PS_VOLTAGE_SENSORS];
8a88157cd7245729dea5d91a5181bb05a80164a8vb int32_t lo_warn[DAK_MAX_PS_VOLTAGE_SENSORS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char fault_state
e79c98e6c943cb3032f272714ff4ce6137d40394zk [DAK_MAX_PS_FAULT_SENSORS][PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char ps_state[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Printing out the Power Supply Heading information */
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Power Supplies:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "---------------\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Current Drain:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Supply Status Fan Fail Temp Fail CS Fail "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "3.3V 5V 12V 48V\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "------ ------------ -------- --------- "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "------- ---- -- --- ---\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_PS", &number,
03831d35f7499c87d51205817c93e9a8d42c4baestevel &ps);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_array_from_id for PS\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Printing out the Power Supply Status information */
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < DAK_MAX_PS; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Re initialize the fail variable so that if
03831d35f7499c87d51205817c93e9a8d42c4baestevel * one power supply fails, they don't all do also.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel fail = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(ps[i], PICL_PROP_NAME, name,
03831d35f7499c87d51205817c93e9a8d42c4baestevel PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(ps[i], "State", ps_state,
e79c98e6c943cb3032f272714ff4ce6137d40394zk PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Error getting ps[%d]'s state: %s"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk i, picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(ps[i], "PSVC_DEV_FAULT_SENSOR",
e79c98e6c943cb3032f272714ff4ce6137d40394zk &number, &ps_fail[i]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed to get present PS fault sensors\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(ps[i], "PSVC_PS_I_SENSOR",
03831d35f7499c87d51205817c93e9a8d42c4baestevel &number, &ps_I_sensor[i]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((err != PICL_SUCCESS) && (err != PICL_INVALIDHANDLE)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed to get present PS I sensors\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%s", name);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If the AC cord is unplugged, then the power supply
03831d35f7499c87d51205817c93e9a8d42c4baestevel * sensors will have unreliable values. In this case,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * skip to the next power supply.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (strcmp(ps_state, "HOTPLUGGED") == 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
03831d35f7499c87d51205817c93e9a8d42c4baestevel " UNPLUGGED\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (r = 0; r < DAK_MAX_PS_FAULT_SENSORS; r++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(ps_fail[i][r], "State",
e79c98e6c943cb3032f272714ff4ce6137d40394zk fault_state[r], PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel fail =
03831d35f7499c87d51205817c93e9a8d42c4baestevel strcmp(fault_state[r], "OFF")
03831d35f7499c87d51205817c93e9a8d42c4baestevel + fail;
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for ps "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "fault state failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (r = 0; r < DAK_MAX_PS_VOLTAGE_SENSORS; r++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(ps_I_sensor[i][r],
e79c98e6c943cb3032f272714ff4ce6137d40394zk "AtoDSensorValue", &volts[r],
e79c98e6c943cb3032f272714ff4ce6137d40394zk sizeof (int32_t));
8a88157cd7245729dea5d91a5181bb05a80164a8vb if (err != PICL_SUCCESS) {
8a88157cd7245729dea5d91a5181bb05a80164a8vb log_printf(dgettext(TEXT_DOMAIN,
8a88157cd7245729dea5d91a5181bb05a80164a8vb "failed to get A to D sensor "
8a88157cd7245729dea5d91a5181bb05a80164a8vb "value\n%s\n"), picl_strerror(err));
8a88157cd7245729dea5d91a5181bb05a80164a8vb return (err);
8a88157cd7245729dea5d91a5181bb05a80164a8vb }
8a88157cd7245729dea5d91a5181bb05a80164a8vb err = picl_get_propval_by_name(ps_I_sensor[i][r],
8a88157cd7245729dea5d91a5181bb05a80164a8vb "LowWarningThreshold", &lo_warn[r],
8a88157cd7245729dea5d91a5181bb05a80164a8vb sizeof (int32_t));
8a88157cd7245729dea5d91a5181bb05a80164a8vb if (err != PICL_SUCCESS) {
8a88157cd7245729dea5d91a5181bb05a80164a8vb log_printf(dgettext(TEXT_DOMAIN,
8a88157cd7245729dea5d91a5181bb05a80164a8vb "failed to get low warning threshold "
8a88157cd7245729dea5d91a5181bb05a80164a8vb "value\n%s\n"), picl_strerror(err));
8a88157cd7245729dea5d91a5181bb05a80164a8vb return (err);
8a88157cd7245729dea5d91a5181bb05a80164a8vb }
8a88157cd7245729dea5d91a5181bb05a80164a8vb if (volts[r] <= lo_warn[r])
8a88157cd7245729dea5d91a5181bb05a80164a8vb low_warn_flag++;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
8a88157cd7245729dea5d91a5181bb05a80164a8vb if (fail != 0 || low_warn_flag != 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
03831d35f7499c87d51205817c93e9a8d42c4baestevel " FAIL "));
8a88157cd7245729dea5d91a5181bb05a80164a8vb } else {
8a88157cd7245729dea5d91a5181bb05a80164a8vb log_printf(dgettext(TEXT_DOMAIN, " GOOD "));
8a88157cd7245729dea5d91a5181bb05a80164a8vb }
8a88157cd7245729dea5d91a5181bb05a80164a8vb
8a88157cd7245729dea5d91a5181bb05a80164a8vb if (fail != 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (r = 0; r < DAK_MAX_PS_FAULT_SENSORS; r++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " %-4s"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk fault_state[r]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (r = 0; r < DAK_MAX_PS_FAULT_SENSORS; r++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (r = 0; r < DAK_MAX_PS_VOLTAGE_SENSORS; r++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " %2d"), volts[r]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_fans(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i, err = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number, fan_speed;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *fans;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char name[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char enabled[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_FAN", &number,
03831d35f7499c87d51205817c93e9a8d42c4baestevel &fans);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_array_from_id "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "for FAN\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "=================================\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "Fan Bank :\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "----------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "Bank Speed "
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Status Fan State\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " ( RPMS )"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " \n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "---- --------"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " --------- ---------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < DAK_MAX_FANS; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel char fan_state[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel fan_speed = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fans[i], PICL_PROP_NAME, name,
03831d35f7499c87d51205817c93e9a8d42c4baestevel PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%16-s"), name);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fans[i], "Fan-speed",
e79c98e6c943cb3032f272714ff4ce6137d40394zk &fan_speed, sizeof (int32_t));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((err != PICL_SUCCESS) && (err != PICL_INVALIDHANDLE)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in picl_get_propval_by_name for "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "fan speed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((strcmp(name, "CPU0_PRIM_FAN") != 0) &&
e79c98e6c943cb3032f272714ff4ce6137d40394zk (strcmp(name, "CPU1_PRIM_FAN") != 0)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fans[i], "Fan-switch",
e79c98e6c943cb3032f272714ff4ce6137d40394zk enabled, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((err != PICL_SUCCESS) &&
03831d35f7499c87d51205817c93e9a8d42c4baestevel (err != PICL_INVALIDHANDLE)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in picl_get_propval_by_name for"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " fan enabled/disabled\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Display the fan's speed and whether or not
03831d35f7499c87d51205817c93e9a8d42c4baestevel * it's enabled.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (strcmp(enabled, "ON") == 0) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\t %4d [ENABLED]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk fan_speed);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\t 0 [DISABLED]"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* Display the fan's speed */
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "\t %4d"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk fan_speed);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " [ENABLED]"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fans[i], "State", fan_state,
e79c98e6c943cb3032f272714ff4ce6137d40394zk PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name failed: %s"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "\t %s\n"), fan_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "=================================\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_disk(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i, err;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *disks;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t disk_slots[DAK_MAX_DISKS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t disk_fault_leds[DAK_MAX_DISKS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t disk_remove_leds[DAK_MAX_DISKS];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char led_state[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char name[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_DISK", &number,
e79c98e6c943cb3032f272714ff4ce6137d40394zk &disks);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_array_from_id for "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "DISK\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Disk Status:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Presence Fault LED Remove LED\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < DAK_MAX_DISKS; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(disks[i], PICL_PROP_NAME, name,
03831d35f7499c87d51205817c93e9a8d42c4baestevel PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel switch (err) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel case PICL_SUCCESS:
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "DISK %2d: [%7s]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk i, "PRESENT");
03831d35f7499c87d51205817c93e9a8d42c4baestevel break;
03831d35f7499c87d51205817c93e9a8d42c4baestevel case PICL_INVALIDHANDLE:
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "DISK %2d: [%7s]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk i, "EMPTY");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel default:
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Failed picl_get_propval_by_name for "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "disk %d with %s\n"), i, picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_from_id(disks[i], "PSVC_PARENT",
e79c98e6c943cb3032f272714ff4ce6137d40394zk &(disk_slots[i]));
03831d35f7499c87d51205817c93e9a8d42c4baestevel switch (err) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel case PICL_SUCCESS:
03831d35f7499c87d51205817c93e9a8d42c4baestevel break;
03831d35f7499c87d51205817c93e9a8d42c4baestevel case PICL_INVALIDHANDLE:
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel default:
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_from_id for disk "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "slot\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_from_id(disk_slots[i], "PSVC_SLOT_FAULT_LED",
03831d35f7499c87d51205817c93e9a8d42c4baestevel &disk_fault_leds[i]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_from_id for disk slot "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "fault led\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(disk_fault_leds[i],
e79c98e6c943cb3032f272714ff4ce6137d40394zk "State", led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " [%3s]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for fault led_state"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_from_id(disk_slots[i], "PSVC_SLOT_REMOVE_LED",
03831d35f7499c87d51205817c93e9a8d42c4baestevel &disk_remove_leds[i]);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_from_id for disk slot "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "remove led\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(disk_remove_leds[i],
e79c98e6c943cb3032f272714ff4ce6137d40394zk "State", led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " [%3s]"), led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for remove"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " led_state failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_FSP_LEDS(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i, err = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *fsp_leds;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char led_state[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_FSP_LED", &number,
03831d35f7499c87d51205817c93e9a8d42c4baestevel &fsp_leds);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_array_from_id for "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "FSP_LED\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "System LED Status:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " GEN FAULT REMOVE\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < DAK_MAX_FSP_LEDS; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fsp_leds[i], "State",
e79c98e6c943cb3032f272714ff4ce6137d40394zk led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for led_state"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " [%3s]"), led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " DISK FAULT "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "POWER FAULT\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 2; i < 4; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fsp_leds[i], "State",
e79c98e6c943cb3032f272714ff4ce6137d40394zk led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for led_state"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " [%3s]"),
03831d35f7499c87d51205817c93e9a8d42c4baestevel led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " LEFT THERMAL FAULT "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "RIGHT THERMAL FAULT\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 4; i < 6; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fsp_leds[i], "State",
03831d35f7499c87d51205817c93e9a8d42c4baestevel led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for led_state "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " [%3s]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk " LEFT DOOR "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "RIGHT DOOR\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 6; i < 8; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(fsp_leds[i], "State",
03831d35f7499c87d51205817c93e9a8d42c4baestevel led_state, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for led_state"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " [%3s]"),
e79c98e6c943cb3032f272714ff4ce6137d40394zk led_state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "=================================\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_keyswitch(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int err = 0;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *keyswitch;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char ks_pos[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_KEYSWITCH", &number,
03831d35f7499c87d51205817c93e9a8d42c4baestevel &keyswitch);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed in fill_device_array_from_id for "
e79c98e6c943cb3032f272714ff4ce6137d40394zk " PSVC_KEYSWITCH\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(keyswitch[0], "State", ks_pos,
e79c98e6c943cb3032f272714ff4ce6137d40394zk PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "picl_get_propval_by_name for keyswitch state "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "failed\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Front Status Panel:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "-------------------\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Keyswitch position: "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "%s\n"), ks_pos);
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_env_print_temps(picl_nodehdl_t system_node)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel int i;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int err;
03831d35f7499c87d51205817c93e9a8d42c4baestevel picl_nodehdl_t *system_ts_nodes;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t temp;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int32_t number;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char label[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char state[PICL_PROPNAMELEN_MAX];
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *p;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = fill_device_array_from_id(system_node, "PSVC_TS", &number,
03831d35f7499c87d51205817c93e9a8d42c4baestevel &system_ts_nodes);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "System Temperatures (Celsius):\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "-------------------------------\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Device\t\tTemperature\tStatus\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "---------------------------------------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (i = 0; i < number; i++) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(system_ts_nodes[i],
03831d35f7499c87d51205817c93e9a8d42c4baestevel "State", state, sizeof (state));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_INVALIDHANDLE) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel strcpy(state, "n/a");
03831d35f7499c87d51205817c93e9a8d42c4baestevel } else {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%s\n", picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(system_ts_nodes[i],
03831d35f7499c87d51205817c93e9a8d42c4baestevel PICL_PROP_NAME, label, PICL_PROPNAMELEN_MAX);
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err == PICL_INVALIDHANDLE)
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* This FRU isn't present. Skip it. */
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%s\n", picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The names in the tree are like "CPU0_DIE_TEMPERATURE_SENSOR".
03831d35f7499c87d51205817c93e9a8d42c4baestevel * All we want to print is up to the first underscore.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel p = strchr(label, '_');
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (p != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel *p = '\0';
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel err = picl_get_propval_by_name(system_ts_nodes[i],
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Temperature", &temp, sizeof (temp));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (err != PICL_SUCCESS) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%s\n", picl_strerror(err));
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (err);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("%s\t\t%3d\t\t%s\n", label, temp, state);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "\n=================================\n\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel return (PICL_SUCCESS);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic void
03831d35f7499c87d51205817c93e9a8d42c4baesteveldak_display_hw_revisions(Prom_node *root, Board_node *bdlist)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *pnode;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *value;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "========================= HW Revisions "
e79c98e6c943cb3032f272714ff4ce6137d40394zk "=======================================\n\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN,
e79c98e6c943cb3032f272714ff4ce6137d40394zk "System PROM revisions:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "----------------------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel pnode = dev_find_node(root, "openprom");
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (pnode != NULL) {
e79c98e6c943cb3032f272714ff4ce6137d40394zk value = (char *)get_prop_val(find_prop(pnode, "version"));
e79c98e6c943cb3032f272714ff4ce6137d40394zk log_printf(value);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "\n\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "IO ASIC revisions:\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "------------------\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk " Port\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "Model ID Status Version\n"
e79c98e6c943cb3032f272714ff4ce6137d40394zk "-------- ---- ------ -------\n"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel display_schizo_revisions(bdlist);
03831d35f7499c87d51205817c93e9a8d42c4baestevel}
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelstatic void
03831d35f7499c87d51205817c93e9a8d42c4baesteveldisplay_schizo_revisions(Board_node *bdlist)
03831d35f7499c87d51205817c93e9a8d42c4baestevel{
03831d35f7499c87d51205817c93e9a8d42c4baestevel Prom_node *pnode;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int *int_val;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int portid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int prev_portid = -1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *status_a = NULL;
03831d35f7499c87d51205817c93e9a8d42c4baestevel char *status_b = NULL;
03831d35f7499c87d51205817c93e9a8d42c4baestevel int revision;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint32_t a_notes, b_notes;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel int pci_bus;
03831d35f7499c87d51205817c93e9a8d42c4baestevel Board_node *bnode;
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = bdlist;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel while (bnode != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * search this board node for all Schizos
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel for (pnode = dev_find_node_by_compat(bnode->nodes,
e79c98e6c943cb3032f272714ff4ce6137d40394zk SCHIZO_COMPAT_PROP); pnode != NULL;
e79c98e6c943cb3032f272714ff4ce6137d40394zk pnode = dev_next_node_by_compat(pnode,
e79c98e6c943cb3032f272714ff4ce6137d40394zk SCHIZO_COMPAT_PROP)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * get the reg property to determine
03831d35f7499c87d51205817c93e9a8d42c4baestevel * whether we are looking at side A or B
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel int_val = (int *)get_prop_val
e79c98e6c943cb3032f272714ff4ce6137d40394zk (find_prop(pnode, "reg"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (int_val != NULL) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel int_val ++; /* second integer in array */
03831d35f7499c87d51205817c93e9a8d42c4baestevel pci_bus = ((*int_val) & 0x7f0000);
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* get portid */
03831d35f7499c87d51205817c93e9a8d42c4baestevel int_val = (int *)get_prop_val
e79c98e6c943cb3032f272714ff4ce6137d40394zk (find_prop(pnode, "portid"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (int_val == NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel portid = *int_val;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If this is a new portid and it is PCI bus B,
03831d35f7499c87d51205817c93e9a8d42c4baestevel * we skip onto the PCI bus A.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel if ((portid != prev_portid) && (pci_bus == 0x700000)) {
03831d35f7499c87d51205817c93e9a8d42c4baestevel prev_portid = portid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel /* status */
03831d35f7499c87d51205817c93e9a8d42c4baestevel status_b = (char *)get_prop_val
03831d35f7499c87d51205817c93e9a8d42c4baestevel (find_prop(pnode, "status"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel b_notes = pci_bus;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel continue; /* skip to the next schizo */
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel /*
03831d35f7499c87d51205817c93e9a8d42c4baestevel * This must be side A of the same Schizo.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Gather all its props and display them.
03831d35f7499c87d51205817c93e9a8d42c4baestevel */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel a_notes = pci_bus;
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel prev_portid = portid;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel int_val = (int *)get_prop_val
e79c98e6c943cb3032f272714ff4ce6137d40394zk (find_prop(pnode, "version#"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel if (int_val != NULL)
03831d35f7499c87d51205817c93e9a8d42c4baestevel revision = *int_val;
03831d35f7499c87d51205817c93e9a8d42c4baestevel else
03831d35f7499c87d51205817c93e9a8d42c4baestevel revision = -1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel status_a = (char *)get_prop_val(find_prop
e79c98e6c943cb3032f272714ff4ce6137d40394zk (pnode, "status"));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "Schizo "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, "%-3d "), portid, 0);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf((status_a == NULL && status_b == NULL) ?
e79c98e6c943cb3032f272714ff4ce6137d40394zk dgettext(TEXT_DOMAIN, " ok ") :
e79c98e6c943cb3032f272714ff4ce6137d40394zk dgettext(TEXT_DOMAIN, " fail "));
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(dgettext(TEXT_DOMAIN, " %4d "),
03831d35f7499c87d51205817c93e9a8d42c4baestevel revision);
03831d35f7499c87d51205817c93e9a8d42c4baestevel#ifdef DEBUG
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf(" 0x%x 0x%x", a_notes, b_notes);
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif
03831d35f7499c87d51205817c93e9a8d42c4baestevel log_printf("\n");
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel bnode = bnode->next;
03831d35f7499c87d51205817c93e9a8d42c4baestevel }
03831d35f7499c87d51205817c93e9a8d42c4baestevel}