<?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>ColdFire/68K Microcontrollers and Processorsのトピックcache settings for ltib colilo and kernel</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/cache-settings-for-ltib-colilo-and-kernel/m-p/130960#M817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported&amp;nbsp;from the WildRice - Coldfire forum.&amp;nbsp; Freescale has received the approval from the WildRice administrator on seeding the Freescale forum with messages.&amp;nbsp; The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value as you search for answers to your questions.&amp;nbsp; Freescale assumes no responsibility whatsoever with respect to Posted Material.&amp;nbsp; For additional information, please see the&lt;/SPAN&gt; &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fabstract%2Fhelp_page%2FTERMSOFUSE.html" rel="nofollow" target="_blank"&gt;&lt;SPAN style=": ; color: #000000;"&gt;Terms of Use - Message Boards and Community Forums&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style=";"&gt;.&amp;nbsp; Thank You and Enjoy the Forum!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;HR /&gt;Dec 1, 2005, 6:07 PM&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Post #1 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;[ColdFire] cache settings for ltib colilo and kernel&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I'm bringing up a custom 5472 board using the LTIB package&lt;BR /&gt;(ltib-rigoletto-20050802) with Linux kernel version 2.6.10, and I have&lt;BR /&gt;some questions about the cache settings for colilo and the kernel.&lt;/DIV&gt;&lt;DIV&gt;First, in colilo's arch/5475/cache.S, there is the following code for&lt;BR /&gt;the enableCache function:&lt;/DIV&gt;&lt;DIV&gt;move.l #0x01040100, %d0 /* Invalidate whole cache */&lt;BR /&gt;movec %d0,%CACR&lt;BR /&gt;nop&lt;/DIV&gt;&lt;DIV&gt;move.l #0x0000e400, %d0 /* setup ACR0..ACR3 */&lt;BR /&gt;movec %d0, %ITT0 /* ACR0 */&lt;BR /&gt;movec %d0, %DTT0 /* ACR2 */&lt;BR /&gt;move.l #0, %d0&lt;BR /&gt;movec %d0, %ITT1 /* ACR1 */&lt;BR /&gt;movec %d0, %DTT1 /* ACR3 */&lt;/DIV&gt;&lt;DIV&gt;/* Enable cache */&lt;BR /&gt;move.l #0xa4098400, %d0 /* Write buffer, dflt precise */&lt;BR /&gt;movec %d0,%CACR&lt;BR /&gt;nop&lt;BR /&gt;rts&lt;/DIV&gt;&lt;DIV&gt;I made a dummy loop in colilo that just sits and does nops and placed it&lt;BR /&gt;in the code after colilo copies itself to SDRAM and finishes its other&lt;BR /&gt;initializations. While it was running, I looked at the SDRAM chip&lt;BR /&gt;select and noticed there were a lot of accesses happening. I was able&lt;BR /&gt;to fix this by changing the ACR0 and ACR3 values to 0x0003e000 instead&lt;BR /&gt;of 0x0000e400. After making this change, I noticed that the SDRAM chip&lt;BR /&gt;select activity was reduced to exactly what I expected for automatic&lt;BR /&gt;refresh and no other activity. I also noticed that the time required to&lt;BR /&gt;inflate the kernel image went from minutes to seconds.&lt;/DIV&gt;&lt;DIV&gt;Does anyone have any comments on this? Does this seem like a reasonable&lt;BR /&gt;change?&lt;/DIV&gt;&lt;DIV&gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;before all the mmu_map calls, there is the following code:&lt;/DIV&gt;&lt;DIV&gt;move.l #0xe000c040, %d0&lt;BR /&gt;movec %d0, %itt0&lt;/DIV&gt;&lt;DIV&gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;set ACR2 here, like this:&lt;/DIV&gt;&lt;DIV&gt;move.l #0xe000c040, %d0&lt;BR /&gt;movec %d0, %itt1&lt;/DIV&gt;&lt;DIV&gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;value set by colilo, or is this a bug?&lt;/DIV&gt;&lt;DIV&gt;Finally, in the kernel's include/asm-m68k/cfcache.h file, there is the&lt;BR /&gt;following definition, which is the value written to the CACR register:&lt;/DIV&gt;&lt;DIV&gt;#define CACHE_INITIAL_MODE (CF_CACR_DEC+CF_CACR_BEC+CF_CACR_IEC&lt;BR /&gt;+CF_CACR_EUSP)&lt;/DIV&gt;&lt;DIV&gt;It seems to me that the IDCM bit needs to be set, like this:&lt;/DIV&gt;&lt;DIV&gt;#define CACHE_INITIAL_MODE (CF_CACR_DEC+CF_CACR_BEC+CF_CACR_IEC&lt;BR /&gt;+CF_CACR_IDCM+CF_CACR_EUSP)&lt;/DIV&gt;&lt;DIV&gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;the IDCM bit in the CACR. Any thoughts on this?&lt;/DIV&gt;&lt;DIV&gt;If anyone could offer some insight on these issues, I would greatly&lt;BR /&gt;appreciate it. This is my first experience bringing up Linux on an&lt;BR /&gt;embedded system, and I still haven't gotten over the learning curve yet.&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;BR /&gt;Steve&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Dec 1, 2005, 7:43 PM&lt;/DIV&gt;&lt;DIV&gt;Post #2 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;Re: [ColdFire] cache settings for ltib colilo and kernel [In reply to]&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;&amp;gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;&amp;gt;before all the mmu_map calls, there is the following code:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; movec %d0, %itt0&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;&amp;gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;&amp;gt;set ACR2 here, like this:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; movec %d0, %itt1&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;&amp;gt;value set by colilo, or is this a bug?&lt;/DIV&gt;&lt;DIV&gt;It is intended to overwrite %acr0 (yes, the use of %itt0 is a bug, I&lt;BR /&gt;have a patch for binutils that I need to find time to test/submit on&lt;BR /&gt;the mainline FSF sources).&lt;/DIV&gt;&lt;DIV&gt;The reason is that we don't want to cache MBAR where the internal&lt;BR /&gt;peripherals are, and when the kernel turns on the MMU, use the MMU&lt;BR /&gt;bits to specify whether the page is cached or not.&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;&amp;gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;&amp;gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;&amp;gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;&amp;gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;&amp;gt;the IDCM bit in the CACR. Any thoughts on this?&lt;/DIV&gt;&lt;DIV&gt;IDCM is for instruction default cache modes, has nothing to do with&lt;BR /&gt;data default cache modes(DDCM) which is set to 0x2 which the default&lt;BR /&gt;mode to be cached. Remember that those apply for non-MMU accesses, and&lt;BR /&gt;are when the MMU is on are ignored in favor of the CM field in the MMU&lt;BR /&gt;TLB entry.&lt;/DIV&gt;&lt;DIV&gt;An __ioremap_nocache() call to map an i/o space sets up page table&lt;BR /&gt;entries that have CM bits of 0x2 which indicates that the page is&lt;BR /&gt;non-cachable precise. So an access to the memory pointed at by what&lt;BR /&gt;iomap_nocache() returns causes a TLB miss which sets up a TLB entry&lt;BR /&gt;for the access which has the CM bits set to 0x2 instead of the usual&lt;BR /&gt;copyback value of 0x0.&lt;/DIV&gt;&lt;DIV&gt;--&lt;BR /&gt;Peter Barada&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Dec 2, 2005, 9:59 AM&lt;/DIV&gt;&lt;DIV&gt;Post #3 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;Re: [ColdFire] cache settings for ltib colilo and kernel [In reply to]&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Peter,&lt;/DIV&gt;&lt;DIV&gt;Thanks for the explanation. I think I'm getting a better understanding&lt;BR /&gt;of it now. I had forgotten to consider the caching that is being setup&lt;BR /&gt;by the MMU.&lt;/DIV&gt;&lt;DIV&gt;-Steve&lt;/DIV&gt;&lt;DIV&gt;On Thu, 2005-12-01 at 22:43 -0500, Peter Barada wrote:&lt;BR /&gt;&amp;gt; &amp;gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;&amp;gt; &amp;gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;&amp;gt; &amp;gt;before all the mmu_map calls, there is the following code:&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; &amp;gt; movec %d0, %itt0&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;&amp;gt; &amp;gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;&amp;gt; &amp;gt;set ACR2 here, like this:&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; &amp;gt; movec %d0, %itt1&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;&amp;gt; &amp;gt;value set by colilo, or is this a bug?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; It is intended to overwrite %acr0 (yes, the use of %itt0 is a bug, I&lt;BR /&gt;&amp;gt; have a patch for binutils that I need to find time to test/submit on&lt;BR /&gt;&amp;gt; the mainline FSF sources).&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; The reason is that we don't want to cache MBAR where the internal&lt;BR /&gt;&amp;gt; peripherals are, and when the kernel turns on the MMU, use the MMU&lt;BR /&gt;&amp;gt; bits to specify whether the page is cached or not.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;&amp;gt; &amp;gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;&amp;gt; &amp;gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;&amp;gt; &amp;gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;&amp;gt; &amp;gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;&amp;gt; &amp;gt;the IDCM bit in the CACR. Any thoughts on this?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; IDCM is for instruction default cache modes, has nothing to do with&lt;BR /&gt;&amp;gt; data default cache modes(DDCM) which is set to 0x2 which the default&lt;BR /&gt;&amp;gt; mode to be cached. Remember that those apply for non-MMU accesses, and&lt;BR /&gt;&amp;gt; are when the MMU is on are ignored in favor of the CM field in the MMU&lt;BR /&gt;&amp;gt; TLB entry.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; An __ioremap_nocache() call to map an i/o space sets up page table&lt;BR /&gt;&amp;gt; entries that have CM bits of 0x2 which indicates that the page is&lt;BR /&gt;&amp;gt; non-cachable precise. So an access to the memory pointed at by what&lt;BR /&gt;&amp;gt; iomap_nocache() returns causes a TLB miss which sets up a TLB entry&lt;BR /&gt;&amp;gt; for the access which has the CM bits set to 0x2 instead of the usual&lt;BR /&gt;&amp;gt; copyback value of 0x0.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by Dietrich on &lt;SPAN class="date_text"&gt;04-03-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:00 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Dietrich on &lt;SPAN class="date_text"&gt;04-04-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:14 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Apr 2006 07:35:59 GMT</pubDate>
    <dc:creator>Dietrich</dc:creator>
    <dc:date>2006-04-01T07:35:59Z</dc:date>
    <item>
      <title>cache settings for ltib colilo and kernel</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/cache-settings-for-ltib-colilo-and-kernel/m-p/130960#M817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported&amp;nbsp;from the WildRice - Coldfire forum.&amp;nbsp; Freescale has received the approval from the WildRice administrator on seeding the Freescale forum with messages.&amp;nbsp; The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value as you search for answers to your questions.&amp;nbsp; Freescale assumes no responsibility whatsoever with respect to Posted Material.&amp;nbsp; For additional information, please see the&lt;/SPAN&gt; &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fabstract%2Fhelp_page%2FTERMSOFUSE.html" rel="nofollow" target="_blank"&gt;&lt;SPAN style=": ; color: #000000;"&gt;Terms of Use - Message Boards and Community Forums&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style=";"&gt;.&amp;nbsp; Thank You and Enjoy the Forum!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;HR /&gt;Dec 1, 2005, 6:07 PM&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Post #1 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;[ColdFire] cache settings for ltib colilo and kernel&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I'm bringing up a custom 5472 board using the LTIB package&lt;BR /&gt;(ltib-rigoletto-20050802) with Linux kernel version 2.6.10, and I have&lt;BR /&gt;some questions about the cache settings for colilo and the kernel.&lt;/DIV&gt;&lt;DIV&gt;First, in colilo's arch/5475/cache.S, there is the following code for&lt;BR /&gt;the enableCache function:&lt;/DIV&gt;&lt;DIV&gt;move.l #0x01040100, %d0 /* Invalidate whole cache */&lt;BR /&gt;movec %d0,%CACR&lt;BR /&gt;nop&lt;/DIV&gt;&lt;DIV&gt;move.l #0x0000e400, %d0 /* setup ACR0..ACR3 */&lt;BR /&gt;movec %d0, %ITT0 /* ACR0 */&lt;BR /&gt;movec %d0, %DTT0 /* ACR2 */&lt;BR /&gt;move.l #0, %d0&lt;BR /&gt;movec %d0, %ITT1 /* ACR1 */&lt;BR /&gt;movec %d0, %DTT1 /* ACR3 */&lt;/DIV&gt;&lt;DIV&gt;/* Enable cache */&lt;BR /&gt;move.l #0xa4098400, %d0 /* Write buffer, dflt precise */&lt;BR /&gt;movec %d0,%CACR&lt;BR /&gt;nop&lt;BR /&gt;rts&lt;/DIV&gt;&lt;DIV&gt;I made a dummy loop in colilo that just sits and does nops and placed it&lt;BR /&gt;in the code after colilo copies itself to SDRAM and finishes its other&lt;BR /&gt;initializations. While it was running, I looked at the SDRAM chip&lt;BR /&gt;select and noticed there were a lot of accesses happening. I was able&lt;BR /&gt;to fix this by changing the ACR0 and ACR3 values to 0x0003e000 instead&lt;BR /&gt;of 0x0000e400. After making this change, I noticed that the SDRAM chip&lt;BR /&gt;select activity was reduced to exactly what I expected for automatic&lt;BR /&gt;refresh and no other activity. I also noticed that the time required to&lt;BR /&gt;inflate the kernel image went from minutes to seconds.&lt;/DIV&gt;&lt;DIV&gt;Does anyone have any comments on this? Does this seem like a reasonable&lt;BR /&gt;change?&lt;/DIV&gt;&lt;DIV&gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;before all the mmu_map calls, there is the following code:&lt;/DIV&gt;&lt;DIV&gt;move.l #0xe000c040, %d0&lt;BR /&gt;movec %d0, %itt0&lt;/DIV&gt;&lt;DIV&gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;set ACR2 here, like this:&lt;/DIV&gt;&lt;DIV&gt;move.l #0xe000c040, %d0&lt;BR /&gt;movec %d0, %itt1&lt;/DIV&gt;&lt;DIV&gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;value set by colilo, or is this a bug?&lt;/DIV&gt;&lt;DIV&gt;Finally, in the kernel's include/asm-m68k/cfcache.h file, there is the&lt;BR /&gt;following definition, which is the value written to the CACR register:&lt;/DIV&gt;&lt;DIV&gt;#define CACHE_INITIAL_MODE (CF_CACR_DEC+CF_CACR_BEC+CF_CACR_IEC&lt;BR /&gt;+CF_CACR_EUSP)&lt;/DIV&gt;&lt;DIV&gt;It seems to me that the IDCM bit needs to be set, like this:&lt;/DIV&gt;&lt;DIV&gt;#define CACHE_INITIAL_MODE (CF_CACR_DEC+CF_CACR_BEC+CF_CACR_IEC&lt;BR /&gt;+CF_CACR_IDCM+CF_CACR_EUSP)&lt;/DIV&gt;&lt;DIV&gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;the IDCM bit in the CACR. Any thoughts on this?&lt;/DIV&gt;&lt;DIV&gt;If anyone could offer some insight on these issues, I would greatly&lt;BR /&gt;appreciate it. This is my first experience bringing up Linux on an&lt;BR /&gt;embedded system, and I still haven't gotten over the learning curve yet.&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;BR /&gt;Steve&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Dec 1, 2005, 7:43 PM&lt;/DIV&gt;&lt;DIV&gt;Post #2 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;Re: [ColdFire] cache settings for ltib colilo and kernel [In reply to]&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;&amp;gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;&amp;gt;before all the mmu_map calls, there is the following code:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; movec %d0, %itt0&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;&amp;gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;&amp;gt;set ACR2 here, like this:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; movec %d0, %itt1&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;&amp;gt;value set by colilo, or is this a bug?&lt;/DIV&gt;&lt;DIV&gt;It is intended to overwrite %acr0 (yes, the use of %itt0 is a bug, I&lt;BR /&gt;have a patch for binutils that I need to find time to test/submit on&lt;BR /&gt;the mainline FSF sources).&lt;/DIV&gt;&lt;DIV&gt;The reason is that we don't want to cache MBAR where the internal&lt;BR /&gt;peripherals are, and when the kernel turns on the MMU, use the MMU&lt;BR /&gt;bits to specify whether the page is cached or not.&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;&amp;gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;&amp;gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;&amp;gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;&amp;gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;&amp;gt;the IDCM bit in the CACR. Any thoughts on this?&lt;/DIV&gt;&lt;DIV&gt;IDCM is for instruction default cache modes, has nothing to do with&lt;BR /&gt;data default cache modes(DDCM) which is set to 0x2 which the default&lt;BR /&gt;mode to be cached. Remember that those apply for non-MMU accesses, and&lt;BR /&gt;are when the MMU is on are ignored in favor of the CM field in the MMU&lt;BR /&gt;TLB entry.&lt;/DIV&gt;&lt;DIV&gt;An __ioremap_nocache() call to map an i/o space sets up page table&lt;BR /&gt;entries that have CM bits of 0x2 which indicates that the page is&lt;BR /&gt;non-cachable precise. So an access to the memory pointed at by what&lt;BR /&gt;iomap_nocache() returns causes a TLB miss which sets up a TLB entry&lt;BR /&gt;for the access which has the CM bits set to 0x2 instead of the usual&lt;BR /&gt;copyback value of 0x0.&lt;/DIV&gt;&lt;DIV&gt;--&lt;BR /&gt;Peter Barada&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Dec 2, 2005, 9:59 AM&lt;/DIV&gt;&lt;DIV&gt;Post #3 of 3 (31 views)&lt;BR /&gt;Copy Shortcut&lt;BR /&gt;&amp;nbsp;Re: [ColdFire] cache settings for ltib colilo and kernel [In reply to]&amp;nbsp; Can't Post&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Peter,&lt;/DIV&gt;&lt;DIV&gt;Thanks for the explanation. I think I'm getting a better understanding&lt;BR /&gt;of it now. I had forgotten to consider the caching that is being setup&lt;BR /&gt;by the MMU.&lt;/DIV&gt;&lt;DIV&gt;-Steve&lt;/DIV&gt;&lt;DIV&gt;On Thu, 2005-12-01 at 22:43 -0500, Peter Barada wrote:&lt;BR /&gt;&amp;gt; &amp;gt;My next question has to do with the cache settings in the kernel's&lt;BR /&gt;&amp;gt; &amp;gt;arch/m68k/coldfire/head.S cache settings. Shortly after __start and&lt;BR /&gt;&amp;gt; &amp;gt;before all the mmu_map calls, there is the following code:&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; &amp;gt; movec %d0, %itt0&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;My concern here is that the kernel has overwritten ACR0 that was setup&lt;BR /&gt;&amp;gt; &amp;gt;by colilo for caching SDRAM. Wouldn't it be better for the kernel to&lt;BR /&gt;&amp;gt; &amp;gt;set ACR2 here, like this:&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt; move.l #0xe000c040, %d0&lt;BR /&gt;&amp;gt; &amp;gt; movec %d0, %itt1&lt;BR /&gt;&amp;gt; &amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;What do you think about this? Was the intent to overwrite the ACR0&lt;BR /&gt;&amp;gt; &amp;gt;value set by colilo, or is this a bug?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; It is intended to overwrite %acr0 (yes, the use of %itt0 is a bug, I&lt;BR /&gt;&amp;gt; have a patch for binutils that I need to find time to test/submit on&lt;BR /&gt;&amp;gt; the mainline FSF sources).&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; The reason is that we don't want to cache MBAR where the internal&lt;BR /&gt;&amp;gt; peripherals are, and when the kernel turns on the MMU, use the MMU&lt;BR /&gt;&amp;gt; bits to specify whether the page is cached or not.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; &amp;gt;Without the IDCM bit set, all accesses other than 0xe0000000 will be&lt;BR /&gt;&amp;gt; &amp;gt;cached. That would probably be bad for things like peripherals on flex&lt;BR /&gt;&amp;gt; &amp;gt;bus, etc. I notice that the kernel sets MBAR to 0xe0000000. I wonder&lt;BR /&gt;&amp;gt; &amp;gt;if the 0xe000c040 value was written to ACR0 in order to prevent caching&lt;BR /&gt;&amp;gt; &amp;gt;of internal peripherals, when the better solution may have been to set&lt;BR /&gt;&amp;gt; &amp;gt;the IDCM bit in the CACR. Any thoughts on this?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; IDCM is for instruction default cache modes, has nothing to do with&lt;BR /&gt;&amp;gt; data default cache modes(DDCM) which is set to 0x2 which the default&lt;BR /&gt;&amp;gt; mode to be cached. Remember that those apply for non-MMU accesses, and&lt;BR /&gt;&amp;gt; are when the MMU is on are ignored in favor of the CM field in the MMU&lt;BR /&gt;&amp;gt; TLB entry.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; An __ioremap_nocache() call to map an i/o space sets up page table&lt;BR /&gt;&amp;gt; entries that have CM bits of 0x2 which indicates that the page is&lt;BR /&gt;&amp;gt; non-cachable precise. So an access to the memory pointed at by what&lt;BR /&gt;&amp;gt; iomap_nocache() returns causes a TLB miss which sets up a TLB entry&lt;BR /&gt;&amp;gt; for the access which has the CM bits set to 0x2 instead of the usual&lt;BR /&gt;&amp;gt; copyback value of 0x0.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by Dietrich on &lt;SPAN class="date_text"&gt;04-03-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:00 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Dietrich on &lt;SPAN class="date_text"&gt;04-04-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:14 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Apr 2006 07:35:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/cache-settings-for-ltib-colilo-and-kernel/m-p/130960#M817</guid>
      <dc:creator>Dietrich</dc:creator>
      <dc:date>2006-04-01T07:35:59Z</dc:date>
    </item>
  </channel>
</rss>

