1 | /** |
---|
2 | * @file arm-errata.h |
---|
3 | * |
---|
4 | * @ingroup arm_shared |
---|
5 | * |
---|
6 | * @brief Create #defines which state which erratas shall get applied |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2014 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * embedded brains GmbH |
---|
13 | * Dornierstr. 4 |
---|
14 | * 82178 Puchheim |
---|
15 | * Germany |
---|
16 | * <rtems@embedded-brains.de> |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.org/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef ARM_ERRATA_H_ |
---|
24 | #define ARM_ERRATA_H_ |
---|
25 | |
---|
26 | #include <bsp/arm-release-id.h> |
---|
27 | #include <libcpu/arm-cp15.h> |
---|
28 | |
---|
29 | #ifdef __cplusplus |
---|
30 | extern "C" { |
---|
31 | #endif /* __cplusplus */ |
---|
32 | |
---|
33 | #if defined( __ARM_ARCH_7A__ ) |
---|
34 | static arm_release_id arm_errata_get_processor_release( |
---|
35 | void |
---|
36 | ) |
---|
37 | { |
---|
38 | const uint32_t MIDR = arm_cp15_get_id_code(); |
---|
39 | const uint8_t REVISION = (MIDR & 0xF00000U) >> 20; |
---|
40 | const uint8_t PATCH_LEVEL = (MIDR & 0xFU); |
---|
41 | |
---|
42 | return ARM_RELEASE_ID_FROM_NUMBER_AND_PATCH_LEVEL( |
---|
43 | REVISION, |
---|
44 | PATCH_LEVEL |
---|
45 | ); |
---|
46 | } |
---|
47 | #endif /* #if defined( __ARM_ARCH_7A__ ) */ |
---|
48 | |
---|
49 | #if defined( __ARM_ARCH_7A__ ) |
---|
50 | #if ( defined( RTEMS_SMP ) ) |
---|
51 | static bool arm_errata_is_applicable_processor_errata_764369( |
---|
52 | void |
---|
53 | ) |
---|
54 | { |
---|
55 | const arm_release_id RELEASE = arm_errata_get_processor_release(); |
---|
56 | bool is_applicable = false; |
---|
57 | |
---|
58 | /* Errata information for Cortex-A9 processors. |
---|
59 | * Information taken from ARMs |
---|
60 | * "Cortex-A series processors |
---|
61 | * - Cortex-A9 |
---|
62 | * - Software Developers Errata Notice |
---|
63 | * - Revision r4 revisions |
---|
64 | * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice" |
---|
65 | * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html |
---|
66 | * Please see this document for more information on these erratas */ |
---|
67 | |
---|
68 | switch( RELEASE ) { |
---|
69 | case ARM_RELEASE_ID_R4_P1: |
---|
70 | case ARM_RELEASE_ID_R4_P4: |
---|
71 | case ARM_RELEASE_ID_R3_P0: |
---|
72 | case ARM_RELEASE_ID_R2_P10: |
---|
73 | case ARM_RELEASE_ID_R2_P8: |
---|
74 | case ARM_RELEASE_ID_R2_P6: |
---|
75 | case ARM_RELEASE_ID_R2_P4: |
---|
76 | case ARM_RELEASE_ID_R2_P3: |
---|
77 | case ARM_RELEASE_ID_R2_P2: |
---|
78 | case ARM_RELEASE_ID_R2_P0: |
---|
79 | is_applicable = true; |
---|
80 | break; |
---|
81 | default: |
---|
82 | is_applicable = false; |
---|
83 | break; |
---|
84 | } |
---|
85 | |
---|
86 | return is_applicable; |
---|
87 | } |
---|
88 | #else |
---|
89 | #define arm_errata_is_applicable_processor_errata_764369() false |
---|
90 | #endif /* ( defined( RTEMS_SMP ) ) */ |
---|
91 | #endif /* #if defined( __ARM_ARCH_7A__ ) */ |
---|
92 | |
---|
93 | #if defined( __ARM_ARCH_7A__ ) |
---|
94 | static bool arm_errata_is_applicable_processor_errata_775420( |
---|
95 | void |
---|
96 | ) |
---|
97 | { |
---|
98 | const arm_release_id RELEASE = arm_errata_get_processor_release(); |
---|
99 | bool is_applicable = false; |
---|
100 | |
---|
101 | /* Errata information for Cortex-A9 processors. |
---|
102 | * Information taken from ARMs |
---|
103 | * "Cortex-A series processors |
---|
104 | * - Cortex-A9 |
---|
105 | * - Software Developers Errata Notice |
---|
106 | * - Revision r4 revisions |
---|
107 | * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice" |
---|
108 | * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html |
---|
109 | * Please see this document for more information on these erratas */ |
---|
110 | |
---|
111 | switch( RELEASE ) { |
---|
112 | case ARM_RELEASE_ID_R2_P10: |
---|
113 | case ARM_RELEASE_ID_R2_P8: |
---|
114 | case ARM_RELEASE_ID_R2_P6: |
---|
115 | case ARM_RELEASE_ID_R2_P4: |
---|
116 | case ARM_RELEASE_ID_R2_P3: |
---|
117 | case ARM_RELEASE_ID_R2_P2: |
---|
118 | is_applicable = true; |
---|
119 | default: |
---|
120 | is_applicable = false; |
---|
121 | break; |
---|
122 | } |
---|
123 | |
---|
124 | return is_applicable; |
---|
125 | } |
---|
126 | #endif /* #if defined( __ARM_ARCH_7A__ ) */ |
---|
127 | |
---|
128 | #ifdef __cplusplus |
---|
129 | } |
---|
130 | #endif /* __cplusplus */ |
---|
131 | |
---|
132 | #endif /* ARM_ERRATA_H_ */ |
---|