[rtems commit] bsps/arm: Move bsp_memory_management_initialize()

Sebastian Huber sebh at rtems.org
Tue Apr 24 08:25:16 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr 24 06:37:06 2018 +0200

bsps/arm: Move bsp_memory_management_initialize()

This function is only used by the raspberrypi BSP.

This patch is a part of the BSP source reorganization.

Update #3285.

---

 bsps/arm/raspberrypi/start/bspstarthooks.c   | 18 +++++++++++-
 bsps/headers.am                              |  1 -
 bsps/include/bsp/mm.h                        | 41 ----------------------------
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am |  1 -
 c/src/lib/libbsp/arm/shared/mminit.c         | 29 --------------------
 5 files changed, 17 insertions(+), 73 deletions(-)

diff --git a/bsps/arm/raspberrypi/start/bspstarthooks.c b/bsps/arm/raspberrypi/start/bspstarthooks.c
index 165a555..b39c8b1 100644
--- a/bsps/arm/raspberrypi/start/bspstarthooks.c
+++ b/bsps/arm/raspberrypi/start/bspstarthooks.c
@@ -25,9 +25,10 @@
 #include <bspopts.h>
 #include <bsp/start.h>
 #include <bsp/raspberrypi.h>
-#include <bsp/mm.h>
 #include <libcpu/arm-cp15.h>
 #include <bsp.h>
+#include <bsp/linker-symbols.h>
+#include <bsp/arm-cp15-start.h>
 
 #ifdef RTEMS_SMP
 #include <rtems/score/smp.h>
@@ -97,6 +98,21 @@ void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
 #endif
 }
 
+BSP_START_TEXT_SECTION static void bsp_memory_management_initialize(void)
+{
+  uint32_t ctrl = arm_cp15_get_control();
+
+  ctrl |= ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_S | ARM_CP15_CTRL_XP;
+
+  arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(
+    ctrl,
+    (uint32_t *) bsp_translation_table_base,
+    ARM_MMU_DEFAULT_CLIENT_DOMAIN,
+    &arm_cp15_start_mmu_config_table[0],
+    arm_cp15_start_mmu_config_table_size
+  );
+}
+
 void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
 {
   bsp_start_copy_sections();
diff --git a/bsps/headers.am b/bsps/headers.am
index 294d786..e217b9b 100644
--- a/bsps/headers.am
+++ b/bsps/headers.am
@@ -18,7 +18,6 @@ include_bsp_HEADERS += ../../bsps/include/bsp/fdt.h
 include_bsp_HEADERS += ../../bsps/include/bsp/gpio.h
 include_bsp_HEADERS += ../../bsps/include/bsp/irq-generic.h
 include_bsp_HEADERS += ../../bsps/include/bsp/irq-info.h
-include_bsp_HEADERS += ../../bsps/include/bsp/mm.h
 include_bsp_HEADERS += ../../bsps/include/bsp/stackalloc.h
 include_bsp_HEADERS += ../../bsps/include/bsp/u-boot.h
 include_bsp_HEADERS += ../../bsps/include/bsp/uart-output-char.h
diff --git a/bsps/include/bsp/mm.h b/bsps/include/bsp/mm.h
deleted file mode 100644
index 2152f68..0000000
--- a/bsps/include/bsp/mm.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- *  @file
- *
- *  @ingroup shared_mm
- *
- *  @brief MM Support
- */
-
-/*
- * Copyright (c) 2013 Hesham AL-Matary.
- * Copyright (c) 2013 Gedare Bloom.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifndef __LIBBSP_MM_H
-#define __LIBBSP_MM_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  @defgroup shared_mm MM Support
- *
- *  @ingroup shared_include
- *
- *  @brief MM Support Package
- */
-
-void bsp_memory_management_initialize(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index 1e70a2b..94fb80a 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -109,7 +109,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/start/bspstartho
 
 # LIBMM
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/raspberrypi/start/mm_config_table.c
-librtemsbsp_a_SOURCES += ../shared/mminit.c
 
 ###############################################################################
 #                  Special Rules                                              #
diff --git a/c/src/lib/libbsp/arm/shared/mminit.c b/c/src/lib/libbsp/arm/shared/mminit.c
deleted file mode 100644
index acfbfc0..0000000
--- a/c/src/lib/libbsp/arm/shared/mminit.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2013 Hesham AL-Matary.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#define ARM_CP15_TEXT_SECTION BSP_START_TEXT_SECTION
-
-#include <bsp/start.h>
-#include <bsp/arm-cp15-start.h>
-#include <bsp/linker-symbols.h>
-#include <bsp/mm.h>
-
-BSP_START_TEXT_SECTION void bsp_memory_management_initialize(void)
-{
-  uint32_t ctrl = arm_cp15_get_control();
-
-  ctrl |= ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_S | ARM_CP15_CTRL_XP;
-
-  arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(
-    ctrl,
-    (uint32_t *) bsp_translation_table_base,
-    ARM_MMU_DEFAULT_CLIENT_DOMAIN,
-    &arm_cp15_start_mmu_config_table[0],
-    arm_cp15_start_mmu_config_table_size
-  );
-}



More information about the vc mailing list