4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/ddifm.h>
40 #define PBM_SECONDARY 0
41 #define PBM_NONFATAL 0
49 #define ECC_MAX_ERRS 6
52 * Since pci_pbm_err_handler() is called by various interrupt/trap/callback
53 * handlers, it is necessary for it to know where it is being called from.
54 * Below are the flags passed to pci_pbm_err_handler() to give it knowledge
57 #define PCI_TRAP_CALL 0x0
58 #define PCI_CB_CALL 0x1
59 #define PCI_INTR_CALL 0x2
60 #define PCI_BUS_EXIT_CALL 0x3
61 #define PCI_ECC_CALL 0x4
63 #define PCIX_ERROR_SUBCLASS "pcix"
64 #define PCIX_SECONDARY "s-"
65 #define PCIX_STAT "pcix-stat"
66 #define PCIX_PFAR "pcix-pfar"
68 extern errorq_t
*pci_ecc_queue
; /* per-system ecc handling queue */
71 * region where schizo pio ecc error was detected
84 typedef struct pbm_fm_err
{
92 typedef struct ecc_format
{
93 ecc_region_t ecc_region
;
98 typedef struct cb_fm_err
{
104 typedef struct ecc_fm_err
{
106 uint64_t ecc_reg_bit
;
109 uint64_t ecc_region_bits
;
115 * iommu errstate used to store iommu specific registers
117 struct iommu_errstate
{
122 struct pci_errstate
{
124 uint16_t pci_cfg_stat
;
125 uint16_t pci_cfg_comm
;
130 * pbm errstate use to encompass the state for all errors
131 * detected by the pci block
133 struct pbm_errstate
{
139 char *pbm_bridge_type
;
140 uint64_t pbm_ctl_stat
;
145 iommu_errstate_t pbm_iommu
;
146 uint64_t pbm_pcix_stat
;
147 uint32_t pbm_pcix_pfar
;
148 pci_errstate_t pbm_pci
;
149 char *pbm_terr_class
;
153 * ecc errstate used to store all state captured,
154 * upon detection of an ecc error.
156 struct ecc_errstate
{
157 char *ecc_bridge_type
;
163 uint64_t ecc_dw_offset
;
164 struct async_flt ecc_aflt
;
165 ecc_intr_info_t ecc_ii_p
;
168 ecc_region_t ecc_region
;
170 uint64_t ecc_err_addr
;
175 uint64_t ecc_dimm_offset
;
176 char ecc_unum
[UNUM_NAMLEN
];
177 char ecc_dimm_sid
[DIMM_SERIAL_ID_LEN
];
181 * control block error state
185 char *cb_bridge_type
;
196 uint64_t cb_first_elog
;
197 uint64_t cb_first_eaddr
;
198 uint64_t cb_leaf_status
;
199 pbm_errstate_t cb_pbm
[2];
202 extern int pci_fm_init_child(dev_info_t
*dip
, dev_info_t
*tdip
, int cap
,
203 ddi_iblock_cookie_t
*ibc
);
204 extern void pci_bus_enter(dev_info_t
*dip
, ddi_acc_handle_t handle
);
205 extern void pci_bus_exit(dev_info_t
*dip
, ddi_acc_handle_t handle
);
206 extern void pbm_ereport_post(dev_info_t
*dip
, uint64_t ena
,
207 pbm_errstate_t
*pbm_err
);
208 extern void pci_fm_acc_setup(ddi_map_req_t
*mp
, dev_info_t
*rdip
);
209 extern void pci_fmri_create(dev_info_t
*dip
, pci_common_t
*cmn_p
);
210 extern void pci_fm_create(pci_t
*pci_p
);
211 extern void pci_fm_destroy(pci_t
*pci_p
);
212 extern int pci_err_callback(dev_info_t
*dip
, ddi_fm_error_t
*derr
,
213 const void *impl_data
);
220 #endif /* _PCI_FM_H */