<div dir="ltr"><div></div><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 1:44 PM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Please avoid unnecessary white-space changes and white-space at the end of line.<div><div class="h5"><br></div></div></blockquote><div>Something went wrong with the whitespace. I couldn't see that change in my code. I'll rectify it.  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
<br>
On 22/06/15 22:59, Rohini Kulkarni wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<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>
</blockquote>
<br></div></div>
Why is this not ARMV7_MMU_CODE_CACHED?  Why can't this BSP use ARMV7_CP15_START_DEFAULT_SECTIONS?<div><div class="h5"><br></div></div></blockquote><div>One question that came up when I figured out last night that this was the only required change. This was the only uncached normal memory section in the table. So there were many changes I tried before I made this cacheable. Why was it not made cacheable (MMU_CODE_CACHED is read only. But then yes, why is this made read write, differently from ARMV7_CP15_START_DEFAULT_SECTIONS)<br><br></div><div>The TEX bits 2 and 1 have been assigned the value for cacheable memory but are used in the defines for CACHED sections. <br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
   }, {<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>
</blockquote>
<br></div></div>
Such a construct in a shared folder makes no sense.<br></blockquote><div><br></div><div>Thats right. Will change the integration for the two memory initializations <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
+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>
Rohini Kulkarni<br>
<br>
<br></div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><span class=""><font color="#888888"><br>
</font></span></blockquote><span class=""><font color="#888888">
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : +49 89 189 47 41-16<br>
Fax     : +49 89 189 47 41-09<br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Rohini Kulkarni</div></div>
</div></div>