<?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: Jump to kernel from bootloader in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Jump-to-kernel-from-bootloader/m-p/692394#M107340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in general this may be debugged using AN4553 Using Open Source Debugging Tools for&lt;/P&gt;&lt;P&gt;Linux on i.MX Processors&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fassets%2Fdocuments%2Fdata%2Fen%2Fapplication-notes%2FAN4553.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/assets/documents/data/en/application-notes/AN4553.pdf&lt;/A&gt;&lt;BR /&gt;and may be recommended to post this to uboot mail list&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://lists.denx.de/listinfo/u-boot" title="https://lists.denx.de/listinfo/u-boot"&gt;U-Boot Info Page&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Thu, 03 Aug 2017 00:02:53 GMT</pubDate>
    <dc:creator>igorpadykov</dc:creator>
    <dc:date>2017-08-03T00:02:53Z</dc:date>
    <item>
      <title>Jump to kernel from bootloader</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Jump-to-kernel-from-bootloader/m-p/692393#M107339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, I write due to a big question I have. I am using a custom board of imx6 with a custom bootloader and I am trying to copy the zimage from pnor to ram. There is no problem copy the information and then I want to jump to the memory address of the kernel to start its execution but it doesn work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this same process in the u-boot file like the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int do_sh_zimageboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])&lt;BR /&gt;{&lt;BR /&gt; ulong (*zboot_entry)(int, char * const []) = NULL;&lt;BR /&gt; char *s0, *s1;&lt;BR /&gt; unsigned char *param = NULL;&lt;BR /&gt; char *cmdline;&lt;BR /&gt; char *bootargs;&lt;/P&gt;&lt;P&gt;disable_interrupts();&lt;/P&gt;&lt;P&gt;if (argc &amp;gt;= 3) {&lt;BR /&gt; /* argv[1] holds the address of the zImage */&lt;BR /&gt; s0 = argv[1];&lt;BR /&gt; /* argv[2] holds the address of zero page */&lt;BR /&gt; s1 = argv[2];&lt;BR /&gt; } else {&lt;BR /&gt; goto exit;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (s0)&lt;BR /&gt; zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16);&lt;/P&gt;&lt;P&gt;/* empty_zero_page */&lt;BR /&gt; if (s1)&lt;BR /&gt; param = (unsigned char*)simple_strtoul(s1, NULL, 16);&lt;/P&gt;&lt;P&gt;/* Linux kernel command line */&lt;BR /&gt; cmdline = (char *)param + COMMAND_LINE;&lt;BR /&gt; bootargs = getenv("bootargs");&lt;/P&gt;&lt;P&gt;/* Clear zero page */&lt;BR /&gt; /* cppcheck-suppress nullPointer */&lt;BR /&gt; memset(param, 0, 0x1000);&lt;/P&gt;&lt;P&gt;/* Set commandline */&lt;BR /&gt; strcpy(cmdline, bootargs);&lt;/P&gt;&lt;P&gt;/* Boot */&lt;BR /&gt; zboot_entry(0, NULL);&lt;/P&gt;&lt;P&gt;exit:&lt;BR /&gt; return -1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if the address of my kernel is 0x4000000 how should I jump to that address? Can someone explain me how this is working to do the jump?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In internet i found this to jump to a memory address:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #444444;"&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;unsigned long&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;address=0x80;&lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(*func_ptr)(&lt;SPAN class="" style="color: #0000ff;"&gt;void&lt;/SPAN&gt;) = (&lt;SPAN class="" style="color: #0000ff;"&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(*)(&lt;SPAN class="" style="color: #0000ff;"&gt;void&lt;/SPAN&gt;))address;&lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt;func_ptr();&lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt;but how exactly does it work?&lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #444444;"&gt;Thanks for the help.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 21:20:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Jump-to-kernel-from-bootloader/m-p/692393#M107339</guid>
      <dc:creator>jaimepena</dc:creator>
      <dc:date>2017-08-02T21:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Jump to kernel from bootloader</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Jump-to-kernel-from-bootloader/m-p/692394#M107340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in general this may be debugged using AN4553 Using Open Source Debugging Tools for&lt;/P&gt;&lt;P&gt;Linux on i.MX Processors&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fassets%2Fdocuments%2Fdata%2Fen%2Fapplication-notes%2FAN4553.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/assets/documents/data/en/application-notes/AN4553.pdf&lt;/A&gt;&lt;BR /&gt;and may be recommended to post this to uboot mail list&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://lists.denx.de/listinfo/u-boot" title="https://lists.denx.de/listinfo/u-boot"&gt;U-Boot Info Page&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Thu, 03 Aug 2017 00:02:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Jump-to-kernel-from-bootloader/m-p/692394#M107340</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-08-03T00:02:53Z</dc:date>
    </item>
  </channel>
</rss>

