From 73305a1044bcf7289bbfa8cebc925f06972f44cb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 29 Nov 2021 16:19:01 +0100 Subject: arm: Add AARCH32_PMSA_DATA_READ_WRITE_DEFAULT Add default memory attributes for read-write data. The actual attributes depend on the RTEMS_SMP build option. Update #4202. --- .../cpu/arm/include/rtems/score/aarch32-pmsa.h | 36 +++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h b/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h index 6d36de4923..47b034813c 100644 --- a/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h +++ b/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h @@ -37,8 +37,7 @@ #ifndef _RTEMS_SCORE_AARCH32_PMSA_H #define _RTEMS_SCORE_AARCH32_PMSA_H -#include -#include +#include #ifdef __cplusplus extern "C" { @@ -165,6 +164,13 @@ extern "C" { AARCH32_PMSA_ATTR_SH( AARCH32_PMSA_ATTR_SH_NO ) | \ AARCH32_PMSA_ATTR_IDX( 1U ) ) +#define AARCH32_PMSA_DATA_READ_WRITE_SHARED \ + ( AARCH32_PMSA_ATTR_EN | \ + AARCH32_PMSA_ATTR_XN | \ + AARCH32_PMSA_ATTR_AP( AARCH32_PMSA_ATTR_AP_EL1_RW_EL0_NO ) | \ + AARCH32_PMSA_ATTR_SH( AARCH32_PMSA_ATTR_SH_OUTER ) | \ + AARCH32_PMSA_ATTR_IDX( 1U ) ) + #define AARCH32_PMSA_DEVICE \ ( AARCH32_PMSA_ATTR_EN | \ AARCH32_PMSA_ATTR_XN | \ @@ -172,6 +178,20 @@ extern "C" { AARCH32_PMSA_ATTR_SH( AARCH32_PMSA_ATTR_SH_NO ) | \ AARCH32_PMSA_ATTR_IDX( 2U ) ) +/* + * The Cortex-R52 processor is not coherent and the inner shareability domain + * consists of an individual Cortex-R52 core. Thus for an SMP configuration, + * the read-write data must be configured as Non-cachable and Shareable. The + * outer shareability domain is external to the Cortex-R52 processor. + */ +#if defined(RTEMS_SMP) +#define AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ + AARCH32_PMSA_DATA_READ_WRITE_SHARED +#else +#define AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ + AARCH32_PMSA_DATA_READ_WRITE_CACHED +#endif + /** * @brief The default section definitions shall be used by the BSP to define * ::_AArch32_PMSA_Sections. @@ -187,7 +207,7 @@ extern "C" { }, { \ .begin = (uint32_t) bsp_section_fast_data_begin, \ .end = (uint32_t) bsp_section_fast_data_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_start_begin, \ .end = (uint32_t) bsp_section_start_end, \ @@ -207,23 +227,23 @@ extern "C" { }, { \ .begin = (uint32_t) bsp_section_data_begin, \ .end = (uint32_t) bsp_section_data_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_bss_begin, \ .end = (uint32_t) bsp_section_bss_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_rtemsstack_begin, \ .end = (uint32_t) bsp_section_rtemsstack_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_work_begin, \ .end = (uint32_t) bsp_section_work_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_stack_begin, \ .end = (uint32_t) bsp_section_stack_end, \ - .attributes = AARCH32_PMSA_DATA_READ_WRITE_CACHED \ + .attributes = AARCH32_PMSA_DATA_READ_WRITE_DEFAULT \ }, { \ .begin = (uint32_t) bsp_section_nocache_begin, \ .end = (uint32_t) bsp_section_nocache_end, \ -- cgit v1.2.3