<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The caches are being enabled on the RPI 1 BSP. The same code is being executed by the RPI 2 BSP, but obviously it’s not sufficient for the cache setup.<div class="">I have been reading through this long thread, and it is very informative:</div><div class=""><a href="https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=98904" class="">https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=98904</a></div><div class=""><br class=""></div><div class="">I am starting to understand the setup that is required to enable caches on the RPI 2. For example this message near the bottom of page 3 gives a good indication of the speedup available by configuring the MMU and caches correctly:</div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">Quote from above thread</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">------------------------------</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">Enabling I/D caches and branch prediction, just like the julia demo uses, it takes ~12 seconds, or ~21 fps. It's just one core but also a much smaller loop than the julia demo has.</span><br style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px;" class=""><br style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px;" class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">Enabling the MMU and mapping memory inner/outer write-back, write allocate and the framebuffer inner write-through, no write allocate + outer write-back, write-allocate it takes ~8 seconds, of 32 fps.</span><br class=""><br style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px;" class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">PS: 640x480x32 with MMU gets me ~256 fps. Must have a greater L2 cache effect.</span></div><div class="">-------------------------</div><div class="">End of quote</div><div class=""><br class=""></div><div class="">The person who posted the above comment (mrvn) posted the code here:</div><div class=""><a href="https://github.com/mrvn/test/blob/master/mmu.cc" class="">https://github.com/mrvn/test/blob/master/mmu.cc</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif" size="2" class=""><span style="background-color: rgb(252, 252, 252);" class=""><span style="line-height: 19.239999771118164px;" class="">Also, it seems that when the Pi 2 starts up, cores 1-3 are put in a wait loop always accessing the bus. By putting this option in the config.txt file you can put the other cores to sleep, speeding up the code on core 1.  </span></span></font></div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class=""> </span><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.239999771118164px; font-weight: bold;" class="">arm_control=0x1000</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: small; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">It would be worth trying that option to see if the benchmark speeds up.</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: small; line-height: 19.239999771118164px; background-color: rgb(252, 252, 252);" class="">Alan</span></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2015, at 8:05 AM, Hesham ALMatary <<a href="mailto:heshamelmatary@gmail.com" class="">heshamelmatary@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Tue, Jun 2, 2015 at 12:41 PM, Rohini Kulkarni <</span><a href="mailto:krohini1593@gmail.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">krohini1593@gmail.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">From what I saw, they have to be enabled separately. Cache/mmu are disabled<br class="">upon reset.<br class=""><br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">For the existing Raspberry BSP [1] there's a code for MMU/Cache init,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">however I don't know about Pi2 and where its code is.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">[1]<span class="Apple-converted-space"> </span></span><a href="https://github.com/RTEMS/rtems/tree/master/c/src/lib/libbsp/arm/raspberrypi" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://github.com/RTEMS/rtems/tree/master/c/src/lib/libbsp/arm/raspberrypi</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On 2 Jun 2015 16:59, "Hesham ALMatary" <<a href="mailto:heshamelmatary@gmail.com" class="">heshamelmatary@gmail.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Hi,<br class=""><br class="">Aren't the MMU/Caches enabled by default for RPi [1]?<br class=""><br class="">[1]<br class=""><a href="https://github.com/RTEMS/rtems/blob/master/c/src/lib/libbsp/arm/shared/mminit.c" class="">https://github.com/RTEMS/rtems/blob/master/c/src/lib/libbsp/arm/shared/mminit.c</a><br class=""><br class="">On Tue, Jun 2, 2015 at 12:18 PM, Joel Sherrill<br class=""><joel.sherrill@oarcorp.com> wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class="">On June 2, 2015 7:01:21 AM EDT, Rohini Kulkarni <krohini1593@gmail.com><br class="">wrote:<br class=""><blockquote type="cite" class="">Dr. Joel,<br class=""><br class="">So we can't say something solely on the basis of this result?<br class=""></blockquote><br class="">I don't think so. If Linux performs the same, then what you did is as<br class="">good as it gets.<br class=""><br class="">However, if Linux is faster then some setting still isn't right.<br class=""><br class="">You need a reference measurement to have any confidence. It is possible<br class="">you did something but didn't actually turn the cache (or all the cache) on.<br class=""><br class=""><blockquote type="cite" class="">On 2 Jun 2015 16:28, "Rohini Kulkarni" <krohini1593@gmail.com> wrote:<br class=""><br class="">I have not run it under linux on pi2 yet. Will have to run and check<br class="">the result.<br class=""><br class="">On 2 Jun 2015 16:16, "Joel Sherrill" <joel.sherrill@oarcorp.com> wrote:<br class=""><br class=""><br class=""><br class="">On June 2, 2015 5:58:33 AM EDT, Rohini Kulkarni <krohini1593@gmail.com><br class="">wrote:<br class=""><blockquote type="cite" class="">HI,<br class=""><br class="">I tried running the dhrystone benchmark with some changes for<br class=""></blockquote>cache/mmu<br class=""><blockquote type="cite" class="">set up.<br class=""><br class="">However, the output shows a reduction in performance.<br class="">The time to run through the dhrystone has increased from 12 to 13 and<br class="">dhrystones run per second decreased.<br class=""><br class="">According to this result, things were better with caches disabled.<br class=""><br class=""><br class="">I have been working on this since two days and could not figure out an<br class="">improvement. Any pointers?<br class=""></blockquote><br class="">How did it do under Linux on the Pi2?<br class=""><br class=""><br class=""><blockquote type="cite" class="">Thanks.<br class=""><br class=""><br class=""><br class="">On Thu, May 28, 2015 at 8:41 PM, Rohini Kulkarni<br class=""><krohini1593@gmail.com> wrote:<br class=""><br class="">Hi All,<br class=""><br class="">I have to implement the cache coherency support for Cortex A7. But for<br class="">A7 MPCore, unlike for A9, I am not able to find any register<br class="">description for the Snoop Control Unit from the TRM.<br class=""><br class="">I need help here on how to proceed.<br class=""><br class="">Additionally for A9 there is a single bit for A9 in the Auxiliary<br class="">Control Register which enables cache broadcast operations. The<br class=""></blockquote>register<br class=""><blockquote type="cite" class="">format is different for A7 and again I am unable to find how to<br class=""></blockquote>achieve<br class=""><blockquote type="cite" class="">the same for A7.<br class=""><br class="">Thanks!<br class=""><br class=""><br class=""><br class=""><br class=""><br class="">On Tue, May 5, 2015 at 10:42 PM, Joel Sherrill<br class=""><joel.sherrill@oarcorp.com> wrote:<br class=""><br class=""><br class=""><br class="">On 5/5/2015 11:11 AM, Rohini Kulkarni wrote:<br class=""><br class="">Hi,<br class=""><br class="">I am working with the code for bsp hooks. I am referring to existing<br class="">ARM multicore bsp codes, zync mainly.<br class=""><br class="">1. There are existing hooks for the raspberry pi. Where should the<br class=""></blockquote>code<br class=""><blockquote type="cite" class="">for the  Pi2 hooks be added?<br class=""><br class="">The Pi and Pi2 are remarkably similar so Pi2 should be placed inside<br class="">the Pi BSP directory.<br class="">There is already a Pi2 variant of that code built. But we know<br class=""></blockquote>specific<br class=""><blockquote type="cite" class="">places where there<br class="">are variances. Depending on the scope of what is different, it can be<br class="">as simple as<br class="">a cpp conditional in a .h to select a value or two implementations of<br class=""></blockquote>a<br class=""><blockquote type="cite" class="">single method<br class="">and the Makefile.am picking the right file to build based on the board<br class="">variant.<br class=""><br class="">The big question to always ask is: Is this specific to the Pi2 and<br class="">incompatible with the Pi?<br class=""><br class="">Since the Pi BSP is still missing capabilities, it is likely code<br class="">common to both will<br class="">be added this summer. For example, did the mailbox interface change? I<br class="">don't know<br class="">but would guess that it didn't.  Each new capability added needs that<br class="">added.<br class=""><br class="">And any differences need to be analyzed to pick the least intrusive<br class=""></blockquote>way<br class=""><blockquote type="cite" class="">to provide<br class="">alternate implementations. Or enable special code like the Pi2 SMP<br class="">support which<br class="">is dependent on --enable-smp and being a Pi2.<br class=""><br class="">2. Am I right in understanding that I will have to implement A7<br class="">specific functions as have been for A9? I am referring specifically to<br class="">the arm-a9mpcore-start.h<br class=""><br class="">Yes.<br class=""><br class="">If the code is very similar between the a7 and a9, then a discussion<br class="">on devel@ should occur to decide the best way to minimize duplication.<br class=""><br class="">If you end up with a7 specific code, you should follow the location<br class=""></blockquote>and<br class=""><blockquote type="cite" class=""><br class="">naming patterns already established. That places it in<br class="">libbsp/arm/shared/...<br class="">so it can be used by any BSP with the right SMP core.<br class=""><br class=""><br class="">I am referring to existing codes to locate and get hold of what needs<br class="">to be done in the hooks. However, being new to such implementations, I<br class="">am taking longer to understand the details. Any suggestions that might<br class="">help here are welcome<br class=""><br class="">The answer will depend on the factors listed above. When code can<br class="">be shared, we want to share it across as many BSPs as makes sense.<br class="">When it is unique to a specific BSP **variant** (e.g. Pi vs Pi2), then<br class="">you want to find the way to account for the variation in the least<br class="">intrusive code way possible.<br class=""><br class="">Thanks!<br class=""><br class="">On 1 May 2015 12:45, "Rohini Kulkarni" <krohini1593@gmail.com> wrote:<br class=""><br class=""><br class="">Hi,<br class=""><br class="">Excited to be a part of  this edition of GSoC! Thanks to everybody for<br class="">helping me get here and congratulations to all the participating<br class="">students!<br class=""><br class="">So, now getting to work, firstly I wish to know, specifically from my<br class="">mentors, any changes that must be made to my proposed project or<br class="">schedule.<br class=""><br class="">Secondly, are there any specifics for the development blog that we<br class=""></blockquote>need<br class=""><blockquote type="cite" class="">to create for the project? Over time what is the blog expected to<br class="">convey.<br class=""><br class="">Also, I have to create a new wiki page for my project as none exists.<br class=""></blockquote>I<br class=""><blockquote type="cite" class="">want to know how to add one.<br class=""><br class="">--<br class=""><br class="">Rohini Kulkarni<br class=""><br class=""><br class="">-- Joel Sherrill, Ph.D. Director of Research & Development<br class="">joel.sherrill@OARcorp.com On-Line Applications Research Ask me about<br class="">RTEMS: a free RTOS Huntsville AL 35805 Support Available (256)<br class=""></blockquote>722-9985<br class=""><blockquote type="cite" class=""><br class=""><br class=""><br class=""><br class=""><br class="">--<br class=""><br class="">Rohini Kulkarni<br class=""><br class=""><br class=""><br class=""><br class="">--<br class=""><br class="">Rohini Kulkarni<br class=""></blockquote><br class="">--joel<br class=""></blockquote><br class="">--joel<br class="">_______________________________________________<br class="">devel mailing list<br class="">devel@rtems.org<br class="">http://lists.rtems.org/mailman/listinfo/devel<br class=""></blockquote><br class=""><br class=""><br class="">--<br class="">Hesham<br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hesham</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">devel mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:devel@rtems.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">devel@rtems.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.rtems.org/mailman/listinfo/devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.rtems.org/mailman/listinfo/devel</a></div></blockquote></div><br class=""></div></body></html>