<?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: iMX6 - filesystem as RAMdisk in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295772#M36639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this post is really old but I was wondering if you could list what you have in your bootargs variable when you include it at the beginning of your setenv bootargs command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Mar 2019 02:10:58 GMT</pubDate>
    <dc:creator>rja</dc:creator>
    <dc:date>2019-03-17T02:10:58Z</dc:date>
    <item>
      <title>iMX6 - filesystem as RAMdisk</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295769#M36636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on my custom board with iMX6, I'm trying to launch a Linux filesystem from on-board MMC to RAM-disk; MMC if formatted as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Units = sectors of 1 * 512 = 512 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Device Boot&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blocks&amp;nbsp;&amp;nbsp;&amp;nbsp; Id&amp;nbsp;&amp;nbsp;&amp;nbsp; System&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /dev/mmcblk0p1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40960&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 655359&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 307200&amp;nbsp;&amp;nbsp;&amp;nbsp; 83&amp;nbsp;&amp;nbsp;&amp;nbsp; Linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /dev/mmcblk0p2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 655360&amp;nbsp;&amp;nbsp;&amp;nbsp; 1064959&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 204800&amp;nbsp;&amp;nbsp;&amp;nbsp; 83&amp;nbsp;&amp;nbsp;&amp;nbsp; Linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /dev/mmcblk0p3&amp;nbsp;&amp;nbsp; 1064960&amp;nbsp;&amp;nbsp; 30535679&amp;nbsp;&amp;nbsp;&amp;nbsp; 14735360&amp;nbsp;&amp;nbsp;&amp;nbsp; 83&amp;nbsp;&amp;nbsp;&amp;nbsp; Linux&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U-boot and kernel are stored in /dev/mmcblk0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rootfs.ext2.gz and rootfs.ext2.gz.uboot files was created with LTIB with this configuration:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; General setup &amp;gt; initial ram filesystem and ram disk support --&amp;gt; CONFIG_BLK_DEV_INITRD=y, CONFIG_RD_GZIP=y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Device drivers &amp;gt; block devices &amp;gt; ram block device support --&amp;gt; CONFIG_BLK_DEV_RAM=y, CONFIG_BLK_DEV_RAM_COUNT=16, CONFIG_BLK_DEV_RAM_SIZE=4096&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rootfs.ext2.gz was copied in MMC in the second partition, using the command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dd if=rootfs.ext2.gz of=/dev/mmcblk0p2 conv=fsync&lt;/P&gt;&lt;P&gt;thus it is stored at address 655360, that is 0xA0000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I changed the U-boot parameters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 3; mmc read ${loadaddr} 0x2000 0x2000; mmc read 0x13000000 0xA0000 0xC000; bootm'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (the compressed rootfs is read from MMC starting from 0xA0000 and stored in memory at 0x13000000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/ram0 rw initrd=0x13000000,200M'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (the root device is /dev/ram0; the compressed rootfs is read starting from address 0x13000000; 200MB was allocated for ram-file-system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executing the boot, the kernel is correctly launched but, at time to mount the file-system, these messages are displayed on the console:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RAMDISK: gzip image found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Uncompression error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; VFS: mounted root (ext2 filesystem) on device 1:0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EXT2-fs (ram0): error: ... ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Kernel panic ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this, I repeated the same procedure using the file rootfs.ext2.gz.uboot (instead of rootfs.ext2.gz); in this case, executing the boot, on console appear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RAMDISK: Couldn't find valid RAM disk image&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Kernel panic ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:18:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295769#M36636</guid>
      <dc:creator>andreapizzato</dc:creator>
      <dc:date>2014-03-13T16:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 - filesystem as RAMdisk</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295770#M36637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I 'think' that the bootm command needs to know where the ramdisk is too..&lt;/P&gt;&lt;P&gt;for example...&lt;/P&gt;&lt;P&gt;bootcmd=tftp 0x10800000 uImage; tftp 0x12000000 &lt;SPAN class="il"&gt;ramdisk&lt;/SPAN&gt;; bootm 0x10800000 0x12000000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 17:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295770#M36637</guid>
      <dc:creator>ottawa-imx6</dc:creator>
      <dc:date>2014-03-13T17:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 - filesystem as RAMdisk</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295771#M36638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is in &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/ram0 rw initrd=0x13000000,200M'&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need to define how much memory (in kB) to allocate for /dev/ram0 in order to hold all the uncompressed filesystem: for this, I need to add &lt;EM&gt;ramdisk_size=200000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Moreover, the second parameter passed to the initrd is the size, in MB, of compressed filesystem, that is (in my case) about 25MB.&lt;/P&gt;&lt;P&gt;Summary, the correct string is s&lt;EM style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;etenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/ram0 &lt;EM&gt;ramdisk_size=200000&lt;/EM&gt; rw initrd=0x13000000,25M'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In this way, my system load the filesystem in RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 09:33:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295771#M36638</guid>
      <dc:creator>andreapizzato</dc:creator>
      <dc:date>2014-03-14T09:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 - filesystem as RAMdisk</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295772#M36639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this post is really old but I was wondering if you could list what you have in your bootargs variable when you include it at the beginning of your setenv bootargs command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Mar 2019 02:10:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-filesystem-as-RAMdisk/m-p/295772#M36639</guid>
      <dc:creator>rja</dc:creator>
      <dc:date>2019-03-17T02:10:58Z</dc:date>
    </item>
  </channel>
</rss>

