From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Anderson Date: Thu, 17 Sep 2020 16:26:28 -0400 Subject: Ways to copy FIT image from the flash to RAM In-Reply-To: <1747e47f1c0.1284c3b97115802.699746260582076082@d.mobilunity.com> References: <1747e47f1c0.1284c3b97115802.699746260582076082@d.mobilunity.com> Message-ID: <0e7fe69c-2198-a18c-4376-84a60fa36613@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/11/20 1:47 PM, Andrii Voloshyn wrote: > Hi there, > > What are the ways of copying whole FIT image form NOR flash to RAM by specifying flash offset without any extra bytes. > I've seen quite a lot of times when kernel image size has a fixed value (as an uboot environment variable), which is greater than the actual kernel size. > Problem with that that we copy from flash whatever is after kernel which is not required, and there is a potential problem when kernel gets bigger at some > point than the fixed size specified in the variable mentioned above. > As FIT file has all required info about size, is there a command to copy it to RAM from flash? > > Thank you > > Cheers, > Andy > Yes... but only for NAND flash... I am also interested in booting from NOR flash, so I was looking around and noticed that the function nand_load_image used by the nboot command contains no nand-specific functionality. Although it calls nand_read_skip_bad, that in turn only call simple wrappers around generic mtd functions. The only nan-specific part is the check against unknown command suffixes, which is easily moved to do_nandboot. In terms of things already supported by U-Boot, you could format your flash device with UBIFS, and then use ubifsmount/ubifsload/bootm to boot. --Sean