RTEMS 6.1-rc4
Loading...
Searching...
No Matches
ecc.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2024 On-Line Applications Research Corporation (OAR)
13 * Written by Kinsey Moore <kinsey.moore@oarcorp.com>
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef LIBBSP_AARCH64_XILINX_ZYNQMP_BSP_ECC_H
38#define LIBBSP_AARCH64_XILINX_ZYNQMP_BSP_ECC_H
39
46//#include <bspopts.h>
47
48#ifndef ASM
49
50#ifdef __cplusplus
51extern "C" {
52#endif /* __cplusplus */
53
57typedef enum {
58 /* L1 Cache event information is delivered via Cache_Error_Info struct. */
59 L1_CACHE,
60 /* L2 Cache event information is delivered via Cache_Error_Info struct. */
61 L2_CACHE,
62 /*
63 * L1 and L2 cache are on a combined interrupt on ZynqMP. They are enabled as
64 * a single unit. The above individual L1 and L2 cache definitions will be
65 * used for reporting. Attempting to enable L1 or L2 individually will enable
66 * both.
67 */
68 L1_L2_CACHE,
69 /* OCM RAM event information is delivered via OCM_Error_Info struct. */
70 OCM_RAM,
71 /* DDR RAM event information is delivered via DDR_Error_Info struct. */
72 DDR_RAM,
74
78typedef enum {
79 RAM_ID_L1I_TAG,
80 RAM_ID_L1I_DATA,
81 RAM_ID_L1D_TAG,
82 RAM_ID_L1D_DATA,
83 RAM_ID_L1D_DIRTY,
84 RAM_ID_TLB,
85 RAM_ID_L2_TAG,
86 RAM_ID_L2_DATA,
87 RAM_ID_SCU,
88 RAM_ID_UNKNOWN
90
94typedef struct {
95 /* Indicates the RAM index address */
96 uint64_t address;
97 /* Indicates the type of RAM where the error originated */
99 /*
100 * Indicates the segment (way or bank) of the RAM where the error originated.
101 * Does not apply to L1D_DIRTY RAM ID. For SCU errors, this also indicates the
102 * associated CPU.
103 */
104 uint8_t segment;
105 /* The number of times this specific error has occurred since last reset */
106 uint8_t repeats;
107 /* The number of times other errors have occurred since last reset */
108 uint8_t other_errors;
109 /* Whether any of the errors represented have caused a data abort */
110 bool abort;
112
120typedef void (*zynqmp_ecc_handler)( ECC_Event_Type event, void *data );
121
130
139
143void zynqmp_ocm_inject_fault( void );
144
148typedef enum {
149 OCM_UNCORRECTABLE,
150 OCM_UNCORRECTABLE_RMW,
151 OCM_CORRECTABLE
153
157typedef struct {
158 /* Describes the type of error being reported */
159 OCM_Error_Type type;
160 /* The offset into OCM where the error occurred */
161 uint32_t offset;
162 /* The data relevant to the error. Does not apply to RMW errors */
163 uint32_t data0;
164 uint32_t data1;
165 uint32_t data2;
166 uint32_t data3;
167 /* The ECC syndrome relevant to the error. Does not apply to RMW errors */
168 uint16_t syndrome;
170
174typedef enum {
175 DDR_UNCORRECTABLE,
176 DDR_CORRECTABLE
178
182typedef struct {
183 /* Describes the type of error being reported */
184 DDR_Error_Type type;
185 /* The DDR Rank where the error occurred */
186 uint32_t rank;
187 /* The DDR Bank Group where the error occurred */
188 uint32_t bank_group;
189 /* The DDR Bank where the error occurred */
190 uint32_t bank;
191 /* The DDR Row where the error occurred */
192 uint32_t row;
193 /* The DDR Column where the error occurred */
194 uint32_t column;
195 /*
196 * When mapping from SDRAM addressing back to AXI addressing, this is will
197 * only be a close approximation of the source address since bits can be
198 * discarded when converting from AXI to SDRAM.
199 */
200 uint64_t address;
202
203#ifdef __cplusplus
204}
205#endif /* __cplusplus */
206
207#endif /* ASM */
208
211#endif /* LIBBSP_AARCH64_XILINX_ZYNQMP_BSP_ECC_H */
int zynqmp_ecc_enable(ECC_Event_Type event)
Enable ECC error reporting.
Definition: bspstartecc_hw.c:58
OCM_Error_Type
The types of OCM ECC errors.
Definition: ecc.h:148
void zynqmp_ecc_register_handler(zynqmp_ecc_handler handler)
Enumeration describing the possible types of ECC events.
Definition: bspstartecc_hw.c:44
Cache_Error_RAM_ID
The specific locations where a cache error can originate.
Definition: ecc.h:78
void zynqmp_ocm_inject_fault(void)
Injects an ECC fault in the On-Chip Memory (OCM)
Definition: ocm.c:99
void(* zynqmp_ecc_handler)(ECC_Event_Type event, void *data)
Typedef for ECC handlers.
Definition: ecc.h:120
DDR_Error_Type
The types of DDR ECC errors.
Definition: ecc.h:174
ECC_Event_Type
Enumeration describing the possible types of ECC events.
Definition: ecc.h:57
Structure containing information about a Cache error.
Definition: ecc.h:94
Structure containing information about a DDR ECC error.
Definition: ecc.h:182
Structure containing information about a OCM ECC error.
Definition: ecc.h:157