<?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: Kernel when relocated outside of first 2MB of RAM in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685579#M106066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping out. Here is link to where I've read the kernel is decompressed to 0x80008000 (the RAM baseaddr of the i.mx7 plus the 0x8000 offset). &lt;A class="link-titled" href="http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309" title="http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309"&gt;Booting ARM Linux&lt;/A&gt;. The location of kernel code and data can also be found by `cat /proc/iomem`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the code that actually does the decompression is in arch/arm/boot/compressed/decompress.c, which calls __decompress from the listed includes depending on the type of compression. Here is a link to the overview of the kernel startup process: &lt;A class="link-titled" href="https://www.quora.com/What-is-the-Linux-boot-sequence-in-case-of-ARM-processor" title="https://www.quora.com/What-is-the-Linux-boot-sequence-in-case-of-ARM-processor"&gt;What is the Linux boot sequence in case of ARM processor - Quora&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jul 2017 18:09:36 GMT</pubDate>
    <dc:creator>ryanschaefer</dc:creator>
    <dc:date>2017-07-21T18:09:36Z</dc:date>
    <item>
      <title>Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685575#M106062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the correct way to reserve the lower 2MB of DDR for use with the M4 with the i.mx7? I am having trouble getting the kernel to successfully decompress at an address outside of the first 2MB of ram (address 0x00208000 exactly). When the kernel boots, &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The motivation for relocating the kernel comes from this previous question: &lt;A _jive_internal="true" href="https://community.nxp.com/thread/446985?commentID=896590#comment-896590" rel="nofollow noopener noreferrer" target="_blank"&gt;IMX7 M4 caching and execution speed&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Summary: The M4 Cache only works with the first 2MB of DDR address space. In order to run the M4 out of DDR with the best performance, the binary should be loaded into this cache-able space.&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The steps I have taken to use the lower 2MB:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Modify the M4 ddr linker to start at address 0x80000000 (The M4 binary works correctly)&lt;/LI&gt;&lt;LI&gt;Modify linux arch/arm/Makefile:139 to change TEXT_OFFSET to 0x00208000&lt;/LI&gt;&lt;LI&gt;Add a reserved memory node to the dts to prevent the kernel from overwriting the M4 binary&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Details&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Usually, ARM kernels decompress themselves at an offset of 0x8000 from the beginning of memory, which conflicts with the M4 cache-able zone. By changing textofs-y to 0x00208000 (arch/arm/Makefile:139), I am able to boot the kernel at a higher address, with a couple BUGS(). &lt;STRONG&gt;Is this the correct way to change the kernel entry point/where the kernel decompresses itself?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Here are the related nodes of the device tree:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="font-size: 13px;"&gt;memory {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;device_type = "memory";&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; reg = &amp;lt;0x80000000 0x20000000&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; linux,usable-memory = &amp;lt;0x80200000 0x3ff00000&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;};&lt;/SPAN&gt;

&lt;SPAN style="font-size: 13px;"&gt;reserved-memory {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;#address-cells = &amp;lt;0x1&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;#size-cells = &amp;lt;0x1&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ranges;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;linux,cma {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compatible = "shared-dma-pool";&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reusable;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size = &amp;lt;0x14000000&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; linux,cma-default;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; &amp;nbsp; };&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; m4@80000000 {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;reg = &amp;lt;0x80000000 0x100000&amp;gt;;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;};

&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The full dmesg output is attached&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337033" rel="nofollow noopener noreferrer" target="_blank"&gt;dmesg.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 17:54:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685575#M106062</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-07-06T17:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685576#M106063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't modify anything in the kernel Makefile if you want to relocate kernel address.&lt;/P&gt;&lt;P&gt;Please modify CONFIG_LOADADDR and CONFIG_SYS_TEXT_BASE in uboot to satisfy your requirement. Aslo, you need reserve the first 2MB DDR memory in the device tree.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Carlos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:29:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685576#M106063</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2017-07-19T14:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685577#M106064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CONFIG_LOADADDR is where the zImage is placed in memory, not the final destination of the decompressed kernel.&lt;/P&gt;&lt;P&gt;CONFIG_SYS_TEXT_BASE is the location that u-boot is initially placed in memory. U-boot will then relocate itself to the top of RAM. (&lt;A class="" href="https://stackoverflow.com/questions/35336940/understand-u-boot-memory-footprint" title="https://stackoverflow.com/questions/35336940/understand-u-boot-memory-footprint"&gt;linux kernel - Understand U-Boot memory footprint - Stack Overflow&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not change the final location of the kernel *after decompression*. Subsequently, when execution is handed to the kernel, it will decompress itself to 0x80008000, which conflicts with the memory reserved for the M4. Adding a reserved memory node to the device tree does not changes this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This link is an example of what I am trying to accomplish with the i.MX7: &lt;A href="http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address" title="http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address"&gt;HOWTO Change the Linux Kernel Start Address - Texas Instruments Wiki&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 15:57:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685577#M106064</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-07-20T15:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685578#M106065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand your point, I have just one question. Where did you see that "when execution is handed to the kernel, it will decompress itself to 0x80008000". I cannot find this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 17:14:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685578#M106065</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2017-07-21T17:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685579#M106066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping out. Here is link to where I've read the kernel is decompressed to 0x80008000 (the RAM baseaddr of the i.mx7 plus the 0x8000 offset). &lt;A class="link-titled" href="http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309" title="http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309"&gt;Booting ARM Linux&lt;/A&gt;. The location of kernel code and data can also be found by `cat /proc/iomem`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the code that actually does the decompression is in arch/arm/boot/compressed/decompress.c, which calls __decompress from the listed includes depending on the type of compression. Here is a link to the overview of the kernel startup process: &lt;A class="link-titled" href="https://www.quora.com/What-is-the-Linux-boot-sequence-in-case-of-ARM-processor" title="https://www.quora.com/What-is-the-Linux-boot-sequence-in-case-of-ARM-processor"&gt;What is the Linux boot sequence in case of ARM processor - Quora&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 18:09:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685579#M106066</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-07-21T18:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685580#M106067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've determined that the problem is &lt;STRONG&gt;not&lt;/STRONG&gt; with modifying the text offset, but how the device tree describes the reserved memory. Am I breaking an alignment issues for arm kernels and memory nodes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following device tree causes the bug below it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memory {&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; device_type = "memory";&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; reg = &amp;lt;0x80000000 0x40000000&amp;gt;;&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; linux,usable-memory = &amp;lt;0x80200000 0x3fdf0000&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reserved-memory {&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; #address-cells = &amp;lt;0x1&amp;gt;;&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; #size-cells = &amp;lt;0x1&amp;gt;;&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; ranges;&lt;/P&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; linux,cma {&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; compatible = "shared-dma-pool";&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; reusable;&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; size = &amp;lt;0x14000000&amp;gt;;&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; linux,cma-default;&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; };&lt;/P&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; m4@80000000 {&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; reg = &amp;lt;0x80000000 0x200000&amp;gt;;&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; };&lt;/P&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; rpmsg@BFFF0000 {&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; reg = &amp;lt;0xbfff0000 0x10000&amp;gt;;&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; };&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;BUG: Bad page state in process swapper pfn:bff8c
page:bfd5a180 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x70860253(locked|error|dirty|active|arch_1|mappedtodisk|reclaim)
page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
bad because of flags:
flags: 0x41(locked|active)
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 4.1.15+ #2
Hardware name: Freescale i.MX7 Dual (Device Tree)
[&amp;lt;80215e78&amp;gt;] (unwind_backtrace) from [&amp;lt;802127dc&amp;gt;] (show_stack+0x10/0x14)
[&amp;lt;802127dc&amp;gt;] (show_stack) from [&amp;lt;80729910&amp;gt;] (dump_stack+0x84/0xc4)
[&amp;lt;80729910&amp;gt;] (dump_stack) from [&amp;lt;802b31ec&amp;gt;] (bad_page+0xcc/0x11c)
[&amp;lt;802b31ec&amp;gt;] (bad_page) from [&amp;lt;802b3464&amp;gt;] (free_pages_prepare+0x228/0x28c)
[&amp;lt;802b3464&amp;gt;] (free_pages_prepare) from [&amp;lt;802b5338&amp;gt;] (free_hot_cold_page+0x34/0x198)
[&amp;lt;802b5338&amp;gt;] (free_hot_cold_page) from [&amp;lt;802b56fc&amp;gt;] (free_highmem_page+0x28/0x78)
[&amp;lt;802b56fc&amp;gt;] (free_highmem_page) from [&amp;lt;809451a8&amp;gt;] (mem_init+0x210/0x404)
[&amp;lt;809451a8&amp;gt;] (mem_init) from [&amp;lt;8093facc&amp;gt;] (start_kernel+0x1fc/0x3a8)
[&amp;lt;8093facc&amp;gt;] (start_kernel) from [&amp;lt;8020807c&amp;gt;] (0x8020807c)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This change to the device tree removes the bug from the kernel, but breaks userspace programs (e.g. gdbserver):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memory {&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; device_type = "memory";&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; reg = &amp;lt;0x80000000 0x40000000&amp;gt;;&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; linux,usable-memory = &amp;lt;0x80200000 0x3fdf0000&amp;gt;;&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; linux,usable-memory = &amp;lt;0x80200000 0x3fd00000&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 20:52:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685580#M106067</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-07-31T20:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685581#M106068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;memory {&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&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; device_type = "memory";&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&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; reg = &amp;lt;0x80000000 0x40000000&amp;gt;;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&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; linux,usable-memory = &amp;lt;0x80200000 0x3fdf0000&amp;gt;;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&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; linux,usable-memory = &amp;lt;0x80200000 0x3fbf0000&amp;gt;;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I think the rpoblem is you are not substracting the offset to the whole size, so the final size is larger that the real memory size and the MCU may consider some memory space out of boundaries.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Carlos&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 20:48:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685581#M106068</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2017-08-04T20:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685582#M106069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did it worked?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:00:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685582#M106069</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2017-08-22T20:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685583#M106070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original size is correct. RAM goes from address 0x80000000 - C0000000&lt;/P&gt;&lt;P&gt;0x80000000 - 0x801FFFFF is for the M4&lt;/P&gt;&lt;P&gt;0x80200000 - 0xBFEFFFFF is for linux os&lt;/P&gt;&lt;P&gt;0xBFFF0000 - 0xBFFFFFFF is for RPMSG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the device tree, 0x80200000 + 0x3FBF0000 = 0xBFFF0000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've uploaded our current solution - which seems to mostly works. It isn't currently under moderator review.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-335105"&gt;https://community.nxp.com/docs/DOC-335105&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 23:21:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685583#M106070</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-08-22T23:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685584#M106071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could a moderator review my document and approve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-335105"&gt;https://community.nxp.com/docs/DOC-335105&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 18:11:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685584#M106071</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-10-24T18:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685585#M106072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:49:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685585#M106072</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2017-10-25T16:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685586#M106073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your document the first method of reserving the first 2MB from linux creates userspace regressions. In&amp;nbsp;the TI document you linked earlier (&lt;A class="link-titled" href="http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address" title="http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address"&gt;http://processors.wiki.ti.com/index.php/HOWTO_Change_the_Linux_Kernel_Start_Address&lt;/A&gt;&amp;nbsp;) as well as AN5127 it is stated that the kernel&amp;nbsp;requires start addresses to be a multiple of 16MB. Is this something you tried?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685586#M106073</guid>
      <dc:creator>dogisfat</dc:creator>
      <dc:date>2017-11-06T19:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685587#M106074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Allen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the userspace regressions you refer to when using the "linux,usable-memory" device tree node? We haven't seen any userspace errors since switching to the "reserved-memory" approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, I haven't tried having the start of memory be 16MB aligned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:24:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685587#M106074</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-11-06T23:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685588#M106075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was referring to the example where you just modify the "linux,usable-memory" node, the first attempt you discuss. I wondered if&amp;nbsp;you had reserved the 16MB you might not have had to&amp;nbsp;go to the lengths you described as there wouldn't have been any userspace bugs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like I cannot change the text offset by 16MB as described by the makefile modification of "textofs-$(CONFIG_ARCH_MXC)" or I get an assembly error unfortunately. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:41:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685588#M106075</guid>
      <dc:creator>dogisfat</dc:creator>
      <dc:date>2017-11-06T23:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685589#M106076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/evanthompson"&gt;evanthompson&lt;/A&gt;‌ got this far, and modified the assembly to fix the error by hardcoding the offset. The kernel compiles, but did not boot. The 16MB offset solution was abandoned after this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the changes he made for reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--- a/arch/arm/boot/compressed/head.S&lt;BR /&gt;+++ b/arch/arm/boot/compressed/head.S&lt;BR /&gt;@@ -198,7 +198,9 @@ not_angel:&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; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, pc&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; and&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r4, #0xf8000000&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; /* Determine final kernel image address. */&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; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r4, #TEXT_OFFSET&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; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r4, #0x00008000&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; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r4, #0x00800000&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; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r4, #TEXT_OFFSET&lt;BR /&gt;&amp;nbsp;#else&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; ldr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, =zreladdr&lt;BR /&gt;&amp;nbsp;#endif&lt;BR /&gt;&lt;BR /&gt;--- a/arch/arm/kernel/head.S&lt;BR /&gt;+++ b/arch/arm/kernel/head.S&lt;BR /&gt;@@ -52,7 +52,9 @@&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .equ&amp;nbsp;&amp;nbsp;&amp;nbsp; swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .macro&amp;nbsp; pgtbl, rd, phys&lt;BR /&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \rd, \phys, #TEXT_OFFSET&lt;BR /&gt;+//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \rd, \phys, #TEXT_OFFSET&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \rd, \phys, #0x00008000&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \rd, \rd, #0x00800000&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sub&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \rd, \rd, #PG_DIR_SIZE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .endm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 17:05:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685589#M106076</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2017-11-07T17:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685590#M106077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get it to work and boot with the attached patch. I am using the Toradex colibri dev board but the same changes to the colibri dts could be made to the imx7d-sdb-m4.dtsi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have not tried to load the firmware from linux as I have only reserved the memory in the dts but not configured it with the shared-dma-pool compatible property.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 18:19:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685590#M106077</guid>
      <dc:creator>dogisfat</dc:creator>
      <dc:date>2017-11-07T18:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685591#M106078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;I found your document very useful, since I have the same needs.&lt;/P&gt;&lt;P&gt;I 've just started working with i.mx7 and I have a question about your doc: the use for "Kernel Module to Reload M4 " chapter is only to reload M4 firmware while Linux is running,&amp;nbsp; while if I just update the m4 file in "mnt/mmcboot" (in this case I load from eMMC) and then reboot, there is no need to change the&amp;nbsp;&lt;SPAN style="font-size: 10.0pt;"&gt;FORCE_MAX_ZONEORDE, is this correct?&lt;/SPAN&gt; &lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Simone&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 11:24:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685591#M106078</guid>
      <dc:creator>simonepusca</dc:creator>
      <dc:date>2018-01-22T11:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685592#M106079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is correct, you don't need to change FORCE_MAX_ZONEORDER if you are not reloading the M4 from Linux.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 18:31:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685592#M106079</guid>
      <dc:creator>ryanschaefer</dc:creator>
      <dc:date>2018-01-22T18:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685593#M106080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have since tried compiling this patch with the kernel provided with the Compulab CL-SOM-iMX7 and have found it to no longer work with the movw and movt instructions. When I have tried using the ldr instruction instead to load a full 32bit constant the kernel still halts prior to booting with&amp;nbsp;a 16MB offset. With a 2MB offset the kernel has no issue booting using the ldr instruction, there is some additional issue booting the kernel with the 16MB offset on the Compulab kernel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jun 2018 19:46:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685593#M106080</guid>
      <dc:creator>dogisfat</dc:creator>
      <dc:date>2018-06-10T19:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel when relocated outside of first 2MB of RAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685594#M106081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Status update:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had relied on a combination&amp;nbsp; of the method described in the patch and the method described in the&amp;nbsp;&lt;A _jive_internal="true" data-containerid="2014" data-containertype="14" data-objectid="335105" data-objecttype="102" href="https://community.nxp.com/docs/DOC-335105" style="color: #3d9ce7; background-color: #ffffff; border: 0px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;reserve_m4_memory.docx&lt;/A&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;. Unfortunately&amp;nbsp;after months of&amp;nbsp;success with the combo I hit a final roadblock&amp;nbsp;related to module relocation and getuser(). In the end I found that AN5127_R1.pdf (just google it) describes what seems to be the best method and avoids a lot of issues documented in the reserve_m4_memory.docx. The method in the app note along with a change of the dts to&amp;nbsp;set the linux usable memory to the correct offset essentially "hides" the first 16MB of ram. This seems preferable to using the CMA and changing the&amp;nbsp;TEXT_OFFSET because it requires no patching to the kernel code, just build&amp;nbsp;configuration.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;DTS Modification:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt; /* usable memory */&lt;BR /&gt; memory {&lt;BR /&gt;- linux,usable-memory = &amp;lt;0x80000000 0x1ff00000&amp;gt;,&lt;BR /&gt;+ linux,usable-memory = &amp;lt;0x81000000 0x1ef00000&amp;gt;,&lt;BR /&gt; &amp;lt;0xa0000000 0x1ff00000&amp;gt;;&lt;BR /&gt; };&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 14:24:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-when-relocated-outside-of-first-2MB-of-RAM/m-p/685594#M106081</guid>
      <dc:creator>dogisfat</dc:creator>
      <dc:date>2018-08-31T14:24:33Z</dc:date>
    </item>
  </channel>
</rss>

