1*25cf1a30Sjl139090 /* 2*25cf1a30Sjl139090 * CDDL HEADER START 3*25cf1a30Sjl139090 * 4*25cf1a30Sjl139090 * The contents of this file are subject to the terms of the 5*25cf1a30Sjl139090 * Common Development and Distribution License (the "License"). 6*25cf1a30Sjl139090 * You may not use this file except in compliance with the License. 7*25cf1a30Sjl139090 * 8*25cf1a30Sjl139090 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*25cf1a30Sjl139090 * or http://www.opensolaris.org/os/licensing. 10*25cf1a30Sjl139090 * See the License for the specific language governing permissions 11*25cf1a30Sjl139090 * and limitations under the License. 12*25cf1a30Sjl139090 * 13*25cf1a30Sjl139090 * When distributing Covered Code, include this CDDL HEADER in each 14*25cf1a30Sjl139090 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*25cf1a30Sjl139090 * If applicable, add the following below this CDDL HEADER, with the 16*25cf1a30Sjl139090 * fields enclosed by brackets "[]" replaced with your own identifying 17*25cf1a30Sjl139090 * information: Portions Copyright [yyyy] [name of copyright owner] 18*25cf1a30Sjl139090 * 19*25cf1a30Sjl139090 * CDDL HEADER END 20*25cf1a30Sjl139090 */ 21*25cf1a30Sjl139090 /* 22*25cf1a30Sjl139090 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23*25cf1a30Sjl139090 * Use is subject to license terms. 24*25cf1a30Sjl139090 */ 25*25cf1a30Sjl139090 26*25cf1a30Sjl139090 #ifndef _SYS_PCMU_ECC_H 27*25cf1a30Sjl139090 #define _SYS_PCMU_ECC_H 28*25cf1a30Sjl139090 29*25cf1a30Sjl139090 #pragma ident "%Z%%M% %I% %E% SMI" 30*25cf1a30Sjl139090 31*25cf1a30Sjl139090 #ifdef __cplusplus 32*25cf1a30Sjl139090 extern "C" { 33*25cf1a30Sjl139090 #endif 34*25cf1a30Sjl139090 35*25cf1a30Sjl139090 struct pcmu_ecc_intr_info { 36*25cf1a30Sjl139090 pcmu_ecc_t *pecc_p; 37*25cf1a30Sjl139090 int pecc_type; /* CBNINTR_UE */ 38*25cf1a30Sjl139090 uint64_t pecc_afsr_pa; /* ECC AFSR phsyical address */ 39*25cf1a30Sjl139090 uint64_t pecc_afar_pa; /* ECC AFAR physical address */ 40*25cf1a30Sjl139090 41*25cf1a30Sjl139090 /* 42*25cf1a30Sjl139090 * Implementation-specific masks & shift values. 43*25cf1a30Sjl139090 */ 44*25cf1a30Sjl139090 uint64_t pecc_errpndg_mask; /* 0 if not applicable. */ /* RAGS */ 45*25cf1a30Sjl139090 uint64_t pecc_offset_mask; 46*25cf1a30Sjl139090 uint_t pecc_offset_shift; 47*25cf1a30Sjl139090 uint_t pecc_size_log2; 48*25cf1a30Sjl139090 }; 49*25cf1a30Sjl139090 50*25cf1a30Sjl139090 struct pcmu_ecc { 51*25cf1a30Sjl139090 pcmu_t *pecc_pcmu_p; 52*25cf1a30Sjl139090 volatile uint64_t pecc_csr_pa; /* ECC control & status reg */ 53*25cf1a30Sjl139090 struct pcmu_ecc_intr_info pecc_ue; /* ECC UE error intr info */ 54*25cf1a30Sjl139090 timeout_id_t pecc_tout_id; 55*25cf1a30Sjl139090 }; 56*25cf1a30Sjl139090 57*25cf1a30Sjl139090 /* 58*25cf1a30Sjl139090 * Prototypes 59*25cf1a30Sjl139090 */ 60*25cf1a30Sjl139090 extern void pcmu_ecc_create(pcmu_t *pcmu_p); 61*25cf1a30Sjl139090 extern int pcmu_ecc_register_intr(pcmu_t *pcmu_p); 62*25cf1a30Sjl139090 extern void pcmu_ecc_destroy(pcmu_t *pcmu_p); 63*25cf1a30Sjl139090 extern void pcmu_ecc_configure(pcmu_t *pcmu_p); 64*25cf1a30Sjl139090 extern void pcmu_ecc_enable_intr(pcmu_t *pcmu_p); 65*25cf1a30Sjl139090 extern void pcmu_ecc_disable_wait(pcmu_ecc_t *pecc_p); 66*25cf1a30Sjl139090 extern uint_t pcmu_ecc_disable_nowait(pcmu_ecc_t *pecc_p); 67*25cf1a30Sjl139090 extern uint_t pcmu_ecc_intr(caddr_t a); 68*25cf1a30Sjl139090 extern int pcmu_ecc_err_handler(pcmu_ecc_errstate_t *ecc_err_p); 69*25cf1a30Sjl139090 extern void pcmu_ecc_err_drain(void *not_used, pcmu_ecc_errstate_t *ecc_err); 70*25cf1a30Sjl139090 71*25cf1a30Sjl139090 #ifdef __cplusplus 72*25cf1a30Sjl139090 } 73*25cf1a30Sjl139090 #endif 74*25cf1a30Sjl139090 75*25cf1a30Sjl139090 #endif /* _SYS_PCMU_ECC_H */ 76