RTEMS 6.1-rc5
Loading...
Searching...
No Matches
arm-errata.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (c) 2014 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef ARM_ERRATA_H_
37#define ARM_ERRATA_H_
38
39#include <bsp/arm-release-id.h>
40#include <libcpu/arm-cp15.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
46static inline arm_release_id arm_errata_get_processor_release(void)
47{
48 const uint32_t MIDR = arm_cp15_get_id_code();
49 const uint8_t REVISION = (MIDR & 0xF00000U) >> 20;
50 const uint8_t PATCH_LEVEL = (MIDR & 0xFU);
51
52 return ARM_RELEASE_ID_FROM_NUMBER_AND_PATCH_LEVEL(
53 REVISION,
54 PATCH_LEVEL
55 );
56}
57
58static inline bool arm_errata_is_applicable_processor_errata_764369(void)
59{
60#if defined(RTEMS_SMP)
61 const arm_release_id RELEASE = arm_errata_get_processor_release();
62 bool is_applicable = false;
63
64 /* Errata information for Cortex-A9 processors.
65 * Information taken from ARMs
66 * "Cortex-A series processors
67 * - Cortex-A9
68 * - Software Developers Errata Notice
69 * - Revision r4 revisions
70 * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice"
71 * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html
72 * Please see this document for more information on these erratas */
73
74 switch( RELEASE ) {
75 case ARM_RELEASE_ID_R4_P1:
76 case ARM_RELEASE_ID_R4_P4:
77 case ARM_RELEASE_ID_R3_P0:
78 case ARM_RELEASE_ID_R2_P10:
79 case ARM_RELEASE_ID_R2_P8:
80 case ARM_RELEASE_ID_R2_P6:
81 case ARM_RELEASE_ID_R2_P4:
82 case ARM_RELEASE_ID_R2_P3:
83 case ARM_RELEASE_ID_R2_P2:
84 case ARM_RELEASE_ID_R2_P0:
85 is_applicable = true;
86 break;
87 default:
88 is_applicable = false;
89 break;
90 }
91
92 return is_applicable;
93#else
94 return false;
95#endif
96}
97
98static inline bool arm_errata_is_applicable_processor_errata_775420(void)
99{
100 const arm_release_id RELEASE = arm_errata_get_processor_release();
101 bool is_applicable = false;
102
103 /* Errata information for Cortex-A9 processors.
104 * Information taken from ARMs
105 * "Cortex-A series processors
106 * - Cortex-A9
107 * - Software Developers Errata Notice
108 * - Revision r4 revisions
109 * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice"
110 * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html
111 * Please see this document for more information on these erratas */
112
113 switch( RELEASE ) {
114 case ARM_RELEASE_ID_R2_P10:
115 case ARM_RELEASE_ID_R2_P8:
116 case ARM_RELEASE_ID_R2_P6:
117 case ARM_RELEASE_ID_R2_P4:
118 case ARM_RELEASE_ID_R2_P3:
119 case ARM_RELEASE_ID_R2_P2:
120 is_applicable = true;
121 break;
122 default:
123 is_applicable = false;
124 break;
125 }
126
127 return is_applicable;
128}
129
130#ifdef __cplusplus
131}
132#endif /* __cplusplus */
133
134#endif /* ARM_ERRATA_H_ */
ARM co-processor 15 (CP15) API.
Create #defines for release IDs.