<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cache L1 address retrieving and flush in P-Series</title>
    <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752362#M4420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finnaly I understood that implementing the code from my first question was enougth to flush the entire D-cache.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2018 15:54:34 GMT</pubDate>
    <dc:creator>quenreyn</dc:creator>
    <dc:date>2018-03-14T15:54:34Z</dc:date>
    <item>
      <title>Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752358#M4416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to flush the L1 cache on my P2020 processor with the assembly instruction dcbf. In order to do that, I need to know where the cache L1 is (if I am not mistaken ?). But I don't find any L1 cache definition in my project and I was wondering if this is why I don't know the address or if this is kind of an automatic process made by the processor ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, how can I retrieve the address of the L1 cache ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once retrieved, in order to flush it, I will do something like that:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH&gt;code&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# r1 = start of shared region&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# r2 = end of region&lt;/P&gt;&lt;P&gt;loop:&lt;/P&gt;&lt;P&gt;dcbf &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0,r1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # flush line at address r1&lt;BR /&gt;addi &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r1,r1,&amp;lt;line size in bytes&amp;gt; # point to next line&lt;BR /&gt;cmpw &amp;nbsp;&amp;nbsp;&amp;nbsp;r1,r2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # finished?&lt;BR /&gt;ble&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;loop&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it the rigth manner to proceed ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you a lot for your answers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quentin Reynard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 10:25:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752358#M4416</guid>
      <dc:creator>quenreyn</dc:creator>
      <dc:date>2018-03-13T10:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752359#M4417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I read this &lt;A href="https://community.nxp.com/docs/DOC-329442"&gt;L1 D-Cache Flushing&lt;/A&gt; , it helps a bit about L1 cache organisation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 15:04:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752359#M4417</guid>
      <dc:creator>quenreyn</dc:creator>
      <dc:date>2018-03-13T15:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752360#M4418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The cache addresses are setup by U-Boot and L1 is used to execute first stage boot loader. Anyway, if I may ask why do you want to flush L1 with your code? OS should take care it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 09:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752360#M4418</guid>
      <dc:creator>adeel</dc:creator>
      <dc:date>2018-03-14T09:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752361#M4419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I needed to remove U-boot.&lt;/P&gt;&lt;P&gt;I need to flush L1 D-cache before writing into the flash memory to maintain coherency in the memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 10:34:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752361#M4419</guid>
      <dc:creator>quenreyn</dc:creator>
      <dc:date>2018-03-14T10:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752362#M4420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finnaly I understood that implementing the code from my first question was enougth to flush the entire D-cache.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 15:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752362#M4420</guid>
      <dc:creator>quenreyn</dc:creator>
      <dc:date>2018-03-14T15:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cache L1 address retrieving and flush</title>
      <link>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752363#M4421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so after some verification with my probe, the routine does not work, I don't see my D-cache as totally flushed and invalidated.&lt;BR /&gt;I think I made a mistake while giving the argument to the dcbf instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In C, I created a variable:&lt;/P&gt;&lt;P&gt;int i = 0;&lt;/P&gt;&lt;P&gt;// then I call the next routine (which is exactly the routine from my first message (with isync and msync at the end))&lt;/P&gt;&lt;P&gt;FlushDataCache((int)&amp;amp;i, (int)(&amp;amp;i + DATA_CACHE_FLUSH_48K/4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the dcbf instruction will find the D-cache according to i variable, and flush the line. I don't know what's wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry to bother, thank you for your anwsers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quentin Reynard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 08:46:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Cache-L1-address-retrieving-and-flush/m-p/752363#M4421</guid>
      <dc:creator>quenreyn</dc:creator>
      <dc:date>2018-03-19T08:46:26Z</dc:date>
    </item>
  </channel>
</rss>

