[PATCH] Modify raspberrypi mm_config_table to map GPIO and registers.

Hesham AL-Matary heshamelmatary at gmail.com
Mon Oct 14 13:34:58 UTC 2013


Changes include reverting back to setting all page-table section entries 
as invalid and modify mm_config_table to apply the correct memory attributes
for raspbberypi memory sections at startup. The newly added entry at mm_config_table
maps raspberrypi GPIO and other registers found at raspberrypi.h
---
 c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c | 8 ++++++--
 c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h       | 4 ++--
 2 files changed, 8 insertions(+), 4 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 5436a76..2b748b2 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
@@ -42,7 +42,7 @@ bsp_mm_config_table[] = {
   }, {
     .begin = (uint32_t) bsp_section_text_begin,
     .end = (uint32_t) bsp_section_text_end,
-    .flags = ARMV7_MMU_CODE_CACHED
+    .flags = ARMV7_MMU_READ_WRITE 
   }, {
     .begin = (uint32_t) bsp_section_rodata_begin,
     .end = (uint32_t) bsp_section_rodata_end,
@@ -63,8 +63,12 @@ bsp_mm_config_table[] = {
     .begin = (uint32_t) bsp_section_stack_begin,
     .end = (uint32_t) bsp_section_stack_end,
     .flags = MMU_DATA_READ_WRITE
+  }, {
+    .begin = 0x20000000,
+    .end = 0x20FFFFFF,
+    .flags = ARMV7_MMU_DATA_READ_WRITE
   }
 };
 
 BSP_START_DATA_SECTION const size_t bsp_mm_config_table_size =
-RTEMS_ARRAY_SIZE(&bsp_mm_config_table);
+RTEMS_ARRAY_SIZE(bsp_mm_config_table);
diff --git a/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h b/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
index 88f903b..b5d5de8 100644
--- a/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
+++ b/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
@@ -90,9 +90,9 @@ arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(
   arm_cp15_set_domain_access_control(dac);
   arm_cp15_set_translation_table_base(ttb);
 
-  /* Initialize translation table with fixed-map read-write entries */
+  /* Initialize translation table with invalid entries */
   for (i = 0; i < ARM_MMU_TRANSLATION_TABLE_ENTRY_COUNT; ++i) {
-    ttb [i] = (i << ARM_MMU_SECT_BASE_SHIFT) | ARMV7_MMU_DATA_READ_WRITE;
+    ttb [i] = 0;
   }
 
   for (i = 0; i < config_count; ++i) {
-- 
1.8.3.1




More information about the devel mailing list