/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 1998-2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_PDA_H #define _SYS_PDA_H #pragma ident "%Z%%M% %I% %E% SMI" #ifdef __cplusplus extern "C" { #endif #include /* * Contains definitions used for PDA (Post Descriptor Array) [post2obp] * support. * * XXX - These data structures is defined in SSP-land in: * src/post/export/xf_postif.h. It is not anticipated * that any future changes will be made to this data * structure so we'll allow this hack on this go around. */ #define MAX_ABUSES 4 /* Address buses */ #define MAX_DBUSES 2 /* Data buses */ #define MAX_SYSBDS 16 /* no more than 16 system boards */ #define MAX_PROCMODS 4 /* Per system board */ #define MAX_PC 3 /* Per system board */ #define MAX_XDB 4 /* Per system board */ #define MAX_CIC 4 /* Per system board */ #define MAX_MGROUPS 4 /* Per MC and system board */ #define MAX_IOCS 2 /* Per system board */ #define MAX_SLOTS_PER_IOC 4 /* Per ioc */ typedef struct { ushort_t bda_board; /* BDAN 0|Anyred|mem|Board */ ushort_t bda_proc; /* BDAN Processor 3:0 */ ushort_t bda_pc; /* BDAN PC asic 2:0 */ ushort_t bda_xdb; /* BDAN XDB asic 3:0 */ ushort_t bda_cic; /* BDAN CIC asic 3:0 */ ushort_t bda_ldpath; /* BDAN 0|0| ldpath [dbus] */ ushort_t bda_ioc; /* BDAN 0|0| ioc 1:0 */ ushort_t bda_ios[MAX_IOCS]; /* BDAN Scard 3:0 */ ushort_t bda_mgroup; /* BDAN memory group 3:0 */ } board_desc_t; typedef struct { ushort_t bada_proc [MAX_PROCMODS]; /* Extra status on procs */ uchar_t bada_iom_type; /* I/O module type. */ uchar_t bada_fill[3]; ushort_t bada_ioc[MAX_IOCS]; /* Extra status on iocs */ } board_auxdesc_t; /* * The three lsb of bada_proc holds the ecache size of that proc * module, as (log-base-2 - 19), so 1/2 MB is 0, 1 MB is 1, ... * 32 MB is 6. 7 is a bogus value. */ #define BADA_PROC_GET_ECL2M19(bada_proc) ((bada_proc) & 0x7) typedef struct { uint32_t bmda_adr; /* MC ADR */ uint32_t bmda_gab_bank_sel; /* MC gab bank sel reg */ ushort_t bmda_bank_setup; /* MC gab bank setup reg */ ushort_t bmda_filler; int32_t bmda_badpage[MAX_MGROUPS]; /* * One bad page offset per * mgroup is allowed. No * bad page if < 0. */ } board_mdesc_t; /* * BDA nibble status definitions: * These are ordered in terms of preserving interesting information * in POST displays where all configurations are displayed in a * single value. The highest value for a resource over all * configurations is shown. * Of course, this is just for help to engineers/technicians in * understanding what happened; for the most part, everything * except "GOOD" is just different flavors of "BAD". * Note the special macro SET_BDA_NBL_CRUNCH below which requires * that BDAN_CRUNCH be 0. */ #define BDAN_CRUNCH 0x0 /* Unusable by implication */ #define BDAN_UNDEFINED 0x1 /* Architecturally Missing */ #define BDAN_MISS 0x2 /* Missing */ #define BDAN_FAIL 0x3 /* Tested and failed */ #define BDAN_BLACK 0x4 /* Blacklisted */ #define BDAN_RED 0x5 /* Redlisted */ #define BDAN_EXCLUDED 0x6 /* Board is not in this domain */ #define BDAN_UNCONFIG 0x7 /* Good, but not in config. */ #define BDAN_GOOD 0x8 /* Like it says. */ #define BDAN_MASK 0xF /* Macros for accessing BDA nibbles */ #define BDA_NBL(shrt, nibix) \ (((shrt) >> ((nibix) << 2)) & BDAN_MASK) #define SET_BDA_NBL(shrt, nibix, val) \ { \ shrt &= ~(BDAN_MASK << ((nibix) << 2)); \ shrt |= (val) << ((nibix) << 2); \ } /* * This exists to keep lint from complaining about statements with * null efect when we OR in a constant 0 in SET_BDA_NBL. It's a pain, * but it does save the code optimizer some work. ;-{ */ #define SET_BDA_NBL_CRUNCH(shrt, nibix) \ (shrt &= ~(BDAN_MASK << ((nibix) << 2))) /* Definitions for nibbles in the bda_board element: */ #define BDA_GEN_NBL 0 /* Overall state of the board */ #define BDA_MC_NBL 1 /* State of the memory. */ /* * BDAN_RED if anything red on board, or board is BDAN_EXCLUDED; * otherwise BDAN_GOOD */ #define BDA_ANYRED_NBL 2 /* * Macro BDA_PAGESHIFT hides Solaris page size to Starfire POST, as POST * assumes Solaris basic page size as 8K. * Note: Only BDA_PAGESHIFT is used, BDA_PAGESIZE is added for readability. */ #define BDA_PAGESHIFT 13 #define BDA_PAGESIZE (1<