[rtems commit] bsps/arm: Define index of the workspace entry.

Christian Mauderer christianm at rtems.org
Tue Jan 7 17:24:22 UTC 2020


Module:    rtems
Branch:    master
Commit:    c51f1fc52680f68f47eed6ba838683c1b78cb91a
Changeset: http://git.rtems.org/rtems/commit/?id=c51f1fc52680f68f47eed6ba838683c1b78cb91a

Author:    Christian Mauderer <christian.mauderer at embedded-brains.de>
Date:      Fri Dec 27 22:08:11 2019 +0100

bsps/arm: Define index of the workspace entry.

The imx BSP contained a hack to change the workspace entry of the MMU
table. This makes the used define visible for other BSPs too so that the
same hack can be used for example in raspberry pi too.

---

 bsps/arm/imx/start/bspstarthooks.c    | 9 ++++-----
 bsps/arm/include/bsp/arm-cp15-start.h | 2 ++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/bsps/arm/imx/start/bspstarthooks.c b/bsps/arm/imx/start/bspstarthooks.c
index f4c5350..30e03dd 100644
--- a/bsps/arm/imx/start/bspstarthooks.c
+++ b/bsps/arm/imx/start/bspstarthooks.c
@@ -24,8 +24,6 @@
 
 #include <libfdt.h>
 
-#define WORKSPACE_ENTRY_INDEX 8
-
 BSP_START_DATA_SECTION static arm_cp15_start_section_config
 imx_mmu_config_table[] = {
   ARMV7_CP15_START_DEFAULT_SECTIONS,
@@ -68,7 +66,8 @@ BSP_START_TEXT_SECTION static void setup_mmu_and_cache(void)
         size -= 4;
       }
 
-      imx_mmu_config_table[WORKSPACE_ENTRY_INDEX].end = begin + size;
+      imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].end =
+        begin + size;
     }
   }
 
@@ -112,8 +111,8 @@ void bsp_work_area_initialize(void)
   uintptr_t begin;
   uintptr_t end;
 
-  begin = imx_mmu_config_table[WORKSPACE_ENTRY_INDEX].begin;
-  end = imx_mmu_config_table[WORKSPACE_ENTRY_INDEX].end;
+  begin = imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].begin;
+  end = imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].end;
 
   bsp_work_area_initialize_default((void *) begin, end - begin);
 }
diff --git a/bsps/arm/include/bsp/arm-cp15-start.h b/bsps/arm/include/bsp/arm-cp15-start.h
index 220423f..c4686fb 100644
--- a/bsps/arm/include/bsp/arm-cp15-start.h
+++ b/bsps/arm/include/bsp/arm-cp15-start.h
@@ -95,6 +95,8 @@ typedef struct {
     .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
   }
 
+#define ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX 8
+
 BSP_START_DATA_SECTION extern const arm_cp15_start_section_config
   arm_cp15_start_mmu_config_table[];
 



More information about the vc mailing list