7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm * Common Development and Distribution License (the "License").
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#pragma ident "%Z%%M% %I% %E% SMI"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern "C" {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define MC_PC_COLADDRBIT 10 /* col address bit used for precharge */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi ((size_t)bam->bam_sizemb * MC_CS_SCALE * ((width) == 128 ? 2 : 1))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi (csbmap >> MC_CHIP_DIMMPAIR(csnum) * MC_DC_BAM_CSBANK_SHIFT & \
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi ((val) & (((2ULL << (high)) - 1) & ~((1ULL << (low)) - 1)))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define BITVAL(var, num) ((BIT(var, num) >> (num)) & 1ULL)
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm#define MC_RC_ROW_MAX 16 /* maximum number of row address bits */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm#define MC_RC_COL_MAX 12 /* maximum number of col address bits */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm#define MC_RC_BANKBITS_MAX 3 /* number of internal banksel bits */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm#define MC_RC_CSMODES 16 /* max number of cs bankaddr modes */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm#define MC_RC_SWZLBITS 2 /* number of row bits in swizzle */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm int rcb_bankbit[MC_RC_BANKBITS_MAX]; /* bank address bits */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm int rcb_colbit[MC_RC_COL_MAX + 1]; /* one for MC_PC_ALL */
8a40a695ee676a322b094e9afe5375567bfb51e3gavinm int bswz_rowbits[MC_RC_BANKBITS_MAX][MC_RC_SWZLBITS];
8a40a695ee676a322b094e9afe5375567bfb51e3gavinmextern const struct rct_bnkaddrmode *rct_bnkaddrmode(uint_t, uint_t);
8a40a695ee676a322b094e9afe5375567bfb51e3gavinmextern const struct rct_rcbmap *rct_rcbmap(uint_t, int, uint_t);
8a40a695ee676a322b094e9afe5375567bfb51e3gavinmextern const struct rct_bnkswzlinfo *rct_bnkswzlinfo(uint_t, int);
8a40a695ee676a322b094e9afe5375567bfb51e3gavinmextern void rct_csintlv_bits(uint_t, int, uint_t, int, struct rct_csintlv *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif /* _MCAMD_ROWCOL_IMPL_H */