[PATCH 1/2] bsps/arm: Define index of the workspace entry.

list at c-mauderer.de list at c-mauderer.de
Fri Dec 27 21:08:11 UTC 2019


From: Christian Mauderer <oss at c-mauderer.de>

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 f4c5350a52..30e03dd788 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 220423fefe..c4686fbbd4 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[];
 
-- 
2.24.1



More information about the devel mailing list