mc-opl.h revision cfb9e06246189a19958ae6c1a6f3bcb07f06c191
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER START
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * The contents of this file are subject to the terms of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Common Development and Distribution License (the "License").
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You may not use this file except in compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * See the License for the specific language governing permissions
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * When distributing Covered Code, include this CDDL HEADER in each
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * If applicable, add the following below this CDDL HEADER, with the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * fields enclosed by brackets "[]" replaced with your own identifying
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * information: Portions Copyright [yyyy] [name of copyright owner]
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER END
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Use is subject to license terms.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#pragma ident "%Z%%M% %I% %E% SMI"
25cf1a301a396c38e8adf52c15f537b80d2483f7jlextern "C" {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * load/store MAC register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define ST_MAC_REG(paddr, data) mc_stphysio((paddr), (data))
0cc8ae8667155d352d327b5c92b62899a7e05bcdavtypedef struct {
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct scf_log {
0cc8ae8667155d352d327b5c92b62899a7e05bcdav * Current max serial number size is 12, but keep enough room
0cc8ae8667155d352d327b5c92b62899a7e05bcdav * to accomodate any future changes.
0cc8ae8667155d352d327b5c92b62899a7e05bcdav * Current max part number size is 18 + 18(Sun's partnumber + FJ's partnumber),
0cc8ae8667155d352d327b5c92b62899a7e05bcdav * but keep enough room to accomodate any future changes.
0cc8ae8667155d352d327b5c92b62899a7e05bcdav#define MCOPL_MAX_SERIALID (MCOPL_MAX_SERIAL + MCOPL_MAX_PARTNUM)
0cc8ae8667155d352d327b5c92b62899a7e05bcdavtypedef struct mc_dimm_info {
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct mc_opl_state {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define BANK_MIRROR_MODE 0x40000000 /* 0: normal 1: mirror */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uchar_t mc_trans_table[2][64]; /* csX-mac-pa-trans-table */
0cc8ae8667155d352d327b5c92b62899a7e05bcdav /* number of times memory scanned */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define IS_MIRROR(mcp, bn) ((mcp)->mc_bank[bn].mcb_status\
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct mc_addr {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint32_t ma_dimm_addr; /* DIMM address (same format as ERR_ADD) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct mc_addr_info {
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct mc_flt_stat {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint32_t mf_err_add; /* MAC_BANKm_{PTRL|MI}_ERR_ADD Register */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint32_t mf_err_log; /* MAC_BANKm_{PTRL|MI}_ERR_LOG Register */
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct mc_aflt {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_STAT(mcp, i) (mcp->mc_bank[i].mcb_reg_base)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_CNTL(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x10)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_ERR_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x20)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_ERR_LOG(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x24)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_MI_ERR_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x28)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_MI_ERR_LOG(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x2c)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_STATIC_ERR_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x30)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_STATIC_ERR_LOG(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x34)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_RESTART_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x40)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_REWRITE_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x44)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_EG_ADD(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x48)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_EG_CNTL(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x4c)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_MIRR(mcp, i) (mcp->mc_bank[i].mcb_reg_base + 0x50)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* use PA[37:6] */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * MAC_BANKm_PTRL_STAT_Register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_STAT_PTRL_ERRS (MAC_STAT_PTRL_CE|MAC_STAT_PTRL_UE\
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * MAC_BANKm_PTRL_CTRL_Register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_CNTL_PTRL_PRESERVE_BITS (MAC_CNTL_PTRL_INTERVAL)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_CNTL_PTRL_ERRS (MAC_CNTL_PTRL_CE|MAC_CNTL_PTRL_UE\
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_CNTL_REW_ERRS (MAC_CNTL_REW_CE|MAC_CNTL_REW_CMPE|\
0cc8ae8667155d352d327b5c92b62899a7e05bcdav#define MAC_PTRL_START(mcp, i) { if (!(ldphysio(MAC_PTRL_CNTL(mcp, i)) \
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_STOP(mcp, i) MAC_CMD((mcp), (i), MAC_CNTL_PTRL_STOP)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_PTRL_RESET(mcp, i) MAC_CMD((mcp), (i), MAC_CNTL_PTRL_RESET)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_REW_REQ(mcp, i) MAC_CMD((mcp), (i), MAC_CNTL_REW_REQ)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_REW_RESET(mcp, i) MAC_CMD((mcp), (i), MAC_CNTL_REW_RESET)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define MAC_CLEAR_ERRS(mcp, i, errs) MAC_CMD((mcp), (i), errs)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * MAC_BANKm_STATIC_ERR_ADD_Register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * MAC_BANKm_MIRR_Register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * MAC_BANKm_EG_ADD_Register
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * To set the EG_CNTL register, bit[26-25] and
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * bit[21-20] must be cleared. Then the other
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * control bit should be set. Then the bit[26-25]
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * and bit[21-20] should be set while other bits
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * should be the same as before.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* For MAC-PA translation */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* export interface for error injection */
25cf1a301a396c38e8adf52c15f537b80d2483f7jlextern int mc_inject_error(int error_type, uint64_t pa, uint32_t flags);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif /* _SYS_MC_OPL_H */