<div dir="ltr">---<br> .../arm/raspberrypi/startup/mm_config_table.c      |   18 +++++++--------<br> c/src/lib/libbsp/arm/shared/mminit.c               |   23 ++++++++++++++++++++<br> 2 files changed, 32 insertions(+), 9 deletions(-)<br><br>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<br>index 8a6d37a..dd1941e 100644<br>--- a/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c<br>+++ b/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c<br>@@ -31,39 +31,39 @@ const arm_cp15_start_section_config arm_cp15_start_mmu_config_table[] = {<br>   }, {<br>     .begin = (uint32_t) bsp_section_fast_data_begin,<br>     .end = (uint32_t) bsp_section_fast_data_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_start_begin,<br>     .end = (uint32_t) bsp_section_start_end,<br>-    .flags = ARMV7_MMU_CODE_CACHED<br>+    .flags = ARMV7_MMU_CODE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_vector_begin,<br>     .end = (uint32_t) bsp_section_vector_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_text_begin,<br>     .end = (uint32_t) bsp_section_text_end,<br>-    .flags = ARMV7_MMU_READ_WRITE<br>+    .flags = ARMV7_MMU_READ_WRITE | ARM_MMU_SECT_C | ARM_MMU_SECT_B <br>   }, {<br>     .begin = (uint32_t) bsp_section_rodata_begin,<br>     .end = (uint32_t) bsp_section_rodata_end,<br>-    .flags = ARMV7_MMU_DATA_READ_ONLY_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_ONLY_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_data_begin,<br>     .end = (uint32_t) bsp_section_data_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_bss_begin,<br>     .end = (uint32_t) bsp_section_bss_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_work_begin,<br>     .end = (uint32_t) bsp_section_work_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = (uint32_t) bsp_section_stack_begin,<br>     .end = (uint32_t) bsp_section_stack_end,<br>-    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED<br>+    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED <br>   }, {<br>     .begin = RPI_PERIPHERAL_BASE,<br>     .end =   RPI_PERIPHERAL_BASE + RPI_PERIPHERAL_SIZE,<br>diff --git a/c/src/lib/libbsp/arm/shared/mminit.c b/c/src/lib/libbsp/arm/shared/mminit.c<br>index acfbfc0..96ca1ec 100644<br>--- a/c/src/lib/libbsp/arm/shared/mminit.c<br>+++ b/c/src/lib/libbsp/arm/shared/mminit.c<br>@@ -13,6 +13,28 @@<br> #include <bsp/linker-symbols.h><br> #include <bsp/mm.h><br> <br>+#if (BSP_IS_RPI2 == 1)<br>+BSP_START_TEXT_SECTION void bsp_memory_management_initialize(void)<br>+{  <br>+  /* Enable SMP in auxiliary control */<br>+  uint32_t actlr = arm_cp15_get_auxiliary_control();<br>+  actlr |= ARM_CORTEX_A9_ACTL_SMP;<br>+  arm_cp15_set_auxiliary_control(actlr);<br>+<br>+  uint32_t ctrl = arm_cp15_start_setup_mmu_and_cache(<br>+    ARM_CP15_CTRL_A,<br>+    ARM_CP15_CTRL_AFE| ARM_CP15_CTRL_Z<br>+  );<br>+  <br>+  arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(<br>+    ctrl,<br>+    (uint32_t *) bsp_translation_table_base,<br>+    ARM_MMU_DEFAULT_CLIENT_DOMAIN,<br>+    &arm_cp15_start_mmu_config_table[0],<br>+    arm_cp15_start_mmu_config_table_size<br>+  );<br>+}<br>+#else<br> BSP_START_TEXT_SECTION void bsp_memory_management_initialize(void)<br> {<br>   uint32_t ctrl = arm_cp15_get_control();<br>@@ -27,3 +49,4 @@ BSP_START_TEXT_SECTION void bsp_memory_management_initialize(void)<br>     arm_cp15_start_mmu_config_table_size<br>   );<br> }<br>+#endif<br>\ No newline at end of file<br>-- <br>1.7.9.5<br><br>-- <br><div class="gmail_signature"><div dir="ltr">Rohini Kulkarni</div></div>
</div>