This document has been written and tested with the software/hardware combination described in the history table above. However it contains general concept that can be adapted on any DAVE Embedded Systems' Linux platformusing the SPL.
We'll explain how to program and configure a [[Category: AxelLite|Axel Lite]] to boot in standalone mode, without the need of a system microSD card or a NFS server, with two options:
* booting with NOR + NAND
** U-Boot will fetch Linux kernel binary images (kernel + device tree) from on-board NOR flash memory, while later the OS will mount the root file system from a NAND partition.
== Update u-boot ==
Update In order to support the latest u-boot version allows usage of u-boot environment SPL, new additional uboot variables availablehave been introduced.
<pre class="board-terminal">
U=> print load_spl load_uboot spi_update_spl spi_update_ubootload_spl=tftp ${loadaddr} ${spl}load_uboot=tftp ${loaddr} ${ubootimg}spi_update_spl=sf probe; sf erase 0 10000;sf write ${loadaddr} 400 ${filesize}spi_update_uboot=sf probe; sf erase 10000 f0000;sf write ${loadaddr} 10000 ${filesize}</pre> === u-Boot boot on NOR SPI ===Uboot can be flashed into NOR following the example below. Firstly, the SPL is fetched from the tftpserver and then it is flashed into the NOR SPL partition. Lastly, the same operation is performed for the uboot image.<pre>=> run loadload_spl
Using FEC device
TFTP from server 192.168.0.1389; our IP address is 192.168.0.9883Filename 'axel/uxelk-boot4.0.0_mx6qdlaxel_spi_SPL'.Load address: 0x12000000Loading: ############ 335 KiB/sdoneBytes transferred = 56320 (dc00 hex)=> run spi_update_spl SF: Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiBSF: 65536 bytes @ 0x0 Erased: OKdevice 0 offset 0x400, size 0xdc00SF: 56320 bytes @ 0x400 Written: OK=> run load_uboot Using FEC deviceTFTP from server 192.168.0.89; our IP address is 192.168.0.83Filename 'axel/xelk-24.30.4_mx6qaxel_spi_u0_mx6qdlaxel_spi_u-boot.imximg'.
Bytes transferred = 566184 493272 (8a3a8 786d8 hex)U-Boot => run spi_updatespi_update_uboot SF: Detected S25FL256S s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiBU-Boot ></pre>=== u-boot on NOR SPI ===Be sure the ''spi_update'' commands has enough erase and program size definedSF: 983040 bytes @ 0x10000 Erased:OK <pre>U-Boot > setenv spi_update 'sf probe; sf erase device 0 90000;sf write ${loadaddr} 400 90000'offset 0x10000, size 0x786d8</pre>Then update u-boot on NORSF: <pre class="board-terminal">U-Boot > run spi_updateSF493272 bytes @ 0x10000 Written: Detected S25FL256S with page size 64 KiB, total 32 MiBU-Boot >OK
</pre>
=== u-boot on NAND ===
The SPL and u-boot image, must be flashed on NAND flash must be programmed using the NXP <code>kobs-ng</code> utility: this . This tool is required for writing the correct u-boot image on NAND storing all information needed by bootrom to identify the NAND as a boot device.
Here below an exampleThe following steps are therefore necessary:
* boot the system via SD on NFS
* uses a rfs with <b>kobs-ng</b> utility available on it (e.g. DAVE's rfs provided with XELK)
* copy the related u-boot imx image file ans SPL files on nfs /home/root (for example)* execute kobs-ng passing the parameters for flashing u-boot the SPL on NAND.* execute nandwrite to flash uboot image on NAND.
mtd: erasing @0:0x120000-0x140000We write one page for save guard. *mtd: erasing @0:0x140000-0x160000mtdWritting .tmp_kobs_ng: erasing #1 @0:0x1600000x00180000 -0x1800000x0018c000
mtd: erasing @0:0x180000-0x1a0000
mtd: The last page is not full : 928
mtd: We write one page for save guard. *
mtd: Writting .tmp_kobs_ngroot@imx6qxelk: ~#1 @flash_erase /dev/mtd1 0 0: 0x00480000 - 0x0050a000mtd: erasing Erasing 128 Kibyte @0:0x4800005e0000 --0x4a0000100 % complete mtd: erasing root@0imx6dlxelk:0x4a0000~# nandwrite -0x4c0000mtd: erasing @0:0x4c0000p /dev/mtd1 xelk-0x4e0000mtd: erasing @4.0:0x4e0000.0_mx6qdlaxel_nand_u-0x500000boot.imgmtd: erasing @Writing data to block 0:0x500000-0x520000at offset 0x0mtd: The last page is not full : 928Writing data to block 1 at offset 0x20000mtd: We write one page for save guard. *Writing data to block 2 at offset 0x40000root@axel-lite:~#Writing data to block 3 at offset 0x60000
</pre>
For more details, please refer to [[Booting_from_NAND_flash_on_i.MX6-based_platforms|this page]].
== Program root file system in NAND flash ==
* Boot the system via SD or NFS as described into the [[XELK_Quick_Start_Guide|Quick_start_guide]]
* By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for U-boot and kernel images. Here we won't modify this default configuration. The [[Memory Tecnology Device (MTD)|MTD]] partitions can be dumped with <code>/proc/mtd</code> (the partition's name should be self-explanatory)