29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER START
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * The contents of this file are subject to the terms of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * Common Development and Distribution License (the "License").
29949e866e40b95795203f3ee46f44a197c946e4stevel * You may not use this file except in compliance with the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
29949e866e40b95795203f3ee46f44a197c946e4stevel * or http://www.opensolaris.org/os/licensing.
29949e866e40b95795203f3ee46f44a197c946e4stevel * See the License for the specific language governing permissions
29949e866e40b95795203f3ee46f44a197c946e4stevel * and limitations under the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * When distributing Covered Code, include this CDDL HEADER in each
29949e866e40b95795203f3ee46f44a197c946e4stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
29949e866e40b95795203f3ee46f44a197c946e4stevel * If applicable, add the following below this CDDL HEADER, with the
29949e866e40b95795203f3ee46f44a197c946e4stevel * fields enclosed by brackets "[]" replaced with your own identifying
29949e866e40b95795203f3ee46f44a197c946e4stevel * information: Portions Copyright [yyyy] [name of copyright owner]
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER END
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Use is subject to license terms.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifndef _SYS_FHC_H
29949e866e40b95795203f3ee46f44a197c946e4stevel#define _SYS_FHC_H
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#pragma ident "%Z%%M% %I% %E% SMI"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef __cplusplus
29949e866e40b95795203f3ee46f44a197c946e4stevelextern "C" {
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#include <sys/types32.h>
29949e866e40b95795203f3ee46f44a197c946e4stevel#include <sys/dditypes.h>
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* useful debugging stuff */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_ATTACH_DEBUG 0x1
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_INTERRUPT_DEBUG 0x2
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_REGISTERS_DEBUG 0x4
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CTLOPS_DEBUG 0x8
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARDS 0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CLOCKS 1
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * OBP supplies us with 6 register sets for the FHC. The code for the fhc
29949e866e40b95795203f3ee46f44a197c946e4stevel * driver relies on these register sets being presented by the PROM in the
29949e866e40b95795203f3ee46f44a197c946e4stevel * order specified below. If this changes, the following comments must be
29949e866e40b95795203f3ee46f44a197c946e4stevel * revised and the code in fhc_init() must be changed to reflect these
29949e866e40b95795203f3ee46f44a197c946e4stevel * revisions.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * They are:
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0 FHC internal registers
29949e866e40b95795203f3ee46f44a197c946e4stevel * 1 IGR Interrupt Group Number
29949e866e40b95795203f3ee46f44a197c946e4stevel * 2 FanFail IMR, ISMR
29949e866e40b95795203f3ee46f44a197c946e4stevel * 3 System IMR, ISMR
29949e866e40b95795203f3ee46f44a197c946e4stevel * 4 UART IMR, ISMR
29949e866e40b95795203f3ee46f44a197c946e4stevel * 5 TOD IMR, ISMR
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The offsets are defined as offsets from the base of the OBP register
29949e866e40b95795203f3ee46f44a197c946e4stevel * set which the register belongs to.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Register set 0 */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_ID 0x0 /* FHC ID register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_RCTRL 0x10 /* FHC Reset Control and Status */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_CTRL 0x20 /* FHC Control and Status */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_BSR 0x30 /* FHC Board Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_JTAG_CTRL 0xF0 /* JTAG Control Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_JTAG_CMD 0x100 /* JTAG Comamnd Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Register sets 2-5, the ISMR offset is the same */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_ISMR 0x10 /* FHC Interrupt State Machine */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for FHC Control and Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CENTERDIS 0x00100000
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* NOTE: this bit is only used by firmware and must always be cleared by OS */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CSR_SYNC 0x00010000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_MOD_OFF 0x00008000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_ACDC_OFF 0x00004000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_FHC_OFF 0x00002000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_EPDA_OFF 0x00001000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_EPDB_OFF 0x00000800
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_PS_OFF 0x00000400
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_NOT_BRD_PRES 0x00000200
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_LED_LEFT 0x00000040
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_LED_MID 0x00000020
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_LED_RIGHT 0x00000010
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for FHC Reset Control and Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_POR 0x80000000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SOFT_POR 0x40000000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SOFT_XIR 0x20000000
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for the JTAG control register. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define JTAG_MASTER_EN 0x80000000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define JTAG_MASTER_NPRES 0x40000000
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Macros for decoding UPA speed pins from the Board Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CPU_0_PINS(bsr) (((bsr) >> 10) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CPU_1_PINS(bsr) (((bsr) >> 7) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CID_REV_MASK 0x0fffffff
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ULTRAI_COMPID 0x0002502f
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ULTRAII_COMPID 0x0003602f
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Macro for extracting the "plus" bit from the Board Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define ISPLUSBRD(bsr) (((bsr) & 1) == 0)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Macros for physical access */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFFSET 0xf8000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_REGOFF 0x800000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_IGN 0x2000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_SIM 0x6000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_SSM 0x6010ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_UIM 0x8000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OFF_USM 0x8010ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CTRL(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_CTRL)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_JTAG_CTRL(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_JTAG_CTRL)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_IGN(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_IGN)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SIM(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_SIM)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SSM(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_SSM)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_UIM(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_UIM)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_USM(board) (FHC_BOARD_BASE(2*(board)) + FHC_OFFSET + \
29949e866e40b95795203f3ee46f44a197c946e4stevel FHC_REGOFF + FHC_OFF_USM)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * the foolowing defines are used for trans phy-addr to board number
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BOARD_PHYADDR_SHIFT 24
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CLOCKBOARD_PHYADDR_BITS 0x1fff8
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_BOARD_NUMBER_SHIFT 10
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_BOARD_NUMBER_MASK 0xf
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The following defines are used by the fhc driver to determine the
29949e866e40b95795203f3ee46f44a197c946e4stevel * difference between IO and CPU type boards. This will be replaced
29949e866e40b95795203f3ee46f44a197c946e4stevel * later by JTAG scan to determine board type.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* XXX */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_UPADATA64A 0x40000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_UPADATA64B 0x20000
29949e866e40b95795203f3ee46f44a197c946e4stevel/* XXX */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for Board Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DIAG_MODE 0x40
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for the FHC Board Status Register when on a disk board */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_FANFAIL 0x00000040
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SCSI_VDD_OK 0x00000001
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Size of temperature recording array */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MAX_TEMP_HISTORY 16
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Maximum number of boards in system */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MAX_BOARDS 16
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Maximum number of Board Power Supplies. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MAX_PS_COUNT 8
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Use predefined strings to name the kstats from this driver. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_KSTAT_NAME "fhc"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CSR_KSTAT_NAMED "csr"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BSR_KSTAT_NAMED "bsr"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The following defines are for the AC chip, but are needed to be global,
29949e866e40b95795203f3ee46f44a197c946e4stevel * so have been put in the fhc header file.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Most Sunfire ASICs have the chip rev encoded into bits 31-28 of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * component ID register.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CHIP_REV(c) ((c) >> 28)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifndef _ASM
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Use predefined strings to name the kstats from this driver. */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit field defines for Interrupt Mapping registers */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IMR_VALID ((uint_t)1 << INR_EN_SHIFT) /* Mondo valid bit */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Bit defines for Interrupt State Machine Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define INT_PENDING 3 /* state of the interrupt dispatch */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct intr_regs {
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *mapping_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *clear_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t mapping_reg_cache; /* cache current value for CPR */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BD_IVINTR_SHFT 0x7
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Convert the Board Number field in the FHC Board Status Register to
29949e866e40b95795203f3ee46f44a197c946e4stevel * a board number. The field in the register is bits 0,3-1 of the board
29949e866e40b95795203f3ee46f44a197c946e4stevel * number. Therefore a macro is necessary to extract the board number.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BSR_TO_BD(bsr) ((((bsr) >> 16) & 0x1) | \
29949e866e40b95795203f3ee46f44a197c946e4stevel (((bsr) >> 12) & 0xE))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_INO(ino) ((ino) & 0x7)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CPU2BOARD(cpuid) ((cpuid) >> 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CPU_IS_A(cpuid) (!((cpuid) & 1))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CPU_IS_B(cpuid) ((cpuid) & 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD2CPU_A(board) ((board) << 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD2CPU_B(board) (((board) << 1) + 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_PS2BOARD(ps) ((((ps) & 0x6) << 1) | ((ps) & 0x1))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD2PS(board) ((((board) & 0xc) >> 1) | ((board) & 0x1))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_OTHER_CPU_ID(cpuid) ((cpuid) ^ 1)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* this base address is assumed to never map to real memory */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BASE_NOMEM (1ull << 40)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_MAX_ECACHE_SIZE (16 * 1024 * 1024)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD_0 0x1c000000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD_SPAN 0x200000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_OFFSET 0xfa000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_BOARD_BASE(cpuid) (FHC_BOARD_0 + (cpuid) * FHC_BOARD_SPAN)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_BASE(cpuid) (FHC_BOARD_BASE(cpuid) + FHC_DTAG_OFFSET)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_LOW 0x300000000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_HIGH 0x3ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_SIZE (16 * 1024 * 1024)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_DTAG_SKIP 64
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Each Sunfire CPU Board has 32Kbytes of SRAM on the FireHose Bus.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * The SRAM is allocated as follows:
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1ff.f020.0000 - 0x1ff.f020.5fff scratch/stacks
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1ff.f020.6000 - 0x1ff.f020.67ff reset info (2K bytes)
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1ff.f020.6800 - 0x1ff.f020.6fff POST private (2K bytes)
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1ff.f020.7000 - 0x1ff.f020.77ff OS private (2K bytes)
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1ff.f020.7800 - 0x1ff.f020.7fff OBP private (2K bytes)
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_LOCAL_SRAM_BASE 0x1fff0200000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_GLOBAL_SRAM_BASE 0x1c0f8200000ull
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CPU2GLOBAL_SRAM(mid) \
29949e866e40b95795203f3ee46f44a197c946e4stevel (FHC_GLOBAL_SRAM_BASE + (mid) * 0x200000000ull)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SRAM_OS_BASE 0x7000
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_LOCAL_OS_PAGEBASE ((FHC_LOCAL_SRAM_BASE + FHC_SRAM_OS_BASE) & \
29949e866e40b95795203f3ee46f44a197c946e4stevel MMU_PAGEMASK)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SRAM_OS_OFFSET ((FHC_LOCAL_SRAM_BASE + FHC_SRAM_OS_BASE) & \
29949e866e40b95795203f3ee46f44a197c946e4stevel MMU_PAGEOFFSET)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SHUTDOWN_WAIT_MSEC 1000
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_MAX_INO 4
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_SYS_INO 0x0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_UART_INO 0x1
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_TOD_INO 0x2
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_FANFAIL_INO 0x3
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Defines for the kstats created for passing temperature values and
29949e866e40b95795203f3ee46f44a197c946e4stevel * history out to user level programs. All temperatures passed out
29949e866e40b95795203f3ee46f44a197c946e4stevel * will be in degrees Centigrade, corrected for the board type the
29949e866e40b95795203f3ee46f44a197c946e4stevel * temperature was read from. Since each Board type has a different
29949e866e40b95795203f3ee46f44a197c946e4stevel * response curve for the A/D convertor, the temperatures are all
29949e866e40b95795203f3ee46f44a197c946e4stevel * calibrated inside the kernel.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define OVERTEMP_KSTAT_NAME "temperature"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * This kstat is used for manually overriding temperatures.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define TEMP_OVERRIDE_KSTAT_NAME "temperature override"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Time averaging based method of recording temperature history.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Higher level temperature arrays are composed of temperature averages
29949e866e40b95795203f3ee46f44a197c946e4stevel * of the array one level below. When the lower array completes a
29949e866e40b95795203f3ee46f44a197c946e4stevel * set of data, the data is averaged and placed into the higher
29949e866e40b95795203f3ee46f44a197c946e4stevel * level array. Then the lower level array is overwritten until
29949e866e40b95795203f3ee46f44a197c946e4stevel * it is once again complete, where the process repeats.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * This method gives a user a fine grained view of the last minute,
29949e866e40b95795203f3ee46f44a197c946e4stevel * and larger grained views of the temperature as one goes back in
29949e866e40b95795203f3ee46f44a197c946e4stevel * time.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * The time units for the longer samples are based on the value
29949e866e40b95795203f3ee46f44a197c946e4stevel * of the OVERTEMP_TIMEOUT_SEC and the number of elements in each
29949e866e40b95795203f3ee46f44a197c946e4stevel * of the arrays between level 1 and the higher level.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define OVERTEMP_TIMEOUT_SEC 2
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* definition of the clock board index */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CLOCK_BOARD_INDEX 16
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L1_SZ 30 /* # of OVERTEMP_TIMEOUT_SEC samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L2_SZ 15 /* size of array for level 2 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L3_SZ 12 /* size of array for level 3 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L4_SZ 4 /* size of array for level 4 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L5_SZ 2 /* size of array for level 5 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Macros for determining when to do the temperature averaging of arrays.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L2_INDEX(i) ((i) / L1_SZ)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L2_REM(i) ((i) % L1_SZ)
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L3_INDEX(i) ((i) / (L1_SZ * L2_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L3_REM(i) ((i) % (L1_SZ * L2_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L4_INDEX(i) ((i) / (L1_SZ * L2_SZ * L3_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L4_REM(i) ((i) % (L1_SZ * L2_SZ * L3_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L5_INDEX(i) ((i) / (L1_SZ * L2_SZ * L3_SZ * L4_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel#define L5_REM(i) ((i) % (L1_SZ * L2_SZ * L3_SZ * L4_SZ))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * define for an illegal temperature. This temperature will never be seen
29949e866e40b95795203f3ee46f44a197c946e4stevel * in a real system, so it is used as an illegal value in the various
29949e866e40b95795203f3ee46f44a197c946e4stevel * functions processing the temperature data structure.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NA_TEMP 0x7FFF
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * State variable for board temperature. Each board has its own
29949e866e40b95795203f3ee46f44a197c946e4stevel * temperature state. State transitions from OK -> bad direction
29949e866e40b95795203f3ee46f44a197c946e4stevel * happen instantaneously, but use a counter in the opposite
29949e866e40b95795203f3ee46f44a197c946e4stevel * direction, so that noise in the A/D counters does not cause
29949e866e40b95795203f3ee46f44a197c946e4stevel * a large number of messages to appear.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum temp_state { TEMP_OK = 0, /* normal board temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel TEMP_WARN = 1, /* start warning operator */
29949e866e40b95795203f3ee46f44a197c946e4stevel TEMP_DANGER = 2 }; /* get ready to shutdown */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Number of temperature poll counts to wait before printing that the
29949e866e40b95795203f3ee46f44a197c946e4stevel * system has cooled down.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define TEMP_STATE_TIMEOUT_SEC 20
29949e866e40b95795203f3ee46f44a197c946e4stevel#define TEMP_STATE_COUNT ((TEMP_STATE_TIMEOUT_SEC) / \
29949e866e40b95795203f3ee46f44a197c946e4stevel (OVERTEMP_TIMEOUT_SEC))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Number of poll counts that a system temperature must be at or above danger
29949e866e40b95795203f3ee46f44a197c946e4stevel * temperature before system is halted and powers down.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SHUTDOWN_TIMEOUT_SEC 20
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SHUTDOWN_COUNT ((SHUTDOWN_TIMEOUT_SEC) / \
29949e866e40b95795203f3ee46f44a197c946e4stevel (OVERTEMP_TIMEOUT_SEC))
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * State variable for temperature trend. Each state represents the
29949e866e40b95795203f3ee46f44a197c946e4stevel * current temperature trend for a given device.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum temp_trend { TREND_UNKNOWN = 0, /* Unknown temperature trend */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_RAPID_FALL = 1, /* Rapidly falling temp. */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_FALL = 2, /* Falling temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_STABLE = 3, /* Stable temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_RISE = 4, /* Rising temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_RAPID_RISE = 5, /* Rapidly rising temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel TREND_NOISY = 6 }; /* Unknown trend (noisy) */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Thresholds for temperature trend */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NOISE_THRESH 2
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RAPID_RISE_THRESH 4
29949e866e40b95795203f3ee46f44a197c946e4stevel#define RAPID_FALL_THRESH 4
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Main structure for passing the calibrated and time averaged temperature
29949e866e40b95795203f3ee46f44a197c946e4stevel * values to user processes. This structure is copied out via the kstat
29949e866e40b95795203f3ee46f44a197c946e4stevel * mechanism.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define TEMP_KSTAT_VERSION 3 /* version of temp_stats structure */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct temp_stats {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t index; /* index of current temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel short l1[L1_SZ]; /* OVERTEMP_TIMEOUT_SEC samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel short l2[L2_SZ]; /* level 2 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel short l3[L3_SZ]; /* level 3 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel short l4[L4_SZ]; /* level 4 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel short l5[L5_SZ]; /* level 5 samples */
29949e866e40b95795203f3ee46f44a197c946e4stevel short max; /* maximum temperature recorded */
29949e866e40b95795203f3ee46f44a197c946e4stevel short min; /* minimum temperature recorded */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum temp_state state; /* state of board temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel int temp_cnt; /* counter for state changes */
29949e866e40b95795203f3ee46f44a197c946e4stevel int shutdown_cnt; /* counter for overtemp shutdown */
29949e866e40b95795203f3ee46f44a197c946e4stevel int version; /* version of this structure */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum temp_trend trend; /* temperature trend for board */
29949e866e40b95795203f3ee46f44a197c946e4stevel short override; /* override temperature for testing */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* The variable fhc_cpu_warning_temp_threshold is initialized to this value. */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_CPU_WARNING_TEMP_THRESHOLD 45
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Fault list management.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * The following defines and enum definitions have been created to support
29949e866e40b95795203f3ee46f44a197c946e4stevel * the fault list (struct ft_list). These defines must match with the
29949e866e40b95795203f3ee46f44a197c946e4stevel * fault string table in fhc.c. If any faults are added, they must be
29949e866e40b95795203f3ee46f44a197c946e4stevel * added at the end of this list, and the table must be modified
29949e866e40b95795203f3ee46f44a197c946e4stevel * accordingly.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum ft_type {
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_CORE_PS = 0, /* Core power supply */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_OVERTEMP, /* Temperature */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_AC_PWR, /* AC power Supply */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_PPS, /* Peripheral Power Supply */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_CLK_33, /* System 3.3 Volt Power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_CLK_50, /* System 5.0 Volt Power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V5_P, /* Peripheral 5V Power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V12_P, /* Peripheral 12V Power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V5_AUX, /* Auxiliary 5V Power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V5_P_PCH, /* Peripheral 5V Precharge */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V12_P_PCH, /* Peripheral 12V Precharge */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V3_PCH, /* System 3V Precharge */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_V5_PCH, /* System 5V Precharge */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_PPS_FAN, /* Peripheral Power Supply Fan */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_RACK_EXH, /* Rack Exhaust Fan */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_DSK_FAN, /* 4 (or 5) Slot Disk Fan */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_AC_FAN, /* AC Box Fan */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_KEYSW_FAN, /* Key Switch Fan */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_INSUFFICIENT_POWER, /* System has insufficient power */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_PROM, /* fault inherited from PROM */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_HOT_PLUG, /* hot plug unavailable */
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_TODFAULT /* tod error detection */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelenum ft_class {
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_BOARD,
29949e866e40b95795203f3ee46f44a197c946e4stevel FT_SYSTEM
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * This extern allows other drivers to use the ft_str_table if they
29949e866e40b95795203f3ee46f44a197c946e4stevel * have fhc specified as a depends_on driver.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelextern char *ft_str_table[];
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Maximum length of string table entries */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MAX_FT_DESC 64
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FT_LIST_KSTAT_NAME "fault_list"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The fault list structure is a structure for holding information on
29949e866e40b95795203f3ee46f44a197c946e4stevel * kernel detected faults. The fault list structures are linked into
29949e866e40b95795203f3ee46f44a197c946e4stevel * a list and the list is protected by the ftlist_mutex. There are
29949e866e40b95795203f3ee46f44a197c946e4stevel * also several routines for manipulating the fault list.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ft_list {
29949e866e40b95795203f3ee46f44a197c946e4stevel int32_t unit; /* unit number of faulting device */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum ft_type type; /* type of faulting device */
29949e866e40b95795203f3ee46f44a197c946e4stevel int32_t pad; /* padding to replace old next pointer */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum ft_class fclass; /* System or board class fault */
29949e866e40b95795203f3ee46f44a197c946e4stevel time32_t create_time; /* Time stamp at fault detection */
29949e866e40b95795203f3ee46f44a197c946e4stevel char msg[MAX_FT_DESC]; /* fault string */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Allow binary compatibility between ILP32 and LP64 by
29949e866e40b95795203f3ee46f44a197c946e4stevel * eliminating the next pointer and making ft_list a fixed size.
29949e866e40b95795203f3ee46f44a197c946e4stevel * The structure name "ft_list" remains unchanged for
29949e866e40b95795203f3ee46f44a197c946e4stevel * source compatibility of kstat applications.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct ft_link_list {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct ft_list f;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct ft_link_list *next;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Board list management.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * Enumerated types for defining type of system and clock
29949e866e40b95795203f3ee46f44a197c946e4stevel * boards. It is used by both the kernel and user programs.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum board_type {
29949e866e40b95795203f3ee46f44a197c946e4stevel UNINIT_BOARD = 0, /* Uninitialized board type */
29949e866e40b95795203f3ee46f44a197c946e4stevel UNKNOWN_BOARD, /* Unknown board type */
29949e866e40b95795203f3ee46f44a197c946e4stevel CPU_BOARD, /* System board CPU(s) */
29949e866e40b95795203f3ee46f44a197c946e4stevel MEM_BOARD, /* System board no CPUs */
29949e866e40b95795203f3ee46f44a197c946e4stevel IO_2SBUS_BOARD, /* 2 SBus & SOC IO Board */
29949e866e40b95795203f3ee46f44a197c946e4stevel IO_SBUS_FFB_BOARD, /* SBus & FFB SOC IO Board */
29949e866e40b95795203f3ee46f44a197c946e4stevel IO_PCI_BOARD, /* PCI IO Board */
29949e866e40b95795203f3ee46f44a197c946e4stevel DISK_BOARD, /* Disk Drive Board */
29949e866e40b95795203f3ee46f44a197c946e4stevel CLOCK_BOARD, /* System Clock board */
29949e866e40b95795203f3ee46f44a197c946e4stevel IO_2SBUS_SOCPLUS_BOARD, /* 2 SBus & SOC+ IO board */
29949e866e40b95795203f3ee46f44a197c946e4stevel IO_SBUS_FFB_SOCPLUS_BOARD /* SBus&FFB&SOC+ board */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Defined strings for comparing with OBP board-type property. If OBP ever
29949e866e40b95795203f3ee46f44a197c946e4stevel * changes the board-type properties, these string defines must be changed
29949e866e40b95795203f3ee46f44a197c946e4stevel * as well.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CPU_BD_NAME "cpu"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MEM_BD_NAME "mem"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_2SBUS_BD_NAME "dual-sbus"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_SBUS_FFB_BD_NAME "upa-sbus"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_PCI_BD_NAME "dual-pci"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define DISK_BD_NAME "disk"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_2SBUS_SOCPLUS_BD_NAME "dual-sbus-soc+"
29949e866e40b95795203f3ee46f44a197c946e4stevel#define IO_SBUS_FFB_SOCPLUS_BD_NAME "upa-sbus-soc+"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The following structures and union are needed because the bd_info
29949e866e40b95795203f3ee46f44a197c946e4stevel * structure describes all types of system boards.
29949e866e40b95795203f3ee46f44a197c946e4stevel * XXX - We cannot determine Spitfire rev from JTAG scan, so it is
29949e866e40b95795203f3ee46f44a197c946e4stevel * left blank for now. Future implementations might fill in this info.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct cpu_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int cpu_rev; /* CPU revision */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cpu_speed; /* rated speed of CPU in MHz */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cpu_compid; /* CPU component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sdb0_compid; /* SDB component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sdb1_compid; /* SDB component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int ec_compid; /* Ecache RAM ID, needed for cache size */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cache_size; /* Cache size in bytes */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cpu_sram_mode; /* module's sram mode */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cpu_detected; /* Something on the CPU JTAG ring. */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct io1_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio0_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio1_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int hme_compid; /* several revs in existence */
29949e866e40b95795203f3ee46f44a197c946e4stevel int soc_compid; /* SOC */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct io1plus_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio0_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio1_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int hme_compid; /* several revs in existence */
29949e866e40b95795203f3ee46f44a197c946e4stevel int socplus_compid; /* SOC+ */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Defines for the FFB size field */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FFB_FAILED -1
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FFB_NOT_FOUND 0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FFB_SINGLE 1
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FFB_DOUBLE 2
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct io2_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int fbc_compid; /* FBC component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int ffb_size; /* not present, single or dbl buffered */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio1_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int hme_compid; /* several revs in existence */
29949e866e40b95795203f3ee46f44a197c946e4stevel int soc_compid; /* SOC component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct io2plus_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int fbc_compid; /* FBC component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int ffb_size; /* not present, single or dbl buffered */
29949e866e40b95795203f3ee46f44a197c946e4stevel int sio1_compid; /* Sysio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int hme_compid; /* several revs in existence */
29949e866e40b95795203f3ee46f44a197c946e4stevel int socplus_compid; /* or SOC+ component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct io3_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int psyo0_compid; /* Psycho+ component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int psyo1_compid; /* Psycho+ component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel int cheo_compid; /* Cheerio component ID */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct dsk_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel int disk_pres[2];
29949e866e40b95795203f3ee46f44a197c946e4stevel int disk_id[2];
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelunion bd_un {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct cpu_info cpu[2];
29949e866e40b95795203f3ee46f44a197c946e4stevel struct io1_info io1;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct io2_info io2;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct io3_info io3;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct dsk_info dsk;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct io1plus_info io1plus;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct io2plus_info io2plus;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * board_state and bd_info are maintained for backward
29949e866e40b95795203f3ee46f44a197c946e4stevel * compatibility with prtdiag and others user programs that may rely
29949e866e40b95795203f3ee46f44a197c946e4stevel * on them.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum board_state {
29949e866e40b95795203f3ee46f44a197c946e4stevel UNKNOWN_STATE = 0, /* Unknown board */
29949e866e40b95795203f3ee46f44a197c946e4stevel ACTIVE_STATE, /* active and working */
29949e866e40b95795203f3ee46f44a197c946e4stevel HOTPLUG_STATE, /* Hot plugged board */
29949e866e40b95795203f3ee46f44a197c946e4stevel LOWPOWER_STATE, /* Powered down board */
29949e866e40b95795203f3ee46f44a197c946e4stevel DISABLED_STATE, /* Board disabled by PROM */
29949e866e40b95795203f3ee46f44a197c946e4stevel FAILED_STATE /* Board failed by POST */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct bd_info {
29949e866e40b95795203f3ee46f44a197c946e4stevel enum board_type type; /* Type of board */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum board_state state; /* current state of this board */
29949e866e40b95795203f3ee46f44a197c946e4stevel int board; /* board number */
29949e866e40b95795203f3ee46f44a197c946e4stevel int fhc_compid; /* fhc component id */
29949e866e40b95795203f3ee46f44a197c946e4stevel int ac_compid; /* ac component id */
29949e866e40b95795203f3ee46f44a197c946e4stevel char prom_rev[64]; /* best guess as to what is needed */
29949e866e40b95795203f3ee46f44a197c946e4stevel union bd_un bd;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Config admin interface.
29949e866e40b95795203f3ee46f44a197c946e4stevel *
29949e866e40b95795203f3ee46f44a197c946e4stevel * Receptacle states.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_RSTATE_EMPTY = 0, /* Empty state */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_RSTATE_DISCONNECTED, /* DISCONNECTED state */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_RSTATE_CONNECTED /* CONNECTED state */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_rstate_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Occupant states.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_OSTATE_UNCONFIGURED = 0, /* UNCONFIGURED state */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_OSTATE_CONFIGURED /* CONFIGURED state */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_ostate_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Receptacle/Occupant condition.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_COND_UNKNOWN = 0, /* Unknown condition */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_COND_OK, /* Condition OK */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_COND_FAILING, /* Failing */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_COND_FAILED, /* Failed */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_CFGA_COND_UNUSABLE /* Unusable */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_cond_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Error definitions for CFGADM platform library
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_DEFAULT = 0, /* generic errors */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_INTRANS, /* hardware in transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_UTHREAD, /* can't stop user thread */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_KTHREAD, /* can't stop kernel thread */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_SUSPEND, /* can't suspend a device */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_RESUME, /* can't resume a device */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_POWER, /* not enough power for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_COOLING, /* not enough cooling for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_PRECHARGE, /* not enough precharge for slot */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_HOTPLUG, /* Hot Plug Unavailable */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_HW_COMPAT, /* incompatible hardware found during dr */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_NON_DR_PROM, /* prom not support Dynamic Reconfiguration */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_CORE_RESOURCE, /* core resource cannot be removed */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_PROM, /* error encountered in OBP/POST */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_DR_INIT, /* error encountered in sysc_dr_init op */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_NDI_ATTACH, /* error encountered in NDI attach operations */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_NDI_DETACH, /* error encountered in NDI detach operations */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_RSTATE, /* wrong receptacle state */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_OSTATE, /* wrong occupant state */
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_ERR_COND /* invalid condition */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_err_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Config admin structure.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct sysc_cfga_stat {
29949e866e40b95795203f3ee46f44a197c946e4stevel /* generic representation of the attachment point below */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_rstate_t rstate; /* current receptacle state */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_ostate_t ostate; /* current occupant state */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cond_t condition; /* current board condition */
29949e866e40b95795203f3ee46f44a197c946e4stevel time32_t last_change; /* last state/condition change */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t in_transition:1; /* board is in_transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* platform specific below */
29949e866e40b95795203f3ee46f44a197c946e4stevel enum board_type type; /* Type of board */
29949e866e40b95795203f3ee46f44a197c946e4stevel int board; /* board number */
29949e866e40b95795203f3ee46f44a197c946e4stevel int fhc_compid; /* fhc component id */
29949e866e40b95795203f3ee46f44a197c946e4stevel int ac_compid; /* ac component id */
29949e866e40b95795203f3ee46f44a197c946e4stevel char prom_rev[64]; /* best guess as to what is needed */
29949e866e40b95795203f3ee46f44a197c946e4stevel union bd_un bd;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t no_detach:1; /* board is non_detachable */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t plus_board:1; /* board is 98 MHz capable */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_stat_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Config admin command structure for SYSC_CFGA ioctls.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct sysc_cfga_cmd {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t force:1; /* force this state transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t test:1; /* Need to test hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevel int arg; /* generic data for test */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_err_t errtype; /* error code returned */
29949e866e40b95795203f3ee46f44a197c946e4stevel char *outputstr; /* output returned from ioctl */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_cmd_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct sysc_cfga_cmd32 {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t force:1; /* force this state transition */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t test:1; /* Need to test hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevel int arg; /* generic data for test */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_err_t errtype; /* error code returned */
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr32_t outputstr; /* output returned from ioctl */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_cmd32_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct sysc_cfga_pkt {
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_cmd_t cmd_cfga;
29949e866e40b95795203f3ee46f44a197c946e4stevel char *errbuf; /* internal error buffer */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_cfga_pkt_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Sysctrl DR sequencer interface.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct sysc_dr_handle {
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t **dip_list; /* list of top dips for board */
29949e866e40b95795203f3ee46f44a197c946e4stevel int dip_list_len; /* length devinfo list */
29949e866e40b95795203f3ee46f44a197c946e4stevel int flags; /* dr specific flags */
29949e866e40b95795203f3ee46f44a197c946e4stevel int error; /* dr operation error */
29949e866e40b95795203f3ee46f44a197c946e4stevel char *errstr; /* dr config/unfig error message */
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_dr_handle_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_MAX_NODE 32
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_FHC 0x1 /* connect phase init (fhc) */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_DEVS 0x2 /* config phase init (devices) */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_FORCE 0x4 /* force detach */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_REMOVE 0x8 /* remove dev_info */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_HANDLE_FHC 0x0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_DR_HANDLE_DEVS 0x1
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Sysctrl event interface.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum sysc_evt {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_EMPTY = 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_PRESENT,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_DISABLED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_OVERTEMP,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_TEMP_OK,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_PS_CHANGE,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_INS_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_INSERTED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_REMOVED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_HP_DISABLED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_EVT_BD_CORE_RESOURCE_DISCONNECT
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_evt_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * sysctrl audit message events
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef enum sysc_audit_evt {
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_EMPTY = 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_CONNECT,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_DISCONNECT,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_SUCCEEDED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_EMPTY_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_CONNECT_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_RSTATE_DISCONNECT_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_OSTATE_CONFIGURE,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_OSTATE_UNCONFIGURE,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_OSTATE_SUCCEEDED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_OSTATE_CONFIGURE_FAILED,
29949e866e40b95795203f3ee46f44a197c946e4stevel SYSC_AUDIT_OSTATE_UNCONFIGURE_FAILED
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_audit_evt_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct {
29949e866e40b95795203f3ee46f44a197c946e4stevel void (*update)(void *, sysc_cfga_stat_t *, sysc_evt_t);
29949e866e40b95795203f3ee46f44a197c946e4stevel void *soft;
29949e866e40b95795203f3ee46f44a197c946e4stevel} sysc_evt_handle_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bd_sc_register(void f(void *, sysc_cfga_stat_t *, sysc_evt_t), void *);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The board list structure is the central storage for the kernel's
29949e866e40b95795203f3ee46f44a197c946e4stevel * knowledge of normally booted and hotplugged boards.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct bd_list {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_soft_state *softsp; /* handle for DDI soft state */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_stat_t sc; /* board info */
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_dr_handle_t sh[2]; /* sysctrl dr interface */
29949e866e40b95795203f3ee46f44a197c946e4stevel void *dev_softsp; /* opaque pointer to device state */
29949e866e40b95795203f3ee46f44a197c946e4stevel void *ac_softsp; /* opaque pointer to our AC */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat *ksp; /* pointer used in kstat destroy */
29949e866e40b95795203f3ee46f44a197c946e4stevel int fault; /* failure on this board? */
29949e866e40b95795203f3ee46f44a197c946e4stevel int flags; /* board state flags */
29949e866e40b95795203f3ee46f44a197c946e4stevel} fhc_bd_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Fhc_bd.c holds 2 resizable arrays of boards. First for clock
29949e866e40b95795203f3ee46f44a197c946e4stevel * boards under central and second for normally booted and
29949e866e40b95795203f3ee46f44a197c946e4stevel * hotplugged boards.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4steveltypedef struct resizable_bd_list {
29949e866e40b95795203f3ee46f44a197c946e4stevel fhc_bd_t **boards;
29949e866e40b95795203f3ee46f44a197c946e4stevel int size;
29949e866e40b95795203f3ee46f44a197c946e4stevel int last;
29949e866e40b95795203f3ee46f44a197c946e4stevel int sorted;
29949e866e40b95795203f3ee46f44a197c946e4stevel} fhc_bd_resizable_t;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BDF_VALID 0x1 /* board entry valid */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BDF_DETACH 0x2 /* board detachable */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define BDF_DISABLED 0x4 /* board disabled */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#define SYSC_OUTPUT_LEN MAXPATHLEN /* output str len */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Board list management interface.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_max_boards(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bdlist_init(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bdlist_fini(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bdlist_prime(int, int, int);
29949e866e40b95795203f3ee46f44a197c946e4stevelfhc_bd_t *fhc_bdlist_lock(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bdlist_unlock(void);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bd_init(struct fhc_soft_state *, int, enum board_type);
29949e866e40b95795203f3ee46f44a197c946e4stevelfhc_bd_t *fhc_bd(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelfhc_bd_t *fhc_bd_clock(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelfhc_bd_t *fhc_bd_first(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelfhc_bd_t *fhc_bd_next(fhc_bd_t *);
29949e866e40b95795203f3ee46f44a197c946e4stevelenum board_type fhc_bd_type(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelchar *fhc_bd_typestr(enum board_type);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_valid(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_detachable(int);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_insert_scan(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_remove_scan(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_test(int, sysc_cfga_pkt_t *);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_test_set_cond(int, sysc_cfga_pkt_t *);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bd_update(int, sysc_evt_t);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_bd_env_set(int, void *);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bdlist_locked(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_busy(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_is_jtag_master(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelint fhc_bd_is_plus(int);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#if defined(_KERNEL)
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * In order to indicate that we are in an environmental chamber, or
29949e866e40b95795203f3ee46f44a197c946e4stevel * oven, the test people will set the 'mfg-mode' property in the
29949e866e40b95795203f3ee46f44a197c946e4stevel * options node to 'chamber'. Therefore we have the following define.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define CHAMBER_VALUE "chamber"
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * zs design for fhc has two zs' interrupting on same interrupt mondo
29949e866e40b95795203f3ee46f44a197c946e4stevel * This requires us to poll for zs and zs alone. The poll list has been
29949e866e40b95795203f3ee46f44a197c946e4stevel * defined as a fixed size for simplicity.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define MAX_ZS_CNT 2
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* FHC Interrupt routine wrapper structure */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct fhc_wrapper_arg {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_soft_state *softsp;
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *clear_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *mapping_reg;
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t *child;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint32_t inum;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t (*funcp)(caddr_t, caddr_t);
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr_t arg1;
29949e866e40b95795203f3ee46f44a197c946e4stevel caddr_t arg2;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * The JTAG master command structure. It contains the address of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * the JTAG controller on this system board. The controller can only
29949e866e40b95795203f3ee46f44a197c946e4stevel * be used if this FHC holds the JTAG master signal. This is checked
29949e866e40b95795203f3ee46f44a197c946e4stevel * by reading the JTAG control register on this FHC.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct jt_mstr {
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *jtag_cmd;
29949e866e40b95795203f3ee46f44a197c946e4stevel int is_master;
29949e866e40b95795203f3ee46f44a197c946e4stevel kmutex_t lock;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Functions exported to manage the fault list */
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid reg_fault(int, enum ft_type, enum ft_class);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid clear_fault(int, enum ft_type, enum ft_class);
29949e866e40b95795203f3ee46f44a197c946e4stevelint process_fault_list(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid create_ft_kstats(int);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* memloc's are protected under the bdlist lock */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct fhc_memloc {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_memloc *next;
29949e866e40b95795203f3ee46f44a197c946e4stevel int board; /* reference our board element */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t pa; /* base PA of this segment (in MB) */
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t size; /* size of this segment (in MB) */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Functions used to manage memory 'segments' */
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_MEMLOC_SHIFT 20
29949e866e40b95795203f3ee46f44a197c946e4stevel#define FHC_MEMLOC_MAX (0x10000000000ull >> FHC_MEMLOC_SHIFT)
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_add_memloc(int board, uint64_t pa, uint_t size);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_del_memloc(int board);
29949e866e40b95795203f3ee46f44a197c946e4steveluint64_t fhc_find_memloc_gap(uint_t size);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_program_memory(int board, uint64_t base);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Structures used in the driver to manage the hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct fhc_soft_state {
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t *dip; /* dev info of myself */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct bd_list *list; /* pointer to board list entry */
29949e866e40b95795203f3ee46f44a197c946e4stevel int is_central; /* A central space instance of FHC */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *id; /* FHC ID register */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *rctrl; /* FHC Reset Control and Status */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *bsr; /* FHC Board Status register */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *jtag_ctrl; /* JTAG Control register */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *igr; /* Interrupt Group Number */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct intr_regs intr_regs[FHC_MAX_INO];
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_wrapper_arg poll_list[MAX_ZS_CNT];
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_wrapper_arg *intr_list[FHC_MAX_INO];
29949e866e40b95795203f3ee46f44a197c946e4stevel kmutex_t poll_list_lock;
29949e866e40b95795203f3ee46f44a197c946e4stevel uchar_t spurious_zs_cntr; /* Spurious counter for zs devices */
29949e866e40b95795203f3ee46f44a197c946e4stevel kmutex_t pokefault_mutex;
29949e866e40b95795203f3ee46f44a197c946e4stevel int pokefault;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* this lock protects the following data */
29949e866e40b95795203f3ee46f44a197c946e4stevel /* ! non interrupt use only ! */
29949e866e40b95795203f3ee46f44a197c946e4stevel kmutex_t ctrl_lock; /* lock for access to FHC CSR */
29949e866e40b95795203f3ee46f44a197c946e4stevel volatile uint_t *ctrl; /* FHC Control and Status */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* The JTAG master structure has internal locking */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct jt_mstr jt_master;
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel /* the pointer to the kstat is stored for deletion upon detach */
29949e866e40b95795203f3ee46f44a197c946e4stevel kstat_t *fhc_ksp;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/*
29949e866e40b95795203f3ee46f44a197c946e4stevel * Function shared with child drivers which require fhc
29949e866e40b95795203f3ee46f44a197c946e4stevel * support. They gain access to this function through the use of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * _depends_on variable.
29949e866e40b95795203f3ee46f44a197c946e4stevel */
29949e866e40b95795203f3ee46f44a197c946e4stevelenum board_type get_board_type(int board);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid update_temp(dev_info_t *pdip, struct temp_stats *envstat, uchar_t value);
29949e866e40b95795203f3ee46f44a197c946e4stevelenum temp_trend temp_trend(struct temp_stats *);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid fhc_reboot(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelint overtemp_kstat_update(kstat_t *ksp, int rw);
29949e866e40b95795203f3ee46f44a197c946e4stevelint temp_override_kstat_update(kstat_t *ksp, int rw);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid init_temp_arrays(struct temp_stats *envstat);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid update_board_leds(fhc_bd_t *, uint_t, uint_t);
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct jt_mstr *jtag_master_lock(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelvoid jtag_master_unlock(struct jt_mstr *);
29949e866e40b95795203f3ee46f44a197c946e4stevelextern int fhc_board_poweroffcpus(int board, char *errbuf, int cpu_flags);
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* FHC interrupt specification */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct fhcintrspec {
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t mondo;
29949e866e40b95795203f3ee46f44a197c946e4stevel uint_t pil;
29949e866e40b95795203f3ee46f44a197c946e4stevel dev_info_t *child;
29949e866e40b95795203f3ee46f44a197c946e4stevel struct fhc_wrapper_arg *handler_arg;
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel/* kstat structure used by fhc to pass data to user programs. */
29949e866e40b95795203f3ee46f44a197c946e4stevelstruct fhc_kstat {
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named csr; /* FHC Control and Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel struct kstat_named bsr; /* FHC Board Status Register */
29949e866e40b95795203f3ee46f44a197c946e4stevel};
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _KERNEL */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _ASM */
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#ifdef __cplusplus
29949e866e40b95795203f3ee46f44a197c946e4stevel}
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif
29949e866e40b95795203f3ee46f44a197c946e4stevel
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* _SYS_FHC_H */