/*
* 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
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SERENGETI_H
#define _SYS_SERENGETI_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* serengeti.h - Serengeti/WildCat common header file
*
* This header file contains the common definitions and macros for the
* Serengeti and WildCat platforms. We define them all here to avoid them
* being redefined in numerous different drivers.
*/
#include <sys/dditypes.h>
/*
* Definitions
* ===========
*/
#ifndef TRUE
#endif
#ifndef FALSE
#define FALSE 0
#endif
/*
* possible states for the Keyswitch Position.
*/
/*
* Macros
* ======
*/
/* we only need the 5 LSB of the portid to calculate the board number */
/*
* For Serengeti and WildCat the portid consists of 10 bits.
*
* [9] [8 -------- 5][4 --------- 0]
* ^ NodeID AgentID
* |___ Used in CMP to identify core 1. Unused with non-CMP.
*
* For CPU boards:
* Aid <1:0> : CPU ID
* For IO boards:
* (Aid <4:0> - 24) % 2 : Schizo ID
*/
/*
* For Jaguar there are two CPU IDs the can be derived from portid
* and coreid. On Serengeti, bit 9 is set for core 1, resulting in
* the cpuid for core 1 being 512 off from the one for core 0.
*/
((c) * SG_MAX_CMPS_PER_BD))
SG_CPUID_TO_PORTID(c), \
/*
* SG_PORTID_TO_NODEID
*
* Calculates the SSM NodeID from the portid
*/
/*
* SG_PORTID_TO_SAFARI_ID
*
* Calculates the Safari Agent ID from the portid.
*/
/*
* SG_PORTID_TO_BOARD_NUM
*
* If a valid portid is passed in, this macro returns the board number
* associated with it, otherwise it returns -1.
*/
((SG_PORTID_IS_CPU_TYPE(portid)) ? \
(SG_CPU_BD_PORTID_TO_BD_NUM(portid)) : \
((SG_PORTID_IS_IO_TYPE(portid)) ? \
/*
* SG_BOARD_IS_CPU_TYPE
*
* If the board number of a board of CPU type is passed in, TRUE is returned,
* otherwise FALSE.
*/
/*
* SG_BOARD_IS_IO_TYPE
*
* If the board number of a board of IO type is passed in, TRUE is returned,
* otherwise FALSE.
*/
((((board_num) >= SG_MAX_CPU_BDS) && \
/*
* SG_PORTID_IS_CPU_TYPE
*
* If the portid associated with a CPU board is passed in, TRUE is returned,
* otherwise FALSE.
*/
/*
* SG_PORTID_IS_IO_TYPE
*
* If the portid associated with an IO board is passed in, TRUE is returned,
* otherwise FALSE.
*/
/*
* SG_CPU_BD_PORTID_TO_BD_NUM
*
* If the portid associated with a CPU board is passed in, the board number
* associated with this portid is returned, otherwise -1.
*/
((SG_PORTID_IS_CPU_TYPE(portid)) ? \
/*
* SG_IO_BD_PORTID_TO_BD_NUM
*
* If the portid associated with an IO board is passed in, the board number
* associated with this portid is returned, otherwise -1.
*/
(SG_PORTID_IS_IO_TYPE(portid) ? \
/*
* SG_PORTID_TO_CPU_POSN
*
* If the portid associated with a CPU board is passed in, the position
* of the CPU module for this portid is returned, otherwise -1.
*/
((SG_PORTID_IS_CPU_TYPE(portid)) ? \
/*
* Serengeti slices are defined by bits 34..41 of the physical address
* space, and can contain Safari agent ID bits depending upon the SC
* firmware being used.
*/
/* Define the max memory banks per CPU board */
/* Define the number of possible slices for the span of slice bits */
/*
* b represents the SB and c represents the processor (P)
* in relation to the SB.
*/
/* Each physical CPU has 2 ecache DIMMs */
/* Bit 4 of the physical address indicates ecache dimm 0 or 1 */
extern dev_info_t *find_chosen_dip(void);
extern int sg_prom_sb_dr_check(void);
extern int sg_prom_cpci_dr_check(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SERENGETI_H */