[rtems commit] arm/raspberrypi: reorder and update MMU config table to nor force RW section later to RO.

Pavel Pisa ppisa at rtems.org
Sun Oct 2 08:47:07 UTC 2016


Module:    rtems
Branch:    4.11
Commit:    b11669a9567cb5c68c1e50f9548ff439346ffcd0
Changeset: http://git.rtems.org/rtems/commit/?id=b11669a9567cb5c68c1e50f9548ff439346ffcd0

Author:    Pavel Pisa <pisa at cmp.felk.cvut.cz>
Date:      Sun Jul 17 18:50:18 2016 +0200

arm/raspberrypi: reorder and update MMU config table to nor force RW section later to RO.

Enable even the first megabyte of SDRAM to be cache-able after
problems with stale cache content has been resolved by previous commit.
Because major part of application usually fits to the first
megabyte this speedups test dhrystone application by factor 40.

Updates #2783

---

 .../arm/raspberrypi/startup/mm_config_table.c      | 31 +++++++++++++++-------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c b/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
index 8a6d37a..50e19d8 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
@@ -23,32 +23,45 @@
 #include <bsp.h>
 #include <bsp/arm-cp15-start.h>
 
+/*
+ * Pagetable initialization data
+ *
+ * Keep all read-only sections before read-write ones.
+ * This ensures that write is allowed if one page/region
+ * is partially filled by read-only section contentent
+ * and rest is used for writeable section
+ */
+
 const arm_cp15_start_section_config arm_cp15_start_mmu_config_table[] = {
   {
     .begin = (uint32_t) bsp_section_fast_text_begin,
     .end = (uint32_t) bsp_section_fast_text_end,
     .flags = ARMV7_MMU_CODE_CACHED
   }, {
-    .begin = (uint32_t) bsp_section_fast_data_begin,
-    .end = (uint32_t) bsp_section_fast_data_end,
-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
-  }, {
     .begin = (uint32_t) bsp_section_start_begin,
     .end = (uint32_t) bsp_section_start_end,
     .flags = ARMV7_MMU_CODE_CACHED
   }, {
-    .begin = (uint32_t) bsp_section_vector_begin,
-    .end = (uint32_t) bsp_section_vector_end,
-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
-  }, {
     .begin = (uint32_t) bsp_section_text_begin,
     .end = (uint32_t) bsp_section_text_end,
-    .flags = ARMV7_MMU_READ_WRITE
+    .flags = ARMV7_MMU_CODE_CACHED
   }, {
     .begin = (uint32_t) bsp_section_rodata_begin,
     .end = (uint32_t) bsp_section_rodata_end,
     .flags = ARMV7_MMU_DATA_READ_ONLY_CACHED
   }, {
+    .begin = (uint32_t) bsp_translation_table_base,
+    .end = (uint32_t) bsp_translation_table_base + 0x4000,
+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
+  }, {
+    .begin = (uint32_t) bsp_section_fast_data_begin,
+    .end = (uint32_t) bsp_section_fast_data_end,
+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
+  }, {
+    .begin = (uint32_t) bsp_section_vector_begin,
+    .end = (uint32_t) bsp_section_vector_end,
+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
+  }, {
     .begin = (uint32_t) bsp_section_data_begin,
     .end = (uint32_t) bsp_section_data_end,
     .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED



More information about the vc mailing list