source: rtems/c/src/lib/libbsp/arm/shared/include/arm-errata.h @ b87bf0b

4.115
Last change on this file since b87bf0b was b87bf0b, checked in by Ralf Kirchner <ralf.kirchner@…>, on 02/17/14 at 10:44:47

bsp/arm: Add arm-errata.h and arm-release-id.h

  • Property mode set to 100644
File size: 3.3 KB
Line 
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
30extern "C" {
31#endif /* __cplusplus */
32
33#if defined( __ARM_ARCH_7A__ )
34static 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__ )
50static bool arm_errata_is_applicable_processor_errata_764369(
51  void
52)
53{
54  const arm_release_id RELEASE       = arm_errata_get_processor_release();
55  bool                 is_applicable = false;
56 
57  /* Errata information for Cortex-A9 processors.
58   * Information taken from ARMs
59   * "Cortex-A series processors
60   * - Cortex-A9
61   * - Software Developers Errata Notice
62   * - Revision r4 revisions
63   * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice"
64   * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html
65   * Please see this document for more information on these erratas */
66 
67  switch( RELEASE ) {
68    case ARM_RELEASE_ID_R4_P1:
69    case ARM_RELEASE_ID_R4_P4:
70    case ARM_RELEASE_ID_R3_P0:
71    case ARM_RELEASE_ID_R2_P10:
72    case ARM_RELEASE_ID_R2_P8:
73    case ARM_RELEASE_ID_R2_P6:
74    case ARM_RELEASE_ID_R2_P4:
75    case ARM_RELEASE_ID_R2_P3:
76    case ARM_RELEASE_ID_R2_P2:
77    case ARM_RELEASE_ID_R2_P0:
78      is_applicable = true;
79    default:
80      is_applicable = false;
81    break;
82  }
83 
84  return is_applicable;
85}
86#endif /* #if defined( __ARM_ARCH_7A__ ) */
87
88#if defined( __ARM_ARCH_7A__ )
89static bool arm_errata_is_applicable_processor_errata_775420(
90  void
91)
92{
93  const arm_release_id RELEASE       = arm_errata_get_processor_release();
94  bool                 is_applicable = false;
95 
96  /* Errata information for Cortex-A9 processors.
97  * Information taken from ARMs
98  * "Cortex-A series processors
99  * - Cortex-A9
100  * - Software Developers Errata Notice
101  * - Revision r4 revisions
102  * - ARM Cortex-A9 processors r4 release Software Developers Errata Notice"
103  * The corresponding link is: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/BABJFIBA.html
104  * Please see this document for more information on these erratas */
105 
106  switch( RELEASE ) {
107    case ARM_RELEASE_ID_R2_P10:
108    case ARM_RELEASE_ID_R2_P8:
109    case ARM_RELEASE_ID_R2_P6:
110    case ARM_RELEASE_ID_R2_P4:
111    case ARM_RELEASE_ID_R2_P3:
112    case ARM_RELEASE_ID_R2_P2:
113      is_applicable = true;
114    default:
115      is_applicable = false;
116    break;
117  }
118 
119  return is_applicable;
120}
121#endif /* #if defined( __ARM_ARCH_7A__ ) */
122
123#ifdef __cplusplus
124}
125#endif /* __cplusplus */
126
127#endif /* ARM_ERRATA_H_ */
Note: See TracBrowser for help on using the repository browser.